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 47100A034C; Tue, 11 Jan 2022 17:18:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1A5042736; Tue, 11 Jan 2022 17:18:32 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 7663441143 for ; Tue, 11 Jan 2022 17:18:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641917910; x=1673453910; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=uygvrs3mSqA54QptdKlJ1lyFcv2E27OyguY7rzOp5YA=; b=P4ERm83mf0jVrktaPxGV1NwrNFUTkD6QkE/Nw1SvYYdJWs1i+9wWFmZY znU5YBGDUAaTv0Wj2Zg2ErMiN58Gfl2E+n11WXZ/Dh9I8JpQFKP3j6LfX jOZJJk4nR66/Q19JwnpuQXCufXyx2FPR3lOFCbzo0ZU0tSrjg51u22pcp t90C47GTkozv+4OOZNuDCnBCg31BNk+p0d5G2vKyXyAX6lGapRLAXkP9E pjwR0iJ2wadq7QWtAJJwKVKjFgwkYcIo5Bmrw5Rrd1QcDrD6O1AoVQN6T pSnkTLioInBubfYmDWcNBERYDqrM5WUG73RPvyHVcpe4JbMJWABGP17iz g==; X-IronPort-AV: E=McAfee;i="6200,9189,10223"; a="243474983" X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="243474983" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 08:10:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="762572782" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga006.fm.intel.com with ESMTP; 11 Jan 2022 08:10:09 -0800 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.20; Tue, 11 Jan 2022 08:10:07 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.20 via Frontend Transport; Tue, 11 Jan 2022 08:10:07 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 11 Jan 2022 08:09:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FBdBFYi3woBKF50mesjohlnU+BpOfTWWeHdRX84pr/CqYXQ/cz0v/pAH4Xd8700I25tnrrl+84TD6ysySO/O+fdkTKYgmq+8EE3uaaAPsxiHE+yyE/eeGeLDMjQVMTwnNpgACQomZlHIhDQIa29W4VUFrpVapEgJtllDWW/0AeUzcmRIjmoiWXntvGOMiclttBZ4W3ng/3ZrSrMozjyta17Q/L5aZJTo9oSlbobqrHrEkLcGYdNXKzxaXES3rygn8TBiAxu+jrkp5yBzHla4WwPmEQfxGjUeE62K8XFzZOeo8Qq9lKQKzcbsiXnR3Ytd4aP+9QyPkA0iUyicIkpl6g== 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=rQ3jBSNWRcD15vMeZhLLtAN9l8gF1mGsQBlmaq1BNJo=; b=l/luaAOhitTmskqB+uLBwa95UCi8wUwkmaCKOtNeMSnDYA8+kn14KhC3X56YTC1ZWT5GXpk6nffyotVz6QZK5lIx3eEzxDzdt1tUPW18pfrSeSU00O9DgaoRS+ywjRJy0XF5cLcp++xnvKvduCmzDRdV8QAsxGb75tF9vB3MW9xJLQTBx+/qnenPH5HSVHeneMnlgDFx7w8+fgMz4H3ML/9BAWdD0vdxKh3q9WqyUiZT2yilRujRPcmffdyepJKzzsDQ8noLqPGNxfSWZTlJkXymp5BJcIaJtWy1sgeMnk78QqL0Kw3XTwdAub59lUEpLBG0Lw+PuB2jE+C8Hctcew== 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 DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3274.namprd11.prod.outlook.com (2603:10b6:5:b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Tue, 11 Jan 2022 16:09:56 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2%3]) with mapi id 15.20.4888.009; Tue, 11 Jan 2022 16:09:56 +0000 From: "Ananyev, Konstantin" To: Akhil Goyal , "dev@dpdk.org" CC: "anoobj@marvell.com" , "Nicolau, Radu" , "Doherty, Declan" , "hemant.agrawal@nxp.com" , "matan@nvidia.com" , "thomas@monjalon.net" , "Yigit, Ferruh" , "andrew.rybchenko@oktetlabs.ru" , "olivier.matz@6wind.com" , "Xu, Rosen" Subject: RE: [PATCH 2/8] ethdev: add dev op for IP reassembly configuration Thread-Topic: [PATCH 2/8] ethdev: add dev op for IP reassembly configuration Thread-Index: AQHYALPTAeqGGhhhEUOj73nYsC3Sy6xeCRBQ Date: Tue, 11 Jan 2022 16:09:55 +0000 Message-ID: References: <20210823100259.1619886-1-gakhil@marvell.com> <20220103150813.1694888-1-gakhil@marvell.com> <20220103150813.1694888-3-gakhil@marvell.com> In-Reply-To: <20220103150813.1694888-3-gakhil@marvell.com> Accept-Language: en-GB, 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.200.16 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: 13263578-d71e-41a9-fbc3-08d9d51ccf31 x-ms-traffictypediagnostic: DM6PR11MB3274:EE_ 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: wQKF2+EHqSeK4asLAcSMMPxGF84pR+WLhohRj1HWBZ5XCEXn8OSDDftYKy3wsmmFGfzq27CccudmBrsG+F88uvr4nqFPH8RFuoJwZcsA43etLikp0d6BGCNJIj1ai4hgZx9XeHsIPwcAbDdyOZRXZG8vBfJ4SVpB7soK0vVTaMDeXvNQ0ZmO3tuk+fEAPWJoG0DL/H/dXlSNcWk31IUdz2eaKft9IQ8/GmxZWvCKUrx7TR479gm45eS+nnE5z9OW0UMSqc8YaXaz2hD6gKH31PFp/xI7Z6BN3Do+fn4yR5CJTsWFX2zWEgSQ/fF38lnpJ2SzXAv/mN8GmzvOkiiH/BwkYGF2X/jdguP15GEKiFmMNZ21x+IK9OvcQ77oo0MNoaNWtkxmKCJwlO2242sLw8QJ3XBv2fuX7/Ot/aModtC2ReEeg4Nv8x7ycqJGbG3Eh3C0vNBJ5wsRSxFd22L86opM+wcWYRafDMDU96aVjpPo5cKU3AcPVWeAaBFOkN5IC5bopNUT1NMLKZSfQa33lluZGZnUu5VSHaSpoj1mvT9/rcHJtw6ddulZU35FYjggaPPW+/FNjLa5kf2TN2ktwJq5rFiSJO4yGzifQLSphBxCIyV2QzZTFEpqtAoNcNMTl7qNe0LbGHB/A8NdsZGnh2lBNsUpwJOoq0e19ekDz2v3/+EdxKFksX0XwWxBLxkMf3fyyJ0EqPxZXWVXd0OASg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(107886003)(508600001)(6506007)(26005)(52536014)(8676002)(38100700002)(38070700005)(71200400001)(122000001)(76116006)(7696005)(55016003)(64756008)(2906002)(186003)(66556008)(33656002)(66946007)(316002)(66446008)(66476007)(82960400001)(5660300002)(86362001)(9686003)(110136005)(4326008)(54906003)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LKUDYJwENPbHaylpZ6BDiHMCRCVSH5eAZtEdRJwsO+/ES6BijCYLcDPGm7jg?= =?us-ascii?Q?n/CA8D0uqqLntP9fMlwbFumNzcyGJarICBOMGw2ocVfoBFwlM3pYYaP5KD+g?= =?us-ascii?Q?MsEEA7Hd54VLZy+CYJdD4theuHxZCIJ3GlkYCQywxfNrqQ295WDNHn2m4+lj?= =?us-ascii?Q?w53Kk7EltQPQhDVgYafimnzift3LiA2OVX2bk9Xn7Uu2wYfYPRyXd7THPm9t?= =?us-ascii?Q?ZtHyn7vVblwzitwchUz+JqdeeBbk4s7Gs5/6RoMWjvzzGRTRMMklJbGsi/Yk?= =?us-ascii?Q?Id6D3R+jHXUB7lLzQ4xrvuSbPjn/omaDrh6N2gcdTJnnYEVrg1djCZ+pJSr1?= =?us-ascii?Q?f4viSyW4k41Rd0DdLKDoue/+oOAoB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?= =?us-ascii?Q?PkNjtgjIFM4Cr1EemORWAmc/q7y7yDJHsaZtXOzLuVdIm/U+A8On7y5OFy7R?= =?us-ascii?Q?bTzCUxVcmF8qkz3I2GqUM0esIMZ9kNnjl6hfUXzeiH1n2TC+fLH7WgdlY6df?= =?us-ascii?Q?/e+RyFHmPvts2qfPc5EPMnuf4cW5LAPYfpQgjpTwVWO1jpWFUMkZkjDYmyRF?= =?us-ascii?Q?MsMn2giPCOOLbd903YBVIxO7bJKb6Zui0bRGCNnrqKBlsReTK3DONBmlVjdq?= =?us-ascii?Q?LMxcJpLeaHeqyxnic2tSEYT2ZAXwzFuVkIFkX4Oixl/NWTW+8c+XjV3sfjAh?= =?us-ascii?Q?q/6VlUcvNAJ2Gth83oWkeiM6XktuwoHSC9h4cMw2pbGWcOBKmUHW2Bm7atQ9?= =?us-ascii?Q?H+OfLjbDmmlfbPb6sU41GP3qEA5AU8rB9OeCWwmH8Ip809ALuj1jLG2uwiKB?= =?us-ascii?Q?+gH5xQ=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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13263578-d71e-41a9-fbc3-08d9d51ccf31 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2022 16:09:56.0189 (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: HtiVWEQM/LPWybINzBGxGJxvjFhIS88sQgmv2zPa40tAotsLwZx7cAOKdPi6sKxw6jizKPSlq2ACJHnmh9SfelW9Z3sN9GUG1108GlrufiA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3274 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 > A new ethernet device op is added to give application control over > the IP reassembly configuration. This operation is an optional > call from the application, default values are set by PMD and > exposed via rte_eth_dev_info. > Application should always first retreive the capabilities from > rte_eth_dev_info and then set the fields accordingly. >=20 > Signed-off-by: Akhil Goyal > --- > lib/ethdev/ethdev_driver.h | 19 +++++++++++++++++++ > lib/ethdev/rte_ethdev.c | 30 ++++++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 28 ++++++++++++++++++++++++++++ > lib/ethdev/version.map | 3 +++ > 4 files changed, 80 insertions(+) >=20 > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > index d95605a355..0ed53c14f3 100644 > --- a/lib/ethdev/ethdev_driver.h > +++ b/lib/ethdev/ethdev_driver.h > @@ -990,6 +990,22 @@ typedef int (*eth_representor_info_get_t)(struct rte= _eth_dev *dev, > typedef int (*eth_rx_metadata_negotiate_t)(struct rte_eth_dev *dev, > uint64_t *features); >=20 > +/** > + * @internal > + * Set configuration parameters for enabling IP reassembly offload in ha= rdware. > + * > + * @param dev > + * Port (ethdev) handle > + * > + * @param[in] conf > + * Configuration parameters for IP reassembly. > + * > + * @return > + * Negative errno value on error, zero otherwise > + */ > +typedef int (*eth_ip_reassembly_conf_set_t)(struct rte_eth_dev *dev, > + struct rte_eth_ip_reass_params *conf); > + > /** > * @internal A structure containing the functions exported by an Etherne= t driver. > */ > @@ -1186,6 +1202,9 @@ struct eth_dev_ops { > * kinds of metadata to the PMD > */ > eth_rx_metadata_negotiate_t rx_metadata_negotiate; > + > + /** Set IP reassembly configuration */ > + eth_ip_reassembly_conf_set_t ip_reassembly_conf_set; > }; >=20 > /** > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index d9a03f12f9..ecc6c1fe37 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -6473,6 +6473,36 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, ui= nt64_t *features) > (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); > } >=20 > +int > +rte_eth_ip_reassembly_conf_set(uint16_t port_id, > + struct rte_eth_ip_reass_params *conf) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev =3D &rte_eth_devices[port_id]; Should we check here that device is properly configured, but not started ye= t? Another question - if we have reassembly_conf_set() would it make sense to have also reassembly_conf_get? So user can retrieve current ip_reassembly config values?=20 > + > + if ((dev->data->dev_conf.rxmode.offloads & > + RTE_ETH_RX_OFFLOAD_IP_REASSEMBLY) =3D=3D 0) { > + RTE_ETHDEV_LOG(ERR, > + "The port (ID=3D%"PRIu16") is not configured for IP reassembly\n", > + port_id); > + return -EINVAL; > + } > + > + > + if (conf =3D=3D NULL) { > + RTE_ETHDEV_LOG(ERR, > + "Invalid IP reassembly configuration (NULL)\n"); > + return -EINVAL; > + } > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->ip_reassembly_conf_set, > + -ENOTSUP); > + return eth_err(port_id, > + (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); > +} > + > RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO); >=20 > RTE_INIT(ethdev_init_telemetry)