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 BCEAAA04FF; Tue, 22 Mar 2022 08:43:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EB69427ED; Tue, 22 Mar 2022 08:43:35 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id E4B75410E5 for ; Tue, 22 Mar 2022 08:43:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647935014; x=1679471014; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=hwfYkXJEes65p3Lzjfva9kEsqYE3ytaeVhk0aNcee1Q=; b=d/7Wjy8yDc8kulmQdnkVmNilF+NVtnf9eExV2RkJb+2OUA0T0x3T+Ghd a6vHiRboaqJKCpUtDIawsvWeWOHHbMuCyoQkgUbFU/VFFTD5XwVVsSWUZ CAwTZVfQn1Sq2kZg53PMx2Kqo7+FyFL9PQWkaT5fnT9M32xbGATLOO793 k5BObiDCIUG1GAQ99s826CZw/xKx7mElj60Dp3AZUgo9Fwa4BHzGZ+yvT 961n5fZL1CBasOXmyLSzeiEqVNdqHIbFcjwQSsray1v++C5tHDq3O0QA0 IoYNb1jIxpu9r2gcYHDwJNj5MmumpWTvfSB3FgVtmYA85A8u3ZttW96SG A==; X-IronPort-AV: E=McAfee;i="6200,9189,10293"; a="255316319" X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="255316319" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 00:43:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="615932277" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 22 Mar 2022 00:43:33 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 22 Mar 2022 00:43:32 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Tue, 22 Mar 2022 00:43:32 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.42) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Tue, 22 Mar 2022 00:43:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioYHxDuZPcmkoYXaXQ7mwaDoKpUkxesAippzlCSLLQTOlU6rF6oHrl+ufzhV7rH2x2atn5zoOR3pyhMXzxsBHZfKgXOM2cTPKB8KfNxMDJ5dJLm95KIkJR1L1pjgufTkybysz8ms9qCQRD29Bj8UguuHO/j2rkcL0kmbnfmm778Y1oj6yEhE7+YHRLlkO3Usy1WxKNFDO9LemBBY9OUQT5zRxgnYZUvlYFQxY/z8vVxjFVioFOY1hpOQOu2mdbjfeEncVCnvP/RfdOkEzApGAcq23shlCKnqmFor+ig/X4dA1thpNcih77PZaOzJbFdvMtzEiVYgvsOFuwOpqe4eZg== 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=NPJwaIKBpoxjvaevoDlUyWk1FDH2U0ZckBZ2yWl0f2o=; b=cPP1xIH+XAcMlZ9WkNbnFGHcTHlotMwSz2R4axGYHMD8w570IoTnbbpbA7DNY5X39e8s4Gz8X8p1k1FAYHwk8SZWaonjw4M8FuJqkG00c86bPd77pRc4aiskvkUGFlja5+Ay/Gruwik/bWH524DMEZ495vt9u07iQEiABCyMi+1M7jx1H1sue0vONprqjdaj35Gxdel+KG/HHQomS49C9fs63OsZS1vzdLQyamfU76/jDu5MEpErnAF1wwaa6YDURwbsAh6lyjJiVOO4kqFnZ/XIT3yGgXtPwtwOVCMsOkI/QVDkPoSzNbWcfmujg8ec4yRR02SpxdTYv03Hx4Grfw== 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 Received: from BN9PR11MB5513.namprd11.prod.outlook.com (2603:10b6:408:102::11) by CO1PR11MB4897.namprd11.prod.outlook.com (2603:10b6:303:97::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Tue, 22 Mar 2022 07:43:28 +0000 Received: from BN9PR11MB5513.namprd11.prod.outlook.com ([fe80::7067:8016:bef2:5c88]) by BN9PR11MB5513.namprd11.prod.outlook.com ([fe80::7067:8016:bef2:5c88%6]) with mapi id 15.20.5081.022; Tue, 22 Mar 2022 07:43:28 +0000 From: "Ding, Xuan" To: "Zhang, Qi Z" , "thomas@monjalon.net" , "Yigit, Ferruh" , "andrew.rybchenko@oktetlabs.ru" CC: "dev@dpdk.org" , "stephen@networkplumber.org" , "mb@smartsharesystems.com" , "viacheslavo@nvidia.com" , "Yu, Ping" , "Wu, WenxuanX" , "Wang, YuanX" Subject: RE: [RFC,v2 1/3] ethdev: introduce protocol type based header split Thread-Topic: [RFC,v2 1/3] ethdev: introduce protocol type based header split Thread-Index: AQHYPaFh0SqVwiZXlUS0JlZ4pm5gCKzK/aAAgAAHMDA= Date: Tue, 22 Mar 2022 07:43:27 +0000 Message-ID: References: <20220303060136.36427-1-xuan.ding@intel.com> <20220322035629.18756-1-xuan.ding@intel.com> <20220322035629.18756-2-xuan.ding@intel.com> <7912b7c67946402186fd8e318715d5a0@intel.com> In-Reply-To: <7912b7c67946402186fd8e318715d5a0@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a0f783aa-14b3-40e1-edab-08da0bd7a76c x-ms-traffictypediagnostic: CO1PR11MB4897:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: M5Vh50h7RHS/8C2yJN27ccQvXHQfiGZvoRe6vYjpGXtBQLdij2BsCAGpM06I016f1FbsDJFMB0w6/dQOOmFKJ4Ygj90h7PsrrulXbbx3wrSaqJCrPePalnEFactce3yLgs/4WnM9knJDY3T7AtMCB2HxhhXlhJ66dLDctkJ96z5Sl+lMVtvNg/DxSprd+kpelEoxXsiNhkK2C+2TKZoqnVkKKP5uaJUReqTuzggBpJm8mnj8HBruZf2eR5GPk3t4G0Y6YqRJ6BqBQy0wkwtQ6RXz/ZHGDMH0do62bd1inKD8R898JYuIjXrAgUxMjeyzq5FN9/2znwSaZ6ym/g5YXCECGDsXNaBQ/wEsDGqvr08BimLY/p2NMa2WkGEEzwzjhyt/GlSLQgixJTbvmpGEKf5hCi6hYSThv0cr1YVnyfqWmELuicizx9eO9cExKAAjDfZBVtt+IIlr9EuO6vM5hCfhpP797Bx9YBPXlzu9SxBKMzPV7+5D/pf0IywKaAsuPDAvJos7sK1WZBQP+FCDbFsVpJieF7JKeJIN+3VYxaiql/b/5DGJ5NBsz1e7LJ+WrCzsuCthiLjy/+8plM5aDZTIYb0Ax7jQiG3NLs6Bmp3ezT9V7ZahhFtEx7jk+G7qa9X4tDlBhTqAA+4qqUZgI9rSQruDdRDfHrpsYShVDJX5c38LNY8Zvd7fXoLtJbSvUZHsKfxqr+ifsyfdFjfugA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5513.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(71200400001)(55016003)(86362001)(8936002)(53546011)(54906003)(316002)(186003)(2906002)(26005)(82960400001)(6506007)(107886003)(110136005)(9686003)(7696005)(122000001)(33656002)(66556008)(66946007)(66446008)(66476007)(5660300002)(76116006)(83380400001)(38100700002)(64756008)(52536014)(8676002)(4326008)(38070700005)(508600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jKhh8AlI8kkZutiHX51rzOgEk+vcMh04MFKjYItmgN2+D49Azef/ovAY5wHo?= =?us-ascii?Q?jkvG6US264SO6994V6uzF4LC/kjBkzmbo240y5HdHqypxNPAEsm/yay0ByxT?= =?us-ascii?Q?3S7SAxnOYwKll473dQd+1bjyfjRaCoeARNGj0OggzMFcOrZdxhUGrI3rmex2?= =?us-ascii?Q?JfxFi6Bxc9Q5qCBpAmHrKU7j87VdPnIn4fVgOZf8a8ovnyEl516deXdQZ5CC?= =?us-ascii?Q?xn0+bbvP2xil76MyZ7luxyMDvvwYo/J3e5i3LnrXy91I/RXLxyrXtvgvYDoi?= =?us-ascii?Q?SF+ZD9VZ4zC9Xr9R8cbdL8doG5nSHFVqHaPojOVuVQMVPz0s0KIIxhfr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Mmwk7MGsPq99A80bMZS8VuCkq?= =?us-ascii?Q?sjuCqdGgOXJS10mojQlwLulBOi/4Z0YcMXXsjR/Xrq+PR3SSp1hJULvDBS70?= =?us-ascii?Q?0rmu5aGwWbR4z5L0rDdFzSdPiwnttY7EDTSrbKGYYwzt0dBe0Ta70DEbBY5M?= =?us-ascii?Q?rraW+C4XgNJHUwjjbxF1aioxPX7UfWI58TQ4soiwoUxii10toPvS+TGq5unq?= =?us-ascii?Q?kt9s+iE5eGAk13ACQvNZOMj1QAbt6enB?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5513.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0f783aa-14b3-40e1-edab-08da0bd7a76c X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2022 07:43:28.0041 (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: Rl5hIk1/o/M0yUEpjxi64oZICVu8L655TVcs2WG0X0D9gcZW5WBK0cOldxKnlfbxoA4azUw3u8idUiMelvTmJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4897 X-OriginatorOrg: intel.com 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 Hi Qi, > -----Original Message----- > From: Zhang, Qi Z > Sent: Tuesday, March 22, 2022 3:14 PM > To: Ding, Xuan ; thomas@monjalon.net; Yigit, Ferruh > ; andrew.rybchenko@oktetlabs.ru > Cc: dev@dpdk.org; stephen@networkplumber.org; > mb@smartsharesystems.com; viacheslavo@nvidia.com; Yu, Ping > ; Wu, WenxuanX ; Wang, > YuanX > Subject: RE: [RFC,v2 1/3] ethdev: introduce protocol type based header sp= lit >=20 >=20 >=20 > > -----Original Message----- > > From: Ding, Xuan > > Sent: Tuesday, March 22, 2022 11:56 AM > > To: thomas@monjalon.net; Yigit, Ferruh ; > > andrew.rybchenko@oktetlabs.ru > > Cc: dev@dpdk.org; stephen@networkplumber.org; > > mb@smartsharesystems.com; viacheslavo@nvidia.com; Zhang, Qi Z > > ; Yu, Ping ; Wu, WenxuanX > > ; Ding, Xuan ; Wang, > YuanX > > > > Subject: [RFC,v2 1/3] ethdev: introduce protocol type based header > > split > > > > From: Xuan Ding > > > > Header split consists of splitting a received packet into two separate > > regions based on the packet content. The split happens after the > > packet header and before the packet payload. Splitting is usually > > between the packet header that can be posted to a dedicated buffer and > > the packet payload that can be posted to a different buffer. > > > > Currently, Rx buffer split supports length and offset based packet spli= t. > > Although header split is a subset of buffer split, configure buffer > > split based on length and offset is not suitable for NICs that do > > split based on header protocol types. And tunneling makes the > > conversion from offset to protocol impossible. > > > > This patch extends the current buffer split to support protocol based > > header split. A new proto field is introduced in the > > rte_eth_rxseg_split structure reserved field to specify header > > protocol type. With Rx offload flag RTE_ETH_RX_OFFLOAD_HEADER_SPLIT > > enabled and protocol type configured, PMD will split the ingress packet= s > into two separate regions. > > Currently, both inner and outer L2/L3/L4 level header split can be > supported. > > > > For example, let's suppose we configured the Rx queue with the > > following > > segments: > > seg0 - pool0 > > seg1 - pool1 > > > > With header split type configured with RTE_ETH_RX_HEADER_SPLIT_UDP, > > the packet consists of MAC_IP_UDP_PAYLOAD will be split like following: > > seg0 - pool0, udp_header > > seg1 - pool1, payload > > > > The memory attributes for the split parts may differ either - for > > example the > > mempool0 and mempool1 belong to dpdk memory and external memory, > > respectively. > > > > Signed-off-by: Xuan Ding > > Signed-off-by: Yuan Wang > > --- > > lib/ethdev/rte_ethdev.c | 24 +++++++++++++---------- > > lib/ethdev/rte_ethdev.h | 43 > > +++++++++++++++++++++++++++++++++++++++-- > > 2 files changed, 55 insertions(+), 12 deletions(-) > > > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > > 70c850a2f1..49c8fef1c3 100644 > > --- a/lib/ethdev/rte_ethdev.c > > +++ b/lib/ethdev/rte_ethdev.c > > @@ -1661,6 +1661,7 @@ rte_eth_rx_queue_check_split(const struct > > rte_eth_rxseg_split *rx_seg, struct rte_mempool *mpl =3D > > rx_seg[seg_idx].mp; uint32_t length =3D rx_seg[seg_idx].length; > > uint32_t offset =3D rx_seg[seg_idx].offset; > > +uint16_t proto =3D rx_seg[seg_idx].proto; > > > > if (mpl =3D=3D NULL) { > > RTE_ETHDEV_LOG(ERR, "null mempool pointer\n"); @@ -1692,15 > +1693,17 > > @@ rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split > > *rx_seg, (struct rte_pktmbuf_pool_private)); return -ENOSPC; } > > -offset +=3D seg_idx !=3D 0 ? 0 : RTE_PKTMBUF_HEADROOM; -*mbp_buf_size = =3D > > rte_pktmbuf_data_room_size(mpl); -length =3D length !=3D 0 ? length : > > *mbp_buf_size; -if (*mbp_buf_size < length + offset) { > > -RTE_ETHDEV_LOG(ERR, > > - "%s mbuf_data_room_size %u < %u > > (segment length=3D%u + segment offset=3D%u)\n", > > - mpl->name, *mbp_buf_size, > > - length + offset, length, offset); > > -return -EINVAL; > > +if (proto =3D=3D 0) { > > +offset +=3D seg_idx !=3D 0 ? 0 : > > RTE_PKTMBUF_HEADROOM; > > +*mbp_buf_size =3D > > rte_pktmbuf_data_room_size(mpl); > > +length =3D length !=3D 0 ? length : *mbp_buf_size; if (*mbp_buf_size < > > +length + offset) { RTE_ETHDEV_LOG(ERR, "%s mbuf_data_room_size %u < > > +%u > > (segment length=3D%u + segment offset=3D%u)\n", > > +mpl->name, *mbp_buf_size, > > +length + offset, length, offset); > > +return -EINVAL; > > +} > > } >=20 > As the length and proto is exclusive, it better also check the length whe= n > proto!=3D0 Thanks for your comments, will fix it in next version. >=20 > ..... >=20 > > @@ -1197,12 +1197,26 @@ struct rte_eth_txmode { > > * - pool from the last valid element > > * - the buffer size from this pool > > * - zero offset > > + * > > + * Header split is a subset of buffer split. The split happens after > > + the > > + * packet header and before the packet payload. For PMDs that do not > > + * support header split configuration by length and offset, the > > + location > > + * of the split needs to be specified by the header protocol type. > > + While for > > + * buffer split, this field should not be configured. > > + * > > + * If RTE_ETH_RX_OFFLOAD_HEADER_SPLIT flag is set in offloads field, > > + * the PMD will split the received packets into two separate regions: > > + * - The header buffer will be allocated from the memory pool, > > + * specified in the first array element, the second buffer, from the > > + * pool in the second element. > > + * - The length and offset do not need to be configured in header spli= t. >=20 > We may not necessarily ignore the offset configure for header split as th= ere > is no confliction, a driver still can support copying a split header to a= specific > mbuf offset And if we support offset with header split, offset boundary c= heck > can also be considered in rte_eth_rx_queue_check_split You are right. Only length and proto is exclusive in between buffer split a= nd header split. Will update in next version. Thanks, Xuan >=20 > Regards > Qi >=20 >=20