DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 07/10] net/nfp: add a dispatch layer for Tx function of representor
Date: Wed,  7 Jun 2023 09:57:06 +0800	[thread overview]
Message-ID: <20230607015709.336420-8-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230607015709.336420-1-chaoyong.he@corigine.com>

The dispatch layer aims to choose the corresponding Tx function
within NFD3 version and NFDk version for reprsentor port.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c | 29 +++++++++++++++++++++++++++--
 drivers/net/nfp/flower/nfp_flower.h |  3 +++
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 6d86145755..748b45b9ad 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -485,8 +485,8 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
 	return avail;
 }
 
-uint16_t
-nfp_flower_pf_xmit_pkts(void *tx_queue,
+static uint16_t
+nfp_flower_pf_nfd3_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts)
 {
@@ -615,6 +615,30 @@ nfp_flower_pf_xmit_pkts(void *tx_queue,
 	return i;
 }
 
+static void
+nfp_flower_pf_xmit_pkts_register(struct nfp_app_fw_flower *app_fw_flower)
+{
+	struct nfp_flower_nfd_func *nfd_func;
+
+	nfd_func = &app_fw_flower->nfd_func;
+
+	nfd_func->pf_xmit_t = nfp_flower_pf_nfd3_xmit_pkts;
+}
+
+uint16_t
+nfp_flower_pf_xmit_pkts(void *tx_queue,
+		struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts)
+{
+	struct nfp_net_txq *txq;
+	struct nfp_app_fw_flower *app_fw_flower;
+
+	txq = tx_queue;
+	app_fw_flower = txq->hw->pf_dev->app_fw_priv;
+
+	return app_fw_flower->nfd_func.pf_xmit_t(tx_queue, tx_pkts, nb_pkts);
+}
+
 static int
 nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
 {
@@ -1087,6 +1111,7 @@ nfp_flower_nfd_func_register(struct nfp_app_fw_flower *app_fw_flower)
 {
 	nfp_flower_pkt_add_metadata_register(app_fw_flower);
 	nfp_flower_ctrl_vnic_xmit_register(app_fw_flower);
+	nfp_flower_pf_xmit_pkts_register(app_fw_flower);
 }
 
 int
diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h
index 808321dffe..b85e5db3bf 100644
--- a/drivers/net/nfp/flower/nfp_flower.h
+++ b/drivers/net/nfp/flower/nfp_flower.h
@@ -44,6 +44,9 @@ struct nfp_flower_nfd_func {
 	/** Function used to xmit pkt through ctrl vnic. */
 	uint16_t (*ctrl_vnic_xmit_t)(struct nfp_app_fw_flower *app_fw_flower,
 			struct rte_mbuf *mbuf);
+	/** Function used to xmit pkts through PF. */
+	uint16_t (*pf_xmit_t)(void *tx_queue, struct rte_mbuf **tx_pkts,
+			uint16_t nb_pkts);
 };
 
 /* The flower application's private structure */
-- 
2.39.1


  parent reply	other threads:[~2023-06-07  1:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
2023-06-07  1:57 ` [PATCH 01/10] net/nfp: fix the problem of rtsym Chaoyong He
2023-06-07  1:57 ` [PATCH 02/10] net/nfp: add a check function for the NFD version Chaoyong He
2023-06-07  1:57 ` [PATCH 03/10] net/nfp: refactor the insert metadata logic of NFD3 Chaoyong He
2023-06-07  1:57 ` [PATCH 04/10] net/nfp: add the insert metadata logic of NFDk Chaoyong He
2023-06-07  1:57 ` [PATCH 05/10] net/nfp: add a dispatch layer for Tx function of ctrl VNIC Chaoyong He
2023-06-07  1:57 ` [PATCH 06/10] net/nfp: add the xmit function of NFDk for " Chaoyong He
2023-06-07  1:57 ` Chaoyong He [this message]
2023-06-07  1:57 ` [PATCH 08/10] net/nfp: merge the xmit function of NFD3 Chaoyong He
2023-06-07  1:57 ` [PATCH 09/10] net/nfp: add the xmit function of NFDk for PF representor Chaoyong He
2023-06-07  1:57 ` [PATCH 10/10] net/nfp: merge the recv function Chaoyong He
2023-06-07 14:23 ` [PATCH 00/10] support rte_flow for flower firmware with NFDk Ferruh Yigit

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=20230607015709.336420-8-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    /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).