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 01EBCA0C43; Mon, 18 Oct 2021 18:33:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B870F40142; Mon, 18 Oct 2021 18:33:01 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 1C6C840141 for ; Mon, 18 Oct 2021 18:32:59 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10141"; a="251748016" X-IronPort-AV: E=Sophos;i="5.85,382,1624345200"; d="scan'208";a="251748016" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 09:32:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,382,1624345200"; d="scan'208";a="566127044" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by FMSMGA003.fm.intel.com with ESMTP; 18 Oct 2021 09:32:35 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 18 Oct 2021 09:32:35 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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; Mon, 18 Oct 2021 09:32:34 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 18 Oct 2021 09:32:34 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) 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; Mon, 18 Oct 2021 09:32:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DsPG2pRiFV4uJjguZb1dWw2hI8a5hvnK1pQoYyKQDWGsxd7pzBDj+wil5dw6UfZ4lZLvD2yP7ximK3t7jh2PEpCbG9Tl0F+TOVbzK6pGQc6yqXdM16E2Uh/41K5yhMD8ksn7h5Cx5J22DLfwb5RdB5L/kx0pziMaE0BdfgEYu4ZBgouWpXVE1UM7Wd/JMInKCnYu/Gysc/UaC3NAZy/RiJV7SzEFsHf4MExYrmZt47H4mH1nvRAXEINk0HXJlxJ3rWd56SkRUeSmrtjsJH3MkaSm+KqXP92q0eHaUYWEkHTeS71ASbyKekXsim37vpnZo4rSOyFoRxr2Xpg8+mG1MA== 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=9DpHhJSCWU26tkeflrhpOwMs3o1ViE7e2U51SXXbd+8=; b=R24wM1RaQ6YDabkKI8ZJ/SW14TBHcA88HUh/dkQgrswVkGYQ+XQ363L3grtmzpRrZIg9QjN8eE66IwjPgOrH7tY37rfpO7sz4QmkSUuqbEfSoly6FjVMHPMXCExP/8PxM80jYt/uQ2HTEJgENdo7NRbQtZyQainV1NRR0czSSrHeq0VKB8QopoK3BoSBd3y1gzuwp+ntLgGKcW9C8p0+/6qUiDv1OsPBgA0qCoKqdhDsmG9Tj3RXFGOZ2NH/It40ahuTG2J2wAEPnTFzsO0GIgVZ15Y/X5KdCevl1v5SpLZ32YUdrl+FC5wHk9xJ2NP/qUI3q26rCUTCEDuOCtxyeA== 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=9DpHhJSCWU26tkeflrhpOwMs3o1ViE7e2U51SXXbd+8=; b=J38j7QoUfx+EdjTE8zvu9uu5ZCInrE7eDv1u8FKqvzX+eQ4+YltwIqL9OFdKE54voAxtCtTlqrgKMwW8VgMLV7V7lBIB32YUnKY5UwO4MMQqp2OOZq+yhyz0VVk6Bl25oCMbKEuMaPRA07KGAJig/M2takSho4tqIF0EqY4fBm8= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB4868.namprd11.prod.outlook.com (2603:10b6:303:90::19) by MWHPR11MB1965.namprd11.prod.outlook.com (2603:10b6:300:110::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Mon, 18 Oct 2021 16:32:30 +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.4608.018; Mon, 18 Oct 2021 16:32:30 +0000 To: "Ananyev, Konstantin" , "Iremonger, Bernard" , "Medvedkin, Vladimir" CC: "dev@dpdk.org" , "mdr@ashroe.eu" , "Richardson, Bruce" , "Zhang, Roy Fan" , "hemant.agrawal@nxp.com" , "gakhil@marvell.com" , "anoobj@marvell.com" , "Doherty, Declan" , "Sinha, Abhijit" , "Buckley, Daniel M" , "marchana@marvell.com" , "ktejasree@marvell.com" , "matan@nvidia.com" References: <20210713133542.3550525-1-radu.nicolau@intel.com> <20211013121331.300245-1-radu.nicolau@intel.com> <20211013121331.300245-7-radu.nicolau@intel.com> From: "Nicolau, Radu" Message-ID: <2dc028cf-7ee2-f29c-ad5f-975103d1bee1@intel.com> Date: Mon, 18 Oct 2021 17:32:22 +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: 7bit Content-Language: en-GB X-ClientProxiedBy: DU2PR04CA0333.eurprd04.prod.outlook.com (2603:10a6:10:2b4::25) 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 DU2PR04CA0333.eurprd04.prod.outlook.com (2603:10a6:10:2b4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18 via Frontend Transport; Mon, 18 Oct 2021 16:32:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 575a9e53-bc8c-43b5-f329-08d99254e10d X-MS-TrafficTypeDiagnostic: MWHPR11MB1965: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4aTF5XOOi/jXJOHnp+e6LKirvq74GB2N9T5NcEjFJj0orjcxYuOlL46EZD/O3THMgen5pMQkMpm0WysObshYK6ldjmddjge5i9jc6/Q1L7iMMnkfR6XlfI/qUcDZg74Gg6NvI4RmE5SzYvsxGFmT+YmCTlSea/8bRFTNl8bzdlwqx7WIeXA2MEsoJD6cjku+xKZUJUqpng5pUHTqflLIvgdfFyR8ivXHaPD+FussbKrQVcZXR6CyiRleH9/bHhs9DLKmrFhsbUty0RzSQzRmvEEcITcMELWVYNXjis7lt6kfx+ZBGJV8RzRuDd6giFz1AAxhmmUvOHen4ED/mEpa8JxMYS3qV2QguFSuInqvIiwBpnWhSl8HVt99tSk7Z0hR6WaRS9yhwnu2Rz7rkN/F70W8O689xgyf+4FAD4xuj2ktLwCtI/lrIuA/ab4grPLdLynUrAG2sKozNPG53IdhsEqg8K3rRv7HIy/xyM/ObrSd1bISme831QVzT2CYRajekYyy7rprqkrpX1OkPTEoWSMru9FvOgScBElO0EuPs6cGRaGRY4q22vYa5kd2lLjsiXQK43X7sOsJAEi3oLglDlwGTIKI+3R/UnHod83GM331ywow3TXAODDKK+QdoWbNjYOTKxTfLUAniLymsHp+Y/g5RB+A21ta6aYIQXWL+Ytk84NG1LSC7ToDqB3isRFOSwZeSV0V0B4S4dlmuxrGkzCaTJKY8tdy/rZHCqQHSbrDiELUNyvhTCcacCuNcQaY 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)(66946007)(66556008)(66476007)(26005)(5660300002)(8936002)(186003)(2616005)(86362001)(2906002)(31696002)(54906003)(4326008)(316002)(8676002)(38100700002)(110136005)(55236004)(83380400001)(956004)(36756003)(82960400001)(16576012)(53546011)(6636002)(6666004)(6486002)(31686004)(508600001)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cTdld2l5L1VVejlFbHJoTXJUSVZsdXViWkxBY3gzTUNqMHZsLzNWdXlrZTRY?= =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enant-AuthSource: CO1PR11MB4868.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 16:32:30.1645 (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: a1jq3QmLpgAQu/y9yphxsGBSNBYNoRPNIlw7/WvoVz/RIGJok17TSA3z942xGGRGTOIrJsw9BrGzo4BfHN+Otg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1965 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v9 06/10] ipsec: add transmit segmentation offload 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" Hi, I reworked this patch as part of a new patchset, and some comments below. On the comment about the offload capabilities, i.e. what happens if a PMD supports SECURITY and TSO but not both in the same time, well, if this is the case they should not be set both, and also this can theoretically happen with any offloads combinations. On 10/14/2021 3:42 PM, Ananyev, Konstantin wrote: > >>> Add support for transmit segmentation offload to inline crypto processing >> mode. This offload is not supported by other offload modes, as at a >> minimum it requires inline crypto for IPsec to be supported on the >> network interface. > Thanks for rework. > It looks much better to me now, but still few more comments. > Konstantin > >> Signed-off-by: Declan Doherty >> Signed-off-by: Radu Nicolau >> Signed-off-by: Abhijit Sinha >> Signed-off-by: Daniel Martin Buckley >> Acked-by: Fan Zhang >> --- >> + for (i = 0; i != num; i++) { >> + nb_segs[i] = esn_outb_nb_segments(mb[i]); >> + nb_sqn += nb_segs[i]; >> + /* setup outer l2 and l3 len for TSO */ >> + if (nb_segs[i] > 1) { >> + if (sa->type & RTE_IPSEC_SATP_MODE_TUNLV4) >> + mb[i]->outer_l3_len = >> + sizeof(struct rte_ipv4_hdr); >> + else >> + mb[i]->outer_l3_len = >> + sizeof(struct rte_ipv6_hdr); >> + mb[i]->outer_l2_len = mb[i]->l2_len; > I still don't understand your logic beyond setting these fields here. > How it looks to me: > It is a tunnel mode, so ipsec lib appends it's tunnel header. > In normal case (non-TSO) it sets up l2_len and l3_len that are stored inside sa->tx_offload > (for non-TSO case we don't care about inner/outer case and have to setup outer fields or > set TX_PKT_OUTER flags). > Now for TSO we do need to do that, right? > So as I understand: > sa->tx_offload.l2_len will become mb->outer_l2_len > sa->tx_offload.l3_len will become mb->outer_l3_len > mb->l2_len should be set to zero > mb->l3_len, mb->l4_len, mb->tso_segsz should remain the same > (ipsec lib shouldn't modify them). > Please correct me, if I missed something here. > Also note that right now we setup mbuf tx_offload way below > these lines - at outb_tun_pkt_prepare(). > So probably these changes has to be adjusted after that function call. I removed this section, I think it's best to leave the upper layer to set these fields anyway. > > } >> + } >> >> - n = num; >> + n = nb_sqn; >> sqn = esn_outb_update_sqn(sa, &n); >> - if (n != num) >> + if (n != nb_sqn) >> rte_errno = EOVERFLOW; >> >> k = 0; >> - for (i = 0; i != n; i++) { >> + for (i = 0; i != num; i++) { > As I stated that in previous mail, you can't just assume that n == num always. > That way you just ignores SQN overflow error you get above. > The proper way - would be to find for how many full packets you have > valid SQN value and set 'n' to it. > I know it is an extra pain for TSO mode, but I don't see any better way here. I reworked this, I hope I got it right this time :)