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 C7940A00C5; Tue, 15 Feb 2022 16:50:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FD5E410F7; Tue, 15 Feb 2022 16:50:52 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id CA502410F3 for ; Tue, 15 Feb 2022 16:50:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644940251; x=1676476251; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z6UIdZ8w3w3rpHTirWLI9/dAMvVEwXX9j/WMM6bBufw=; b=ZcP0a+22fmXnBQaD6FNBQ1SX8sQPCUaCECj+85iAW+tznuXK1dY9VRov vCzWHdDrydWmBUTpe9Fv1l92eLQVG9+VLl8mCCjsMs75vK32ySn+VpKEX 6F4YphfijBIVkQaqp+FtSKCxz+ePWvLMvoiAKaNP447a6Lhg44xiX2MgP 5TO79f7hYqRdbEIKtyo9kAUmWpH1tB16dzjCQKPvOpY8QXeXcR5ysBoAj OBAK7qlMxnFEO5mUe0ivwFqNDj9zc7qG598MahddRA7adTeeOtQBgElzh HMWA6eY9BOFA6XUre4wwVqta411S52t8OoWflDev+euzUVfSP3PG+fxfq w==; X-IronPort-AV: E=McAfee;i="6200,9189,10258"; a="237783638" X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="237783638" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 07:50:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="635961568" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by orsmga004.jf.intel.com with ESMTP; 15 Feb 2022 07:50:26 -0800 From: Radu Nicolau To: Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, yux.jiang@intel.com, zhiminx.huang@intel.com, ferruh.yigit@intel.com, ingjing.wu@intel.com, bluca@debian.org, ktraynor@redhat.com, Radu Nicolau Subject: [PATCH v2] net/iavf: fix segmentation offload buffer size Date: Tue, 15 Feb 2022 15:50:23 +0000 Message-Id: <20220215155023.1542072-1-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210130923.1442905-1-radu.nicolau@intel.com> References: <20220210130923.1442905-1-radu.nicolau@intel.com> 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 fix commit ff8b8bcd2ebe, which resulted in incorrect buffer size being computed for non IPses TSO packets. Fixes: ff8b8bcd2ebe ("net/iavf: fix segmentation offload condition") Signed-off-by: Radu Nicolau --- v2: reworked it to fix the initial issue instead of just reverting ff8b8bcd2ebe drivers/net/iavf/iavf_rxtx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 41244055e5..ca54c70dd0 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2463,9 +2463,10 @@ iavf_fill_data_desc(volatile struct iavf_tx_desc *desc, desc->buffer_addr = rte_mbuf_data_iova(m); /* calculate data buffer size less set header lengths */ - if (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { - if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) - hdrlen += m->outer_l3_len; + if ((m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) && + (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | + RTE_MBUF_F_TX_UDP_SEG))) { + hdrlen += m->outer_l3_len; if (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) hdrlen += m->l3_len + m->l4_len; else @@ -2473,6 +2474,14 @@ iavf_fill_data_desc(volatile struct iavf_tx_desc *desc, if (m->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD) hdrlen += ipseclen; bufsz = hdrlen + tlen; + } else if ((m->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD) && + (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | + RTE_MBUF_F_TX_UDP_SEG))) { + hdrlen += m->outer_l3_len + m->l3_len + ipseclen; + if (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) + hdrlen += m->l4_len; + bufsz = hdrlen + tlen; + } else { bufsz = m->data_len; } -- 2.25.1