diff mbox series

[net-next,1/3] dpaa2-eth: use indirect calls wrapper for FD enqueue

Message ID 20210316144730.2150767-2-ciorneiioana@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series dpaa2-eth: use indirect call wrappers | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit fail Errors and warnings before: 0 this patch: 16
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_allmodconfig_warn fail Errors and warnings before: 0 this patch: 16
netdev/header_inline success Link

Commit Message

Ioana Ciornei March 16, 2021, 2:47 p.m. UTC
From: Ioana Ciornei <ioana.ciornei@nxp.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@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox series

Patch

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;
 	}