Skip to contentSkip to conversation

net/axgbe: add support for Scattered Rx

PATCH Superseded [email protected] 3 participants 7 messages Feb 27, 2020 – Feb 28, 2020 Network drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/axgbe: add support for Scattered Rx

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

---
 doc/guides/nics/features/axgbe.ini |   1 +
 drivers/net/axgbe/axgbe_common.h   |   2 +
 drivers/net/axgbe/axgbe_ethdev.c   |  18 +++-
 drivers/net/axgbe/axgbe_rxtx.c     | 146 +++++++++++++++++++++++++++++
 drivers/net/axgbe/axgbe_rxtx.h     |   2 +
 5 files changed, 168 insertions(+), 1 deletion(-)
doc/guides/nics/features/axgbe.ini +1 -0
index ab4da559f..0becaa097 100644
@@ -7,6 +7,7 @@
 Speed capabilities   = Y
 Link status          = Y
 Jumbo frame          = Y
+Scattered Rx         = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
 RSS hash             = Y
drivers/net/axgbe/axgbe_common.h +2 -0
index fdb037dd5..fbd46150c 100644
@@ -1135,6 +1135,8 @@
 #define RX_NORMAL_DESC3_PL_WIDTH		14
 #define RX_NORMAL_DESC3_RSV_INDEX		26
 #define RX_NORMAL_DESC3_RSV_WIDTH		1
+#define RX_NORMAL_DESC3_LD_INDEX		28
+#define RX_NORMAL_DESC3_LD_WIDTH		1
 
 #define RX_DESC3_L34T_IPV4_TCP			1
 #define RX_DESC3_L34T_IPV4_UDP			2
drivers/net/axgbe/axgbe_ethdev.c +17 -1
index d0b6f091f..eb2f51f89 100644
@@ -789,11 +789,17 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM  |
 		DEV_RX_OFFLOAD_TCP_CKSUM  |
+		DEV_RX_OFFLOAD_JUMBO_FRAME	|
+		DEV_RX_OFFLOAD_SCATTER	  |
 		DEV_RX_OFFLOAD_KEEP_CRC;
 
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_IPV4_CKSUM  |
 		DEV_TX_OFFLOAD_UDP_CKSUM   |
+		DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_TX_OFFLOAD_UDP_TSO		|
+		DEV_TX_OFFLOAD_SCTP_CKSUM	|
+		DEV_TX_OFFLOAD_MULTI_SEGS	|
 		DEV_TX_OFFLOAD_TCP_CKSUM;
 
 	if (pdata->hw_feat.rss) {
@@ -1018,9 +1024,19 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
 	struct rte_pci_device *pci_dev;
 	uint32_t reg, mac_lo, mac_hi;
 	int ret;
+	struct rte_eth_dev_info dev_info = { 0 };
 
 	eth_dev->dev_ops = &axgbe_eth_dev_ops;
-	eth_dev->rx_pkt_burst = &axgbe_recv_pkts;
+	eth_dev->dev_ops->dev_infos_get(eth_dev, &dev_info);
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCATTER)
+		eth_dev->data->scattered_rx = 1;
+
+	/*  Scatter Rx handling */
+	if (eth_dev->data->scattered_rx)
+		eth_dev->rx_pkt_burst = &eth_axgbe_recv_scattered_pkts;
+	else
+		eth_dev->rx_pkt_burst = &axgbe_recv_pkts;
 
 	/*
 	 * For secondary processes, we don't initialise any further as primary
drivers/net/axgbe/axgbe_rxtx.c +146 -0

152 lines not on this page · raw message

drivers/net/axgbe/axgbe_rxtx.h +2 -0
index a21537df9..f6796b09b 100644
@@ -179,6 +179,8 @@ int axgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int axgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 uint16_t axgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			 uint16_t nb_pkts);
+uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
+		struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
 uint16_t axgbe_recv_pkts_threshold_refresh(void *rx_queue,
 					   struct rte_mbuf **rx_pkts,
 					   uint16_t nb_pkts);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · On 2/27/2020 6:33 AM, [email protected] wrote:

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

<...>

Quoted 6 lines
drivers/net/axgbe/axgbe_ethdev.c +2 -0
@@ -789,11 +789,17 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM  |
 		DEV_RX_OFFLOAD_TCP_CKSUM  |
+		DEV_RX_OFFLOAD_JUMBO_FRAME	|
+		DEV_RX_OFFLOAD_SCATTER	  |

drivers/net/axgbe/axgbe_ethdev.c axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 803

Quoted 10 lines
drivers/net/axgbe/axgbe_ethdev.c +4 -0
 		DEV_RX_OFFLOAD_KEEP_CRC;
 
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_IPV4_CKSUM  |
 		DEV_TX_OFFLOAD_UDP_CKSUM   |
+		DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_TX_OFFLOAD_UDP_TSO		|
+		DEV_TX_OFFLOAD_SCTP_CKSUM	|
+		DEV_TX_OFFLOAD_MULTI_SEGS	|
 		DEV_TX_OFFLOAD_TCP_CKSUM;

Is the Tx offload capability update related to the this change? If it is not can you please send these updates as a separate patch, and a send new version of this patch without this bit?

Thanks,
ferruh

#2 lore raw

[AMD Official Use Only - Internal Distribution Only]

Hi Ferruh,
For validation of scatter using the testpmd method mentioned in dpdk docs, we need to have these Tx offloads also enabled.

Thanks and Regards
Selwin Sebastian

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 27, 2020 7:59 PM
To: Sebastian, Selwin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for Scattered Rx

[CAUTION: External Email]

Quoted 5 lines · On 2/27/2020 6:33 AM, [email protected] wrote:

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

<...>

Quoted 6 lines
drivers/net/axgbe/axgbe_ethdev.c +2 -0
@@ -789,11 +789,17 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
              DEV_RX_OFFLOAD_IPV4_CKSUM |
              DEV_RX_OFFLOAD_UDP_CKSUM  |
              DEV_RX_OFFLOAD_TCP_CKSUM  |
+             DEV_RX_OFFLOAD_JUMBO_FRAME      |
+             DEV_RX_OFFLOAD_SCATTER    |

drivers/net/axgbe/axgbe_ethdev.c axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 803

Quoted 10 lines
drivers/net/axgbe/axgbe_ethdev.c +4 -0
              DEV_RX_OFFLOAD_KEEP_CRC;
 
      dev_info->tx_offload_capa =
              DEV_TX_OFFLOAD_IPV4_CKSUM  |
              DEV_TX_OFFLOAD_UDP_CKSUM   |
+             DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+             DEV_TX_OFFLOAD_UDP_TSO          |
+             DEV_TX_OFFLOAD_SCTP_CKSUM       |
+             DEV_TX_OFFLOAD_MULTI_SEGS       |
              DEV_TX_OFFLOAD_TCP_CKSUM;

Is the Tx offload capability update related to the this change? If it is not can you please send these updates as a separate patch, and a send new version of this patch without this bit?

Thanks,
ferruh

#3 lore raw
Quoted 4 lines · Selwin

[AMD Official Use Only - Internal Distribution Only]

Hi Ferruh,
For validation of scatter using the testpmd method mentioned in dpdk docs, we need to have these Tx offloads also enabled.

[Please don't top post, it makes conversation hard to follow.]

Can you point where there testpmd requirement in the code?

Also these offloads should be enabled when HW/Driver supports it, not for it is required by testpmd.

Quoted 43 lines

Thanks and Regards
Selwin Sebastian

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 27, 2020 7:59 PM
To: Sebastian, Selwin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for Scattered Rx

[CAUTION: External Email]

Quoted 5 lines · On 2/27/2020 6:33 AM, [email protected] wrote:

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

<...>

Quoted 6 lines
drivers/net/axgbe/axgbe_ethdev.c +2 -0
@@ -789,11 +789,17 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
              DEV_RX_OFFLOAD_IPV4_CKSUM |
              DEV_RX_OFFLOAD_UDP_CKSUM  |
              DEV_RX_OFFLOAD_TCP_CKSUM  |
+             DEV_RX_OFFLOAD_JUMBO_FRAME      |
+             DEV_RX_OFFLOAD_SCATTER    |

drivers/net/axgbe/axgbe_ethdev.c axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 803

Quoted 10 lines
drivers/net/axgbe/axgbe_ethdev.c +4 -0
              DEV_RX_OFFLOAD_KEEP_CRC;
 
      dev_info->tx_offload_capa =
              DEV_TX_OFFLOAD_IPV4_CKSUM  |
              DEV_TX_OFFLOAD_UDP_CKSUM   |
+             DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+             DEV_TX_OFFLOAD_UDP_TSO          |
+             DEV_TX_OFFLOAD_SCTP_CKSUM       |
+             DEV_TX_OFFLOAD_MULTI_SEGS       |
              DEV_TX_OFFLOAD_TCP_CKSUM;

Is the Tx offload capability update related to the this change? If it is not can you please send these updates as a separate patch, and a send new version of this patch without this bit?

Thanks,
ferruh

#4 lore raw

Thanks and Regards
Selwin Sebastian

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 27, 2020 8:08 PM
To: Sebastian, Selwin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for Scattered Rx

[CAUTION: External Email]

Quoted 4 lines · Selwin

[AMD Official Use Only - Internal Distribution Only]

Hi Ferruh,
For validation of scatter using the testpmd method mentioned in dpdk docs, we need to have these Tx offloads also enabled.

[Please don't top post, it makes conversation hard to follow.]

Can you point where there testpmd requirement in the code?
https://doc.dpdk.org/dts/test_plans/scatter_test_plan.html talks about DEV_TX_OFFLOAD_MULTI_SEGS as a prerequisites for scatter . When I add DEV_TX_OFFLOAD_MULTI_SEGS for tx capability , I was forced to add " DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM , DEV_TX_OFFLOAD_UDP_TSO , DEV_TX_OFFLOAD_SCTP_CKSUM" for the mentioned testpmd to run.

Also these offloads should be enabled when HW/Driver supports it, not for it is required by testpmd.

I am able to test scatter without adding "DEV_TX_OFFLOAD_MULTI_SEGS" tx capability. Shall I submit version2 of the patch after removing " DEV_TX_OFFLOAD_MULTI_SEGS, DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM , DEV_TX_OFFLOAD_UDP_TSO, DEV_TX_OFFLOAD_SCTP_CKSUM" capabilities. ?

Quoted 44 lines

Thanks and Regards
Selwin Sebastian

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 27, 2020 7:59 PM
To: Sebastian, Selwin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for Scattered Rx

[CAUTION: External Email]

Quoted 5 lines · On 2/27/2020 6:33 AM, [email protected] wrote:

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

<...>

Quoted 6 lines
drivers/net/axgbe/axgbe_ethdev.c +2 -0
@@ -789,11 +789,17 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
              DEV_RX_OFFLOAD_IPV4_CKSUM |
              DEV_RX_OFFLOAD_UDP_CKSUM  |
              DEV_RX_OFFLOAD_TCP_CKSUM  |
+             DEV_RX_OFFLOAD_JUMBO_FRAME      |
+             DEV_RX_OFFLOAD_SCATTER    |

drivers/net/axgbe/axgbe_ethdev.c axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 803

Quoted 10 lines
drivers/net/axgbe/axgbe_ethdev.c +4 -0
              DEV_RX_OFFLOAD_KEEP_CRC;
 
      dev_info->tx_offload_capa =
              DEV_TX_OFFLOAD_IPV4_CKSUM  |
              DEV_TX_OFFLOAD_UDP_CKSUM   |
+             DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+             DEV_TX_OFFLOAD_UDP_TSO          |
+             DEV_TX_OFFLOAD_SCTP_CKSUM       |
+             DEV_TX_OFFLOAD_MULTI_SEGS       |
              DEV_TX_OFFLOAD_TCP_CKSUM;

Is the Tx offload capability update related to the this change? If it is not can you please send these updates as a separate patch, and a send new version of this patch without this bit?

Thanks,
ferruh

#5 lore raw
Quoted 17 lines · Selwin

Thanks and Regards
Selwin Sebastian

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 27, 2020 8:08 PM
To: Sebastian, Selwin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for Scattered Rx

[CAUTION: External Email]

Quoted 2 lines · Selwin

[AMD Official Use Only - Internal Distribution Only]

Quoted 7 lines
Quoted 2 lines

Hi Ferruh,
For validation of scatter using the testpmd method mentioned in dpdk docs, we need to have these Tx offloads also enabled.

[Please don't top post, it makes conversation hard to follow.]

Can you point where there testpmd requirement in the code?
https://doc.dpdk.org/dts/test_plans/scatter_test_plan.html talks about DEV_TX_OFFLOAD_MULTI_SEGS as a prerequisites for scatter .

Above document has a good point that:
"The forwarding of scattered input packets naturally enforces the transmission of scattered packets by PMD transmit functions."

If you only support scattered Rx, but not Tx (as your case), you may have unexpected results.

But this doesn't mean the multi segment Tx should be announced when it is not supported.

Quoted 1 line

When I add DEV_TX_OFFLOAD_MULTI_SEGS for tx capability , I was forced to add " DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM , DEV_TX_OFFLOAD_UDP_TSO , DEV_TX_OFFLOAD_SCTP_CKSUM" for the mentioned testpmd to run.

It is still no clear why you are forced to add those capabilities, if you can point me the code in testpmd that forces you, I can comment better.

Quoted 4 lines

Also these offloads should be enabled when HW/Driver supports it, not for it is required by testpmd.

I am able to test scatter without adding "DEV_TX_OFFLOAD_MULTI_SEGS" tx capability. Shall I submit version2 of the patch after removing " DEV_TX_OFFLOAD_MULTI_SEGS, DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM , DEV_TX_OFFLOAD_UDP_TSO, DEV_TX_OFFLOAD_SCTP_CKSUM" capabilities. ?

First of all, offload capabilities are set based on what offload HW/Driver support. As far as I can see axgbe doesn't support multi segment Tx, so you shouldn't set 'DEV_TX_OFFLOAD_MULTI_SEGS' at all, same for all offload flags.

If those list of offloads are supported by HW/Driver, but previously forgotten to announce them as capability, please send a separate patch for it, with proper fixes line which points the commit adding the support.

Quoted 46 lines
Quoted 45 lines

Thanks and Regards
Selwin Sebastian

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 27, 2020 7:59 PM
To: Sebastian, Selwin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for Scattered Rx

[CAUTION: External Email]

Quoted 5 lines · On 2/27/2020 6:33 AM, [email protected] wrote:

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

<...>

Quoted 6 lines
drivers/net/axgbe/axgbe_ethdev.c +2 -0
@@ -789,11 +789,17 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
              DEV_RX_OFFLOAD_IPV4_CKSUM |
              DEV_RX_OFFLOAD_UDP_CKSUM  |
              DEV_RX_OFFLOAD_TCP_CKSUM  |
+             DEV_RX_OFFLOAD_JUMBO_FRAME      |
+             DEV_RX_OFFLOAD_SCATTER    |

drivers/net/axgbe/axgbe_ethdev.c axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 803

Quoted 10 lines
drivers/net/axgbe/axgbe_ethdev.c +4 -0
              DEV_RX_OFFLOAD_KEEP_CRC;
 
      dev_info->tx_offload_capa =
              DEV_TX_OFFLOAD_IPV4_CKSUM  |
              DEV_TX_OFFLOAD_UDP_CKSUM   |
+             DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+             DEV_TX_OFFLOAD_UDP_TSO          |
+             DEV_TX_OFFLOAD_SCTP_CKSUM       |
+             DEV_TX_OFFLOAD_MULTI_SEGS       |
              DEV_TX_OFFLOAD_TCP_CKSUM;

Is the Tx offload capability update related to the this change? If it is not can you please send these updates as a separate patch, and a send new version of this patch without this bit?

Thanks,
ferruh

#6 lore raw
In reply to [email protected]
Quoted 5 lines · On 2/27/2020 6:33 AM, [email protected] wrote:

From: Selwin Sebastian <[email protected]>

Enable scattered rx support and add jumbo packet transmit capability

<...>

drivers/net/axgbe/axgbe_ethdev.c eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) · line 1033

Quoted 12 lines
drivers/net/axgbe/axgbe_ethdev.c +5 -1
@@ -1018,9 +1024,19 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
 	struct rte_pci_device *pci_dev;
 	uint32_t reg, mac_lo, mac_hi;
 	int ret;
+	struct rte_eth_dev_info dev_info = { 0 };
 
 	eth_dev->dev_ops = &axgbe_eth_dev_ops;
-	eth_dev->rx_pkt_burst = &axgbe_recv_pkts;
+	eth_dev->dev_ops->dev_infos_get(eth_dev, &dev_info);
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCATTER)
+		eth_dev->data->scattered_rx = 1;

Should check the requested config 'eth_dev->data->dev_conf.rxmode.offloads", not the capability that driver set itself (dev_info.rx_offload_capa).