[v2] net/i40e: fix forward outer IPv6 VXLAN packets

Message ID 20211105033705.285200-1-jie1x.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/i40e: fix forward outer IPv6 VXLAN packets |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues

Commit Message

Jie Wang Nov. 5, 2021, 3:37 a.m. UTC
  Testpmd forwards packets in checksum mode that it need to calculate
the checksum of each layer's protocol. Then it will fill flags and
header length into mbuf.

In process_outer_cksums, HW calculates the outer checksum if
tx_offloads contains outer UDP checksum otherwise SW calculates
the outer checksum.

When tx_offloads contains outer UDP checksum or outer IPv4 checksum,
mbuf will be filled with correct header length.

This patch added outer UDP checksum in tx_offload_capa and
I40E_TX_OFFLOAD_MASK, when we set csum hw outer-udp on that the
engine can forward outer IPv6 VXLAN packets.

Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 1 +
 drivers/net/i40e/i40e_rxtx.c   | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Xing, Beilei Nov. 5, 2021, 3:48 a.m. UTC | #1
> -----Original Message-----
> From: Wang, Jie1X <jie1x.wang@intel.com>
> Sent: Friday, November 5, 2021 11:37 AM
> To: dev@dpdk.org
> Cc: Zhang, Yuying <yuying.zhang@intel.com>; Li, Xiaoyun
> <xiaoyun.li@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Jie1X
> <jie1x.wang@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix forward outer IPv6 VXLAN packets
> 
> Testpmd forwards packets in checksum mode that it need to calculate the
> checksum of each layer's protocol. Then it will fill flags and header length into
> mbuf.
> 
> In process_outer_cksums, HW calculates the outer checksum if tx_offloads
> contains outer UDP checksum otherwise SW calculates the outer checksum.
> 
> When tx_offloads contains outer UDP checksum or outer IPv4 checksum,
> mbuf will be filled with correct header length.
> 
> This patch added outer UDP checksum in tx_offload_capa and
> I40E_TX_OFFLOAD_MASK, when we set csum hw outer-udp on that the
> engine can forward outer IPv6 VXLAN packets.
> 
> Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
  
Ferruh Yigit Nov. 11, 2021, 6:25 p.m. UTC | #2
On 11/5/2021 3:48 AM, Xing, Beilei wrote:
> 
> 
>> -----Original Message-----
>> From: Wang, Jie1X <jie1x.wang@intel.com>
>> Sent: Friday, November 5, 2021 11:37 AM
>> To: dev@dpdk.org
>> Cc: Zhang, Yuying <yuying.zhang@intel.com>; Li, Xiaoyun
>> <xiaoyun.li@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Xing, Beilei
>> <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Jie1X
>> <jie1x.wang@intel.com>; stable@dpdk.org
>> Subject: [PATCH v2] net/i40e: fix forward outer IPv6 VXLAN packets
>>
>> Testpmd forwards packets in checksum mode that it need to calculate the
>> checksum of each layer's protocol. Then it will fill flags and header length into
>> mbuf.
>>
>> In process_outer_cksums, HW calculates the outer checksum if tx_offloads
>> contains outer UDP checksum otherwise SW calculates the outer checksum.
>>
>> When tx_offloads contains outer UDP checksum or outer IPv4 checksum,
>> mbuf will be filled with correct header length.
>>
>> This patch added outer UDP checksum in tx_offload_capa and
>> I40E_TX_OFFLOAD_MASK, when we set csum hw outer-udp on that the
>> engine can forward outer IPv6 VXLAN packets.
>>
>> Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> Acked-by: Beilei Xing <beilei.xing@intel.com>
> 

For record,
This patch has been merged to next-net-intel, and pulled to next-net from there.
  
David Marchand March 29, 2024, 8:16 a.m. UTC | #3
Hello Bruce, John,

On Fri, Nov 5, 2021 at 4:39 AM Jie Wang <jie1x.wang@intel.com> wrote:
>
> Testpmd forwards packets in checksum mode that it need to calculate
> the checksum of each layer's protocol. Then it will fill flags and
> header length into mbuf.
>
> In process_outer_cksums, HW calculates the outer checksum if
> tx_offloads contains outer UDP checksum otherwise SW calculates
> the outer checksum.
>
> When tx_offloads contains outer UDP checksum or outer IPv4 checksum,
> mbuf will be filled with correct header length.
>
> This patch added outer UDP checksum in tx_offload_capa and
> I40E_TX_OFFLOAD_MASK, when we set csum hw outer-udp on that the
> engine can forward outer IPv6 VXLAN packets.
>
> Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>

- There is a bz opened by a OVS user trying to offload geneve checksum.
https://bugs.dpdk.org/show_bug.cgi?id=1406

Reading the X7xx datasheet, parsing i40e_parse_tunneling_params() and
looking at the packets reported by the user, I understand that outer
udp checksum is actually *not* supported by net/i40e.
And so the change from this mail thread should be reverted as the
driver falsely claims support for this feature.


- I found some bits about X722 (5535087e6c56 ("i40e/base: add outer
UDP checksum for X722")) supporting this feature, but I did not find a
definition in the datasheet.
Besides, this I40E_TXD_CTX_QW0_L4T_CS_MASK is not used in the net/i40e tx path.


We need Intel to clear state what is supported or not, and send fixes
accordingly.

Thanks.
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 9ea5f303ff..344cbd25d3 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3746,6 +3746,7 @@  i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
+		RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM |
 		dev_info->tx_queue_offload_capa;
 	dev_info->dev_capa =
 		RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 6ccb598677..41fe3bf481 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -65,6 +65,7 @@ 
 		RTE_MBUF_F_TX_QINQ |       \
 		RTE_MBUF_F_TX_VLAN |	\
 		RTE_MBUF_F_TX_TUNNEL_MASK |	\
+		RTE_MBUF_F_TX_OUTER_UDP_CKSUM |	\
 		I40E_TX_IEEE1588_TMST)
 
 #define I40E_TX_OFFLOAD_NOTSUP_MASK \