net/sfc: support inner checksum offload on transmit
authorAndrew Rybchenko <arybchenko@solarflare.com>
Sun, 24 Dec 2017 10:46:43 +0000 (10:46 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
There is no dedicated controls for inner checksum offload on
device/queue level. So, enable together with outer offloads.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
doc/guides/nics/sfc_efx.rst
drivers/net/sfc/sfc_ethdev.c
drivers/net/sfc/sfc_tx.c

index 813cb6f..8e0782c 100644 (file)
@@ -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
index 0fea997..1b700b1 100644 (file)
@@ -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)
index d1320f4..f580fb5 100644 (file)
@@ -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;
        }