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 A5C91A0C54; Fri, 3 Sep 2021 13:29:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FE6D410E3; Fri, 3 Sep 2021 13:28:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id D525640E3C for ; Fri, 3 Sep 2021 13:28:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10095"; a="206516709" X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="206516709" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 04:28:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="533996163" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by FMSMGA003.fm.intel.com with ESMTP; 03 Sep 2021 04:28:55 -0700 From: Radu Nicolau To: Radu Nicolau , Akhil Goyal Cc: dev@dpdk.org, declan.doherty@intel.com Date: Fri, 3 Sep 2021 12:22:51 +0100 Message-Id: <20210903112257.303961-2-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210903112257.303961-1-radu.nicolau@intel.com> References: <20210903112257.303961-1-radu.nicolau@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/7] examples/ipsec-secgw: add ol_flags support 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 Sender: "dev" Add support for ol_flags to the IPsec GW sample app. Signed-off-by: Declan Doherty Signed-off-by: Radu Nicolau --- examples/ipsec-secgw/ipsec-secgw.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index f252d34985..6d516e2221 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -515,7 +515,7 @@ prepare_traffic(struct rte_mbuf **pkts, struct ipsec_traffic *t, static inline void prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port, - const struct lcore_conf *qconf) + const struct lcore_conf *qconf __rte_unused) { struct ip *ip; struct rte_ether_hdr *ethhdr; @@ -526,20 +526,17 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port, rte_pktmbuf_prepend(pkt, RTE_ETHER_HDR_LEN); if (ip->ip_v == IPVERSION) { - pkt->ol_flags |= qconf->outbound.ipv4_offloads; - pkt->l3_len = sizeof(struct ip); pkt->l2_len = RTE_ETHER_HDR_LEN; - ip->ip_sum = 0; - /* calculate IPv4 cksum in SW */ - if ((pkt->ol_flags & PKT_TX_IP_CKSUM) == 0) + if ((pkt->ol_flags & + (PKT_TX_IP_CKSUM | PKT_TX_OUTER_IP_CKSUM)) == 0) ip->ip_sum = rte_ipv4_cksum((struct rte_ipv4_hdr *)ip); + else + ip->ip_sum = 0; ethhdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); } else { - pkt->ol_flags |= qconf->outbound.ipv6_offloads; - pkt->l3_len = sizeof(struct ip6_hdr); pkt->l2_len = RTE_ETHER_HDR_LEN; ethhdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); -- 2.25.1