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 EEA88A0C55; Wed, 13 Oct 2021 14:15:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9722410DA; Wed, 13 Oct 2021 14:15:58 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 99C9240E64 for ; Wed, 13 Oct 2021 14:15:56 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="207526905" X-IronPort-AV: E=Sophos;i="5.85,370,1624345200"; d="scan'208";a="207526905" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 05:15:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,370,1624345200"; d="scan'208";a="491432675" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 13 Oct 2021 05:15:55 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 13 Oct 2021 05:15:54 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) 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, 13 Oct 2021 05:15:54 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 13 Oct 2021 05:15:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pvq6jlAE783E8LrxaRPORnxEdTZnpu203MpAGHbDnJuS+QKrVXTLRpcDrT2Zi/JSS6PsfXkb5YrfTD8QaXkqcZYRsj8iCXpPXzHQxYMZsm3kPXdzFsB7uDr1eEQtakqD4JpjYWdvF5l7uuLyi59BG5i5wUnb7P+mmzued8w0QcNobbE2uWKm+Tfrt/AeMh6SuvPQ6+nH9yVykRfB816oumg9bbJmlzJEjuiv6iJerbI5uWGweCQqvPiIpHPugrchhldQ5SQ/1rMAHDpKGxESpsqsroiUNWgV2kT4ZsHDqx31QQ8LIH0yZ5kweg6zUuDh6FvLI4bxeSSphJ+qtm76JQ== 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=Eu5XGvsO28dKwVXMWVoui51MUuTXER+VUpvORKs2DpE=; b=PRwTXhsS3CtXOApKRBHc1HoECKxrSwLySbXflJkbQWGJrLzyiolmdDNnbe6Xad0CnniFfOwLALeYX8N2uFp7P3A07cQpHju837e/IGWqqIlCbqpOZoGAA81hJI8wTZP2gKh3C9nuWAiLg68pPhf9+o+4iyhbipLRYynKKo1Dj/2aQYXIyw23sxrhnerGYDzgpK26OsxX0tABIjRcGB7gvia5jmMahwLmcIsHG9fFWtaAbQ+tjnNgzHj9B9tStQ0QGQPyOpcEWVojXAXtBNw4cTlgTiaHG9Em4KEk7lqWYIpRKokxOY4niV7jldT9x8+9Es8YlHILX2Eqz970pBRr6w== 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=Eu5XGvsO28dKwVXMWVoui51MUuTXER+VUpvORKs2DpE=; b=HZs1sj6EzPzExHWvVBmLVPefJ6d5md9DWHPT0KqRaQmBPpMvgUBA3zUT/2toY2ORVft76h0k5dAW4J0seJERqAtXH28OKJg5L8ISVrokFE+ehsxfcmjgCMuy7Qu67JXW0FZMKhd3dHxwgJL3MZjwWfn5V8Ylhvo8HPtPR+hs56M= 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 MW3PR11MB4668.namprd11.prod.outlook.com (2603:10b6:303:54::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Wed, 13 Oct 2021 12:15:49 +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.4587.026; Wed, 13 Oct 2021 12:15:49 +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> <20211011112945.2876-1-radu.nicolau@intel.com> <20211011112945.2876-7-radu.nicolau@intel.com> From: "Nicolau, Radu" Message-ID: Date: Wed, 13 Oct 2021 13:15:41 +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: DB7PR02CA0008.eurprd02.prod.outlook.com (2603:10a6:10:52::21) 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 DB7PR02CA0008.eurprd02.prod.outlook.com (2603:10a6:10:52::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25 via Frontend Transport; Wed, 13 Oct 2021 12:15:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4ec9981-1ea8-4902-6ff4-08d98e43318b X-MS-TrafficTypeDiagnostic: MW3PR11MB4668: 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:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bkys093Nth21lBn0fgzEw1VMpqVNUzxrAXiqx6O3wNou/lQwjhBTHaKPhv0WFNMx/NO9JmMhMQIXYBeSQh4s5H//3HQwyeUvTcjFpRI+s9q2FwpY5cm1FLJhkP2OnX5aCfwBBbrFec/CfTRozluFYOwEVLSSscBqt17oulmaohwaZDuoxllOknQP1xDDQYziciRy1VZKG514WJijidy2uVWdnv62eDNA4JQngml06cUBpHadyZlvsFuGZatXInErjjAYvLW2FdirphhtF6TtaJyw1D+Qjdbp61H6HVUxOiuCkzaCAOBPK+5VYYxnKlQFrTADqobgFvVjrQkfs7JWeZjsA6MCjs4HrbmkTllMDFoIenu0yTSYN8GzZN6tXJQxxyg78CiO0BUwF52PkVSJjBtbe+9bDCrrMofkPOL6iTZOFo9yskmBwEUCNYC3NqHFY0wqlnSSLF0zluMQU2J2A4U6tHJWrxacnQLDhcThPJ0dVwtoJvFwA7+s+MSF+KFTeYh5kJOfSmghRDUtw5WdVqiVzImiDOOjW3EcMIpQi28Lhx2kmEP0a3Zkn3GEr1hPFGwutNXqLu4RDOsNELmB2Smf0p39Zs0BZZB8oC9q5UH3M5d4vp/WmuYmmdWndh8Nw03wC9/OowhuBCZSwLeHnvNv9t8Xwp6e4Y6DOjf10IjiiatoPzYWzgmWHggpbZv1joeTTQhnAwZF505TNikqXpFZ+6L2CXgzc1Mv3SPt2lg= 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:(4636009)(366004)(2616005)(66476007)(8676002)(186003)(316002)(54906003)(110136005)(6636002)(6486002)(26005)(66556008)(66946007)(86362001)(956004)(5660300002)(2906002)(83380400001)(53546011)(8936002)(16576012)(55236004)(508600001)(4326008)(36756003)(82960400001)(31696002)(38100700002)(31686004)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UkZFKzNaNndlb0VZSi9sT2dkMzZqeWNiV0N0TFRqWDhUNWFZUUZYMmZHMkIv?= =?utf-8?B?ejJXZXpzV1BwS0drYURtWjRPa1BoUUxqeWFQQjRPTk5zZzRhKzV2aGhvNlg1?= =?utf-8?B?aTYrVGJULzVWWXFwZ2RsUmhtdW5oeWpNOVQ1TktxSW94dzBEOHlGNVZJVDR4?= =?utf-8?B?Mmt0UWl6dXUyUE1ZRGlXQWRpc1pUMjJ1RG8vSVlZamFlQ2tuUnhMT1JMeE5Y?= =?utf-8?B?UUx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Tzh3azY4RFRNOGpL?= =?utf-8?B?T0VLUU1jeDZWcm1RSmFTd2V5ejlseG81TWtwbkE1ODRaTkIyR2NjaFhMOEZq?= =?utf-8?B?NjdWWjBWUXR4SXRSSU1qREE3Vjl1VG5CdDY5bEJDQ0Z6SnVHY09IaU9zeE5V?= =?utf-8?B?dnpBekJmRmlvL3N3YkxISnhXUzdFQjUwb1VBMXJ0MUpCVFVJWE5Mc3ZpZ3Bl?= =?utf-8?B?b2pZYkFlVGlMMmdWaG1lMC9DTVlBR3NVN3FEbzVIU0Y4MXJPYmhhWEhsaVE4?= =?utf-8?B?aStZdFdYNlI1My8reDIzMWUwSXh4NEV5cFB2OG4rZ0g1dndGL2tLS25mWW1i?= =?utf-8?B?T0lhUmVWOW5GdWlDclNlWnZnVEI0UHNhZnhEWlBuVGhOdG1HNDVOYkFxTGE2?= =?utf-8?B?enA5dXNZQ3lmSWt4ekYzbFRMRHRWR2VXTXdsblZtVFEzOTQyZFdrUWp6WFcx?= =?utf-8?B?c2RlMkJUU0xOM1ZFcHFveUdKM2hONHpOV0h6NGJpL3U2MTExNlowUnFRZnEx?= =?utf-8?B?eHBBdVFSZEVzNGlGcVJnMmd5dENxL3pQbmYrWStMeVh3TUo3TTVSNWh4OTFU?= =?utf-8?B?YWNWeVlJQlovRmJiMkFjSnpodis4WVg0YlR3Q3RGdUtMV3BTRGpmM29LVkxh?= =?utf-8?Q?2mSdN+h/bIl9asmzjmNLJt8lq4g6b3s5yoIQ11j?= X-MS-Exchange-CrossTenant-Network-Message-Id: f4ec9981-1ea8-4902-6ff4-08d98e43318b X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4868.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 12:15:49.5935 (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: QJPo77orFoABZw8AaWurpIvEJt5HzTcjqBWGoVIj/WKeVfGZRIDMph5Qa4pkk8kG36++GcOpZbYvj4M4i9a3Jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4668 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v8 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" On 10/12/2021 5:25 PM, Ananyev, Konstantin wrote: >>> +/* check if packet will exceed MSS and segmentation is required */ >>> +static inline int >>> +esn_outb_nb_segments(struct rte_mbuf *m) { >> DPDK codying style pls. >> >>> + uint16_t segments = 1; >>> + uint16_t pkt_l3len = m->pkt_len - m->l2_len; >>> + >>> + /* Only support segmentation for UDP/TCP flows */ >>> + if (!(m->packet_type & (RTE_PTYPE_L4_UDP | RTE_PTYPE_L4_TCP))) >> For ptypes it is not a bit flag, it should be something like: >> >> pt = m->packet_type & RTE_PTYPE_L4_MASK; >> if (pt == RTE_PTYPE_L4_UDP || pt == RTE_PTYPE_L4_TCP) {...} >> >> BTW, ptype is usually used for RX path. >> If you expect user to setup it up on TX path - it has to be documented in formal API comments. > Thinking a bit more about it: > Do we really need to force user to set ptypes to use this feature? > Might be something as simple as follows would work: > > 1. If user expects that he would need TSO for the ESP packet, > he would simply set PKT_TX_TCP_SEG flag and usual offload fields required > (l2_len, l3_len, l4_len, tso_segsz). > 2. In ipsec lib we'll check for PKT_TX_TCP_SEG - and if it is set we'll do extra processing > (as your patch does - calc number of segments, fill ESP data in a bit different way, > fill outer_l2_len, outer_l3_len etc.) > 3. If user overestimate things and there would be just one segment within packet with > PKT_TX_TCP_SEG - I don't think it is a big deal, things will keep working correctly and AFAIK > there would be no slowdown. > > That way it should probably simplify things for this feature and would help > avoid setting extra ol_flags inside ipsec lib. Yes, this sounds good, I will rework it like so. > One side question - how PMD will report that this feature is supported? > Would it be extra field in rte_security_ipsec_xform or something different? The assumption is that if a PMD supports inline crypto and TSO it will support them together, as DEV_TX_OFFLOAD_SECURITY | DEV_TX_OFFLOAD_TCP_TSO