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 A6211A0C47; Wed, 27 Oct 2021 14:57:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E6E6407FF; Wed, 27 Oct 2021 14:57:45 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 0DD2C4068C for ; Wed, 27 Oct 2021 14:57:42 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10149"; a="228903767" X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="228903767" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 05:57:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="537551259" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga008.fm.intel.com with ESMTP; 27 Oct 2021 05:57:40 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 27 Oct 2021 05:57:40 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 27 Oct 2021 05:57:40 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 27 Oct 2021 05:57:40 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.45) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 27 Oct 2021 05:57:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8Q6EevDyI4/nax9VXvrAV8UNf1hI9qCX8AU/GmhYp8vwoPkWcfBd2TN8/XXyJY4oCnediCR/mShQmzoBspqJrut7ZVrOFj27Gksoj4lHo4MlSlKdrla+HOToV+A1bFHpw09p82zQyxEp52yCD8xcn4qtBb3Adxj2DHgsK7rFSbuKuAY6pSPLtKRKjTfre/iLbp0YRMaYkuQ1URwfCaUpwL9kA6nDRRceqs4+yHr7RhbwIyfe1k0ZPLPWD4IGtn++tVeOLO9hQLdKVREW/R1ucQ6VqOpAF7ORadiFN+5hFx79AcmoAE2sNRoO9yKF7PFtjljfNJf648h2bemLuVvhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C+KaR6ght0NNvpNTrvKo7EiVCrobGVgKhab/nq0rq5c=; b=GdtgvzSuOJYrzWR6EpnHfY8RQ6vi3fvRO3mIhV/fqDwsf4WaHxrBiDbFmZCEM8K90LDO/+ARc0zVrk+Qs3iLYMAWXL1T+UioaX6De+QKXJd2X482Pxlz7GoXJE5m2n9W/3YNAhjWiSbXijG1sCqLjM8Yh8oBHZVSqmtJ/p2HfnbYrBMszJcZSAOku17xA8zy/FfdJqKKq5TO27QHUB8N+uyHIqSjrSYoAW3DzG4IOcBgFd/Gh2o4mX0eASwa8hzmuxP++6TIjFILK4cnGiMqzTtaEj5t52b1bOvonY2Yu6w1RyB9bBPZBPqcUbtSf8XEW5nQphOTI9gMkEA9NuLVYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C+KaR6ght0NNvpNTrvKo7EiVCrobGVgKhab/nq0rq5c=; b=OKw4v0CfzvEfOg3vZ0BUmiQ3z15/K/vd47NkV79SRQ5+R/CsDccdXXKIV9gZT1Dizy/8oUJhD09ERpYLu9VyX2FEvpF/vfxTlv4n4f7auG60wMSzO5oFJTx89vrcOcfl0Vj3mFCQ89KNAIYZ38yjwX6WkRpK5EhpAXsMtxIvUNo= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB4868.namprd11.prod.outlook.com (2603:10b6:303:90::19) by MWHPR1101MB2335.namprd11.prod.outlook.com (2603:10b6:300:73::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Wed, 27 Oct 2021 12:57:38 +0000 Received: from CO1PR11MB4868.namprd11.prod.outlook.com ([fe80::7c6e:d458:33ed:e579]) by CO1PR11MB4868.namprd11.prod.outlook.com ([fe80::7c6e:d458:33ed:e579%8]) with mapi id 15.20.4649.015; Wed, 27 Oct 2021 12:57:38 +0000 From: "Nicolau, Radu" To: "Ananyev, Konstantin" , Akhil Goyal CC: "dev@dpdk.org" , "anoobj@marvell.com" , "Doherty, Declan" References: <20211027112706.2242158-1-radu.nicolau@intel.com> <20211027112706.2242158-3-radu.nicolau@intel.com> Message-ID: Date: Wed, 27 Oct 2021 13:57:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: DU2PR04CA0192.eurprd04.prod.outlook.com (2603:10a6:10:28d::17) To CO1PR11MB4868.namprd11.prod.outlook.com (2603:10b6:303:90::19) MIME-Version: 1.0 Received: from [192.168.1.21] (109.255.186.106) by DU2PR04CA0192.eurprd04.prod.outlook.com (2603:10a6:10:28d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.20 via Frontend Transport; Wed, 27 Oct 2021 12:57:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6131efdd-fc7e-4001-e2a1-08d999495a9a X-MS-TrafficTypeDiagnostic: MWHPR1101MB2335: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q2FiUsZ1zOjnktsVF4ui3Jvcokup+xQeioCWdRHkfn/ZcjsO44rX/x0A5wV7p6148Jl/aHnAUZvY+nA3yDelX33X5/t63RqptrBh16S8+YtTzbdMxAs52apcqOpJLoNtH8MTaOPpXZA9EwoD5Jih5PNF56J1GdajezSgooRoqyMCWLvQg9ilMFPey/dDPPTiO6QiOTtK9XKthMGkY1ALFxPkA5WMJWNNEQXfDHWKldLTIy1ypIgr2tvbPsY8ldWjIUgAsjeju98IgU0YGUli/5IGyKn/pyIP0JDLBDZMgj2KF1JjFc+47MwNzdXNWZJeAedkq3mHadn6Wn5MFq8x1HkHm1g8qYMdmwZc6KKGQCSk224eC22RZ+niHYlhAT+s4UudcoUdpoKXXtXnqTNMB4MMxqo1/SciMHbT3WXQuAwVwTpB9cBMQfWnNigBXE+h/dguITdcsezzqyUjmsDHvLUzfLw3xwb9YXkmed5BuyhTe6uWJTHEgkNP8SKK+aQBAr0RfKXlF5p8o8hEYGI5s/nRxW+R9FkaT5BLzHJQw/PDCEoChl7ywTOzrEGD5tI9x2Cj70RlubGgFzN99ghG0LgSKG6btN4heqUfV8bvagceLGWYbijnI7kqy6yMAxd/DhaXAC3HvM9p3E3I19ntJSO+h0j0nisSHQbBZnxmYaIYg3RLY4+M2QSKlOqh+8wLPZHv0rBW1sLlpwOd2Fo1uOYFDim4S/s6qa/YOP71JzY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB4868.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(110136005)(54906003)(86362001)(82960400001)(4326008)(38100700002)(186003)(316002)(8936002)(2906002)(5660300002)(53546011)(508600001)(55236004)(2616005)(66946007)(36756003)(31686004)(956004)(107886003)(6666004)(26005)(66476007)(66556008)(8676002)(16576012)(31696002)(83380400001)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NzBLQzl4NUhTY1BHV2dxWVBxbkFxNjEvSlkyc0J1bEsvYjE2YVQrWmk1bnNM?= =?utf-8?B?Q0FheC9IbjVBMld4ZVBwSU9HRlcrTHR2cnRUZENDanpRWEFMQUJRSFcwSjFR?= =?utf-8?B?aVQvenJGM2tqMm1VbVJZTTFTSDZwa20wT3NkdkdpdCt2MjlrSzJTTmNnaUlQ?= =?utf-8?B?bU4yV1BmcE1ob1FSaGdRdjFzdFpzbXo2b0VzaFpnbFJZZ0dSUFlpTG5GNTZC?= =?utf-8?B?a0dLRDNqNmUzdFl3SlRLVFRuZ3l2S1JjWU5XUUpoV1BMSDJvSDc2VzBVbHIx?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R0VSQVp2bnFrWG96bEN6R0l1ZW5v?= =?utf-8?B?bDFKcDF0Ym92NHdMTzVpeWZqSjhEaDFzYnh1ZUNQVzU0WExQRVV0ZjlsU3I4?= =?utf-8?Q?u4azCAaVpV0RyaOBmRomPlM=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6131efdd-fc7e-4001-e2a1-08d999495a9a X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4868.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2021 12:57:38.3777 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hi8gxN5qmmNF7mpSoqe5g7mSo8YhqVyRZGe60BHLNJdrUUEUdER1k3iS54j27psm0Hx/M1XGNsSyOb7hByqgTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2335 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 2/2] examples/ipsec-secgw: add support for TSO 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" I'm seeing this problem: if we support both TCP and UDP TSO then we will check the TX offloads for both (and IPsec) and so far the only PMDs that support IPsec and TSO only support TCP TSO. So I will rework the patch to only enable TSO for TCP Inline crypto. On 10/27/2021 1:44 PM, Nicolau, Radu wrote: > > On 10/27/2021 1:02 PM, Ananyev, Konstantin wrote: >> >>> Add support to allow user to specific MSS for TSO offload on a per SA >>> basis. MSS configuration in the context of IPsec is only supported for >>> outbound SA's in the context of an inline IPsec Crypto offload. >>> >>> Signed-off-by: Declan Doherty >>> Signed-off-by: Radu Nicolau >>> --- >>>   doc/guides/rel_notes/release_21_11.rst   |  4 ++++ >>>   doc/guides/sample_app_ug/ipsec_secgw.rst | 11 +++++++++++ >>>   examples/ipsec-secgw/ipsec-secgw.c       |  4 ++++ >>>   examples/ipsec-secgw/ipsec.h             |  1 + >>>   examples/ipsec-secgw/ipsec_process.c     | 25 >>> ++++++++++++++++++++++++ >>>   examples/ipsec-secgw/sa.c                | 21 ++++++++++++++++++-- >>>   6 files changed, 64 insertions(+), 2 deletions(-) >>> >>> diff --git a/doc/guides/rel_notes/release_21_11.rst >>> b/doc/guides/rel_notes/release_21_11.rst >>> index b5b5abadee..8d1767b084 100644 >>> --- a/doc/guides/rel_notes/release_21_11.rst >>> +++ b/doc/guides/rel_notes/release_21_11.rst >>> @@ -306,6 +306,10 @@ New Features >>>       * Pcapng format with timestamps and meta-data. >>>       * Fixes packet capture with stripped VLAN tags. >>> >>> +* **IPsec Security Gateway sample application new features.** >>> + >>> +  * Added support for TSO >>> + >>> >>>   Removed Items >>>   ------------- >>> diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst >>> b/doc/guides/sample_app_ug/ipsec_secgw.rst >>> index 782574dd39..639d309a6e 100644 >>> --- a/doc/guides/sample_app_ug/ipsec_secgw.rst >>> +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst >>> @@ -720,6 +720,17 @@ where each options means: >>> >>>      * *udp-encap* >>> >>> + ```` >>> + >>> + * Maximum segment size for TSO offload, available for egress SAs >>> only. >>> + >>> + * Optional: Yes, TSO offload not set by default >>> + >>> + * Syntax: >>> + >>> +   * *mss N* N is the segment size in bytes >>> + >>> + >>>   Example SA rules: >>> >>>   .. code-block:: console >>> diff --git a/examples/ipsec-secgw/ipsec-secgw.c >>> b/examples/ipsec-secgw/ipsec-secgw.c >>> index 4bdf99b62b..5fcf424efe 100644 >>> --- a/examples/ipsec-secgw/ipsec-secgw.c >>> +++ b/examples/ipsec-secgw/ipsec-secgw.c >>> @@ -398,6 +398,10 @@ prepare_one_packet(struct rte_mbuf *pkt, struct >>> ipsec_traffic *t) >>>           pkt->l2_len = 0; >>>           pkt->l3_len = sizeof(*iph4); >>>           pkt->packet_type |= RTE_PTYPE_L3_IPV4; >>> +        if  (pkt->packet_type & RTE_PTYPE_L4_TCP) >>> +            pkt->l4_len = sizeof(struct rte_tcp_hdr); >>> +        else if (pkt->packet_type & RTE_PTYPE_L4_UDP) >>> +            pkt->l4_len = sizeof(struct rte_udp_hdr); >>>       } else if (eth->ether_type == >>> rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { >>>           int next_proto; >>>           size_t l3len, ext_len; >>> diff --git a/examples/ipsec-secgw/ipsec.h >>> b/examples/ipsec-secgw/ipsec.h >>> index 8405c48171..2c3640833d 100644 >>> --- a/examples/ipsec-secgw/ipsec.h >>> +++ b/examples/ipsec-secgw/ipsec.h >>> @@ -137,6 +137,7 @@ struct ipsec_sa { >>>       enum rte_security_ipsec_sa_direction direction; >>>       uint8_t udp_encap; >>>       uint16_t portid; >>> +    uint16_t mss; >>>       uint8_t fdir_qid; >>>       uint8_t fdir_flag; >>> >>> diff --git a/examples/ipsec-secgw/ipsec_process.c >>> b/examples/ipsec-secgw/ipsec_process.c >>> index 5012e1a6a4..26c6c2fe84 100644 >>> --- a/examples/ipsec-secgw/ipsec_process.c >>> +++ b/examples/ipsec-secgw/ipsec_process.c >>> @@ -222,6 +222,31 @@ prep_process_group(void *sa, struct rte_mbuf >>> *mb[], uint32_t cnt) >>>       for (j = 0; j != cnt; j++) { >>>           priv = get_priv(mb[j]); >>>           priv->sa = sa; >>> +        /* setup TSO related fields if TSO enabled*/ >>> +        if (priv->sa->mss) { >>> +            mb[j]->tso_segsz = priv->sa->mss; >>> + >>> +            if ((IS_TUNNEL(priv->sa->flags))) { >>> +                mb[j]->outer_l3_len = mb[j]->l3_len; >>> +                mb[j]->outer_l2_len = mb[j]->l2_len; >>> +                mb[j]->ol_flags |= >>> +                (RTE_MBUF_F_TX_OUTER_IP_CKSUM | >>> +                        RTE_MBUF_F_TX_TUNNEL_ESP); >>> +            } >>> +            uint32_t ptype = mb[j]->packet_type; >>> +            if  (ptype & RTE_PTYPE_L4_TCP) >>> +                mb[j]->ol_flags |= >>> +                        (RTE_MBUF_F_TX_TCP_SEG | >>> +                        RTE_MBUF_F_TX_TCP_CKSUM); >>> +            else >>> +                mb[j]->ol_flags |= >>> +                    (RTE_MBUF_F_TX_UDP_SEG | >>> +                        RTE_MBUF_F_TX_UDP_CKSUM); >> Could it be that packet is neither TCP nor UDP? > Yes, I will add a third branch for unsupported packet type. >> >>> +            if (RTE_ETH_IS_IPV4_HDR(ptype)) >>> +                mb[j]->ol_flags |= RTE_MBUF_F_TX_OUTER_IPV4; >>> +            else >>> +                mb[j]->ol_flags |= RTE_MBUF_F_TX_OUTER_IPV6; >>> +        } >>>       } >>>   } >>> >>> diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c >>> index 88dd30464f..e8815dffe7 100644 >>> --- a/examples/ipsec-secgw/sa.c >>> +++ b/examples/ipsec-secgw/sa.c >>> @@ -677,6 +677,16 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, >>>               continue; >>>           } >>> >>> +        if (strcmp(tokens[ti], "mss") == 0) { >>> +            INCREMENT_TOKEN_INDEX(ti, n_tokens, status); >>> +            if (status->status < 0) >>> +                return; >>> +            rule->mss = atoi(tokens[ti]); >>> +            if (status->status < 0) >>> +                return; >>> +            continue; >>> +        } >>> + >>>           if (strcmp(tokens[ti], "fallback") == 0) { >>>               struct rte_ipsec_session *fb; >>> >>> @@ -970,7 +980,7 @@ sa_create(const char *name, int32_t socket_id, >>> uint32_t nb_sa) >>>   } >>> >>>   static int >>> -check_eth_dev_caps(uint16_t portid, uint32_t inbound) >>> +check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) >>>   { >>>       struct rte_eth_dev_info dev_info; >>>       int retval; >>> @@ -999,6 +1009,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t >>> inbound) >>>                   "hardware TX IPSec offload is not supported\n"); >>>               return -EINVAL; >>>           } >>> +        if (tso && (dev_info.tx_offload_capa & >>> +                (RTE_ETH_TX_OFFLOAD_TCP_TSO | >>> +                    RTE_ETH_TX_OFFLOAD_UDP_TSO)) == 0) { >> Shouldn't it be: >> dev_info.tx_offload_capa & (RTE_ETH_TX_OFFLOAD_TCP_TSO | >> RTE_ETH_TX_OFFLOAD_UDP_TSO)) == >> RTE_ETH_TX_OFFLOAD_TCP_TSO | RTE_ETH_TX_OFFLOAD_UDP_TSO) >> ? > It should be that but negated, if none of the flags are set we exit - > we can't tell at this point if we need TCP or UDP. >> >>> +            RTE_LOG(WARNING, PORT, >>> +                "hardware TSO offload is not supported\n"); >>> +            return -EINVAL; >>> +        } >>>       } >>>       return 0; >>>   } >> I think you missed changes in a_check_offloads(). >> That's where we specify which HW offloads should be enabled for given >> port. > Yes. >> >> >>> @@ -1127,7 +1144,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const >>> struct ipsec_sa entries[], >>> >>>           if (ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL || >>>               ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) { >>> -            if (check_eth_dev_caps(sa->portid, inbound)) >>> +            if (check_eth_dev_caps(sa->portid, inbound, sa->mss)) >>>                   return -EINVAL; >>>           } >>> >>> -- >>> 2.25.1