Skip to contentSkip to conversation

net/ena: enable multi segment in Tx offload flags

PATCH In review Ghalem Boudour 4 participants 9 messages Jul 12, 2021 – Jul 30, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ena: enable multi segment in Tx offload flags

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default.

This flag in not listed in doc/guides/nics/features/default.ini, so ena.ini does not need to be updated.

---
 drivers/net/ena/ena_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ena/ena_ethdev.c +1 -0
index dfe68279fa7b..a8422ee425ce 100644
@@ -2055,6 +2055,7 @@ static int ena_infos_get(struct rte_eth_dev *dev,
 			DEV_RX_OFFLOAD_TCP_CKSUM;
 
 	rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+	tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 	/* Inform framework about available features */
 	dev_info->rx_offload_capa = rx_feat;
Signature · 1 line
2.28.0
#1 lore raw

pon., 12 lip 2021 o 19:03 Ghalem Boudour <[email protected]> napisał(a):

Quoted 4 lines

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default.

Hi Ghalem,

This patch enables announcement of the DEV_TX_OFFLOAD_MULTI_SEGS capability, but still the application may not request this offload.

As ENA PMD currently assumes all the mbufs may have multiple segments (and we don't have fast-path for the other cases), I suggest overwriting this flag in the ena_dev_configure(), similar to what we're doing with the DEV_RX_OFFLOAD_RSS_HASH flag.

Best regards,
Michal

Quoted 24 lines

This flag in not listed in doc/guides/nics/features/default.ini, so ena.ini does not need to be updated.

---
 drivers/net/ena/ena_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ena/ena_ethdev.c +1 -1
index dfe68279fa7b..a8422ee425ce 100644
@@ -2055,6 +2055,7 @@ static int ena_infos_get(struct rte_eth_dev *dev,
                        DEV_RX_OFFLOAD_TCP_CKSUM;
 
        rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+       tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
        /* Inform framework about available features */
        dev_info->rx_offload_capa = rx_feat;
--

2.28.0

#2 lore raw

Hi Michał,

Quoted 8 lines · Michał Krawczyk

pon., 12 lip 2021 o 19:03 Ghalem Boudour <[email protected]> napisał(a):

Quoted 4 lines

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default.

Hi Ghalem,

Quoted 7 lines

This patch enables announcement of the DEV_TX_OFFLOAD_MULTI_SEGS capability, but still the application may not request this offload.

As ENA PMD currently assumes all the mbufs may have multiple segments (and we don't have fast-path for the other cases), I suggest overwriting this flag in the ena_dev_configure(), similar to what we're doing with the DEV_RX_OFFLOAD_RSS_HASH flag.

To give some more context, our application currently checks if the driver supports multi-segments by checking its capabilities, and asks for the feature if it is advertised.

When dealing with drivers that do not advertise this capability, our app linearizes the segmented mbufs before sending them to the driver.

I think this is the proper way to use the API: if the driver supports to handle multisegmented mbufs, it should advertise the capability.

Regards,
Olivier

Quoted 27 lines

Best regards,
Michal

Quoted 24 lines

This flag in not listed in doc/guides/nics/features/default.ini, so ena.ini does not need to be updated.

---
 drivers/net/ena/ena_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ena/ena_ethdev.c +1 -1
index dfe68279fa7b..a8422ee425ce 100644
@@ -2055,6 +2055,7 @@ static int ena_infos_get(struct rte_eth_dev *dev,
                        DEV_RX_OFFLOAD_TCP_CKSUM;
 
        rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+       tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
        /* Inform framework about available features */
        dev_info->rx_offload_capa = rx_feat;
--

2.28.0

#3 lore raw

śr., 28 lip 2021 o 16:27 Olivier Matz <[email protected]> napisał(a):

Quoted 24 lines

Hi Michał,

Quoted 8 lines · Michał Krawczyk

pon., 12 lip 2021 o 19:03 Ghalem Boudour <[email protected]> napisał(a):

Quoted 4 lines

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default.

Hi Ghalem,

Quoted 7 lines

This patch enables announcement of the DEV_TX_OFFLOAD_MULTI_SEGS capability, but still the application may not request this offload.

As ENA PMD currently assumes all the mbufs may have multiple segments (and we don't have fast-path for the other cases), I suggest overwriting this flag in the ena_dev_configure(), similar to what we're doing with the DEV_RX_OFFLOAD_RSS_HASH flag.

To give some more context, our application currently checks if the driver supports multi-segments by checking its capabilities, and asks for the feature if it is advertised.

Quoted 9 lines

When dealing with drivers that do not advertise this capability, our app linearizes the segmented mbufs before sending them to the driver.

I think this is the proper way to use the API: if the driver supports to handle multisegmented mbufs, it should advertise the capability.

Regards,
Olivier

Hi Olivier,

I agree we should advertise it. However, after advertising this option, the application should ask PMD to use this feature if I understand the offload API correctly.
I was thinking about the PMD behavior if this option won't be requested by the application - it would be the same as for the multisegment setup, that's why I suggested to also override this feature at the configuration step.

With the RSS hash feature we're doing exactly the same - first we're advertising that it's available, and then (if RSS was enabled), we're setting this offload as enabled, even though the application didn't request it explicitly.

Anyway, I won't be holding push of this patch as we're close to rc3. @Ghalem, please add the fixline and Cc the [email protected] in the commit log, so we will have this commit backported.

Thanks,
Michal

#4 lore raw

Hi Michał,

Quoted 35 lines · Michał Krawczyk

śr., 28 lip 2021 o 16:27 Olivier Matz <[email protected]> napisał(a):

Quoted 24 lines

Hi Michał,

Quoted 8 lines · Michał Krawczyk

pon., 12 lip 2021 o 19:03 Ghalem Boudour <[email protected]> napisał(a):

Quoted 4 lines

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default.

Hi Ghalem,

Quoted 7 lines

This patch enables announcement of the DEV_TX_OFFLOAD_MULTI_SEGS capability, but still the application may not request this offload.

As ENA PMD currently assumes all the mbufs may have multiple segments (and we don't have fast-path for the other cases), I suggest overwriting this flag in the ena_dev_configure(), similar to what we're doing with the DEV_RX_OFFLOAD_RSS_HASH flag.

To give some more context, our application currently checks if the driver supports multi-segments by checking its capabilities, and asks for the feature if it is advertised.

Quoted 9 lines

When dealing with drivers that do not advertise this capability, our app linearizes the segmented mbufs before sending them to the driver.

I think this is the proper way to use the API: if the driver supports to handle multisegmented mbufs, it should advertise the capability.

Regards,
Olivier

Quoted 5 lines

Hi Olivier,

I agree we should advertise it. However, after advertising this option, the application should ask PMD to use this feature if I understand the offload API correctly.

Yes

Quoted 9 lines

I was thinking about the PMD behavior if this option won't be requested by the application - it would be the same as for the multisegment setup, that's why I suggested to also override this feature at the configuration step.

With the RSS hash feature we're doing exactly the same - first we're advertising that it's available, and then (if RSS was enabled), we're setting this offload as enabled, even though the application didn't request it explicitly.

I have no strong opinion here. If there is no behavior change when the option is set or unset by the application, I think both options are
acceptable: either return what the application asked for, or return the option always set (as you do for hash).

Quoted 3 lines

Anyway, I won't be holding push of this patch as we're close to rc3. @Ghalem, please add the fixline and Cc the [email protected] in the commit log, so we will have this commit backported.

Ghalem is currently off, I'll take care of it.

The multiseg Tx feature is there since the beginning, so the Fixes line will be:

Fixes 1173fca25af9 ("ena: add polling-mode driver")

I can also add the flag in ena_dev_configure(), if you feel it is more consistent. Please let me know.

Thanks,
Olivier

#5 lore raw

czw., 29 lip 2021 o 09:26 Olivier Matz <[email protected]> napisał(a):

Quoted 66 lines

Hi Michał,

Quoted 35 lines · Michał Krawczyk

śr., 28 lip 2021 o 16:27 Olivier Matz <[email protected]> napisał(a):

Quoted 24 lines

Hi Michał,

Quoted 8 lines · Michał Krawczyk

pon., 12 lip 2021 o 19:03 Ghalem Boudour <[email protected]> napisał(a):

Quoted 4 lines

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default.

Hi Ghalem,

Quoted 7 lines

This patch enables announcement of the DEV_TX_OFFLOAD_MULTI_SEGS capability, but still the application may not request this offload.

As ENA PMD currently assumes all the mbufs may have multiple segments (and we don't have fast-path for the other cases), I suggest overwriting this flag in the ena_dev_configure(), similar to what we're doing with the DEV_RX_OFFLOAD_RSS_HASH flag.

To give some more context, our application currently checks if the driver supports multi-segments by checking its capabilities, and asks for the feature if it is advertised.

Quoted 9 lines

When dealing with drivers that do not advertise this capability, our app linearizes the segmented mbufs before sending them to the driver.

I think this is the proper way to use the API: if the driver supports to handle multisegmented mbufs, it should advertise the capability.

Regards,
Olivier

Quoted 5 lines

Hi Olivier,

I agree we should advertise it. However, after advertising this option, the application should ask PMD to use this feature if I understand the offload API correctly.

Yes

Quoted 9 lines

I was thinking about the PMD behavior if this option won't be requested by the application - it would be the same as for the multisegment setup, that's why I suggested to also override this feature at the configuration step.

With the RSS hash feature we're doing exactly the same - first we're advertising that it's available, and then (if RSS was enabled), we're setting this offload as enabled, even though the application didn't request it explicitly.

I have no strong opinion here. If there is no behavior change when the option is set or unset by the application, I think both options are
acceptable: either return what the application asked for, or return the option always set (as you do for hash).

Quoted 3 lines

Anyway, I won't be holding push of this patch as we're close to rc3. @Ghalem, please add the fixline and Cc the [email protected] in the commit log, so we will have this commit backported.

Quoted 6 lines

Ghalem is currently off, I'll take care of it.

The multiseg Tx feature is there since the beginning, so the Fixes line will be:

Fixes 1173fca25af9 ("ena: add polling-mode driver")

Ack

Quoted 3 lines

I can also add the flag in ena_dev_configure(), if you feel it is more consistent. Please let me know.

Please add it, so it will be more consistent and verbose.

Thanks,
Michal

#6 lore raw

PATCH v2 1/1 net/ena: enable multi segment in Tx offload flags

In reply to Ghalem Boudour

From: Ghalem Boudour <[email protected]>

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default, and always set it in dev->data->dev_conf.txmode.offload.

This flag in not listed in doc/guides/nics/features/default.ini, so ena.ini does not need to be updated.

Fixes 1173fca25af9 ("ena: add polling-mode driver")

---

v2
* set DEV_TX_OFFLOAD_MULTI_SEGS in dev->data->dev_conf.txmode.offload
* add Fixes and Cc stable

 drivers/net/ena/ena_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ena/ena_ethdev.c +2 -0
index dfe68279fa..b59451034c 100644
@@ -1981,6 +1981,7 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
 
 	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
 		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	dev->data->dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 	adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads;
 	adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads;
@@ -2055,6 +2056,7 @@ static int ena_infos_get(struct rte_eth_dev *dev,
 			DEV_RX_OFFLOAD_TCP_CKSUM;
 
 	rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+	tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 	/* Inform framework about available features */
 	dev_info->rx_offload_capa = rx_feat;
Signature · 1 line
2.29.2
Acked-by on v2 1/1
#7 lore raw

pt., 30 lip 2021 o 10:35 Olivier Matz <[email protected]> napisał(a):

Quoted 7 lines

From: Ghalem Boudour <[email protected]>

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default, and always set it in dev->data->dev_conf.txmode.offload.

Quoted 8 lines

This flag in not listed in doc/guides/nics/features/default.ini, so ena.ini does not need to be updated.

Fixes 1173fca25af9 ("ena: add polling-mode driver")
Quoted 32 lines

---

v2
* set DEV_TX_OFFLOAD_MULTI_SEGS in dev->data->dev_conf.txmode.offload
* add Fixes and Cc stable

 drivers/net/ena/ena_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ena/ena_ethdev.c +2 -1
index dfe68279fa..b59451034c 100644
@@ -1981,6 +1981,7 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
 
        if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
                dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+       dev->data->dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
        adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads;
        adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads;
@@ -2055,6 +2056,7 @@ static int ena_infos_get(struct rte_eth_dev *dev,
                        DEV_RX_OFFLOAD_TCP_CKSUM;
 
        rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+       tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
        /* Inform framework about available features */
        dev_info->rx_offload_capa = rx_feat;
--

2.29.2

#8 lore raw

30/07/2021 11:37, Michał Krawczyk:

Quoted 11 lines

pt., 30 lip 2021 o 10:35 Olivier Matz <[email protected]> napisał(a):

Quoted 10 lines

From: Ghalem Boudour <[email protected]>

The DPDK ENA driver does not provide multi-segment tx offload capability. Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by default, and always set it in dev->data->dev_conf.txmode.offload.

This flag in not listed in doc/guides/nics/features/default.ini, so ena.ini does not need to be updated.

Quoted 6 lines
Quoted 5 lines
Fixes 1173fca25af9 ("ena: add polling-mode driver")

Applied, thanks.