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 18C02A0558 for ; Wed, 25 May 2022 15:59:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 152CB42B76; Wed, 25 May 2022 15:59:29 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 1197742B6E; Wed, 25 May 2022 15:59:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653487164; x=1685023164; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q9ZqCNz9aThgsnUOCaDpkhMi9qBMO5xfF6clfhLl2uw=; b=jJJN74F/tfwb0uh3J2kTVRqCmCyA4sbu8QK6IZ+shc548t1ZXiJKOEF/ tsz5wnbzlFZkwJpB9Bz5sVs2phaFZhXq3gzOqn69s9O/7gBrrp+j+A1LZ hY5kN+TJyPR3sEhkehfXDMdZPjXkuabLiQZgqpRmYbnlTSYp7F9QAZops BSvRvBJtaaQRIrT0kodKyNCZEMeoa9PaCx3DAxIr//lSBD9LXNgbfUPxC tYfaCAx2CvC0Js4NGyFcs5dNJ3TFAcmEcfcLdcbTwVXEePOx6yrehn6oy qfd/6WPz/nCSmwSmEaf4l1BGCYVLSd039QCuY1pboSScG8aIschwcRPF2 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="299152584" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="299152584" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 06:59:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="745757100" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by orsmga005.jf.intel.com with ESMTP; 25 May 2022 06:59:20 -0700 From: Radu Nicolau To: Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, daniel.m.buckley@intel.com, qi.z.zhang@intel.com, Radu Nicolau , stable@dpdk.org Subject: [PATCH 3/3] net/iavf: fix NAT-T payload length Date: Wed, 25 May 2022 14:59:12 +0100 Message-Id: <20220525135912.181765-3-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220525135912.181765-1-radu.nicolau@intel.com> References: <20220525135912.181765-1-radu.nicolau@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Correct the length calculation used for NAT-T Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau --- drivers/net/iavf/iavf_ipsec_crypto.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c index b1949cee91..b398819096 100644 --- a/drivers/net/iavf/iavf_ipsec_crypto.c +++ b/drivers/net/iavf/iavf_ipsec_crypto.c @@ -1118,11 +1118,14 @@ iavf_ipsec_crypto_compute_l4_payload_length(struct rte_mbuf *m, * ipv4/6 hdr + ext hdrs */ - if (s->udp_encap.enabled) + if (s->udp_encap.enabled) { ol4_len = sizeof(struct rte_udp_hdr); - - l3_len = m->l3_len; - l4_len = m->l4_len; + l3_len = m->l3_len - ol4_len; + l4_len = l3_len; + } else { + l3_len = m->l3_len; + l4_len = m->l4_len; + } return rte_pktmbuf_pkt_len(m) - (ol2_len + ol3_len + ol4_len + esp_hlen + l3_len + l4_len + esp_tlen); -- 2.25.1