From: Andrew Rybchenko Date: Sun, 24 Dec 2017 10:46:43 +0000 (+0000) Subject: net/sfc: support inner checksum offload on transmit X-Git-Tag: spdx-start~477 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c1767d9399cdefac4b98da2844b3301eff12ee88;p=dpdk.git net/sfc: support inner checksum offload on transmit There is no dedicated controls for inner checksum offload on device/queue level. So, enable together with outer offloads. Signed-off-by: Andrew Rybchenko Reviewed-by: Ivan Malov --- diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index 813cb6fd59..8e0782cdd1 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -48,6 +48,8 @@ SFC EFX PMD has support for: - IPv4/IPv6 TCP/UDP transmit checksum offload +- Inner IPv4/IPv6 TCP/UDP transmit checksum offload + - Port hardware statistics - Extended statistics (see Solarflare Server Adapter User's Guide for diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 0fea997887..1b700b12a2 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -140,6 +140,9 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM; + if (encp->enc_tunnel_encapsulations_supported != 0) + dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; + dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOXSUMSCTP; if ((~sa->dp_tx->features & SFC_DP_TX_FEAT_VLAN_INSERT) || !encp->enc_hw_tx_insert_vlan_enabled) diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c index d1320f462d..f580fb5de7 100644 --- a/drivers/net/sfc/sfc_tx.c +++ b/drivers/net/sfc/sfc_tx.c @@ -410,6 +410,7 @@ sfc_tx_close(struct sfc_adapter *sa) int sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index) { + const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); struct rte_eth_dev_data *dev_data; struct sfc_txq_info *txq_info; struct sfc_txq *txq; @@ -440,9 +441,16 @@ sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index) if ((txq->flags & ETH_TXQ_FLAGS_NOXSUMTCP) || (txq->flags & ETH_TXQ_FLAGS_NOXSUMUDP)) { flags = EFX_TXQ_CKSUM_IPV4; + + if (encp->enc_tunnel_encapsulations_supported != 0) + flags |= EFX_TXQ_CKSUM_INNER_IPV4; } else { flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP; + if (encp->enc_tunnel_encapsulations_supported != 0) + flags |= EFX_TXQ_CKSUM_INNER_IPV4 | + EFX_TXQ_CKSUM_INNER_TCPUDP; + if (sa->tso) flags |= EFX_TXQ_FATSOV2; }