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 B781EA00C3; Tue, 13 Sep 2022 09:56:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98E0340156; Tue, 13 Sep 2022 09:56:44 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by mails.dpdk.org (Postfix) with ESMTP id 3C40F40151 for ; Tue, 13 Sep 2022 09:56:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HwIBYvV4jtNooCCfuQiLc8UZBIgkFhef0AG2uqlv+HWYkWDRuCtgVIYzRE+HUHu4G8GfB7At6n/urnQV5JiFWVVsBxvXrQUjPcfjeElhz3H6xfNP9YvyRt3oPkeX8TijUiCbqJzoZyxEtEn2qmhw3e7ddNIOuaNiOuxM7QhaIrsogIvaYd1cQW6j9THpXRg5tcyGT3cGjmSQ1nvxQiOHr3tQSI4rjnnTACHGnghLkBc6K8UIpGjKHFm62RF4ddzz3TJ5cDAZ1R5Jjmf6b4Ttaoz4QS7PHLgiOj8HRancxDtkKLgd3GQOvu/PYiW8cfXzYewv3sP+VW8HRxs53O4IUA== 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=jh1hxKnh/HxT3UBPiu6jhq/hzgMSNdDsXCJxIenvB58=; b=d+JuKuzPD0x38qmxRVNnzGFTKtdCSsu3mTH2FEeD/m0/XK6PpbD9txyqh/34etVMB1t3G4PDQLVbDRJNKl2WEpWvAOUshcQtWz2/RJ2r9x+c7y6ve2nmp5yiErLCDniKP1VQLE5AB6W7Kzt3zU56a9TEqibPAcJdUdrrBZ05/QYhpTgxJcMa1kAjaGHtG6EtW6lwvgYa9usMWK7djQ1g+onLJaEJ0wZsD8G1GmA9JMfgcj9ENM+ZXmJ7ZB1aIiPFK1GMkzy/Nf3FG2DsnZHYf0orgd6FaZccSq7rfbQRyWq2b5ohSimcGxAnOAsNALYjFXRmAHwndsEQYUixVPI7Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jh1hxKnh/HxT3UBPiu6jhq/hzgMSNdDsXCJxIenvB58=; b=egyuQOJ1p09wHQYAERIIm6g2SmcVzagwRlDb49DNfrgA3dLVLbCMRog8Vour6osb1JYRi7pU+Br91k7yZg/5lABwP3sxGUu0hKL+j0/PG5E4hTlXsjnLCSBlj8TCwFizqqqHL4+epP8zEzE3Th00JkaDK0dRkkUJWWdXvYR0RdetYPH/G1UY8KlQeLTFERVVmBpoNIGKJbZ8nmssVEsAQsXyUILMTnLoRuMBX0/xJPKBUPklYnicy7j4wAqFFhmlr189fq/oyMTz/xznlgsilzm1bYS4iYlw1sIDFnXf8G45gYtyEMxCoZTZqpyatsaS6qKuI7PpfuFwXIWyhNDz+Q== Received: from CO6PR12MB5396.namprd12.prod.outlook.com (2603:10b6:303:139::8) by DS7PR12MB6288.namprd12.prod.outlook.com (2603:10b6:8:93::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19; Tue, 13 Sep 2022 07:56:41 +0000 Received: from CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::fd64:7bf5:2d01:5baf]) by CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::fd64:7bf5:2d01:5baf%8]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 07:56:41 +0000 From: Suanming Mou To: Yuan Wang , "dev@dpdk.org" , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Ferruh Yigit , Andrew Rybchenko CC: "mdr@ashroe.eu" , "xiaoyun.li@intel.com" , "aman.deep.singh@intel.com" , "yuying.zhang@intel.com" , "qi.z.zhang@intel.com" , "qiming.yang@intel.com" , "jerinjacobk@gmail.com" , Slava Ovsiienko , "stephen@networkplumber.org" , "xuan.ding@intel.com" , "hpothula@marvell.com" , "yaqi.tang@intel.com" , Wenxuan Wu Subject: RE: [PATCH v3 2/4] ethdev: introduce protocol hdr based buffer split Thread-Topic: [PATCH v3 2/4] ethdev: introduce protocol hdr based buffer split Thread-Index: AQHYvr58B0Qp5aISmU+WCejEWGdU5K3dDpMg Date: Tue, 13 Sep 2022 07:56:41 +0000 Message-ID: References: <20220812181552.2908067-1-yuanx.wang@intel.com> <20220902191027.666923-1-yuanx.wang@intel.com> <20220902191027.666923-3-yuanx.wang@intel.com> In-Reply-To: <20220902191027.666923-3-yuanx.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR12MB5396:EE_|DS7PR12MB6288:EE_ x-ms-office365-filtering-correlation-id: 0fc0d19a-8cc9-4694-49f9-08da955d7e82 x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PfTPd+zV0kgl0Q4dk7+yhaOdEkmiLroVmu4AF5rftVnFFEGP7pwkhfe2OT90XvwAwQ+9rArmg6Uw1thoxwj0Xe+UQNidFsxitJftGOYiUmMR4zj3rr7w/U61kF+lOPDHZ1fR05JVzCi9tfjxxn3GXVP9oBdy7w2lpwNQ/8TqTTzue/wQC71yIsGYvdpW6GuO5CGqdtR0Wk6S0n45vuTmO849nDEFQzcvqJJ6+wXJquHM8kNPxh5WHCqPrMSK8dTgYx2LPudG66gPxqmh6uxmoh5pN6bRzoKPaNRDKMe7M5ztBrTbhAscLtfrMYXJFfJ1v48kuVVRIL/s5B+hfXdLZpFUpOrcvkAfyv7m0o0YBVsLZeElCUu4xMhNfBqmoHqgZgqVJhfLoKx69cDdvLtJsEK6KOAQ3vnDvXN9ZIVhyGu3zZYLM/gJHrZTONwfQl+6UTv7kedL6hxU2rP8C9zBoitFJ99zHrhy6547CJBw8DOqkK/pVmm5WSkslWp/yWPr0I9BM47H4oIa3nBhj+uR3TP1CYZkCrfLASTq/i4IPOIvQ+iOYcClkU+D52BtKMwhX/tNPXQNNghAEpvAPeBYzwIYXF60+jZUvrnn2kfHIAcmzcLau+dzHyrToDmk4snqN/AJ9gfFPy5zNa+zcGikOBV3feOzxk/HfVFeShj+fzJUXoQa1S8YIvKmAVqLy4yZuxzFsSphjrEu+K1+LHMZYH/tUq79F9vWBod1Mlqkh4ODY75bnmWRYWBNA7n5JQ0aM0k+Ec2qdeJf0TEyUPNGhA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR12MB5396.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(366004)(39860400002)(346002)(376002)(451199015)(83380400001)(6506007)(53546011)(33656002)(7696005)(66946007)(86362001)(478600001)(4326008)(76116006)(55016003)(2906002)(8676002)(71200400001)(41300700001)(9686003)(66476007)(38100700002)(186003)(26005)(7416002)(52536014)(66446008)(316002)(5660300002)(110136005)(38070700005)(54906003)(8936002)(66556008)(64756008)(122000001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-ex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oh2E90BTWCOvfcd30cZWkX4nRe6OIhWtxcCo99Qlgabfvov8Os7BiOf?= =?us-ascii?Q?BFtxmOdd/ZK/CxVduzgcH05pVBzAvbcviti4xN+Lbx1y00QKYpLBsbDKHGKE?= =?us-ascii?Q?Ki2ODeJZrAWmy+JhnrbT2wKtOwXAyPpq5KVc6TydowDTlgOv4u5eWgV9JSLR?= =?us-ascii?Q?TUCAcbLY8L7z6ueMC784APmCxuJrvolJxwK+h+agGy9oyXP1sDx797fWN54/?= =?us-ascii?Q?BXxl4dDu93QdAG/zCMseY5WxccY0AqVYb4G5/z4euhBJ/qwE2CPaj07gGQ9M?= =?us-ascii?Q?6NNu1uBD0EE7apb4z5c8QLoNaNKquWgOf4N6nRGxOPogvVj8xo6OsqmU97J0?= =?us-ascii?Q?c2iVhnWT8659bffsspRw1KRhWcuHLnj9jW+V+hpzF5TfC7Gc0RiwpPpxPdd7?= =?us-ascii?Q?oi8FhNhJOzjdRp6VV7K4e56yCFOIdvuqrVjtZ1OZFyJGGjysx0gBnBTc/9an?= =?us-ascii?Q?c7D31qZ+up4p2IV+NPiK9uMmlPdfNINymbBkUQh86vS+Kyw8cJrwVTZxsC+6?= =?us-ascii?Q?Fn93Q+Tw9JWcIu1iPixhDyCYUOfIrf5RUpjikWonG2Epl5KZwyUpqfXJ6587?= =?us-ascii?Q?4JCbF8+pInMpTkfjCwH9EAmeUUBgTJ3+ANhKRvZZN1V8fqjJ/EmnBGjSWgLm?= =?us-ascii?Q?NaqTTE18AGB+ccReUeclNPANS4MmGgRRnxCy6Ah7HWv6FsFKIkuacP0yMXIf?= =?us-ascii?Q?o/8orsqT8GOD3Y9pXwYKNZFW/L4oCcaQquP/3l5D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5396.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fc0d19a-8cc9-4694-49f9-08da955d7e82 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2022 07:56:41.2686 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wi+8bay83yDJK/NO6XVxRhbVyiGOvLu7aW2t5XPhIdnDqLvRYdXus4KIuAv1hecAzNUcj8yyloRRViW7nlymDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6288 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 > -----Original Message----- > From: Yuan Wang > Sent: Saturday, September 3, 2022 3:10 AM > To: dev@dpdk.org; NBU-Contact-Thomas Monjalon (EXTERNAL) > ; Ferruh Yigit ; Andrew > Rybchenko > Cc: mdr@ashroe.eu; xiaoyun.li@intel.com; aman.deep.singh@intel.com; > yuying.zhang@intel.com; qi.z.zhang@intel.com; qiming.yang@intel.com; > jerinjacobk@gmail.com; Slava Ovsiienko ; > stephen@networkplumber.org; xuan.ding@intel.com; hpothula@marvell.com; > yaqi.tang@intel.com; Yuan Wang ; Wenxuan Wu > > Subject: [PATCH v3 2/4] ethdev: introduce protocol hdr based buffer split >=20 snip > @@ -1693,13 +1695,44 @@ 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; > + > + int ret =3D > rte_eth_buffer_split_get_supported_hdr_ptypes(port_id, NULL, 0); One small question, since the ptypes =3D=3D NULL and num =3D=3D 0, I assum= e ret will always be <=3D0, right? > + if (ret <=3D 0) { > + /* Split at fixed length. */ > + 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; > + } > + } else { > + /* Split after specified protocol header. */ > + uint32_t ptypes[ret]; > + int i; > + > + ret =3D > rte_eth_buffer_split_get_supported_hdr_ptypes(port_id, ptypes, ret); > + for (i =3D 0; i < ret; i++) > + if (ptypes[i] & proto_hdr) > + break; > + snip