DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 00/10] support rte_flow for flower firmware with NFDk
@ 2023-06-07  1:56 Chaoyong He
  2023-06-07  1:57 ` [PATCH 01/10] net/nfp: fix the problem of rtsym Chaoyong He
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:56 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

This patch series add the support of rte_flow for card which using
flower firmware with NFDk:
1. Fix the underlying API logic to support this feature.
2. Import a unified check and dispatch layer for different versions of NFD.
3. Refactor the meta data logic to adapt this dispatch layer.
4. Refactor the packet receive logic to adapt this dispatch layer.
5. Refactor the packet transmit logic to adapt this dispatch layer.
6. Merge the logics of representor port to decrease the redundancy logic.

Chaoyong He (10):
  net/nfp: fix the problem of rtsym
  net/nfp: add a check function for the NFD version
  net/nfp: refactor the insert metadata logic of NFD3
  net/nfp: add the insert metadata logic of NFDk
  net/nfp: add a dispatch layer for Tx function of ctrl VNIC
  net/nfp: add the xmit function of NFDk for ctrl VNIC
  net/nfp: add a dispatch layer for Tx function of representor
  net/nfp: merge the xmit function of NFD3
  net/nfp: add the xmit function of NFDk for PF representor
  net/nfp: merge the recv function

 drivers/net/nfp/flower/nfp_flower.c           | 405 ++++--------------
 drivers/net/nfp/flower/nfp_flower.h           |  27 +-
 drivers/net/nfp/flower/nfp_flower_cmsg.c      |  63 +--
 drivers/net/nfp/flower/nfp_flower_cmsg.h      |   2 -
 drivers/net/nfp/flower/nfp_flower_ctrl.c      | 157 ++++++-
 drivers/net/nfp/flower/nfp_flower_ctrl.h      |   1 +
 .../net/nfp/flower/nfp_flower_representor.c   |  12 +-
 drivers/net/nfp/nfd3/nfp_nfd3.h               |   6 +
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c            |  39 +-
 drivers/net/nfp/nfdk/nfp_nfdk.h               |   8 +
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c            |  37 +-
 drivers/net/nfp/nfp_common.c                  |  37 +-
 drivers/net/nfp/nfp_common.h                  |   1 +
 drivers/net/nfp/nfp_ctrl.h                    |   3 +
 drivers/net/nfp/nfp_ethdev.c                  |  39 +-
 drivers/net/nfp/nfp_ethdev_vf.c               |  32 +-
 drivers/net/nfp/nfp_rxtx.c                    |  50 +--
 drivers/net/nfp/nfp_rxtx.h                    |   2 +
 drivers/net/nfp/nfpcore/nfp_cpp.h             |   7 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c         |  51 ++-
 drivers/net/nfp/nfpcore/nfp_rtsym.c           | 132 +++++-
 21 files changed, 631 insertions(+), 480 deletions(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 01/10] net/nfp: fix the problem of rtsym
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
@ 2023-06-07  1:57 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 02/10] net/nfp: add a check function for the NFD version Chaoyong He
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The symbol '_abi_flower_extra_features' is in IMEM for NFP4000,
but in EMU_CACHE for NFP3800 because which does not have IMEM.

The original logic can't read symbol from EMU_CACHE, so the probe
process will fail when we try to offload flows use NFP3800.

Modify the related data structure and logics to support read symbol
from EMU_CACHE.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c          |   4 +-
 drivers/net/nfp/nfpcore/nfp_cpp.h     |   7 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c |  51 +++++++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c   | 132 ++++++++++++++++++++++++--
 4 files changed, 171 insertions(+), 23 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index f73bffc09b..e84d2ac82e 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -937,6 +937,7 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 	int ret;
 	int err = 0;
 	uint64_t addr;
+	uint32_t cpp_id;
 	struct nfp_cpp *cpp;
 	enum nfp_app_fw_id app_fw_id;
 	struct nfp_pf_dev *pf_dev;
@@ -1036,7 +1037,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 		goto pf_cleanup;
 	}
 
-	pf_dev->hw_queues = nfp_cpp_map_area(pf_dev->cpp, 0, 0,
+	cpp_id = NFP_CPP_ISLAND_ID(0, NFP_CPP_ACTION_RW, 0, 0);
+	pf_dev->hw_queues = nfp_cpp_map_area(pf_dev->cpp, cpp_id,
 			addr, NFP_QCP_QUEUE_AREA_SZ,
 			&pf_dev->hwqueues_area);
 	if (pf_dev->hw_queues == NULL) {
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 2441012b95..8f87c09327 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -31,6 +31,9 @@ struct nfp_cpp {
 	 */
 	uint32_t imb_cat_table[16];
 
+	/* MU access type bit offset */
+	uint32_t mu_locality_lsb;
+
 	int driver_lock_needed;
 };
 
@@ -455,7 +458,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
  */
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
-uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, int domain, int target,
+uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
 			   uint64_t addr, unsigned long size,
 			   struct nfp_cpp_area **area);
 /*
@@ -869,4 +872,6 @@ int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
  */
 int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
 
+uint32_t nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp);
+
 #endif /* !__NFP_CPP_H__ */
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 681ec93b96..6daee313ce 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -118,6 +118,36 @@ nfp_cpp_area_name(struct nfp_cpp_area *cpp_area)
 	return cpp_area->name;
 }
 
+#define NFP_IMB_TGTADDRESSMODECFG_MODE_of(_x)       (((_x) >> 13) & 0x7)
+#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE          RTE_BIT32(12)
+
+static int
+nfp_cpp_set_mu_locality_lsb(struct nfp_cpp *cpp)
+{
+	int ret;
+	int mode;
+	int addr40;
+	uint32_t imbcppat;
+
+	imbcppat = cpp->imb_cat_table[NFP_CPP_TARGET_MU];
+	mode = NFP_IMB_TGTADDRESSMODECFG_MODE_of(imbcppat);
+	addr40 = imbcppat & NFP_IMB_TGTADDRESSMODECFG_ADDRMODE;
+
+	ret = nfp_cppat_mu_locality_lsb(mode, addr40);
+	if (ret < 0)
+		return ret;
+
+	cpp->mu_locality_lsb = ret;
+
+	return 0;
+}
+
+uint32_t
+nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
+{
+	return cpp->mu_locality_lsb;
+}
+
 /*
  * nfp_cpp_area_alloc - allocate a new CPP area
  * @cpp:    CPP handle
@@ -142,10 +172,6 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 	if (cpp == NULL)
 		return NULL;
 
-	/* CPP bus uses only a 40-bit address */
-	if ((address + size) > (1ULL << 40))
-		return NULL;
-
 	/* Remap from cpp_island to cpp_target */
 	err = nfp_target_cpp(dest, tmp64, &dest, &tmp64, cpp->imb_cat_table);
 	if (err < 0)
@@ -578,6 +604,13 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
 		}
 	}
 
+	err = nfp_cpp_set_mu_locality_lsb(cpp);
+	if (err < 0) {
+		PMD_DRV_LOG(ERR, "Can't calculate MU locality bit offset");
+		free(cpp);
+		return NULL;
+	}
+
 	return cpp;
 }
 
@@ -809,8 +842,7 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
 /*
  * nfp_cpp_map_area() - Helper function to map an area
  * @cpp:    NFP CPP handler
- * @domain: CPP domain
- * @target: CPP target
+ * @cpp_id: CPP ID
  * @addr:   CPP address
  * @size:   Size of the area
  * @area:   Area handle (output)
@@ -821,15 +853,12 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
  * Return: Pointer to memory mapped area or NULL
  */
 uint8_t *
-nfp_cpp_map_area(struct nfp_cpp *cpp, int domain, int target, uint64_t addr,
+nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 		 unsigned long size, struct nfp_cpp_area **area)
 {
 	uint8_t *res;
-	uint32_t dest;
-
-	dest = NFP_CPP_ISLAND_ID(target, NFP_CPP_ACTION_RW, 0, domain);
 
-	*area = nfp_cpp_area_alloc_acquire(cpp, dest, addr, size);
+	*area = nfp_cpp_area_alloc_acquire(cpp, cpp_id, addr, size);
 	if (*area == NULL)
 		goto err_eio;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 9713605580..343b0d0bcf 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -211,6 +211,113 @@ nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
 	return NULL;
 }
 
+static uint64_t
+nfp_rtsym_size(const struct nfp_rtsym *sym)
+{
+	switch (sym->type) {
+	case NFP_RTSYM_TYPE_NONE:
+		PMD_DRV_LOG(ERR, "rtsym '%s': type NONE", sym->name);
+		return 0;
+	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
+	case NFP_RTSYM_TYPE_FUNCTION:
+		return sym->size;
+	case NFP_RTSYM_TYPE_ABS:
+		return sizeof(uint64_t);
+	default:
+		PMD_DRV_LOG(ERR, "rtsym '%s': unknown type: %d", sym->name, sym->type);
+		return 0;
+	}
+}
+
+static int
+nfp_rtsym_to_dest(struct nfp_cpp *cpp,
+		const struct nfp_rtsym *sym,
+		uint8_t action,
+		uint8_t token,
+		uint64_t offset,
+		uint32_t *cpp_id,
+		uint64_t *addr)
+{
+	if (sym->type != NFP_RTSYM_TYPE_OBJECT) {
+		PMD_DRV_LOG(ERR, "rtsym '%s': direct access to non-object rtsym",
+				sym->name);
+		return -EINVAL;
+	}
+
+	*addr = sym->addr + offset;
+
+	if (sym->target >= 0) {
+		*cpp_id = NFP_CPP_ISLAND_ID(sym->target, action, token, sym->domain);
+	} else if (sym->target == NFP_RTSYM_TARGET_EMU_CACHE) {
+		int locality_off = nfp_cpp_mu_locality_lsb(cpp);
+
+		*addr &= ~(NFP_MU_ADDR_ACCESS_TYPE_MASK << locality_off);
+		*addr |= NFP_MU_ADDR_ACCESS_TYPE_DIRECT << locality_off;
+
+		*cpp_id = NFP_CPP_ISLAND_ID(NFP_CPP_TARGET_MU, action, token,
+				sym->domain);
+	} else {
+		PMD_DRV_LOG(ERR, "rtsym '%s': unhandled target encoding: %d",
+				sym->name, sym->target);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int
+nfp_rtsym_readl(struct nfp_cpp *cpp,
+		const struct nfp_rtsym *sym,
+		uint8_t action,
+		uint8_t token,
+		uint64_t offset,
+		uint32_t *value)
+{
+	int ret;
+	uint64_t addr;
+	uint32_t cpp_id;
+
+	if (offset + 4 > nfp_rtsym_size(sym)) {
+		PMD_DRV_LOG(ERR, "rtsym '%s': readl out of bounds", sym->name);
+		return -ENXIO;
+	}
+
+	ret = nfp_rtsym_to_dest(cpp, sym, action, token, offset, &cpp_id, &addr);
+	if (ret != 0)
+		return ret;
+
+	return nfp_cpp_readl(cpp, cpp_id, addr, value);
+}
+
+static int
+nfp_rtsym_readq(struct nfp_cpp *cpp,
+		const struct nfp_rtsym *sym,
+		uint8_t action,
+		uint8_t token,
+		uint64_t offset,
+		uint64_t *value)
+{
+	int ret;
+	uint64_t addr;
+	uint32_t cpp_id;
+
+	if (offset + 8 > nfp_rtsym_size(sym)) {
+		PMD_DRV_LOG(ERR, "rtsym '%s': readq out of bounds", sym->name);
+		return -ENXIO;
+	}
+
+	if (sym->type == NFP_RTSYM_TYPE_ABS) {
+		*value = sym->addr;
+		return 0;
+	}
+
+	ret = nfp_rtsym_to_dest(cpp, sym, action, token, offset, &cpp_id, &addr);
+	if (ret != 0)
+		return ret;
+
+	return nfp_cpp_readq(cpp, cpp_id, addr, value);
+}
+
 /*
  * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol
  * @rtbl:	NFP RTsym table
@@ -227,7 +334,7 @@ uint64_t
 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 {
 	const struct nfp_rtsym *sym;
-	uint32_t val32, id;
+	uint32_t val32;
 	uint64_t val;
 	int err;
 
@@ -237,17 +344,13 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 		goto exit;
 	}
 
-	id = NFP_CPP_ISLAND_ID(sym->target, NFP_CPP_ACTION_RW, 0, sym->domain);
-
-	PMD_DRV_LOG(DEBUG, "Reading symbol %s with size %" PRIu64 " at %" PRIx64 "",
-		name, sym->size, sym->addr);
 	switch (sym->size) {
 	case 4:
-		err = nfp_cpp_readl(rtbl->cpp, id, sym->addr, &val32);
+		err = nfp_rtsym_readl(rtbl->cpp, sym, NFP_CPP_ACTION_RW, 0, 0, &val32);
 		val = val32;
 		break;
 	case 8:
-		err = nfp_cpp_readq(rtbl->cpp, id, sym->addr, &val);
+		err = nfp_rtsym_readq(rtbl->cpp, sym, NFP_CPP_ACTION_RW, 0, 0, &val);
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
@@ -272,8 +375,11 @@ uint8_t *
 nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 	      unsigned int min_size, struct nfp_cpp_area **area)
 {
-	const struct nfp_rtsym *sym;
+	int ret;
 	uint8_t *mem;
+	uint64_t addr;
+	uint32_t cpp_id;
+	const struct nfp_rtsym *sym;
 
 	PMD_DRV_LOG(DEBUG, "mapping symbol %s", name);
 	sym = nfp_rtsym_lookup(rtbl, name);
@@ -282,14 +388,20 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 		return NULL;
 	}
 
+	ret = nfp_rtsym_to_dest(rtbl->cpp, sym, NFP_CPP_ACTION_RW, 0, 0,
+			&cpp_id, &addr);
+	if (ret != 0) {
+		PMD_DRV_LOG(ERR, "rtsym '%s': mapping failed", name);
+		return NULL;
+	}
+
 	if (sym->size < min_size) {
 		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
 			sym->size, min_size);
 		return NULL;
 	}
 
-	mem = nfp_cpp_map_area(rtbl->cpp, sym->domain, sym->target, sym->addr,
-			       sym->size, area);
+	mem = nfp_cpp_map_area(rtbl->cpp, cpp_id, addr, sym->size, area);
 	if (mem == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to map symbol %s", name);
 		return NULL;
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 02/10] net/nfp: add a check function for the NFD version
  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 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 03/10] net/nfp: refactor the insert metadata logic of NFD3 Chaoyong He
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Add a check function for the NFD version, this will make the logics
which using this version free from validaty check, thus simplify
the driver.

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 |  3 +++
 drivers/net/nfp/nfp_common.c        | 37 ++++++++++++++++++-----------
 drivers/net/nfp/nfp_common.h        |  1 +
 drivers/net/nfp/nfp_ethdev.c        | 35 +++++++++------------------
 drivers/net/nfp/nfp_ethdev_vf.c     | 32 ++++++++-----------------
 drivers/net/nfp/nfp_rxtx.c          | 14 ++---------
 6 files changed, 50 insertions(+), 72 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index c5cc537790..afb4e5b344 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -649,6 +649,9 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
 
 	/* Get some of the read-only fields from the config BAR */
 	nfp_net_cfg_read_version(hw);
+	if (!nfp_net_is_valid_nfd_version(hw->ver))
+		return -EINVAL;
+
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	/* Set the current MTU to the maximum supported */
diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index 497128f6a6..08f9529ead 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -1162,22 +1162,10 @@ nfp_net_tx_desc_limits(struct nfp_net_hw *hw,
 {
 	uint16_t tx_dpp;
 
-	switch (hw->ver.extend) {
-	case NFP_NET_CFG_VERSION_DP_NFD3:
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
 		tx_dpp = NFD3_TX_DESC_PER_PKT;
-		break;
-	case NFP_NET_CFG_VERSION_DP_NFDK:
-		if (hw->ver.major < 5) {
-			PMD_DRV_LOG(ERR, "NFDK must use ABI 5 or newer, found: %d",
-					hw->ver.major);
-			return -EINVAL;
-		}
+	else
 		tx_dpp = NFDK_TX_DESC_PER_SIMPLE_PKT;
-		break;
-	default:
-		PMD_DRV_LOG(ERR, "The version of firmware is not correct.");
-		return -EINVAL;
-	}
 
 	*max_tx_desc = NFP_NET_MAX_TX_DESC / tx_dpp;
 
@@ -2106,3 +2094,24 @@ nfp_repr_firmware_version_get(struct rte_eth_dev *dev,
 
 	return 0;
 }
+
+bool
+nfp_net_is_valid_nfd_version(struct nfp_net_fw_ver version)
+{
+	uint8_t nfd_version = version.extend;
+
+	if (nfd_version == NFP_NET_CFG_VERSION_DP_NFD3)
+		return true;
+
+	if (nfd_version == NFP_NET_CFG_VERSION_DP_NFDK) {
+		if (version.major < 5) {
+			PMD_INIT_LOG(ERR, "NFDK must use ABI 5 or newer, found: %d",
+					version.major);
+			return false;
+		}
+
+		return true;
+	}
+
+	return false;
+}
diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index 2281445861..acb34535c5 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -444,6 +444,7 @@ void nfp_net_init_metadata_format(struct nfp_net_hw *hw);
 void nfp_net_cfg_read_version(struct nfp_net_hw *hw);
 int nfp_net_firmware_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size);
 int nfp_repr_firmware_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size);
+bool nfp_net_is_valid_nfd_version(struct nfp_net_fw_ver version);
 
 #define NFP_NET_DEV_PRIVATE_TO_HW(adapter)\
 	(&((struct nfp_net_adapter *)adapter)->hw)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index e84d2ac82e..0ccb543f14 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -474,31 +474,18 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = {
 	.fw_version_get         = nfp_net_firmware_version_get,
 };
 
-static inline int
-nfp_net_ethdev_ops_mount(struct nfp_net_hw *hw, struct rte_eth_dev *eth_dev)
+static inline void
+nfp_net_ethdev_ops_mount(struct nfp_net_hw *hw,
+		struct rte_eth_dev *eth_dev)
 {
-	switch (hw->ver.extend) {
-	case NFP_NET_CFG_VERSION_DP_NFD3:
-		eth_dev->tx_pkt_burst = &nfp_net_nfd3_xmit_pkts;
-		break;
-	case NFP_NET_CFG_VERSION_DP_NFDK:
-		if (hw->ver.major < 5) {
-			PMD_DRV_LOG(ERR, "NFDK must use ABI 5 or newer, found: %d",
-					hw->ver.major);
-			return -EINVAL;
-		}
-		eth_dev->tx_pkt_burst = &nfp_net_nfdk_xmit_pkts;
-		break;
-	default:
-		PMD_DRV_LOG(ERR, "The version of firmware is not correct.");
-		return -EINVAL;
-	}
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
+		eth_dev->tx_pkt_burst = nfp_net_nfd3_xmit_pkts;
+	else
+		eth_dev->tx_pkt_burst = nfp_net_nfdk_xmit_pkts;
 
 	eth_dev->dev_ops = &nfp_net_eth_dev_ops;
 	eth_dev->rx_queue_count = nfp_net_rx_queue_count;
 	eth_dev->rx_pkt_burst = &nfp_net_recv_pkts;
-
-	return 0;
 }
 
 static int
@@ -583,12 +570,13 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	PMD_INIT_LOG(DEBUG, "MAC stats: %p", hw->mac_stats);
 
 	nfp_net_cfg_read_version(hw);
+	if (!nfp_net_is_valid_nfd_version(hw->ver))
+		return -EINVAL;
 
 	if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0)
 		return -ENODEV;
 
-	if (nfp_net_ethdev_ops_mount(hw, eth_dev))
-		return -EINVAL;
+	nfp_net_ethdev_ops_mount(hw, eth_dev);
 
 	hw->max_rx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_RXRINGS);
 	hw->max_tx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_TXRINGS);
@@ -1133,8 +1121,7 @@ nfp_secondary_init_app_fw_nic(struct rte_pci_device *pci_dev,
 
 		eth_dev->process_private = cpp;
 		hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
-		if (nfp_net_ethdev_ops_mount(hw, eth_dev))
-			return -EINVAL;
+		nfp_net_ethdev_ops_mount(hw, eth_dev);
 
 		rte_eth_dev_probing_finish(eth_dev);
 	}
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 71f5020ecd..f971bb8903 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -244,31 +244,18 @@ static const struct eth_dev_ops nfp_netvf_eth_dev_ops = {
 	.fw_version_get         = nfp_net_firmware_version_get,
 };
 
-static inline int
-nfp_netvf_ethdev_ops_mount(struct nfp_net_hw *hw, struct rte_eth_dev *eth_dev)
+static inline void
+nfp_netvf_ethdev_ops_mount(struct nfp_net_hw *hw,
+		struct rte_eth_dev *eth_dev)
 {
-	switch (hw->ver.extend) {
-	case NFP_NET_CFG_VERSION_DP_NFD3:
-		eth_dev->tx_pkt_burst = &nfp_net_nfd3_xmit_pkts;
-		break;
-	case NFP_NET_CFG_VERSION_DP_NFDK:
-		if (hw->ver.major < 5) {
-			PMD_DRV_LOG(ERR, "NFDK must use ABI 5 or newer, found: %d",
-					hw->ver.major);
-			return -EINVAL;
-		}
-		eth_dev->tx_pkt_burst = &nfp_net_nfdk_xmit_pkts;
-		break;
-	default:
-		PMD_DRV_LOG(ERR, "The version of firmware is not correct.");
-		return -EINVAL;
-	}
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
+		eth_dev->tx_pkt_burst = nfp_net_nfd3_xmit_pkts;
+	else
+		eth_dev->tx_pkt_burst = nfp_net_nfdk_xmit_pkts;
 
 	eth_dev->dev_ops = &nfp_netvf_eth_dev_ops;
 	eth_dev->rx_queue_count = nfp_net_rx_queue_count;
 	eth_dev->rx_pkt_burst = &nfp_net_recv_pkts;
-
-	return 0;
 }
 
 static int
@@ -300,12 +287,13 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	PMD_INIT_LOG(DEBUG, "ctrl bar: %p", hw->ctrl_bar);
 
 	nfp_net_cfg_read_version(hw);
+	if (!nfp_net_is_valid_nfd_version(hw->ver))
+		return -EINVAL;
 
 	if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0)
 		return -ENODEV;
 
-	if (nfp_netvf_ethdev_ops_mount(hw, eth_dev))
-		return -EINVAL;
+	nfp_netvf_ethdev_ops_mount(hw, eth_dev);
 
 	/* For secondary processes, the primary has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 0ac9d6db03..ce9a07309e 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -889,20 +889,10 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev,
 
 	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	switch (hw->ver.extend) {
-	case NFP_NET_CFG_VERSION_DP_NFD3:
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
 		return nfp_net_nfd3_tx_queue_setup(dev, queue_idx,
 				nb_desc, socket_id, tx_conf);
-	case NFP_NET_CFG_VERSION_DP_NFDK:
-		if (hw->ver.major < 5) {
-			PMD_DRV_LOG(ERR, "NFDK must use ABI 5 or newer, found: %d",
-					hw->ver.major);
-			return -EINVAL;
-		}
+	else
 		return nfp_net_nfdk_tx_queue_setup(dev, queue_idx,
 				nb_desc, socket_id, tx_conf);
-	default:
-		PMD_DRV_LOG(ERR, "The version of firmware is not correct.");
-		return -EINVAL;
-	}
 }
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 03/10] net/nfp: refactor the insert metadata logic of NFD3
  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 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 04/10] net/nfp: add the insert metadata logic of NFDk Chaoyong He
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Extract the insert metadata logic of NFD3 into a single function to
simplify the logics.

Add the data structure aims to hold all the different function pointers
which related to different NFD version.

Also add a register function to initialize the function pointers.

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           | 26 ++++++++
 drivers/net/nfp/flower/nfp_flower.h           | 16 ++++-
 drivers/net/nfp/flower/nfp_flower_cmsg.c      | 63 ++++++++++---------
 .../net/nfp/flower/nfp_flower_representor.c   | 10 +--
 drivers/net/nfp/nfd3/nfp_nfd3.h               |  2 +
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c            | 16 +++++
 6 files changed, 97 insertions(+), 36 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index afb4e5b344..3636c347bb 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -1058,6 +1058,30 @@ nfp_flower_enable_services(struct nfp_app_fw_flower *app_fw_flower)
 	return 0;
 }
 
+static void
+nfp_flower_pkt_add_metadata_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->pkt_add_metadata_t = nfp_flower_nfd3_pkt_add_metadata;
+}
+
+uint32_t
+nfp_flower_pkt_add_metadata(struct nfp_app_fw_flower *app_fw_flower,
+		struct rte_mbuf *mbuf,
+		uint32_t port_id)
+{
+	return app_fw_flower->nfd_func.pkt_add_metadata_t(mbuf, port_id);
+}
+
+static void
+nfp_flower_nfd_func_register(struct nfp_app_fw_flower *app_fw_flower)
+{
+	nfp_flower_pkt_add_metadata_register(app_fw_flower);
+}
+
 int
 nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev)
 {
@@ -1135,6 +1159,8 @@ nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev)
 		goto pf_cpp_area_cleanup;
 	}
 
+	nfp_flower_nfd_func_register(app_fw_flower);
+
 	/* The ctrl vNIC struct comes directly after the PF one */
 	app_fw_flower->ctrl_hw = pf_hw + 1;
 	ctrl_hw = app_fw_flower->ctrl_hw;
diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h
index 0ce5f7bd9e..3bc5924b71 100644
--- a/drivers/net/nfp/flower/nfp_flower.h
+++ b/drivers/net/nfp/flower/nfp_flower.h
@@ -29,11 +29,20 @@
  * to the correct packet data offset after metadata has
  * been added
  */
-#define FLOWER_PKT_DATA_OFFSET 8
+#define FLOWER_PKT_DATA_OFFSET (NFP_NET_META_HEADER_SIZE + NFP_NET_META_FIELD_SIZE)
 
 #define MAX_FLOWER_PHYPORTS 8
 #define MAX_FLOWER_VFS 64
 
+struct nfp_app_fw_flower;
+
+/* The function pointers for different NFD version */
+struct nfp_flower_nfd_func {
+	/** Function used to add metadata into pkt. */
+	uint32_t (*pkt_add_metadata_t)(struct rte_mbuf *mbuf,
+		uint32_t port_id);
+};
+
 /* The flower application's private structure */
 struct nfp_app_fw_flower {
 	/* switch domain for this app */
@@ -77,6 +86,9 @@ struct nfp_app_fw_flower {
 
 	struct nfp_flow_priv *flow_priv;
 	struct nfp_mtr_priv *mtr_priv;
+
+	/* Function pointers for different NFD version */
+	struct nfp_flower_nfd_func nfd_func;
 };
 
 static inline bool
@@ -93,5 +105,7 @@ uint16_t nfp_flower_pf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
 int nfp_flower_pf_start(struct rte_eth_dev *dev);
 int nfp_flower_pf_stop(struct rte_eth_dev *dev);
+uint32_t nfp_flower_pkt_add_metadata(struct nfp_app_fw_flower *app_fw_flower,
+		struct rte_mbuf *mbuf, uint32_t port_id);
 
 #endif /* _NFP_FLOWER_H_ */
diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.c b/drivers/net/nfp/flower/nfp_flower_cmsg.c
index 430dd9c316..00f94c7492 100644
--- a/drivers/net/nfp/flower/nfp_flower_cmsg.c
+++ b/drivers/net/nfp/flower/nfp_flower_cmsg.c
@@ -12,28 +12,19 @@
 #include "nfp_flower_representor.h"
 
 static void *
-nfp_flower_cmsg_init(struct rte_mbuf *m,
+nfp_flower_cmsg_init(struct nfp_app_fw_flower *app_fw_flower,
+		struct rte_mbuf *m,
 		enum nfp_flower_cmsg_type type,
 		uint32_t size)
 {
 	char *pkt;
-	uint32_t data;
 	uint32_t new_size = size;
 	struct nfp_flower_cmsg_hdr *hdr;
 
 	pkt = rte_pktmbuf_mtod(m, char *);
 	PMD_DRV_LOG(DEBUG, "flower_cmsg_init using pkt at %p", pkt);
 
-	data = rte_cpu_to_be_32(NFP_NET_META_PORTID);
-	rte_memcpy(pkt, &data, 4);
-	pkt += 4;
-	new_size += 4;
-
-	/* First the metadata as flower requires it */
-	data = rte_cpu_to_be_32(NFP_META_PORT_ID_CTRL);
-	rte_memcpy(pkt, &data, 4);
-	pkt += 4;
-	new_size += 4;
+	new_size += nfp_flower_pkt_add_metadata(app_fw_flower, m, NFP_META_PORT_ID_CTRL);
 
 	/* Now the ctrl header */
 	hdr = (struct nfp_flower_cmsg_hdr *)pkt;
@@ -51,14 +42,17 @@ nfp_flower_cmsg_init(struct rte_mbuf *m,
 }
 
 static void
-nfp_flower_cmsg_mac_repr_init(struct rte_mbuf *mbuf, int num_ports)
+nfp_flower_cmsg_mac_repr_init(struct rte_mbuf *mbuf,
+		struct nfp_app_fw_flower *app_fw_flower)
 {
 	uint32_t size;
+	uint8_t num_ports;
 	struct nfp_flower_cmsg_mac_repr *msg;
 	enum nfp_flower_cmsg_type type = NFP_FLOWER_CMSG_TYPE_MAC_REPR;
 
+	num_ports = app_fw_flower->num_phyport_reprs;
 	size = sizeof(*msg) + (num_ports * sizeof(msg->ports[0]));
-	msg = nfp_flower_cmsg_init(mbuf, type, size);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf, type, size);
 	memset(msg->reserved, 0, sizeof(msg->reserved));
 	msg->num_ports = num_ports;
 }
@@ -96,7 +90,7 @@ nfp_flower_cmsg_mac_repr(struct nfp_app_fw_flower *app_fw_flower)
 		return -ENOMEM;
 	}
 
-	nfp_flower_cmsg_mac_repr_init(mbuf, app_fw_flower->num_phyport_reprs);
+	nfp_flower_cmsg_mac_repr_init(mbuf, app_fw_flower);
 
 	/* Fill in the mac repr cmsg */
 	nfp_eth_table = app_fw_flower->pf_hw->pf_dev->nfp_eth_table;
@@ -133,7 +127,8 @@ nfp_flower_cmsg_repr_reify(struct nfp_app_fw_flower *app_fw_flower,
 		return -ENOMEM;
 	}
 
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_PORT_REIFY, sizeof(*msg));
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_PORT_REIFY, sizeof(*msg));
 	msg->portnum  = rte_cpu_to_be_32(repr->port_id);
 	msg->reserved = 0;
 	msg->info     = rte_cpu_to_be_16(1);
@@ -162,7 +157,8 @@ nfp_flower_cmsg_port_mod(struct nfp_app_fw_flower *app_fw_flower,
 		return -ENOMEM;
 	}
 
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_PORT_MOD, sizeof(*msg));
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_PORT_MOD, sizeof(*msg));
 	msg->portnum  = rte_cpu_to_be_32(port_id);
 	msg->reserved = 0;
 	msg->info     = carrier_ok;
@@ -199,7 +195,8 @@ nfp_flower_cmsg_flow_delete(struct nfp_app_fw_flower *app_fw_flower,
 	msg_len = (nfp_flow_meta->key_len + nfp_flow_meta->mask_len +
 			nfp_flow_meta->act_len) << NFP_FL_LW_SIZ;
 	msg_len += sizeof(struct nfp_fl_rule_metadata);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_FLOW_DEL, msg_len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_FLOW_DEL, msg_len);
 	rte_memcpy(msg, flow->payload.meta, msg_len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
@@ -233,7 +230,8 @@ nfp_flower_cmsg_flow_add(struct nfp_app_fw_flower *app_fw_flower,
 	msg_len = (nfp_flow_meta->key_len + nfp_flow_meta->mask_len +
 			nfp_flow_meta->act_len) << NFP_FL_LW_SIZ;
 	msg_len += sizeof(struct nfp_fl_rule_metadata);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_FLOW_ADD, msg_len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_FLOW_ADD, msg_len);
 	rte_memcpy(msg, flow->payload.meta, msg_len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
@@ -264,7 +262,8 @@ nfp_flower_cmsg_tun_neigh_v4_rule(struct nfp_app_fw_flower *app_fw_flower,
 	msg_len = sizeof(struct nfp_flower_cmsg_tun_neigh_v4);
 	if (!nfp_flower_support_decap_v2(app_fw_flower))
 		msg_len -= sizeof(struct nfp_flower_tun_neigh_ext);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_TUN_NEIGH, msg_len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_TUN_NEIGH, msg_len);
 	memcpy(msg, payload, msg_len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
@@ -295,7 +294,8 @@ nfp_flower_cmsg_tun_neigh_v6_rule(struct nfp_app_fw_flower *app_fw_flower,
 	msg_len = sizeof(struct nfp_flower_cmsg_tun_neigh_v6);
 	if (!nfp_flower_support_decap_v2(app_fw_flower))
 		msg_len -= sizeof(struct nfp_flower_tun_neigh_ext);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_TUN_NEIGH_V6, msg_len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_TUN_NEIGH_V6, msg_len);
 	memcpy(msg, payload, msg_len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
@@ -324,7 +324,8 @@ nfp_flower_cmsg_tun_off_v4(struct nfp_app_fw_flower *app_fw_flower)
 		return -ENOMEM;
 	}
 
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_TUN_IPS, sizeof(*msg));
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_TUN_IPS, sizeof(*msg));
 
 	priv = app_fw_flower->flow_priv;
 	rte_spinlock_lock(&priv->ipv4_off_lock);
@@ -366,7 +367,8 @@ nfp_flower_cmsg_tun_off_v6(struct nfp_app_fw_flower *app_fw_flower)
 		return -ENOMEM;
 	}
 
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_TUN_IPS_V6, sizeof(*msg));
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_TUN_IPS_V6, sizeof(*msg));
 
 	priv = app_fw_flower->flow_priv;
 	rte_spinlock_lock(&priv->ipv6_off_lock);
@@ -409,7 +411,8 @@ nfp_flower_cmsg_pre_tunnel_rule(struct nfp_app_fw_flower *app_fw_flower,
 		return -ENOMEM;
 	}
 
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_PRE_TUN_RULE, sizeof(*msg));
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_PRE_TUN_RULE, sizeof(*msg));
 
 	meta_tci = (struct nfp_flower_meta_tci *)((char *)nfp_flow_meta +
 			sizeof(struct nfp_fl_rule_metadata));
@@ -450,7 +453,8 @@ nfp_flower_cmsg_tun_mac_rule(struct nfp_app_fw_flower *app_fw_flower,
 		return -ENOMEM;
 	}
 
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_TUN_MAC, sizeof(*msg));
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_TUN_MAC, sizeof(*msg));
 
 	msg->count = rte_cpu_to_be_16(1);
 	msg->index = rte_cpu_to_be_16(mac_idx);
@@ -484,7 +488,8 @@ nfp_flower_cmsg_qos_add(struct nfp_app_fw_flower *app_fw_flower,
 	}
 
 	len = sizeof(struct nfp_profile_conf);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_QOS_MOD, len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_QOS_MOD, len);
 	rte_memcpy(msg, conf, len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
@@ -513,7 +518,8 @@ nfp_flower_cmsg_qos_delete(struct nfp_app_fw_flower *app_fw_flower,
 	}
 
 	len = sizeof(struct nfp_profile_conf);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_QOS_DEL, len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_QOS_DEL, len);
 	rte_memcpy(msg, conf, len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
@@ -542,7 +548,8 @@ nfp_flower_cmsg_qos_stats(struct nfp_app_fw_flower *app_fw_flower,
 	}
 
 	len = sizeof(struct nfp_cfg_head);
-	msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_QOS_STATS, len);
+	msg = nfp_flower_cmsg_init(app_fw_flower, mbuf,
+			NFP_FLOWER_CMSG_TYPE_QOS_STATS, len);
 	rte_memcpy(msg, head, len);
 
 	cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf);
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 607625d204..eb318f66df 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -465,7 +465,6 @@ nfp_flower_repr_tx_burst(void *tx_queue,
 {
 	uint16_t i;
 	uint16_t sent;
-	char *meta_offset;
 	void *pf_tx_queue;
 	struct nfp_net_txq *txq;
 	struct nfp_net_hw *pf_hw;
@@ -483,12 +482,9 @@ nfp_flower_repr_tx_burst(void *tx_queue,
 	repr_dev = &rte_eth_devices[txq->port_id];
 	repr = repr_dev->data->dev_private;
 
-	for (i = 0; i < nb_pkts; i++) {
-		meta_offset = rte_pktmbuf_prepend(tx_pkts[i], FLOWER_PKT_DATA_OFFSET);
-		*(uint32_t *)meta_offset = rte_cpu_to_be_32(NFP_NET_META_PORTID);
-		meta_offset += 4;
-		*(uint32_t *)meta_offset = rte_cpu_to_be_32(repr->port_id);
-	}
+	for (i = 0; i < nb_pkts; i++)
+		nfp_flower_pkt_add_metadata(repr->app_fw_flower,
+				tx_pkts[i], repr->port_id);
 
 	/* This points to the PF vNIC that owns this representor */
 	pf_hw = txq->hw;
diff --git a/drivers/net/nfp/nfd3/nfp_nfd3.h b/drivers/net/nfp/nfd3/nfp_nfd3.h
index e772bc4711..5bf89868fc 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3.h
+++ b/drivers/net/nfp/nfd3/nfp_nfd3.h
@@ -153,6 +153,8 @@ nfp_net_nfd3_tx_cksum(struct nfp_net_txq *txq,
 		txd->flags |= NFD3_DESC_TX_CSUM;
 }
 
+uint32_t nfp_flower_nfd3_pkt_add_metadata(struct rte_mbuf *mbuf,
+		uint32_t port_id);
 uint16_t nfp_net_nfd3_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
index 1a960fbe63..2ad098a699 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
+++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
@@ -10,8 +10,24 @@
 #include "../nfp_logs.h"
 #include "../nfp_common.h"
 #include "../nfp_rxtx.h"
+#include "../flower/nfp_flower.h"
+#include "../flower/nfp_flower_cmsg.h"
 #include "nfp_nfd3.h"
 
+uint32_t
+nfp_flower_nfd3_pkt_add_metadata(struct rte_mbuf *mbuf,
+		uint32_t port_id)
+{
+	char *meta_offset;
+
+	meta_offset = rte_pktmbuf_prepend(mbuf, FLOWER_PKT_DATA_OFFSET);
+	*(rte_be32_t *)meta_offset = rte_cpu_to_be_32(NFP_NET_META_PORTID);
+	meta_offset += NFP_NET_META_HEADER_SIZE;
+	*(rte_be32_t *)meta_offset = rte_cpu_to_be_32(port_id);
+
+	return FLOWER_PKT_DATA_OFFSET;
+}
+
 /*
  * nfp_net_nfd3_tx_vlan() - Set vlan info in the nfd3 tx desc
  *
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 04/10] net/nfp: add the insert metadata logic of NFDk
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (2 preceding siblings ...)
  2023-06-07  1:57 ` [PATCH 03/10] net/nfp: refactor the insert metadata logic of NFD3 Chaoyong He
@ 2023-06-07  1:57 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 05/10] net/nfp: add a dispatch layer for Tx function of ctrl VNIC Chaoyong He
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

NFD3 and NFDk have the same format metadata for the RX direction,
while they are different for the TX direction.

Add the insert metadata logic of NFDk.

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 |  8 +++++++-
 drivers/net/nfp/nfdk/nfp_nfdk.h     |  2 ++
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c  | 18 ++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 3636c347bb..8631664180 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -16,6 +16,7 @@
 #include "../nfp_cpp_bridge.h"
 #include "../nfp_rxtx.h"
 #include "../nfd3/nfp_nfd3.h"
+#include "../nfdk/nfp_nfdk.h"
 #include "../nfpcore/nfp_mip.h"
 #include "../nfpcore/nfp_rtsym.h"
 #include "../nfpcore/nfp_nsp.h"
@@ -1061,11 +1062,16 @@ nfp_flower_enable_services(struct nfp_app_fw_flower *app_fw_flower)
 static void
 nfp_flower_pkt_add_metadata_register(struct nfp_app_fw_flower *app_fw_flower)
 {
+	struct nfp_net_hw *hw;
 	struct nfp_flower_nfd_func *nfd_func;
 
+	hw = app_fw_flower->pf_hw;
 	nfd_func = &app_fw_flower->nfd_func;
 
-	nfd_func->pkt_add_metadata_t = nfp_flower_nfd3_pkt_add_metadata;
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
+		nfd_func->pkt_add_metadata_t = nfp_flower_nfd3_pkt_add_metadata;
+	else
+		nfd_func->pkt_add_metadata_t = nfp_flower_nfdk_pkt_add_metadata;
 }
 
 uint32_t
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk.h b/drivers/net/nfp/nfdk/nfp_nfdk.h
index c39501990a..0e3c6cc90d 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk.h
+++ b/drivers/net/nfp/nfdk/nfp_nfdk.h
@@ -227,6 +227,8 @@ nfp_net_nfdk_tx_tso(struct nfp_net_txq *txq,
 	return txd.raw;
 }
 
+uint32_t nfp_flower_nfdk_pkt_add_metadata(struct rte_mbuf *mbuf,
+		uint32_t port_id);
 uint16_t nfp_net_nfdk_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 9b815800bb..59c507e03b 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -12,8 +12,26 @@
 #include "../nfp_rxtx.h"
 #include "../nfpcore/nfp_mip.h"
 #include "../nfpcore/nfp_rtsym.h"
+#include "../flower/nfp_flower.h"
+#include "../flower/nfp_flower_cmsg.h"
 #include "nfp_nfdk.h"
 
+uint32_t
+nfp_flower_nfdk_pkt_add_metadata(struct rte_mbuf *mbuf,
+		uint32_t port_id)
+{
+	uint32_t header;
+	char *meta_offset;
+
+	meta_offset = rte_pktmbuf_prepend(mbuf, FLOWER_PKT_DATA_OFFSET);
+	header = NFP_NET_META_PORTID << NFP_NET_META_NFDK_LENGTH | FLOWER_PKT_DATA_OFFSET;
+	*(rte_be32_t *)meta_offset = rte_cpu_to_be_32(header);
+	meta_offset += NFP_NET_META_HEADER_SIZE;
+	*(rte_be32_t *)meta_offset = rte_cpu_to_be_32(port_id);
+
+	return FLOWER_PKT_DATA_OFFSET;
+}
+
 static inline uint16_t
 nfp_net_nfdk_headlen_to_segs(uint16_t headlen)
 {
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 05/10] net/nfp: add a dispatch layer for Tx function of ctrl VNIC
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (3 preceding siblings ...)
  2023-06-07  1:57 ` [PATCH 04/10] net/nfp: add the insert metadata logic of NFDk Chaoyong He
@ 2023-06-07  1:57 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 06/10] net/nfp: add the xmit function of NFDk for " Chaoyong He
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

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

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      |  1 +
 drivers/net/nfp/flower/nfp_flower.h      |  3 +++
 drivers/net/nfp/flower/nfp_flower_ctrl.c | 21 +++++++++++++++++++--
 drivers/net/nfp/flower/nfp_flower_ctrl.h |  1 +
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 8631664180..6d86145755 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -1086,6 +1086,7 @@ static void
 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);
 }
 
 int
diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h
index 3bc5924b71..808321dffe 100644
--- a/drivers/net/nfp/flower/nfp_flower.h
+++ b/drivers/net/nfp/flower/nfp_flower.h
@@ -41,6 +41,9 @@ struct nfp_flower_nfd_func {
 	/** Function used to add metadata into pkt. */
 	uint32_t (*pkt_add_metadata_t)(struct rte_mbuf *mbuf,
 		uint32_t port_id);
+	/** 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);
 };
 
 /* The flower application's private structure */
diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c
index 406dfe0d1d..bafcf5b017 100644
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.c
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c
@@ -154,8 +154,8 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
 	return avail;
 }
 
-uint16_t
-nfp_flower_ctrl_vnic_xmit(struct nfp_app_fw_flower *app_fw_flower,
+static uint16_t
+nfp_flower_ctrl_vnic_nfd3_xmit(struct nfp_app_fw_flower *app_fw_flower,
 		struct rte_mbuf *mbuf)
 {
 	uint16_t cnt = 0;
@@ -224,6 +224,23 @@ nfp_flower_ctrl_vnic_xmit(struct nfp_app_fw_flower *app_fw_flower,
 	return cnt;
 }
 
+void
+nfp_flower_ctrl_vnic_xmit_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->ctrl_vnic_xmit_t = nfp_flower_ctrl_vnic_nfd3_xmit;
+}
+
+uint16_t
+nfp_flower_ctrl_vnic_xmit(struct nfp_app_fw_flower *app_fw_flower,
+		struct rte_mbuf *mbuf)
+{
+	return app_fw_flower->nfd_func.ctrl_vnic_xmit_t(app_fw_flower, mbuf);
+}
+
 static void
 nfp_flower_cmsg_rx_stats(struct nfp_flow_priv *flow_priv,
 		struct rte_mbuf *mbuf)
diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.h b/drivers/net/nfp/flower/nfp_flower_ctrl.h
index 1e385787e5..b7e836cf7e 100644
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.h
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.h
@@ -9,5 +9,6 @@
 void nfp_flower_ctrl_vnic_poll(struct nfp_app_fw_flower *app_fw_flower);
 uint16_t nfp_flower_ctrl_vnic_xmit(struct nfp_app_fw_flower *app_fw_flower,
 		struct rte_mbuf *mbuf);
+void nfp_flower_ctrl_vnic_xmit_register(struct nfp_app_fw_flower *app_fw_flower);
 
 #endif /* _NFP_FLOWER_CTRL_H_ */
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 06/10] net/nfp: add the xmit function of NFDk for ctrl VNIC
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (4 preceding siblings ...)
  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 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 07/10] net/nfp: add a dispatch layer for Tx function of representor Chaoyong He
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Add the xmit function of NFDk for ctrl VNIC.

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

diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c
index bafcf5b017..0be44a68aa 100644
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.c
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c
@@ -12,6 +12,7 @@
 #include "../nfp_ctrl.h"
 #include "../nfp_rxtx.h"
 #include "../nfd3/nfp_nfd3.h"
+#include "../nfdk/nfp_nfdk.h"
 #include "nfp_flower.h"
 #include "nfp_flower_ctrl.h"
 #include "nfp_flower_cmsg.h"
@@ -224,14 +225,149 @@ nfp_flower_ctrl_vnic_nfd3_xmit(struct nfp_app_fw_flower *app_fw_flower,
 	return cnt;
 }
 
+static uint16_t
+nfp_flower_ctrl_vnic_nfdk_xmit(struct nfp_app_fw_flower *app_fw_flower,
+		struct rte_mbuf *mbuf)
+{
+	int nop_descs;
+	uint32_t type;
+	uint32_t dma_len;
+	uint32_t tmp_dlen;
+	uint64_t dma_addr;
+	uint32_t dlen_type;
+	uint32_t used_descs;
+	uint32_t free_descs;
+	struct rte_mbuf **lmbuf;
+	struct nfp_net_txq *txq;
+	uint32_t issued_descs = 0;
+	struct rte_eth_dev *ctrl_dev;
+	struct nfp_net_nfdk_tx_desc *ktxds;
+
+	ctrl_dev = app_fw_flower->ctrl_hw->eth_dev;
+
+	/* Flower ctrl vNIC only has a single tx queue */
+	txq = ctrl_dev->data->tx_queues[0];
+
+	if (unlikely(mbuf->nb_segs > 1)) {
+		PMD_TX_LOG(ERR, "Multisegment packet not supported");
+		return 0;
+	}
+
+	if (nfp_net_nfdk_free_tx_desc(txq) < NFDK_TX_DESC_PER_SIMPLE_PKT ||
+			nfp_net_nfdk_txq_full(txq))
+		nfp_net_tx_free_bufs(txq);
+
+	free_descs = nfp_net_nfdk_free_tx_desc(txq);
+	if (unlikely(free_descs < NFDK_TX_DESC_PER_SIMPLE_PKT)) {
+		PMD_TX_LOG(ERR, "ctrl dev no free descs");
+		return 0;
+	}
+
+	nop_descs = nfp_net_nfdk_tx_maybe_close_block(txq, mbuf);
+	if (nop_descs < 0)
+		return 0;
+
+	issued_descs += nop_descs;
+	ktxds = &txq->ktxds[txq->wr_p];
+
+	/*
+	 * Checksum and VLAN flags just in the first descriptor for a
+	 * multisegment packet, but TSO info needs to be in all of them.
+	 */
+	dma_len = mbuf->data_len;
+	if (dma_len <= NFDK_TX_MAX_DATA_PER_HEAD)
+		type = NFDK_DESC_TX_TYPE_SIMPLE;
+	else
+		type = NFDK_DESC_TX_TYPE_GATHER;
+
+	/* Implicitly truncates to chunk in below logic */
+	dma_len -= 1;
+
+	/*
+	 * We will do our best to pass as much data as we can in descriptor
+	 * and we need to make sure the first descriptor includes whole
+	 * head since there is limitation in firmware side. Sometimes the
+	 * value of 'dma_len & NFDK_DESC_TX_DMA_LEN_HEAD' will be less
+	 * than packet head len.
+	 */
+	if (dma_len > NFDK_DESC_TX_DMA_LEN_HEAD)
+		dma_len = NFDK_DESC_TX_DMA_LEN_HEAD;
+	dlen_type = dma_len | (NFDK_DESC_TX_TYPE_HEAD & (type << 12));
+	ktxds->dma_len_type = rte_cpu_to_le_16(dlen_type);
+	dma_addr = rte_mbuf_data_iova(mbuf);
+	ktxds->dma_addr_hi = rte_cpu_to_le_16(dma_addr >> 32);
+	ktxds->dma_addr_lo = rte_cpu_to_le_32(dma_addr & 0xffffffff);
+	ktxds++;
+
+	/*
+	 * Preserve the original dlen_type, this way below the EOP logic
+	 * can use dlen_type.
+	 */
+	tmp_dlen = dlen_type & NFDK_DESC_TX_DMA_LEN_HEAD;
+	dma_len -= tmp_dlen;
+	dma_addr += tmp_dlen + 1;
+
+	/*
+	 * The rest of the data (if any) will be in larger DMA descriptors
+	 * and is handled with the dma_len loop.
+	 */
+	lmbuf = &txq->txbufs[txq->wr_p].mbuf;
+	if (*lmbuf != NULL)
+		rte_pktmbuf_free_seg(*lmbuf);
+	*lmbuf = mbuf;
+	while (dma_len > 0) {
+		dma_len -= 1;
+		dlen_type = NFDK_DESC_TX_DMA_LEN & dma_len;
+
+		ktxds->dma_len_type = rte_cpu_to_le_16(dlen_type);
+		ktxds->dma_addr_hi = rte_cpu_to_le_16(dma_addr >> 32);
+		ktxds->dma_addr_lo = rte_cpu_to_le_32(dma_addr & 0xffffffff);
+		ktxds++;
+
+		dma_len -= dlen_type;
+		dma_addr += dlen_type + 1;
+	}
+
+	(ktxds - 1)->dma_len_type = rte_cpu_to_le_16(dlen_type | NFDK_DESC_TX_EOP);
+
+	ktxds->raw = rte_cpu_to_le_64(NFDK_DESC_TX_CHAIN_META);
+	ktxds++;
+
+	used_descs = ktxds - txq->ktxds - txq->wr_p;
+	if (RTE_ALIGN_FLOOR(txq->wr_p, NFDK_TX_DESC_BLOCK_CNT) !=
+			RTE_ALIGN_FLOOR(txq->wr_p + used_descs - 1, NFDK_TX_DESC_BLOCK_CNT)) {
+		PMD_TX_LOG(INFO, "Used descs cross block boundary");
+		return 0;
+	}
+
+	txq->wr_p = D_IDX(txq, txq->wr_p + used_descs);
+	if (txq->wr_p % NFDK_TX_DESC_BLOCK_CNT)
+		txq->data_pending += mbuf->pkt_len;
+	else
+		txq->data_pending = 0;
+
+	issued_descs += used_descs;
+
+	/* Increment write pointers. Force memory write before we let HW know */
+	rte_wmb();
+	nfp_qcp_ptr_add(txq->qcp_q, NFP_QCP_WRITE_PTR, issued_descs);
+
+	return 1;
+}
+
 void
 nfp_flower_ctrl_vnic_xmit_register(struct nfp_app_fw_flower *app_fw_flower)
 {
+	struct nfp_net_hw *hw;
 	struct nfp_flower_nfd_func *nfd_func;
 
+	hw = app_fw_flower->pf_hw;
 	nfd_func = &app_fw_flower->nfd_func;
 
-	nfd_func->ctrl_vnic_xmit_t = nfp_flower_ctrl_vnic_nfd3_xmit;
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
+		nfd_func->ctrl_vnic_xmit_t = nfp_flower_ctrl_vnic_nfd3_xmit;
+	else
+		nfd_func->ctrl_vnic_xmit_t = nfp_flower_ctrl_vnic_nfdk_xmit;
 }
 
 uint16_t
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk.h b/drivers/net/nfp/nfdk/nfp_nfdk.h
index 0e3c6cc90d..898454102d 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk.h
+++ b/drivers/net/nfp/nfdk/nfp_nfdk.h
@@ -237,5 +237,7 @@ int nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t nb_desc,
 		unsigned int socket_id,
 		const struct rte_eth_txconf *tx_conf);
+int nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq,
+		struct rte_mbuf *pkt);
 
 #endif /* _NFP_NFDK_H_ */
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 59c507e03b..dbb15581c4 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -63,7 +63,7 @@ nfp_net_nfdk_tx_close_block(struct nfp_net_txq *txq,
 	txq->wr_p = D_IDX(txq, wr_p + nop_slots);
 }
 
-static int
+int
 nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq,
 		struct rte_mbuf *pkt)
 {
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 07/10] net/nfp: add a dispatch layer for Tx function of representor
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (5 preceding siblings ...)
  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
  2023-06-07  1:57 ` [PATCH 08/10] net/nfp: merge the xmit function of NFD3 Chaoyong He
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 08/10] net/nfp: merge the xmit function of NFD3
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (6 preceding siblings ...)
  2023-06-07  1:57 ` [PATCH 07/10] net/nfp: add a dispatch layer for Tx function of representor Chaoyong He
@ 2023-06-07  1:57 ` Chaoyong He
  2023-06-07  1:57 ` [PATCH 09/10] net/nfp: add the xmit function of NFDk for PF representor Chaoyong He
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

The only different logic between the NFD3 xmit function of PF representor
port and PF is if the logic about metadata exists. So squash the NFD3
xmit function and use a parameter to distinguish them.

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 | 124 +---------------------------
 drivers/net/nfp/nfd3/nfp_nfd3.h     |   4 +
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c  |  23 +++++-
 3 files changed, 24 insertions(+), 127 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 748b45b9ad..3bc863b9f1 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -490,129 +490,7 @@ nfp_flower_pf_nfd3_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts)
 {
-	int i;
-	int pkt_size;
-	int dma_size;
-	uint64_t dma_addr;
-	uint16_t free_descs;
-	uint16_t issued_descs;
-	struct rte_mbuf *pkt;
-	struct nfp_net_hw *hw;
-	struct rte_mbuf **lmbuf;
-	struct nfp_net_txq *txq;
-	struct nfp_net_nfd3_tx_desc txd;
-	struct nfp_net_nfd3_tx_desc *txds;
-
-	txq = tx_queue;
-	hw = txq->hw;
-	txds = &txq->txds[txq->wr_p];
-
-	PMD_TX_LOG(DEBUG, "working for queue %hu at pos %u and %hu packets",
-			txq->qidx, txq->wr_p, nb_pkts);
-
-	if ((nfp_net_nfd3_free_tx_desc(txq) < nb_pkts) || (nfp_net_nfd3_txq_full(txq)))
-		nfp_net_tx_free_bufs(txq);
-
-	free_descs = (uint16_t)nfp_net_nfd3_free_tx_desc(txq);
-	if (unlikely(free_descs == 0))
-		return 0;
-
-	pkt = *tx_pkts;
-	issued_descs = 0;
-
-	/* Sending packets */
-	for (i = 0; i < nb_pkts && free_descs > 0; i++) {
-		/* Grabbing the mbuf linked to the current descriptor */
-		lmbuf = &txq->txbufs[txq->wr_p].mbuf;
-		/* Warming the cache for releasing the mbuf later on */
-		RTE_MBUF_PREFETCH_TO_FREE(*lmbuf);
-
-		pkt = *(tx_pkts + i);
-
-		if (unlikely(pkt->nb_segs > 1 &&
-				!(hw->cap & NFP_NET_CFG_CTRL_GATHER))) {
-			PMD_INIT_LOG(ERR, "Multisegment packet not supported");
-			goto xmit_end;
-		}
-
-		/* Checking if we have enough descriptors */
-		if (unlikely(pkt->nb_segs > free_descs))
-			goto xmit_end;
-
-		/*
-		 * Checksum and VLAN flags just in the first descriptor for a
-		 * multisegment packet, but TSO info needs to be in all of them.
-		 */
-		txd.data_len = pkt->pkt_len;
-		nfp_net_nfd3_tx_tso(txq, &txd, pkt);
-		nfp_net_nfd3_tx_cksum(txq, &txd, pkt);
-
-		if ((pkt->ol_flags & RTE_MBUF_F_TX_VLAN) &&
-				(hw->cap & NFP_NET_CFG_CTRL_TXVLAN)) {
-			txd.flags |= NFD3_DESC_TX_VLAN;
-			txd.vlan = pkt->vlan_tci;
-		}
-
-		/*
-		 * mbuf data_len is the data in one segment and pkt_len data
-		 * in the whole packet. When the packet is just one segment,
-		 * then data_len = pkt_len
-		 */
-		pkt_size = pkt->pkt_len;
-
-		while (pkt != NULL && free_descs > 0) {
-			/* Copying TSO, VLAN and cksum info */
-			*txds = txd;
-
-			/* Releasing mbuf used by this descriptor previously*/
-			if (*lmbuf != NULL)
-				rte_pktmbuf_free_seg(*lmbuf);
-
-			/*
-			 * Linking mbuf with descriptor for being released
-			 * next time descriptor is used
-			 */
-			*lmbuf = pkt;
-
-			dma_size = pkt->data_len;
-			dma_addr = rte_mbuf_data_iova(pkt);
-
-			/* Filling descriptors fields */
-			txds->dma_len = dma_size;
-			txds->data_len = txd.data_len;
-			txds->dma_addr_hi = (dma_addr >> 32) & 0xff;
-			txds->dma_addr_lo = (dma_addr & 0xffffffff);
-			free_descs--;
-
-			txq->wr_p++;
-			if (unlikely(txq->wr_p == txq->tx_count)) /* wrapping?*/
-				txq->wr_p = 0;
-
-			pkt_size -= dma_size;
-
-			/*
-			 * Making the EOP, packets with just one segment
-			 * the priority
-			 */
-			if (likely(pkt_size == 0))
-				txds->offset_eop = NFD3_DESC_TX_EOP | FLOWER_PKT_DATA_OFFSET;
-			else
-				txds->offset_eop = 0;
-
-			pkt = pkt->next;
-			/* Referencing next free TX descriptor */
-			txds = &txq->txds[txq->wr_p];
-			lmbuf = &txq->txbufs[txq->wr_p].mbuf;
-			issued_descs++;
-		}
-	}
-
-xmit_end:
-	/* Increment write pointers. Force memory write before we let HW know */
-	rte_wmb();
-	nfp_qcp_ptr_add(txq->qcp_q, NFP_QCP_WRITE_PTR, issued_descs);
-
-	return i;
+	return nfp_net_nfd3_xmit_pkts_common(tx_queue, tx_pkts, nb_pkts, true);
 }
 
 static void
diff --git a/drivers/net/nfp/nfd3/nfp_nfd3.h b/drivers/net/nfp/nfd3/nfp_nfd3.h
index 5bf89868fc..910e622fa2 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3.h
+++ b/drivers/net/nfp/nfd3/nfp_nfd3.h
@@ -155,6 +155,10 @@ nfp_net_nfd3_tx_cksum(struct nfp_net_txq *txq,
 
 uint32_t nfp_flower_nfd3_pkt_add_metadata(struct rte_mbuf *mbuf,
 		uint32_t port_id);
+uint16_t nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
+		struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts,
+		bool repr_flag);
 uint16_t nfp_net_nfd3_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
index 2ad098a699..ee39686329 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
+++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
@@ -109,10 +109,20 @@ uint16_t
 nfp_net_nfd3_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts)
+{
+	return nfp_net_nfd3_xmit_pkts_common(tx_queue, tx_pkts, nb_pkts, false);
+}
+
+uint16_t
+nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
+		struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts,
+		bool repr_flag)
 {
 	int i;
 	int pkt_size;
 	int dma_size;
+	uint8_t offset;
 	uint64_t dma_addr;
 	uint16_t free_descs;
 	uint16_t issued_descs;
@@ -122,7 +132,6 @@ nfp_net_nfd3_xmit_pkts(void *tx_queue,
 	struct nfp_net_txq *txq;
 	struct nfp_net_nfd3_tx_desc txd;
 	struct nfp_net_nfd3_tx_desc *txds;
-	struct nfp_net_meta_raw meta_data;
 
 	txq = tx_queue;
 	hw = txq->hw;
@@ -146,7 +155,6 @@ nfp_net_nfd3_xmit_pkts(void *tx_queue,
 
 	/* Sending packets */
 	for (i = 0; i < nb_pkts && free_descs > 0; i++) {
-		memset(&meta_data, 0, sizeof(meta_data));
 		/* Grabbing the mbuf linked to the current descriptor */
 		lmbuf = &txq->txbufs[txq->wr_p].mbuf;
 		/* Warming the cache for releasing the mbuf later on */
@@ -154,7 +162,14 @@ nfp_net_nfd3_xmit_pkts(void *tx_queue,
 
 		pkt = *(tx_pkts + i);
 
-		nfp_net_nfd3_set_meta_data(&meta_data, txq, pkt);
+		if (!repr_flag) {
+			struct nfp_net_meta_raw meta_data;
+			memset(&meta_data, 0, sizeof(meta_data));
+			nfp_net_nfd3_set_meta_data(&meta_data, txq, pkt);
+			offset = meta_data.length;
+		} else {
+			offset = FLOWER_PKT_DATA_OFFSET;
+		}
 
 		if (unlikely(pkt->nb_segs > 1 &&
 				(hw->cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {
@@ -222,7 +237,7 @@ nfp_net_nfd3_xmit_pkts(void *tx_queue,
 				txds->offset_eop = 0;
 
 			/* Set the meta_len */
-			txds->offset_eop |= meta_data.length;
+			txds->offset_eop |= offset;
 
 			pkt = pkt->next;
 			/* Referencing next free TX descriptor */
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 09/10] net/nfp: add the xmit function of NFDk for PF representor
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (7 preceding siblings ...)
  2023-06-07  1:57 ` [PATCH 08/10] net/nfp: merge the xmit function of NFD3 Chaoyong He
@ 2023-06-07  1:57 ` 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
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

The only different logic between the NFDk xmit function of PF representor
and PF is if the logic about metadata exists. Refactor the NFDk xmit
function and use a parameter to distinguish them.

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 | 15 ++++++++++++++-
 drivers/net/nfp/nfdk/nfp_nfdk.h     |  4 ++++
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c  | 17 +++++++++++++++--
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 3bc863b9f1..5b452da6eb 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -493,14 +493,27 @@ nfp_flower_pf_nfd3_xmit_pkts(void *tx_queue,
 	return nfp_net_nfd3_xmit_pkts_common(tx_queue, tx_pkts, nb_pkts, true);
 }
 
+static uint16_t
+nfp_flower_pf_nfdk_xmit_pkts(void *tx_queue,
+		struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts)
+{
+	return nfp_net_nfdk_xmit_pkts_common(tx_queue, tx_pkts, nb_pkts, true);
+}
+
 static void
 nfp_flower_pf_xmit_pkts_register(struct nfp_app_fw_flower *app_fw_flower)
 {
+	struct nfp_net_hw *hw;
 	struct nfp_flower_nfd_func *nfd_func;
 
+	hw = app_fw_flower->pf_hw;
 	nfd_func = &app_fw_flower->nfd_func;
 
-	nfd_func->pf_xmit_t = nfp_flower_pf_nfd3_xmit_pkts;
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
+		nfd_func->pf_xmit_t = nfp_flower_pf_nfd3_xmit_pkts;
+	else
+		nfd_func->pf_xmit_t = nfp_flower_pf_nfdk_xmit_pkts;
 }
 
 uint16_t
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk.h b/drivers/net/nfp/nfdk/nfp_nfdk.h
index 898454102d..66f020efb0 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk.h
+++ b/drivers/net/nfp/nfdk/nfp_nfdk.h
@@ -229,6 +229,10 @@ nfp_net_nfdk_tx_tso(struct nfp_net_txq *txq,
 
 uint32_t nfp_flower_nfdk_pkt_add_metadata(struct rte_mbuf *mbuf,
 		uint32_t port_id);
+uint16_t nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
+		struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts,
+		bool repr_flag);
 uint16_t nfp_net_nfdk_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index dbb15581c4..f66802211f 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -165,12 +165,20 @@ uint16_t
 nfp_net_nfdk_xmit_pkts(void *tx_queue,
 		struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts)
+{
+	return nfp_net_nfdk_xmit_pkts_common(tx_queue, tx_pkts, nb_pkts, false);
+}
+
+uint16_t
+nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
+		struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts,
+		bool repr_flag)
 {
 	uint32_t buf_idx;
 	uint64_t dma_addr;
 	uint32_t free_descs;
 	uint32_t npkts = 0;
-	uint64_t metadata = 0;
 	struct rte_mbuf *pkt;
 	struct nfp_net_hw *hw;
 	struct rte_mbuf **lmbuf;
@@ -203,6 +211,7 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue,
 		uint32_t tmp_dlen;
 		uint32_t dlen_type;
 		uint32_t used_descs;
+		uint64_t metadata = 0;
 
 		pkt = *(tx_pkts + npkts);
 		nop_descs = nfp_net_nfdk_tx_maybe_close_block(txq, pkt);
@@ -219,7 +228,11 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue,
 		RTE_MBUF_PREFETCH_TO_FREE(*lmbuf);
 
 		temp_pkt = pkt;
-		nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
+
+		if (repr_flag)
+			metadata = NFDK_DESC_TX_CHAIN_META;
+		else
+			nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
 
 		if (unlikely(pkt->nb_segs > 1 &&
 				(hw->cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 10/10] net/nfp: merge the recv function
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (8 preceding siblings ...)
  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 ` Chaoyong He
  2023-06-07 14:23 ` [PATCH 00/10] support rte_flow for flower firmware with NFDk Ferruh Yigit
  10 siblings, 0 replies; 12+ messages in thread
From: Chaoyong He @ 2023-06-07  1:57 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Refactor the logic of parse metadata to include all the supported
metadata type in one function.

If a packet received carried metadata type 'PORT_ID', then it should
be dispatched to the corresponding ring of the representor port,
else it should be put into the array of the caller function.

This will simplify the logic and eliminate duplicate code.

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           | 225 ++----------------
 drivers/net/nfp/flower/nfp_flower.h           |   5 +-
 drivers/net/nfp/flower/nfp_flower_cmsg.h      |   2 -
 .../net/nfp/flower/nfp_flower_representor.c   |   2 +-
 drivers/net/nfp/nfp_ctrl.h                    |   3 +
 drivers/net/nfp/nfp_rxtx.c                    |  36 ++-
 drivers/net/nfp/nfp_rxtx.h                    |   2 +
 7 files changed, 49 insertions(+), 226 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 5b452da6eb..8e1bc22747 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -244,41 +244,6 @@ static const struct eth_dev_ops nfp_flower_pf_vnic_ops = {
 	.dev_close              = nfp_flower_pf_close,
 };
 
-static inline void
-nfp_flower_parse_metadata(struct nfp_net_rxq *rxq,
-		struct nfp_net_rx_desc *rxd,
-		struct rte_mbuf *mbuf,
-		uint32_t *portid)
-{
-	uint32_t meta_info;
-	uint8_t *meta_offset;
-	struct nfp_net_hw *hw;
-
-	hw = rxq->hw;
-	if (!((hw->ctrl & NFP_NET_CFG_CTRL_RSS) ||
-			(hw->ctrl & NFP_NET_CFG_CTRL_RSS2)))
-		return;
-
-	meta_offset = rte_pktmbuf_mtod(mbuf, uint8_t *);
-	meta_offset -= NFP_DESC_META_LEN(rxd);
-	meta_info = rte_be_to_cpu_32(*(uint32_t *)meta_offset);
-	meta_offset += 4;
-
-	while (meta_info != 0) {
-		switch (meta_info & NFP_NET_META_FIELD_MASK) {
-		/* Expect flower firmware to only send packets with META_PORTID */
-		case NFP_NET_META_PORTID:
-			*portid = rte_be_to_cpu_32(*(uint32_t *)meta_offset);
-			meta_offset += 4;
-			meta_info >>= NFP_NET_META_FIELD_SIZE;
-			break;
-		default:
-			/* Unsupported metadata can be a performance issue */
-			return;
-		}
-	}
-}
-
 static inline struct nfp_flower_representor *
 nfp_flower_get_repr(struct nfp_net_hw *hw,
 		uint32_t port_id)
@@ -303,186 +268,26 @@ nfp_flower_get_repr(struct nfp_net_hw *hw,
 	return NULL;
 }
 
-uint16_t
-nfp_flower_pf_recv_pkts(void *rx_queue,
-		struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts)
+bool
+nfp_flower_pf_dispatch_pkts(struct nfp_net_hw *hw,
+		struct rte_mbuf *mbuf,
+		uint32_t port_id)
 {
-	/*
-	 * We need different counters for packets given to the caller
-	 * and packets sent to representors
-	 */
-	uint16_t avail = 0;
-	uint16_t avail_multiplexed = 0;
-	uint64_t dma_addr;
-	uint32_t meta_portid;
-	uint16_t nb_hold = 0;
-	struct rte_mbuf *mb;
-	struct nfp_net_hw *hw;
-	struct rte_mbuf *new_mb;
-	struct nfp_net_rxq *rxq;
-	struct nfp_net_dp_buf *rxb;
-	struct nfp_net_rx_desc *rxds;
 	struct nfp_flower_representor *repr;
 
-	rxq = rx_queue;
-	if (unlikely(rxq == NULL)) {
-		/*
-		 * DPDK just checks the queue is lower than max queues
-		 * enabled. But the queue needs to be configured
-		 */
-		PMD_RX_LOG(ERR, "RX Bad queue");
-		return 0;
+	repr = nfp_flower_get_repr(hw, port_id);
+	if (repr == NULL) {
+		PMD_RX_LOG(ERR, "Can not get repr for port %u", hw->idx);
+		return false;
 	}
 
-	hw = rxq->hw;
-
-	/*
-	 * This is tunable as we could allow to receive more packets than
-	 * requested if most are multiplexed.
-	 */
-	while (avail + avail_multiplexed < nb_pkts) {
-		rxb = &rxq->rxbufs[rxq->rd_p];
-		if (unlikely(rxb == NULL)) {
-			PMD_RX_LOG(ERR, "rxb does not exist!");
-			break;
-		}
-
-		rxds = &rxq->rxds[rxq->rd_p];
-		if ((rxds->rxd.meta_len_dd & PCIE_DESC_RX_DD) == 0)
-			break;
-
-		/*
-		 * Memory barrier to ensure that we won't do other
-		 * reads before the DD bit.
-		 */
-		rte_rmb();
-
-		/*
-		 * We got a packet. Let's alloc a new mbuf for refilling the
-		 * free descriptor ring as soon as possible
-		 */
-		new_mb = rte_pktmbuf_alloc(rxq->mem_pool);
-		if (unlikely(new_mb == NULL)) {
-			PMD_RX_LOG(DEBUG,
-			"RX mbuf alloc failed port_id=%hu queue_id=%hu",
-				rxq->port_id, rxq->qidx);
-			nfp_net_mbuf_alloc_failed(rxq);
-			break;
-		}
-
-		/*
-		 * Grab the mbuf and refill the descriptor with the
-		 * previously allocated mbuf
-		 */
-		mb = rxb->mbuf;
-		rxb->mbuf = new_mb;
-
-		PMD_RX_LOG(DEBUG, "Packet len: %u, mbuf_size: %u",
-				rxds->rxd.data_len, rxq->mbuf_size);
-
-		/* Size of this segment */
-		mb->data_len = rxds->rxd.data_len - NFP_DESC_META_LEN(rxds);
-		/* Size of the whole packet. We just support 1 segment */
-		mb->pkt_len = rxds->rxd.data_len - NFP_DESC_META_LEN(rxds);
-
-		if (unlikely((mb->data_len + hw->rx_offset) > rxq->mbuf_size)) {
-			/*
-			 * This should not happen and the user has the
-			 * responsibility of avoiding it. But we have
-			 * to give some info about the error
-			 */
-			PMD_RX_LOG(ERR,
-				"mbuf overflow likely due to the RX offset.\n"
-				"\t\tYour mbuf size should have extra space for"
-				" RX offset=%u bytes.\n"
-				"\t\tCurrently you just have %u bytes available"
-				" but the received packet is %u bytes long",
-				hw->rx_offset,
-				rxq->mbuf_size - hw->rx_offset,
-				mb->data_len);
-			rte_pktmbuf_free(mb);
-			break;
-		}
-
-		/* Filling the received mbuf with packet info */
-		if (hw->rx_offset != 0)
-			mb->data_off = RTE_PKTMBUF_HEADROOM + hw->rx_offset;
-		else
-			mb->data_off = RTE_PKTMBUF_HEADROOM + NFP_DESC_META_LEN(rxds);
-
-		/* No scatter mode supported */
-		mb->nb_segs = 1;
-		mb->next = NULL;
-
-		mb->port = rxq->port_id;
-		meta_portid = 0;
-
-		/* Checking the RSS flag */
-		nfp_flower_parse_metadata(rxq, rxds, mb, &meta_portid);
-		PMD_RX_LOG(DEBUG, "Received from port %u type %u",
-				NFP_FLOWER_CMSG_PORT_VNIC(meta_portid),
-				NFP_FLOWER_CMSG_PORT_VNIC_TYPE(meta_portid));
-
-		/* Checking the checksum flag */
-		nfp_net_rx_cksum(rxq, rxds, mb);
-
-		if ((rxds->rxd.flags & PCIE_DESC_RX_VLAN) &&
-				(hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) {
-			mb->vlan_tci = rte_cpu_to_le_32(rxds->rxd.offload_info);
-			mb->ol_flags |= RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED;
-		}
-
-		repr = nfp_flower_get_repr(hw, meta_portid);
-		if (repr != NULL && repr->ring != NULL) {
-			PMD_RX_LOG(DEBUG, "Using representor %s", repr->name);
-			rte_ring_enqueue(repr->ring, (void *)mb);
-			avail_multiplexed++;
-		} else if (repr != NULL) {
-			PMD_RX_LOG(ERR, "No ring available for repr_port %s", repr->name);
-			rx_pkts[avail++] = mb;
-		} else {
-			PMD_RX_LOG(DEBUG, "Adding the mbuf to the mbuf array passed by the app");
-			rx_pkts[avail++] = mb;
-		}
-
-		/* Now resetting and updating the descriptor */
-		rxds->vals[0] = 0;
-		rxds->vals[1] = 0;
-		dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb));
-		rxds->fld.dd = 0;
-		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
-		rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
-		nb_hold++;
-
-		rxq->rd_p++;
-		if (unlikely(rxq->rd_p == rxq->rx_count))
-			rxq->rd_p = 0;
-	}
-
-	if (nb_hold == 0)
-		return nb_hold;
-
-	PMD_RX_LOG(DEBUG, "RX port_id=%hu queue_id=%hu, %hu packets received",
-			rxq->port_id, rxq->qidx, nb_hold);
-
-	nb_hold += rxq->nb_rx_hold;
-
-	/*
-	 * FL descriptors needs to be written before incrementing the
-	 * FL queue WR pointer
-	 */
-	rte_wmb();
-	if (nb_hold > rxq->rx_free_thresh) {
-		PMD_RX_LOG(DEBUG, "port=%hu queue=%hu nb_hold=%hu avail=%hu",
-				rxq->port_id, rxq->qidx, nb_hold, avail);
-		nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold);
-		nb_hold = 0;
+	if (repr->ring == NULL) {
+		PMD_RX_LOG(ERR, "No ring available for repr_port %s", repr->name);
+		return false;
 	}
 
-	rxq->nb_rx_hold = nb_hold;
-
-	return avail;
+	rte_ring_enqueue(repr->ring, (void *)mbuf);
+	return true;
 }
 
 static uint16_t
@@ -569,6 +374,8 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
 		return -EINVAL;
 
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
+	nfp_net_init_metadata_format(hw);
+
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	/* Set the current MTU to the maximum supported */
 	hw->mtu = hw->max_mtu;
@@ -1164,7 +971,7 @@ nfp_secondary_init_app_fw_flower(struct nfp_cpp *cpp)
 
 	eth_dev->process_private = cpp;
 	eth_dev->dev_ops = &nfp_flower_pf_vnic_ops;
-	eth_dev->rx_pkt_burst = nfp_flower_pf_recv_pkts;
+	eth_dev->rx_pkt_burst = nfp_net_recv_pkts;
 	eth_dev->tx_pkt_burst = nfp_flower_pf_xmit_pkts;
 	rte_eth_dev_probing_finish(eth_dev);
 
diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h
index b85e5db3bf..34092cd4b4 100644
--- a/drivers/net/nfp/flower/nfp_flower.h
+++ b/drivers/net/nfp/flower/nfp_flower.h
@@ -105,8 +105,9 @@ nfp_flower_support_decap_v2(const struct nfp_app_fw_flower *app_fw_flower)
 
 int nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev);
 int nfp_secondary_init_app_fw_flower(struct nfp_cpp *cpp);
-uint16_t nfp_flower_pf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+bool nfp_flower_pf_dispatch_pkts(struct nfp_net_hw *hw,
+		struct rte_mbuf *mbuf,
+		uint32_t port_id);
 uint16_t nfp_flower_pf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
 int nfp_flower_pf_start(struct rte_eth_dev *dev);
diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h
index 96e080a8e9..47abf49d8a 100644
--- a/drivers/net/nfp/flower/nfp_flower_cmsg.h
+++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h
@@ -365,8 +365,6 @@ enum nfp_flower_cmsg_port_vnic_type {
 
 #define NFP_FLOWER_CMSG_HLEN            sizeof(struct nfp_flower_cmsg_hdr)
 #define NFP_FLOWER_CMSG_VER1            1
-#define NFP_NET_META_PORTID             5
-#define NFP_META_PORT_ID_CTRL           ~0U
 
 #define NFP_FLOWER_CMSG_PORT_TYPE(x)            (((x) >> 28) & 0xf)  /* [31,28] */
 #define NFP_FLOWER_CMSG_PORT_SYS_ID(x)          (((x) >> 24) & 0xf)  /* [24,27] */
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index eb318f66df..6b4ba5b9a2 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -596,7 +596,7 @@ nfp_flower_pf_repr_init(struct rte_eth_dev *eth_dev,
 	snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name);
 
 	eth_dev->dev_ops = &nfp_flower_pf_repr_dev_ops;
-	eth_dev->rx_pkt_burst = nfp_flower_pf_recv_pkts;
+	eth_dev->rx_pkt_burst = nfp_net_recv_pkts;
 	eth_dev->tx_pkt_burst = nfp_flower_pf_xmit_pkts;
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 
diff --git a/drivers/net/nfp/nfp_ctrl.h b/drivers/net/nfp/nfp_ctrl.h
index 47e77ea51d..7007548447 100644
--- a/drivers/net/nfp/nfp_ctrl.h
+++ b/drivers/net/nfp/nfp_ctrl.h
@@ -34,6 +34,9 @@
 /* Prepend field types */
 #define NFP_NET_META_HASH               1 /* next field carries hash type */
 #define NFP_NET_META_VLAN               4
+#define NFP_NET_META_PORTID             5
+
+#define NFP_META_PORT_ID_CTRL           ~0U
 
 /* Hash type pre-pended when a RSS hash was computed */
 #define NFP_NET_RSS_NONE                0
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index ce9a07309e..9867db4388 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -16,6 +16,7 @@
 #include "nfdk/nfp_nfdk.h"
 #include "nfpcore/nfp_mip.h"
 #include "nfpcore/nfp_rtsym.h"
+#include "flower/nfp_flower.h"
 
 static int
 nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq)
@@ -124,6 +125,9 @@ nfp_net_parse_chained_meta(uint8_t *meta_base,
 
 	for (; meta_info != 0; meta_info >>= NFP_NET_META_FIELD_SIZE, meta_offset += 4) {
 		switch (meta_info & NFP_NET_META_FIELD_MASK) {
+		case NFP_NET_META_PORTID:
+			meta->port_id = rte_be_to_cpu_32(*(rte_be32_t *)meta_offset);
+			break;
 		case NFP_NET_META_HASH:
 			/* Next field type is about the hash type */
 			meta_info >>= NFP_NET_META_FIELD_SIZE;
@@ -270,11 +274,11 @@ static void
 nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
 		struct nfp_net_rxq *rxq,
 		struct nfp_net_hw *hw,
-		struct rte_mbuf *mb)
+		struct rte_mbuf *mb,
+		struct nfp_meta_parsed *meta)
 {
 	uint8_t *meta_base;
 	rte_be32_t meta_header;
-	struct nfp_meta_parsed meta = {};
 
 	if (unlikely(NFP_DESC_META_LEN(rxds) == 0))
 		return;
@@ -285,18 +289,18 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
 
 	switch (hw->meta_format) {
 	case NFP_NET_METAFORMAT_CHAINED:
-		if (nfp_net_parse_chained_meta(meta_base, meta_header, &meta)) {
-			nfp_net_parse_meta_hash(&meta, rxq, mb);
-			nfp_net_parse_meta_vlan(&meta, rxds, rxq, mb);
-			nfp_net_parse_meta_qinq(&meta, rxq, mb);
+		if (nfp_net_parse_chained_meta(meta_base, meta_header, meta)) {
+			nfp_net_parse_meta_hash(meta, rxq, mb);
+			nfp_net_parse_meta_vlan(meta, rxds, rxq, mb);
+			nfp_net_parse_meta_qinq(meta, rxq, mb);
 		} else {
 			PMD_RX_LOG(DEBUG, "RX chained metadata format is wrong!");
 		}
 		break;
 	case NFP_NET_METAFORMAT_SINGLE:
 		if ((rxds->rxd.flags & PCIE_DESC_RX_RSS) != 0) {
-			nfp_net_parse_single_meta(meta_base, meta_header, &meta);
-			nfp_net_parse_meta_hash(&meta, rxq, mb);
+			nfp_net_parse_single_meta(meta_base, meta_header, meta);
+			nfp_net_parse_meta_hash(meta, rxq, mb);
 		}
 		break;
 	default:
@@ -493,6 +497,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 	uint16_t nb_hold;
 	uint64_t dma_addr;
 	uint16_t avail;
+	uint16_t avail_multiplexed = 0;
 
 	rxq = rx_queue;
 	if (unlikely(rxq == NULL)) {
@@ -508,7 +513,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 	avail = 0;
 	nb_hold = 0;
-	while (avail < nb_pkts) {
+	while (avail + avail_multiplexed < nb_pkts) {
 		rxb = &rxq->rxbufs[rxq->rd_p];
 		if (unlikely(rxb == NULL)) {
 			PMD_RX_LOG(ERR, "rxb does not exist!");
@@ -585,15 +590,22 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		mb->next = NULL;
 		mb->port = rxq->port_id;
 
-		nfp_net_parse_meta(rxds, rxq, hw, mb);
+		struct nfp_meta_parsed meta = {};
+		nfp_net_parse_meta(rxds, rxq, hw, mb, &meta);
 
 		nfp_net_parse_ptype(rxds, hw, mb);
 
 		/* Checking the checksum flag */
 		nfp_net_rx_cksum(rxq, rxds, mb);
 
-		/* Adding the mbuf to the mbuf array passed by the app */
-		rx_pkts[avail++] = mb;
+		if (meta.port_id == 0) {
+			rx_pkts[avail++] = mb;
+		} else if (nfp_flower_pf_dispatch_pkts(hw, mb, meta.port_id)) {
+			avail_multiplexed++;
+		} else {
+			rte_pktmbuf_free(mb);
+			break;
+		}
 
 		/* Now resetting and updating the descriptor */
 		rxds->vals[0] = 0;
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index cf713b0cd5..48e548b02d 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -44,6 +44,7 @@ struct nfp_net_meta_raw {
  * Parsed NFP packet metadata are recorded in this struct. The content is
  * read-only after it have been recorded during parsing by nfp_net_parse_meta().
  *
+ * @port_id: Port id value
  * @hash: RSS hash value
  * @hash_type: RSS hash type
  * @vlan_layer: The layers of VLAN info which are passed from nic.
@@ -62,6 +63,7 @@ struct nfp_net_meta_raw {
  * @vlan.tci: Vlan TCI including PCP + Priority + VID
  */
 struct nfp_meta_parsed {
+	uint32_t port_id;
 	uint32_t hash;
 	uint8_t hash_type;
 	uint8_t vlan_layer;
-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 00/10] support rte_flow for flower firmware with NFDk
  2023-06-07  1:56 [PATCH 00/10] support rte_flow for flower firmware with NFDk Chaoyong He
                   ` (9 preceding siblings ...)
  2023-06-07  1:57 ` [PATCH 10/10] net/nfp: merge the recv function Chaoyong He
@ 2023-06-07 14:23 ` Ferruh Yigit
  10 siblings, 0 replies; 12+ messages in thread
From: Ferruh Yigit @ 2023-06-07 14:23 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund

On 6/7/2023 2:56 AM, Chaoyong He wrote:
> This patch series add the support of rte_flow for card which using
> flower firmware with NFDk:
> 1. Fix the underlying API logic to support this feature.
> 2. Import a unified check and dispatch layer for different versions of NFD.
> 3. Refactor the meta data logic to adapt this dispatch layer.
> 4. Refactor the packet receive logic to adapt this dispatch layer.
> 5. Refactor the packet transmit logic to adapt this dispatch layer.
> 6. Merge the logics of representor port to decrease the redundancy logic.
> 
> Chaoyong He (10):
>   net/nfp: fix the problem of rtsym
>   net/nfp: add a check function for the NFD version
>   net/nfp: refactor the insert metadata logic of NFD3
>   net/nfp: add the insert metadata logic of NFDk
>   net/nfp: add a dispatch layer for Tx function of ctrl VNIC
>   net/nfp: add the xmit function of NFDk for ctrl VNIC
>   net/nfp: add a dispatch layer for Tx function of representor
>   net/nfp: merge the xmit function of NFD3
>   net/nfp: add the xmit function of NFDk for PF representor
>   net/nfp: merge the recv function
>

Series applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-06-07 14:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 07/10] net/nfp: add a dispatch layer for Tx function of representor Chaoyong He
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

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).