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 AFF3DA00C2; Thu, 10 Feb 2022 14:09:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EC14411AE; Thu, 10 Feb 2022 14:09:30 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id EABBA4013F for ; Thu, 10 Feb 2022 14:09:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644498569; x=1676034569; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eOECmUFITmynPHTPUN+JWTQPZnlSLl5gQ/vH8UVJPlU=; b=dXxk6/i9W3qmEcE5BqdGhFpz011ceE6+Az9oRn/oJxvR3AT8bLYb8dMG qCtt6NzgdYtNcGlAftJH3wU4ttGVKicCoDn9VUKSc0z25bOCrcbxc3I8F x6Fn1mV3H4txOR+EH/+TOC0AOHjqaUPOkpEel4qiMPm6yrE732xe7MmHi X6GE7SugFOS0YSr2/oiOqKYWlfUEryCF9wyXv75m6KMSV3SslUJnVDFqT o7flOHgfkkJ8C3tuAp0nB7RXeuvoReys2Sx+Xt0J8gfgzit/0V+g9rGZI yKoeAXnyEag8IRYcP71vy0SjVpjdgoL7lJkhFQo4vQpGyRyxtRoTU9X3T w==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="229453526" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="229453526" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 05:09:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622673119" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 05:09:26 -0800 From: Radu Nicolau To: Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, yux.jiang@intel.com, Radu Nicolau Subject: [PATCH] net/iavf: fix segmentation offload buffer size Date: Thu, 10 Feb 2022 13:09:23 +0000 Message-Id: <20220210130923.1442905-1-radu.nicolau@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 reverts commit ff8b8bcd2ebe, which resulted in incorrect buffer size being computed for TSO packets. Fixes: ff8b8bcd2ebe ("net/iavf: fix segmentation offload condition") Signed-off-by: Radu Nicolau --- drivers/net/iavf/iavf_rxtx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index b0fed1b992..ba272bb211 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2464,9 +2464,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 -- 2.25.1