From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F97741E9B; Wed, 15 Mar 2023 09:41:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0254440EE4; Wed, 15 Mar 2023 09:41:44 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 26418400EF for ; Wed, 15 Mar 2023 09:41:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678869702; x=1710405702; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DNBpx6htOtkwXrQHmh0KcuLThzhO14GoLvgMIF/mK3s=; b=Q6jtKbAUODpqWhxEWTdUy+LrdR6bCb9q1mejk4xL0lU1UtLQE1R8HIPN 2j7vQPtuazcbXbCw2QOH2/083++0QJxZFQS9GQ6EGUW6H0JHGYEtLx41J r0JRxjXeZOsIvgGjvYajGQKgi6MFCgsLueQBKAYcdNG1Ey9lP5EGpf9n3 JCfBmcJ5zb5iRuYUfM3RPe67pSp30kBlbCT7PolE4LWEi0Qz5cRFd3Lyp rcsLGvANq2/QWis4irrjv8jap3hrsIyO+syZPjIU8R75rE5ohMylkphSk XkRbiUcp0v9E3REHuCH61bgQJf0y6Y1U1uU4rtNCIFamsnMPs/ztf9q5/ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="402518577" X-IronPort-AV: E=Sophos;i="5.98,262,1673942400"; d="scan'208";a="402518577" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2023 01:41:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="681750244" X-IronPort-AV: E=Sophos;i="5.98,262,1673942400"; d="scan'208";a="681750244" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2023 01:41:37 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, yidingx.zhou@intel.com, ke1.xu@intel.com, zhiminx.huang@intel.com, Zhichao Zeng , Bruce Richardson , Konstantin Ananyev , Jingjing Wu , Beilei Xing Subject: [PATCH] net/iavf: fix VLAN Tx in AVX512 Date: Wed, 15 Mar 2023 16:46:17 +0800 Message-Id: <20230315084617.432821-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch fixes the insertion of the Vlan tci, which was broken by previous incorrect modification. Fixes: 4f8259df563a ("net/iavf: enable Tx outer checksum offload on AVX512") Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 30 ++++++++++++------------- drivers/net/iavf/iavf_rxtx_vec_common.h | 5 ++--- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c index 6d6e227bc4..4fe9b97278 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c @@ -1764,14 +1764,14 @@ tx_backlog_entry_avx512(struct iavf_tx_vec_entry *txep, static __rte_always_inline void iavf_vtx1(volatile struct iavf_tx_desc *txdp, struct rte_mbuf *pkt, uint64_t flags, - bool offload, uint8_t vlan_flag) + bool offload) { uint64_t high_qw = (IAVF_TX_DESC_DTYPE_DATA | ((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT) | ((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT)); if (offload) - iavf_txd_enable_offload(pkt, &high_qw, vlan_flag); + iavf_txd_enable_offload(pkt, &high_qw); __m128i descriptor = _mm_set_epi64x(high_qw, pkt->buf_iova + pkt->data_off); @@ -1783,14 +1783,14 @@ iavf_vtx1(volatile struct iavf_tx_desc *txdp, static __rte_always_inline void iavf_vtx(volatile struct iavf_tx_desc *txdp, struct rte_mbuf **pkt, uint16_t nb_pkts, uint64_t flags, - bool offload, uint8_t vlan_flag) + bool offload) { const uint64_t hi_qw_tmpl = (IAVF_TX_DESC_DTYPE_DATA | ((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT)); /* if unaligned on 32-bit boundary, do one to align */ if (((uintptr_t)txdp & 0x1F) != 0 && nb_pkts != 0) { - iavf_vtx1(txdp, *pkt, flags, offload, vlan_flag); + iavf_vtx1(txdp, *pkt, flags, offload); nb_pkts--, txdp++, pkt++; } @@ -1813,10 +1813,10 @@ iavf_vtx(volatile struct iavf_tx_desc *txdp, ((uint64_t)pkt[0]->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT); if (offload) { - iavf_txd_enable_offload(pkt[3], &hi_qw3, vlan_flag); - iavf_txd_enable_offload(pkt[2], &hi_qw2, vlan_flag); - iavf_txd_enable_offload(pkt[1], &hi_qw1, vlan_flag); - iavf_txd_enable_offload(pkt[0], &hi_qw0, vlan_flag); + iavf_txd_enable_offload(pkt[3], &hi_qw3); + iavf_txd_enable_offload(pkt[2], &hi_qw2); + iavf_txd_enable_offload(pkt[1], &hi_qw1); + iavf_txd_enable_offload(pkt[0], &hi_qw0); } __m512i desc0_3 = @@ -1834,7 +1834,7 @@ iavf_vtx(volatile struct iavf_tx_desc *txdp, /* do any last ones */ while (nb_pkts) { - iavf_vtx1(txdp, *pkt, flags, offload, vlan_flag); + iavf_vtx1(txdp, *pkt, flags, offload); txdp++, pkt++, nb_pkts--; } } @@ -2009,7 +2009,7 @@ ctx_vtx1(volatile struct iavf_tx_desc *txdp, struct rte_mbuf *pkt, ((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT) | ((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT)); if (offload) - iavf_txd_enable_offload(pkt, &high_data_qw, vlan_flag); + iavf_txd_enable_offload(pkt, &high_data_qw); __m256i ctx_data_desc = _mm256_set_epi64x(high_data_qw, pkt->buf_iova + pkt->data_off, high_ctx_qw, low_ctx_qw); @@ -2071,8 +2071,8 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp, } if (offload) { - iavf_txd_enable_offload(pkt[1], &hi_data_qw1, vlan_flag); - iavf_txd_enable_offload(pkt[0], &hi_data_qw0, vlan_flag); + iavf_txd_enable_offload(pkt[1], &hi_data_qw1); + iavf_txd_enable_offload(pkt[0], &hi_data_qw0); iavf_fill_ctx_desc_tunnelling_field(&low_ctx_qw1, pkt[1]); iavf_fill_ctx_desc_tunnelling_field(&low_ctx_qw0, pkt[0]); } @@ -2120,11 +2120,11 @@ iavf_xmit_fixed_burst_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts, if (nb_commit >= n) { tx_backlog_entry_avx512(txep, tx_pkts, n); - iavf_vtx(txdp, tx_pkts, n - 1, flags, offload, txq->vlan_flag); + iavf_vtx(txdp, tx_pkts, n - 1, flags, offload); tx_pkts += (n - 1); txdp += (n - 1); - iavf_vtx1(txdp, *tx_pkts++, rs, offload, txq->vlan_flag); + iavf_vtx1(txdp, *tx_pkts++, rs, offload); nb_commit = (uint16_t)(nb_commit - n); @@ -2139,7 +2139,7 @@ iavf_xmit_fixed_burst_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts, tx_backlog_entry_avx512(txep, tx_pkts, nb_commit); - iavf_vtx(txdp, tx_pkts, nb_commit, flags, offload, txq->vlan_flag); + iavf_vtx(txdp, tx_pkts, nb_commit, flags, offload); tx_id = (uint16_t)(tx_id + nb_commit); if (tx_id > txq->next_rs) { diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h b/drivers/net/iavf/iavf_rxtx_vec_common.h index 9cc1a69dce..cc38f70ce2 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_common.h +++ b/drivers/net/iavf/iavf_rxtx_vec_common.h @@ -328,7 +328,7 @@ iavf_tx_vec_dev_check_default(struct rte_eth_dev *dev) static __rte_always_inline void iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt, - uint64_t *txd_hi, uint8_t vlan_flag) + uint64_t *txd_hi) { #if defined(IAVF_TX_CSUM_OFFLOAD) || defined(IAVF_TX_VLAN_QINQ_OFFLOAD) uint64_t ol_flags = tx_pkt->ol_flags; @@ -389,8 +389,7 @@ iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt, #endif #ifdef IAVF_TX_VLAN_QINQ_OFFLOAD - if ((ol_flags & (RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_QINQ)) && - (vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG1)) { + if (ol_flags & (RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_QINQ)) { td_cmd |= IAVF_TX_DESC_CMD_IL2TAG1; *txd_hi |= ((uint64_t)tx_pkt->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT); -- 2.25.1