From a8e0c002f2bc686687c74181c985fbc2bf572bba Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Tue, 13 Oct 2020 14:45:36 +0100 Subject: [PATCH] net/sfc: support TCP and UDP checksum offloads for EF100 Use outer layer 4 full checksum offload which does not require any assistance from driver. Signed-off-by: Andrew Rybchenko --- doc/guides/nics/sfc_efx.rst | 4 ++-- drivers/net/sfc/sfc_ef100_tx.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index 17e9461bea..98521f9975 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -328,8 +328,8 @@ boolean parameters value. **ef10_simple** chooses EF10 (SFN7xxx, SFN8xxx, X2xxx) native datapath which is even more faster then **ef10** but does not support multi-segment mbufs, disallows multiple mempools and neglects mbuf reference counters. - **ef100** chooses EF100 native datapath which does not support - any offloads except multi-segment mbufs. + **ef100** chooses EF100 native datapath which supports multi-segment + mbufs and TCP/UDP checksum offloads. - ``perf_profile`` [auto|throughput|low-latency] (default **throughput**) diff --git a/drivers/net/sfc/sfc_ef100_tx.c b/drivers/net/sfc/sfc_ef100_tx.c index 00e050e60a..df42d480b3 100644 --- a/drivers/net/sfc/sfc_ef100_tx.c +++ b/drivers/net/sfc/sfc_ef100_tx.c @@ -216,10 +216,15 @@ sfc_ef100_tx_reap(struct sfc_ef100_txq *txq) static void sfc_ef100_tx_qdesc_send_create(const struct rte_mbuf *m, efx_oword_t *tx_desc) { - EFX_POPULATE_OWORD_4(*tx_desc, + bool outer_l4; + + outer_l4 = (m->ol_flags & PKT_TX_L4_MASK); + + EFX_POPULATE_OWORD_5(*tx_desc, ESF_GZ_TX_SEND_ADDR, rte_mbuf_data_iova(m), ESF_GZ_TX_SEND_LEN, rte_pktmbuf_data_len(m), ESF_GZ_TX_SEND_NUM_SEGS, m->nb_segs, + ESF_GZ_TX_SEND_CSO_OUTER_L4, outer_l4, ESF_GZ_TX_DESC_TYPE, ESE_GZ_TX_DESC_TYPE_SEND); } @@ -592,7 +597,9 @@ struct sfc_dp_tx sfc_ef100_tx = { }, .features = SFC_DP_TX_FEAT_MULTI_PROCESS, .dev_offload_capa = 0, - .queue_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS, + .queue_offload_capa = DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_MULTI_SEGS, .get_dev_info = sfc_ef100_get_dev_info, .qsize_up_rings = sfc_ef100_tx_qsize_up_rings, .qcreate = sfc_ef100_tx_qcreate,