The iavf driver included two #defines which enabled the QinQ and
checksum offload in the code. The intent as documented in code comments
was that any user not taking advantage of these features could remove
the #defines to cut out some code. However, this was never actually
publicly documented, and the use of these defines was never tested in
any builds, making them fragile - if not already broken. Therefore, just
remove these build time macros.

Signed-off-by: Bruce Richardson <[email protected]>
---
 drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c   |  6 ------
 drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c |  6 ------
 drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 18 ------------------
 3 files changed, 30 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c 
b/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c
index d05e6101ad..7217f32cef 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c
@@ -1910,7 +1910,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct 
rte_mbuf *pkt,

        if (offload) {
                iavf_fill_ctx_desc_tunneling_avx2(&low_ctx_qw, pkt);
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
                if (pkt->ol_flags & RTE_MBUF_F_TX_QINQ) {
                        uint64_t qinq_tag = vlan_flag & 
IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ?
                                (uint64_t)pkt->vlan_tci_outer :
@@ -1922,7 +1921,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct 
rte_mbuf *pkt,
                        high_ctx_qw |= IAVF_TX_CTX_DESC_IL2TAG2 << 
IAVF_TXD_CTX_QW1_CMD_SHIFT;
                        low_ctx_qw |= (uint64_t)pkt->vlan_tci << 
IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
                }
-#endif
        }
        if (IAVF_CHECK_TX_LLDP(pkt, ptype_lldp_enabled))
                high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << 
IAVF_TXD_CTX_QW1_CMD_SHIFT;
@@ -1967,7 +1965,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
                                ((uint64_t)pkt[0]->data_len <<
                                        IAVF_TXD_QW1_TX_BUF_SZ_SHIFT);

-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
                if (offload) {
                        /* tunnel fill assigns low_ctx_qw1; must run before 
QinQ/VLAN OR below */
                        iavf_fill_ctx_desc_tunneling_field(&low_ctx_qw1, 
pkt[1]);
@@ -1986,11 +1983,9 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
                                        (uint64_t)pkt[1]->vlan_tci << 
IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
                        }
                }
-#endif
                if (IAVF_CHECK_TX_LLDP(pkt[1], ptype_lldp_enabled))
                        hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << 
IAVF_TXD_CTX_QW1_CMD_SHIFT;

-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
                if (offload) {
                        /* tunnel fill assigns low_ctx_qw0; must run before 
QinQ/VLAN OR below */
                        iavf_fill_ctx_desc_tunneling_field(&low_ctx_qw0, 
pkt[0]);
@@ -2009,7 +2004,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
                                        (uint64_t)pkt[0]->vlan_tci << 
IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
                        }
                }
-#endif
                if (IAVF_CHECK_TX_LLDP(pkt[0], ptype_lldp_enabled))
                        hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << 
IAVF_TXD_CTX_QW1_CMD_SHIFT;

diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c 
b/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c
index bae9b2af9c..bf0245e8f4 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c
@@ -2054,7 +2054,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct 
rte_mbuf *pkt,

        if (offload) {
                iavf_fill_ctx_desc_tunneling_avx512(&low_ctx_qw, pkt);
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
                if (pkt->ol_flags & RTE_MBUF_F_TX_QINQ) {
                        uint64_t qinq_tag = vlan_flag & 
IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ?
                                (uint64_t)pkt->vlan_tci_outer :
@@ -2066,7 +2065,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct 
rte_mbuf *pkt,
                        high_ctx_qw |= IAVF_TX_CTX_DESC_IL2TAG2 << 
IAVF_TXD_CTX_QW1_CMD_SHIFT;
                        low_ctx_qw |= (uint64_t)pkt->vlan_tci << 
IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
                }
-#endif
        }
        if (IAVF_CHECK_TX_LLDP(pkt, lldp_enabled))
                high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
@@ -2109,7 +2107,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
                hi_data_qw0 = hi_data_qw_tmpl |
                                ((uint64_t)pkt[0]->data_len << 
CI_TXD_QW1_TX_BUF_SZ_S);

-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
                if (offload) {
                        /* tunnel fill assigns low_ctx_qw1; must run before 
QinQ/VLAN OR below */
                        iavf_fill_ctx_desc_tunnelling_field(&low_ctx_qw1, 
pkt[1]);
@@ -2126,12 +2123,10 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
                                        (uint64_t)pkt[1]->vlan_tci << 
IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
                        }
                }
-#endif
                if (IAVF_CHECK_TX_LLDP(pkt[1], lldp_enabled))
                        hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
                                << CI_TXD_QW1_CMD_S;

-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
                if (offload) {
                        /* tunnel fill assigns low_ctx_qw0; must run before 
QinQ/VLAN OR below */
                        iavf_fill_ctx_desc_tunnelling_field(&low_ctx_qw0, 
pkt[0]);
@@ -2148,7 +2143,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
                                        (uint64_t)pkt[0]->vlan_tci << 
IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
                        }
                }
-#endif
                if (IAVF_CHECK_TX_LLDP(pkt[0], lldp_enabled))
                        hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << 
CI_TXD_QW1_CMD_S;

diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h 
b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
index 1538a44892..1e9ce924ee 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
@@ -119,31 +119,16 @@ iavf_tx_vec_dev_check_default(struct rte_eth_dev *dev)
        return ret;
 }

-/******************************************************************************
- * If user knows a specific offload is not enabled by APP,
- * the macro can be commented to save the effort of fast path.
- * Currently below 2 features are supported in TX path,
- * 1, checksum offload
- * 2, VLAN/QINQ insertion
- 
******************************************************************************/
-#define IAVF_TX_CSUM_OFFLOAD
-#define IAVF_TX_VLAN_QINQ_OFFLOAD
-
 static __rte_always_inline void
 iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
                        uint64_t *txd_hi, uint8_t vlan_flag)
 {
-#if defined(IAVF_TX_CSUM_OFFLOAD) || defined(IAVF_TX_VLAN_QINQ_OFFLOAD)
        uint64_t ol_flags = tx_pkt->ol_flags;
-#endif
        uint32_t td_cmd = 0;
-#ifdef IAVF_TX_CSUM_OFFLOAD
        uint32_t td_offset = 0;
-#endif

        RTE_SET_USED(vlan_flag);

-#ifdef IAVF_TX_CSUM_OFFLOAD
        /* Set MACLEN */
        if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
                td_offset |= (tx_pkt->outer_l2_len >> 1)
@@ -191,9 +176,7 @@ iavf_txd_enable_offload(__rte_unused struct rte_mbuf 
*tx_pkt,
        }

        *txd_hi |= ((uint64_t)td_offset) << CI_TXD_QW1_OFFSET_S;
-#endif

-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
        if (ol_flags & RTE_MBUF_F_TX_QINQ) {
                td_cmd |= IAVF_TX_DESC_CMD_IL2TAG1;
                /* vlan_flag specifies outer tag location for QinQ. */
@@ -205,7 +188,6 @@ iavf_txd_enable_offload(__rte_unused struct rte_mbuf 
*tx_pkt,
                td_cmd |= CI_TX_DESC_CMD_IL2TAG1;
                *txd_hi |= ((uint64_t)tx_pkt->vlan_tci << CI_TXD_QW1_L2TAG1_S);
        }
-#endif

        *txd_hi |= ((uint64_t)td_cmd) << CI_TXD_QW1_CMD_S;
 }
--
2.53.0

Reply via email to