lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210316144730.2150767-2-ciorneiioana@gmail.com>
Date:   Tue, 16 Mar 2021 16:47:28 +0200
From:   Ioana Ciornei <ciorneiioana@...il.com>
To:     davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org
Cc:     ruxandra.radulescu@....com, Ioana Ciornei <ioana.ciornei@....com>
Subject: [PATCH net-next 1/3] dpaa2-eth: use indirect calls wrapper for FD enqueue

From: Ioana Ciornei <ioana.ciornei@....com>

We can avoid an indirect call per Tx packet by wrapping the enqueue of
the frame descriptor with the appropriate helper.

Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 492943bb9c48..7702b921ab0b 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -266,8 +266,11 @@ static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv,
 	num_fds = xdp_fds->num;
 	max_retries = num_fds * DPAA2_ETH_ENQUEUE_RETRIES;
 	while (total_enqueued < num_fds && retries < max_retries) {
-		err = priv->enqueue(priv, fq, &fds[total_enqueued],
-				    0, num_fds - total_enqueued, &enqueued);
+		err = INDIRECT_CALL_2(priv->enqueue,
+				      dpaa2_eth_enqueue_fq_multiple,
+				      dpaa2_eth_enqueue_qd,
+				      priv, fq, &fds[total_enqueued],
+				      0, num_fds - total_enqueued, &enqueued);
 		if (err == -EBUSY) {
 			percpu_extras->tx_portal_busy += ++retries;
 			continue;
@@ -1153,7 +1156,10 @@ static netdev_tx_t __dpaa2_eth_tx(struct sk_buff *skb,
 	 * the Tx confirmation callback for this frame
 	 */
 	for (i = 0; i < DPAA2_ETH_ENQUEUE_RETRIES; i++) {
-		err = priv->enqueue(priv, fq, &fd, prio, 1, NULL);
+		err = INDIRECT_CALL_2(priv->enqueue,
+				      dpaa2_eth_enqueue_fq_multiple,
+				      dpaa2_eth_enqueue_qd,
+				      priv, fq, &fd, prio, 1, NULL);
 		if (err != -EBUSY)
 			break;
 	}
-- 
2.30.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ