DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luc Pelletier <lucp.at.work@gmail.com>
To: grive@u256.net
Cc: dev@dpdk.org, stephen@networkplumber.org,
	konstantin.ananyev@huawei.com,
	Luc Pelletier <lucp.at.work@gmail.com>
Subject: [PATCH v4 2/5] failsafe: use public rx/tx burst API
Date: Tue, 29 Nov 2022 10:25:14 -0500	[thread overview]
Message-ID: <20221129152516.4513-3-lucp.at.work@gmail.com> (raw)
In-Reply-To: <20221110163410.12734-1-lucp.at.work@gmail.com>

The failsafe rx/tx functions are calling the rx/tx functions of
sub-devices via the function pointers stored in the rte_eth_dev
structure rather than use the public APIs (rte_eth_rx/tx_burst).

Use the public API rather than access structure internals which could
change in the future.

Signed-off-by: Luc Pelletier <lucp.at.work@gmail.com>
---
 drivers/net/failsafe/failsafe_rxtx.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 707fe60a36..6d8ab0a6e7 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -50,7 +50,6 @@ failsafe_rx_burst(void *queue,
 {
 	struct sub_device *sdev;
 	struct rxq *rxq;
-	void *sub_rxq;
 	uint16_t nb_rx;
 
 	rxq = queue;
@@ -61,10 +60,8 @@ failsafe_rx_burst(void *queue,
 			sdev = sdev->next;
 			continue;
 		}
-		sub_rxq = ETH(sdev)->data->rx_queues[rxq->qid];
 		FS_ATOMIC_P(rxq->refcnt[sdev->sid]);
-		nb_rx = ETH(sdev)->
-			rx_pkt_burst(sub_rxq, rx_pkts, nb_pkts);
+		nb_rx = rte_eth_rx_burst(PORT_ID(sdev), rxq->qid, rx_pkts, nb_pkts);
 		FS_ATOMIC_V(rxq->refcnt[sdev->sid]);
 		sdev = sdev->next;
 	} while (nb_rx == 0 && sdev != rxq->sdev);
@@ -82,16 +79,14 @@ failsafe_tx_burst(void *queue,
 {
 	struct sub_device *sdev;
 	struct txq *txq;
-	void *sub_txq;
 	uint16_t nb_tx;
 
 	txq = queue;
 	sdev = TX_SUBDEV(&rte_eth_devices[txq->priv->data->port_id]);
 	if (unlikely(fs_tx_unsafe(sdev)))
 		return 0;
-	sub_txq = ETH(sdev)->data->tx_queues[txq->qid];
 	FS_ATOMIC_P(txq->refcnt[sdev->sid]);
-	nb_tx = ETH(sdev)->tx_pkt_burst(sub_txq, tx_pkts, nb_pkts);
+	nb_tx = rte_eth_tx_burst(PORT_ID(sdev), txq->qid, tx_pkts, nb_pkts);
 	FS_ATOMIC_V(txq->refcnt[sdev->sid]);
 	return nb_tx;
 }
-- 
2.38.1


  parent reply	other threads:[~2022-11-29 15:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 16:34 [PATCH] failsafe: fix segfault on hotplug event Luc Pelletier
2022-11-10 17:42 ` [PATCH v2] " Luc Pelletier
2022-11-10 23:33   ` Stephen Hemminger
2022-11-16 17:35 ` [PATCH] " Konstantin Ananyev
2022-11-16 21:51   ` Luc Pelletier
2022-11-16 22:25     ` Stephen Hemminger
2022-11-18 16:31       ` Konstantin Ananyev
2022-11-29 14:48 ` [PATCH v3 0/5] Failsafe bug fixes and improvements Luc Pelletier
2022-11-29 14:48 ` [PATCH v3 1/5] failsafe: fix segfault on hotplug event Luc Pelletier
2023-10-31 17:35   ` Stephen Hemminger
2022-11-29 14:48 ` [PATCH v3 2/5] failsafe: use public rx/tx burst API Luc Pelletier
2022-11-29 14:48 ` [PATCH v3 3/5] failsafe: fix double release of port Luc Pelletier
2022-11-29 14:48 ` [PATCH v3 4/5] failsafe: use public APIs in fs_link_update Luc Pelletier
2022-11-29 14:48 ` [PATCH v3 5/5] failsafe: make sub-device remove flag thread-safe Luc Pelletier
2022-11-29 15:25 ` [PATCH v4 0/5] Failsafe bug fixes and improvements Luc Pelletier
2022-11-29 15:25 ` [PATCH v4 1/5] failsafe: fix segfault on hotplug event Luc Pelletier
2022-11-29 15:25 ` Luc Pelletier [this message]
2022-11-29 15:25 ` [PATCH v4 3/5] failsafe: fix double release of port Luc Pelletier
2022-11-29 15:25 ` [PATCH v4 4/5] failsafe: use public APIs in fs_link_update Luc Pelletier
2022-11-29 15:25 ` [PATCH v4 5/5] failsafe: make sub-device remove flag thread-safe Luc Pelletier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221129152516.4513-3-lucp.at.work@gmail.com \
    --to=lucp.at.work@gmail.com \
    --cc=dev@dpdk.org \
    --cc=grive@u256.net \
    --cc=konstantin.ananyev@huawei.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).