Skip to contentSkip to conversation

patchset for bnxt PMD

PATCH Superseded Ajit Khaparde 2 participants 20 messages Oct 7, 2021 – Oct 12, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

cover patchset for bnxt PMD

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start
net/bnxt: enhance support for RSS action

 drivers/net/bnxt/bnxt_ethdev.c |  16 +--
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 190 ++++++++++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
 drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
 drivers/net/bnxt/bnxt_rxq.c    |  71 +++++++-----
 drivers/net/bnxt/bnxt_rxq.h    |   2 +
 drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
 8 files changed, 416 insertions(+), 132 deletions(-)
Signature · 1 line
2.30.1 (Apple Git-130)
#1 lore raw

PATCH 1/3 net/bnxt: create aggregration rings when needed

Aggregration rings are needed when PMD needs to support jumbo frames, LRO. Currently we are creating the aggregration rings whether jumbo frames or LRO has been enabled or disabled. This causes unnecessary allocation of mbufs needing larger mbuf pool which is not used at all.

This patch modifies the code to create aggregration rings only when needed.

---
 drivers/net/bnxt/bnxt_hwrm.c |   9 +++
 drivers/net/bnxt/bnxt_ring.c | 148 ++++++++++++++++++++++-------------
 drivers/net/bnxt/bnxt_rxq.c  |  71 +++++++++++------
 drivers/net/bnxt/bnxt_rxq.h  |   2 +
 drivers/net/bnxt/bnxt_rxr.c  | 111 +++++++++++++++-----------
 5 files changed, 216 insertions(+), 125 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +9 -0
index 503add42fd..181e607d7b 100644
@@ -2741,6 +2741,14 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 	if (BNXT_HAS_RING_GRPS(bp))
 		bp->grp_info[queue_index].rx_fw_ring_id = INVALID_HW_RING_ID;
 
+	/* Check agg ring struct explicitly.
+	 * bnxt_need_agg_ring() returns the current state of offload flags,
+	 * but we may have to deal with agg ring struct before the offload
+	 * flags are updated.
+	 */
+	if (!bnxt_need_agg_ring(bp->eth_dev) || rxr->ag_ring_struct == NULL)
+		goto no_agg;
+
 	ring = rxr->ag_ring_struct;
 	bnxt_hwrm_ring_free(bp, ring,
 			    BNXT_CHIP_P5(bp) ?
@@ -2750,6 +2758,7 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 	if (BNXT_HAS_RING_GRPS(bp))
 		bp->grp_info[queue_index].ag_fw_ring_id = INVALID_HW_RING_ID;
 
+no_agg:
 	bnxt_hwrm_stat_ctx_free(bp, cpr);
 
 	bnxt_free_cp_ring(bp, cpr);
drivers/net/bnxt/bnxt_ring.c +92 -56

223 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxq.c +47 -24

97 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxq.h +2 -0
index 42bd8e7ab7..2bd0c64345 100644
@@ -63,4 +63,6 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev,
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev,
 		       uint16_t rx_queue_id);
 void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq);
+int bnxt_need_agg_ring(struct rte_eth_dev *eth_dev);
+void bnxt_free_rxq_mem(struct bnxt_rx_queue *rxq);
 #endif
drivers/net/bnxt/bnxt_rxr.c +66 -45

129 lines not on this page · raw message

Signature · 1 line
2.30.1 (Apple Git-130)
#2 lore raw

PATCH 2/3 net/bnxt: fix Rx queue state on start

In reply to Ajit Khaparde

Fix Rx queue state on device start.
The state of Rx queues could be incorrect in some cases because instead of updating the state for all the Rx queues, we are updating it for queues in a VNIC.

Fixes 0105ea1296c9 ("net/bnxt: support runtime queue setup")
---
 drivers/net/bnxt/bnxt_ethdev.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +10 -6
index aa7e7fdc85..a98f93ab29 100644
@@ -482,12 +482,6 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id)
 			rxq->vnic->fw_grp_ids[j] = INVALID_HW_RING_ID;
 		else
 			vnic->rx_queue_cnt++;
-
-		if (!rxq->rx_deferred_start) {
-			bp->eth_dev->data->rx_queue_state[j] =
-				RTE_ETH_QUEUE_STATE_STARTED;
-			rxq->rx_started = true;
-		}
 	}
 
 	PMD_DRV_LOG(DEBUG, "vnic->rx_queue_cnt = %d\n", vnic->rx_queue_cnt);
@@ -824,6 +818,16 @@ static int bnxt_start_nic(struct bnxt *bp)
 		}
 	}
 
+	for (j = 0; j < bp->rx_nr_rings; j++) {
+		struct bnxt_rx_queue *rxq = bp->rx_queues[j];
+
+		if (!rxq->rx_deferred_start) {
+			bp->eth_dev->data->rx_queue_state[j] =
+				RTE_ETH_QUEUE_STATE_STARTED;
+			rxq->rx_started = true;
+		}
+	}
+
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, &bp->vnic_info[0], 0, NULL);
 	if (rc) {
 		PMD_DRV_LOG(ERR,
Signature · 1 line
2.30.1 (Apple Git-130)
#3 lore raw

PATCH 3/3 net/bnxt: enhance support for RSS action

In reply to Ajit Khaparde

Enhance support for RSS action in the non-TruFlow path. This will allow the user or application to update the RSS settings using RTE_FLOW API.

---
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 190 ++++++++++++++++++++++++++++++++-
 2 files changed, 190 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_filter.h +1 -0
index 8bae0c4c72..07938534a9 100644
@@ -43,6 +43,7 @@ struct bnxt_filter_info {
 #define HWRM_CFA_EM_FILTER	1
 #define HWRM_CFA_NTUPLE_FILTER	2
 #define HWRM_CFA_TUNNEL_REDIRECT_FILTER	3
+#define HWRM_CFA_CONFIG_VNIC	4
 	uint8_t                 filter_type;
 	uint32_t                dst_id;
 
drivers/net/bnxt/bnxt_flow.c +189 -1

212 lines not on this page · raw message

Signature · 1 line
2.30.1 (Apple Git-130)
#4 lore raw
In reply to Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Quoted 20 lines

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start
net/bnxt: enhance support for RSS action

 drivers/net/bnxt/bnxt_ethdev.c |  16 +--
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 190 ++++++++++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
 drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
 drivers/net/bnxt/bnxt_rxq.c    |  71 +++++++-----
 drivers/net/bnxt/bnxt_rxq.h    |   2 +
 drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
 8 files changed, 416 insertions(+), 132 deletions(-)

--
2.30.1 (Apple Git-130)

#5 lore raw
Quoted 13 lines · Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Hi Ajit,

dpdk-next-net-brcm conflicts with next-net because of some patches updating bnxt in next-net.
Can you please rebase 'dpdk-next-net-brcm' on top of latest next-net?

Thanks,
ferruh

Quoted 21 lines
Quoted 21 lines

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start net/bnxt: enhance support for RSS action

  drivers/net/bnxt/bnxt_ethdev.c |  16 +--
  drivers/net/bnxt/bnxt_filter.h |   1 +
  drivers/net/bnxt/bnxt_flow.c   | 190 ++++++++++++++++++++++++++++++++-
  drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
  drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
  drivers/net/bnxt/bnxt_rxq.c    |  71 +++++++-----
  drivers/net/bnxt/bnxt_rxq.h    |   2 +
  drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
  8 files changed, 416 insertions(+), 132 deletions(-)

--
2.30.1 (Apple Git-130)

#6 lore raw
Quoted 16 lines · Ferruh Yigit
Quoted 13 lines · Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Quoted 5 lines

Hi Ajit,

dpdk-next-net-brcm conflicts with next-net because of some patches updating bnxt in next-net.
Can you please rebase 'dpdk-next-net-brcm' on top of latest next-net?

Sure. I will send an email once it's ready.

Thanks
Ajit

Quoted 26 lines

Thanks,
ferruh

Quoted 21 lines
Quoted 21 lines

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start net/bnxt: enhance support for RSS action

  drivers/net/bnxt/bnxt_ethdev.c |  16 +--
  drivers/net/bnxt/bnxt_filter.h |   1 +
  drivers/net/bnxt/bnxt_flow.c   | 190 ++++++++++++++++++++++++++++++++-
  drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
  drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
  drivers/net/bnxt/bnxt_rxq.c    |  71 +++++++-----
  drivers/net/bnxt/bnxt_rxq.h    |   2 +
  drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
  8 files changed, 416 insertions(+), 132 deletions(-)

--
2.30.1 (Apple Git-130)

#7 lore raw
Quoted 18 lines · Ajit Khaparde
Quoted 16 lines · Ferruh Yigit
Quoted 13 lines · Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Quoted 6 lines
Quoted 5 lines

Hi Ajit,

dpdk-next-net-brcm conflicts with next-net because of some patches updating bnxt in next-net.
Can you please rebase 'dpdk-next-net-brcm' on top of latest next-net?

Sure. I will send an email once it's ready.

Done. I have rebased the repo to the latest next-net/main and merged the patches. Please try now.

Thanks
Ajit

Quoted 30 lines

Thanks
Ajit

Quoted 26 lines

Thanks,
ferruh

Quoted 21 lines
Quoted 21 lines

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start net/bnxt: enhance support for RSS action

  drivers/net/bnxt/bnxt_ethdev.c |  16 +--
  drivers/net/bnxt/bnxt_filter.h |   1 +
  drivers/net/bnxt/bnxt_flow.c   | 190 ++++++++++++++++++++++++++++++++-
  drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
  drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
  drivers/net/bnxt/bnxt_rxq.c    |  71 +++++++-----
  drivers/net/bnxt/bnxt_rxq.h    |   2 +
  drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
  8 files changed, 416 insertions(+), 132 deletions(-)

--
2.30.1 (Apple Git-130)

#8 lore raw
Quoted 20 lines · Ajit Khaparde
Quoted 18 lines · Ajit Khaparde
Quoted 16 lines · Ferruh Yigit
Quoted 13 lines · Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

Hi Ajit,

dpdk-next-net-brcm conflicts with next-net because of some patches updating bnxt in next-net.
Can you please rebase 'dpdk-next-net-brcm' on top of latest next-net?

Sure. I will send an email once it's ready.

Done. I have rebased the repo to the latest next-net/main and merged the patches. Please try now.

Hi Ajit,

I am getting lots of checkpatch warnings on the patches in your tree, but I don't see them in the patchwork. Warnings can be because of the updates during rebase.

If there is code change during rebase, to not have a diverge between the patch in the patchwork and what we are merging, can you please send and updated version of the effected patches first?
This lets us see the CI results and later they can be merge in your tree again.

#9 lore raw
Quoted 34 lines · Ferruh Yigit
Quoted 20 lines · Ajit Khaparde
Quoted 18 lines · Ajit Khaparde
Quoted 16 lines · Ferruh Yigit
Quoted 13 lines · Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

Hi Ajit,

dpdk-next-net-brcm conflicts with next-net because of some patches updating bnxt in next-net.
Can you please rebase 'dpdk-next-net-brcm' on top of latest next-net?

Sure. I will send an email once it's ready.

Done. I have rebased the repo to the latest next-net/main and merged the patches. Please try now.

Hi Ajit,

Quoted 7 lines

I am getting lots of checkpatch warnings on the patches in your tree, but I don't see them in the patchwork. Warnings can be because of the updates during rebase.

If there is code change during rebase, to not have a diverge between the patch in the patchwork and what we are merging, can you please send and updated version of the effected patches first?

There is no code change made during the rebase.
My checkpatch run did not point out anything.
But let me try again. Thanks Ferruh.

Thanks
Ajit

Quoted 3 lines

This lets us see the CI results and later they can be merge in your tree again.

#10 lore raw
Quoted 40 lines · Ajit Khaparde
Quoted 38 lines · Ferruh Yigit
Quoted 20 lines · Ajit Khaparde
Quoted 18 lines · Ajit Khaparde
Quoted 16 lines · Ferruh Yigit
Quoted 13 lines · Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!

Patchset applied to dpdk-next-net-brcm.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

Hi Ajit,

dpdk-next-net-brcm conflicts with next-net because of some patches updating bnxt in next-net.
Can you please rebase 'dpdk-next-net-brcm' on top of latest next-net?

Sure. I will send an email once it's ready.

Done. I have rebased the repo to the latest next-net/main and merged the patches. Please try now.

Hi Ajit,

I am getting lots of checkpatch warnings on the patches in your tree, but I don't see them in the patchwork. Warnings can be because of the updates during rebase.

Quoted 6 lines
Quoted 3 lines

If there is code change during rebase, to not have a diverge between the patch in the patchwork and what we are merging, can you please send and updated version of the effected patches first?

There is no code change made during the rebase.
My checkpatch run did not point out anything.
But let me try again. Thanks Ferruh.

Ok, got it.
I had done the merge on a new system which did not have the checkpatch setup correctly.
I have fixed the issues and updated the tree. Apologies for the trouble.

Thanks
Ajit

Quoted 9 lines

Thanks
Ajit

Quoted 3 lines

This lets us see the CI results and later they can be merge in your tree again.

#11 lore raw

v3 cover patchset for bnxt PMD

In reply to Ferruh Yigit

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!
--
v1->v2: use correct patch for 3/3.
v2->v3: rebase against latest dpdk-next-net tree.

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start
net/bnxt: enhance support for RSS action

 drivers/net/bnxt/bnxt_ethdev.c |  16 ++-
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 196 ++++++++++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
 drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
 drivers/net/bnxt/bnxt_rxq.c    |  84 ++++++++------
 drivers/net/bnxt/bnxt_rxq.h    |   2 +
 drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
 8 files changed, 428 insertions(+), 139 deletions(-)
Signature · 1 line
2.30.1 (Apple Git-130)
#12 lore raw

PATCH v3 1/3 net/bnxt: create aggregration rings when needed

Aggregration rings are needed when PMD needs to support jumbo frames, LRO. Currently we are creating the aggregration rings whether jumbo frames or LRO has been enabled or disabled. This causes unnecessary allocation of mbufs needing larger mbuf pool which is not used at all.

This patch modifies the code to create aggregration rings only when needed.

---
 drivers/net/bnxt/bnxt_hwrm.c |   9 +++
 drivers/net/bnxt/bnxt_ring.c | 148 ++++++++++++++++++++++-------------
 drivers/net/bnxt/bnxt_rxq.c  |  84 ++++++++++++--------
 drivers/net/bnxt/bnxt_rxq.h  |   2 +
 drivers/net/bnxt/bnxt_rxr.c  | 111 +++++++++++++++-----------
 5 files changed, 222 insertions(+), 132 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +9 -0
index 503add42fd..181e607d7b 100644
@@ -2741,6 +2741,14 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 	if (BNXT_HAS_RING_GRPS(bp))
 		bp->grp_info[queue_index].rx_fw_ring_id = INVALID_HW_RING_ID;
 
+	/* Check agg ring struct explicitly.
+	 * bnxt_need_agg_ring() returns the current state of offload flags,
+	 * but we may have to deal with agg ring struct before the offload
+	 * flags are updated.
+	 */
+	if (!bnxt_need_agg_ring(bp->eth_dev) || rxr->ag_ring_struct == NULL)
+		goto no_agg;
+
 	ring = rxr->ag_ring_struct;
 	bnxt_hwrm_ring_free(bp, ring,
 			    BNXT_CHIP_P5(bp) ?
@@ -2750,6 +2758,7 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 	if (BNXT_HAS_RING_GRPS(bp))
 		bp->grp_info[queue_index].ag_fw_ring_id = INVALID_HW_RING_ID;
 
+no_agg:
 	bnxt_hwrm_stat_ctx_free(bp, cpr);
 
 	bnxt_free_cp_ring(bp, cpr);
drivers/net/bnxt/bnxt_ring.c +92 -56

223 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxq.c +53 -31

106 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxq.h +2 -0
index 9bb9352feb..0331c23810 100644
@@ -63,4 +63,6 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev,
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev,
 		       uint16_t rx_queue_id);
 void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq);
+int bnxt_need_agg_ring(struct rte_eth_dev *eth_dev);
+void bnxt_free_rxq_mem(struct bnxt_rx_queue *rxq);
 #endif
drivers/net/bnxt/bnxt_rxr.c +66 -45

129 lines not on this page · raw message

Signature · 1 line
2.30.1 (Apple Git-130)
#13 lore raw

PATCH v3 2/3 net/bnxt: fix Rx queue state on start

In reply to Ajit Khaparde

Fix Rx queue state on device start.
The state of Rx queues could be incorrect in some cases because instead of updating the state for all the Rx queues, we are updating it for queues in a VNIC.

Fixes 0105ea1296c9 ("net/bnxt: support runtime queue setup")
---
 drivers/net/bnxt/bnxt_ethdev.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +10 -6
index aa7e7fdc85..a98f93ab29 100644
@@ -482,12 +482,6 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id)
 			rxq->vnic->fw_grp_ids[j] = INVALID_HW_RING_ID;
 		else
 			vnic->rx_queue_cnt++;
-
-		if (!rxq->rx_deferred_start) {
-			bp->eth_dev->data->rx_queue_state[j] =
-				RTE_ETH_QUEUE_STATE_STARTED;
-			rxq->rx_started = true;
-		}
 	}
 
 	PMD_DRV_LOG(DEBUG, "vnic->rx_queue_cnt = %d\n", vnic->rx_queue_cnt);
@@ -824,6 +818,16 @@ static int bnxt_start_nic(struct bnxt *bp)
 		}
 	}
 
+	for (j = 0; j < bp->rx_nr_rings; j++) {
+		struct bnxt_rx_queue *rxq = bp->rx_queues[j];
+
+		if (!rxq->rx_deferred_start) {
+			bp->eth_dev->data->rx_queue_state[j] =
+				RTE_ETH_QUEUE_STATE_STARTED;
+			rxq->rx_started = true;
+		}
+	}
+
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, &bp->vnic_info[0], 0, NULL);
 	if (rc) {
 		PMD_DRV_LOG(ERR,
Signature · 1 line
2.30.1 (Apple Git-130)
#14 lore raw

PATCH v3 3/3 net/bnxt: enhance support for RSS action

In reply to Ajit Khaparde

Enhance support for RSS action in the non-TruFlow path. This will allow the user or application to update the RSS settings using RTE_FLOW API.

---
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 196 ++++++++++++++++++++++++++++++++-
 2 files changed, 196 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_filter.h +1 -0
index 8bae0c4c72..587932c96f 100644
@@ -43,6 +43,7 @@ struct bnxt_filter_info {
 #define HWRM_CFA_EM_FILTER	1
 #define HWRM_CFA_NTUPLE_FILTER	2
 #define HWRM_CFA_TUNNEL_REDIRECT_FILTER	3
+#define HWRM_CFA_CONFIG		4
 	uint8_t                 filter_type;
 	uint32_t                dst_id;
 
drivers/net/bnxt/bnxt_flow.c +195 -1

226 lines not on this page · raw message

Signature · 1 line
2.30.1 (Apple Git-130)
#15 lore raw

v4 cover patchset for bnxt PMD

In reply to Ferruh Yigit

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!
--
v1->v2: use correct patch for 3/3.
v2->v3: rebase against latest dpdk-next-net tree. v3->v4: fix checkpatch warnings and errors.

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start
net/bnxt: enhance support for RSS action

 drivers/net/bnxt/bnxt_ethdev.c |  16 ++-
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 196 ++++++++++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_hwrm.c   |   9 ++
 drivers/net/bnxt/bnxt_ring.c   | 148 +++++++++++++++----------
 drivers/net/bnxt/bnxt_rxq.c    |  72 +++++++-----
 drivers/net/bnxt/bnxt_rxq.h    |   2 +
 drivers/net/bnxt/bnxt_rxr.c    | 111 +++++++++++--------
 8 files changed, 422 insertions(+), 133 deletions(-)
Signature · 1 line
2.30.1 (Apple Git-130)
#16 lore raw

PATCH v4 1/3 net/bnxt: create aggregration rings when needed

Aggregration rings are needed when PMD needs to support jumbo frames, LRO. Currently we are creating the aggregration rings whether jumbo frames or LRO has been enabled or disabled. This causes unnecessary allocation of mbufs needing larger mbuf pool which is not used at all.

This patch modifies the code to create aggregration rings only when needed.

---
 drivers/net/bnxt/bnxt_hwrm.c |   9 +++
 drivers/net/bnxt/bnxt_ring.c | 148 ++++++++++++++++++++++-------------
 drivers/net/bnxt/bnxt_rxq.c  |  72 +++++++++++------
 drivers/net/bnxt/bnxt_rxq.h  |   2 +
 drivers/net/bnxt/bnxt_rxr.c  | 111 +++++++++++++++-----------
 5 files changed, 216 insertions(+), 126 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +9 -0
index 503add42fd..181e607d7b 100644
@@ -2741,6 +2741,14 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 	if (BNXT_HAS_RING_GRPS(bp))
 		bp->grp_info[queue_index].rx_fw_ring_id = INVALID_HW_RING_ID;
 
+	/* Check agg ring struct explicitly.
+	 * bnxt_need_agg_ring() returns the current state of offload flags,
+	 * but we may have to deal with agg ring struct before the offload
+	 * flags are updated.
+	 */
+	if (!bnxt_need_agg_ring(bp->eth_dev) || rxr->ag_ring_struct == NULL)
+		goto no_agg;
+
 	ring = rxr->ag_ring_struct;
 	bnxt_hwrm_ring_free(bp, ring,
 			    BNXT_CHIP_P5(bp) ?
@@ -2750,6 +2758,7 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 	if (BNXT_HAS_RING_GRPS(bp))
 		bp->grp_info[queue_index].ag_fw_ring_id = INVALID_HW_RING_ID;
 
+no_agg:
 	bnxt_hwrm_stat_ctx_free(bp, cpr);
 
 	bnxt_free_cp_ring(bp, cpr);
drivers/net/bnxt/bnxt_ring.c +92 -56

223 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxq.c +47 -25

99 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxq.h +2 -0
index 9bb9352feb..0331c23810 100644
@@ -63,4 +63,6 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev,
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev,
 		       uint16_t rx_queue_id);
 void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq);
+int bnxt_need_agg_ring(struct rte_eth_dev *eth_dev);
+void bnxt_free_rxq_mem(struct bnxt_rx_queue *rxq);
 #endif
drivers/net/bnxt/bnxt_rxr.c +66 -45

129 lines not on this page · raw message

Signature · 1 line
2.30.1 (Apple Git-130)
#17 lore raw

PATCH v4 2/3 net/bnxt: fix Rx queue state on start

In reply to Ajit Khaparde

Fix Rx queue state on device start.
The state of Rx queues could be incorrect in some cases because instead of updating the state for all the Rx queues, we are updating it for queues in a VNIC.

Fixes 0105ea1296c9 ("net/bnxt: support runtime queue setup")
---
 drivers/net/bnxt/bnxt_ethdev.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +10 -6
index aa7e7fdc85..a98f93ab29 100644
@@ -482,12 +482,6 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id)
 			rxq->vnic->fw_grp_ids[j] = INVALID_HW_RING_ID;
 		else
 			vnic->rx_queue_cnt++;
-
-		if (!rxq->rx_deferred_start) {
-			bp->eth_dev->data->rx_queue_state[j] =
-				RTE_ETH_QUEUE_STATE_STARTED;
-			rxq->rx_started = true;
-		}
 	}
 
 	PMD_DRV_LOG(DEBUG, "vnic->rx_queue_cnt = %d\n", vnic->rx_queue_cnt);
@@ -824,6 +818,16 @@ static int bnxt_start_nic(struct bnxt *bp)
 		}
 	}
 
+	for (j = 0; j < bp->rx_nr_rings; j++) {
+		struct bnxt_rx_queue *rxq = bp->rx_queues[j];
+
+		if (!rxq->rx_deferred_start) {
+			bp->eth_dev->data->rx_queue_state[j] =
+				RTE_ETH_QUEUE_STATE_STARTED;
+			rxq->rx_started = true;
+		}
+	}
+
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, &bp->vnic_info[0], 0, NULL);
 	if (rc) {
 		PMD_DRV_LOG(ERR,
Signature · 1 line
2.30.1 (Apple Git-130)
#18 lore raw

PATCH v4 3/3 net/bnxt: enhance support for RSS action

In reply to Ajit Khaparde

Enhance support for RSS action in the non-TruFlow path. This will allow the user or application to update the RSS settings using RTE_FLOW API.

---
 drivers/net/bnxt/bnxt_filter.h |   1 +
 drivers/net/bnxt/bnxt_flow.c   | 196 ++++++++++++++++++++++++++++++++-
 2 files changed, 196 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_filter.h +1 -0
index 8bae0c4c72..587932c96f 100644
@@ -43,6 +43,7 @@ struct bnxt_filter_info {
 #define HWRM_CFA_EM_FILTER	1
 #define HWRM_CFA_NTUPLE_FILTER	2
 #define HWRM_CFA_TUNNEL_REDIRECT_FILTER	3
+#define HWRM_CFA_CONFIG		4
 	uint8_t                 filter_type;
 	uint32_t                dst_id;
 
drivers/net/bnxt/bnxt_flow.c +195 -1

226 lines not on this page · raw message

Signature · 1 line
2.30.1 (Apple Git-130)
#19 lore raw
In reply to Ajit Khaparde
Quoted 11 lines · Ajit Khaparde

Apart from fixing an issue with Rx queue state at startup, this patchset enhances support for RSS action and optimizes the mbuf requirement at startup by creating the aggregation rings only when needed (rx_scatter is enabled).

Please apply!
--
v1->v2: use correct patch for 3/3.
v2->v3: rebase against latest dpdk-next-net tree. v3->v4: fix checkpatch warnings and errors.

Quoted 5 lines

Ajit Khaparde (3):
net/bnxt: create aggregration rings when needed net/bnxt: fix Rx queue state on start net/bnxt: enhance support for RSS action

Pulled from next-net-brmc to next-net, thanks.