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 46AFBA0506; Tue, 29 Mar 2022 10:18:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3F1D41151; Tue, 29 Mar 2022 10:18:51 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 2C62A40691 for ; Tue, 29 Mar 2022 10:18:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648541930; x=1680077930; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=5sPncyi8Cq6eG8H4ejSVqG3H9MYYu6IYEsv32V3xAE4=; b=KsVQhlhUGIQZn0reQLN5MSDMWdFV1bLqx4tFo7ONIag+g7B1UX9NL02J M4cu4Nw1l5FJK5QQlBQTqQNnIrE+V+XgktOA8X6yRTUOeJML8lvf9zvMY oyZF3hhf0VEg8NUCTTI/cDQgv5KA2ZozcrMvQylaEnJJ2mFZ6L6jzwkmP DYzqtFRaV2t8S5A+5g+uvm3Fy/b/HkOV6HBBeB+ORqS9M6uXjTlRp+rfT Y03smzRTE+O9gMbLhYcjVnlbWjj9QkQueFXudz6B5McsFjtqF65SjPh7+ af+OSzj9LI3L5DsadKT7O0Mx0QFWVnWmz0n+cmFs75PYp1Jh2ZKbInnZJ w==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="239789152" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="239789152" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 01:18:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="585489602" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2022 01:18:48 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 29 Mar 2022 01:18:48 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 29 Mar 2022 01:18:47 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 29 Mar 2022 01:18:47 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.49) 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.2308.21; Tue, 29 Mar 2022 01:18:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6neyLAlHYqB7yw0iwy6+vXKfPHa/jYBy3ZVgUdECn6zvWe8Irk1nd0de0ZjnAMdoTbEw/oPgYzsntqw7tw1iyfXwKoOYHjRbZHwzkGirdmQuH2YGGuCE1pg28hLeXwIPdiMy6pNCCtJ+qWJ+WFAiGmI9Pm8G+tCbVhiq50Ql2VDUy0Z/Io+2KNME9MjbnYBBpUB8f0OkOXGxuaxJ9/FGcaeoxd2uIxk21pYdlQdPW/KSKEFh3gK2tyKh07tBgK/oMRk4hP1wZ/9bGmuHlyvQTsTb6nfFIsotvxJw17ovpVal4bONiUGr63ecnLqtR+iNdez+yZeWINJCPAUorHnug== 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=Zi6wFfBvM/zjifddl4qhGrJq3wNtc3vsiHF5S+BeTio=; b=XKNJm0os+WVqmZC/WB5Fwk2u49zij5ToKibHKUMefMY3UJgkotqmpBwbD0Yt3B+xrToCXBLBm49vUPO8GAYHqfYXzPTe/xIGouirjDVxwM2bVdKn8m3C7Z8fEk5E2AnhjyBh0ewFXBhoW8JlQCK4YtYN1x5lZ03O5g93UqgFvF51sMElrQ84JA3ub4kWiJxkU6aAbsCEJrS9FiPtEt+crrmOcQcFi9ZoPuYftByCQldT4ca5FNSasMhXDCxhaq2jQ5Hls55DATYIcaIUAautib6rWt85lPAWtZeE4udOdn6DiKN/Fdh+6Ozmj/XOKaSh9pYc35UtzqZjKo/ld+CQFA== 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 BN6PR11MB1331.namprd11.prod.outlook.com (2603:10b6:404:49::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Tue, 29 Mar 2022 08:18:42 +0000 Received: from BN9PR11MB5513.namprd11.prod.outlook.com ([fe80::d7:c1a5:3e30:8593]) by BN9PR11MB5513.namprd11.prod.outlook.com ([fe80::d7:c1a5:3e30:8593%2]) with mapi id 15.20.5102.022; Tue, 29 Mar 2022 08:18:42 +0000 From: "Ding, Xuan" To: "Zhang, Qi Z" , "thomas@monjalon.net" , "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,v3 1/3] ethdev: introduce protocol type based header split Thread-Topic: [RFC,v3 1/3] ethdev: introduce protocol type based header split Thread-Index: AQHYQznTDPAo68FBZEG70uD6Q4fqBazV/n+AgAAFOdA= Date: Tue, 29 Mar 2022 08:18:42 +0000 Message-ID: References: <20220303060136.36427-1-xuan.ding@intel.com> <20220329064945.54777-1-xuan.ding@intel.com> <20220329064945.54777-2-xuan.ding@intel.com> In-Reply-To: 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: 90526862-a3cd-4c83-749a-08da115cbcac x-ms-traffictypediagnostic: BN6PR11MB1331: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: mrz+CrKDcdd14ZjVVaHgYSKRht0yvTvdIzOl6zfkKk7Yr4wP9LMTONv1ab03JWUv6ioRBoCXNtR9xKR0S/X8WBrN2OSGkZwTzwGbKYohI70o0Awm/meZ1w2CIaQkruEIEpfY4cYbaiwgReBD1jURcxrXK2kk/WWmnfFzASPFAq9xxynvOCEZO3Mz+WcbDwF1b+kxZs3giFvlyds8QFVkV/2FiwXE0emHrIEQypMlBePysZuj3QI7KNN4DEDmPD/mI0Yn0OC3rL1TGjvudX/wtIMZy2MweUze94G7VQW+c0KvT24IbtTriLPAcNX8HbWL9+c3v61kdvA0LkXP3Sm82YC9XJA0v/tP70XkvIMrTswLcA0Kx4ojju2EHlKIXOiapOMBq0kMpcm+5Mi+zGHuB5aqsU1segkTGDtNY0htJTYJuD8W8caoo6P+9tbc037Cw49a7tqGqZPTaqD6feWkDSFONtReRTlp8v70iR1MizlyfLVWUJf73PXlQvKeGA8XGHvYenN1CPzwJJTwZivQdeDcHs2p1DATqq8arZlhID8ls4AkV0G5Qch5rtnS+iUijvcupZwSV3Li1nIFBA62lnW3iHjrDRRfop3SU4PNS2PA9Q7oBJ/OtqFjlHsJX28YzqCCo+VTmDuIZAtUkOwo7jHH1WP6aApZ9SUeOPAybQGjSdG5kIBqqTIzu0BPOh4T3oJLw0oqw4gAV70p+t64JQ== 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)(83380400001)(53546011)(316002)(2906002)(8936002)(52536014)(5660300002)(508600001)(66476007)(86362001)(66556008)(54906003)(66446008)(55016003)(71200400001)(107886003)(186003)(26005)(38070700005)(76116006)(9686003)(38100700002)(33656002)(122000001)(4326008)(64756008)(8676002)(110136005)(7696005)(66946007)(6506007)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+ZHGdBA+00UMrHFT3BIRGX7+wKle7MxDY1M1CQGScbvtAc3uru7AYHGe6Y4q?= =?us-ascii?Q?dhnAwtlHSeSe9dSXN86MlJ+BZ0D/XOpHSP/qv03H74k6Y5zNwZuFsLO+Msc+?= =?us-ascii?Q?7zs/vbqOzOyw7cWHx6qJ5HxnIzHFQ0+Qx4F1PRfXCa+aDX88bzsf1F7mQ6/G?= =?us-ascii?Q?aJHReg7jh7ARC/hQIhLT2SG/DK90pHFuqN8myRg7f5leEGXZ2NNEb5TKcQNa?= =?us-ascii?Q?/EVh/m6wswA+nS0MaJas4/eK/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YoXpKVGcPka7++ynAnZ0yFxLwP9Pp3bhkHU8Fv6XNdiM5o3pMbr?= =?us-ascii?Q?ZhS1g8dwurgKtaLTlT/TnhD131aOJBTq2nfwExUHw/wN0NkXjHzr0ueSXWrL?= =?us-ascii?Q?7hf0yM/UXMTkSbGsJ5DyBmF64lR0oqWh7Yxu6+oID4yAYuJLtGycppRin/bZ?= =?us-ascii?Q?Ia32osy2s5fsyluvU5JeZ4QrIrFe3Em0kCX6ET42pOZFrHlkenicpCLjj/TD?= =?us-ascii?Q?Et7HNRM8wpdXG0gLp733H0BdAVfmZKUScx3kVptcH0SVtPTeFdAs3n0AFt1F?= =?us-ascii?Q?oUNFHA3bdOt2eAiXf4dv7zcZBO/gOkfxOrx7ob4ysv2kYlKYRu/BXDz4Nv7g?= =?us-ascii?Q?k19IDFa+dg9WOkfjmLNyXYfjRWlf/biZ8lCshce3su535+maED1RmdeA3ZHx?= =?us-ascii?Q?nWVfOxwHlsn/Dp96x1MUtHDpyHvPTMP+xZ64oSkFhDkXgne7hodfDD3fe+/O?= =?us-ascii?Q?bUM0+KrD6REuJfrrCp6lI6aaaWfld2d8tW+/gBOsYSRCzuzE7XNsfMoWj7zH?= =?us-ascii?Q?xGtJ+wUKeaIgG8iSv31SOsLYffAxoGE3lhHKRHjk+4m2QoytcFYqdZDv0gWg?= =?us-ascii?Q?lCNppswNjw=3D=3D?= 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: 90526862-a3cd-4c83-749a-08da115cbcac X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2022 08:18:42.5178 (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: SCIdKr2230eWdebw8n6szb4nun/cpVMocQCsHSmVSZwM8asJeauZmLGkBkr3UgpjLiwzT7g3wnWguuArfdhf7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1331 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 29, 2022 3:56 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,v3 1/3] ethdev: introduce protocol type based header sp= lit >=20 >=20 >=20 > > -----Original Message----- > > From: Ding, Xuan > > Sent: Tuesday, March 29, 2022 2:50 PM > > 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,v3 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, configuring buffer > > split based on length is not suitable for NICs that do split based on h= eader > protocol types. > > Because tunneling makes the conversion from length to protocol type > > impossible. > > > > This patch extends the current buffer split to support protocol type > > and offset 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 packets 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, off0=3D2B > > seg1 - pool1, off1=3D128B > > > > 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 - udp header @ RTE_PKTMBUF_HEADROOM + 2 in mbuf from pool0 > > seg1 - payload @ 128 in mbuf from pool1 > > > > 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 | 34 ++++++++++++++++++++++------- > > lib/ethdev/rte_ethdev.h | 48 > > +++++++++++++++++++++++++++++++++++++++-- > > 2 files changed, 72 insertions(+), 10 deletions(-) > > > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > > 29a3d80466..144a43588c 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"); @@ -1694,13 > +1695,29 > > @@ rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split > > *rx_seg, } 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) { >=20 > use RTE_ETH_RX_HEADER_SPLIT_NONE looks better? Yes, it is better to use RTE_ETH_RX_HEADER_SPLIT_NONE here. Will fix it in next version. Thanks, Xuan >=20 > Reviewed-by: Qi Zhang >=20 >=20 >=20