From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <dev-bounces@dpdk.org> Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA8F8A0577; Sun, 5 Apr 2020 21:46:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0CF342B83; Sun, 5 Apr 2020 21:46:50 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80079.outbound.protection.outlook.com [40.107.8.79]) by dpdk.org (Postfix) with ESMTP id 721C8276C for <dev@dpdk.org>; Sun, 5 Apr 2020 21:46:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvv3SygpBfChlz7MFvbx39XQbria5tFr1xMo4WQLFH+vD/ylb2OQxEFg0EGYIRUlX7sYqxcoXDf9mlrEL/FyfyMah5NrCYQkFuVEGxQ/BsrTEzhm7tH1LXruXi4xdcNd0sEga+8avmRw5IbMtAbYj+f2GiGVrknUoJ91bfyll2YFt5A9KkV5mS6XBBzlJGo7U7bmNFcNtOFOqFuhiMe21IucfETDmyNVkEJJO8/DAfJkH08w2gp78S4W+JSnMcqZ1iSGAExEZGlZ910mjwN400aBDXtdfUu8RwMq0VnFi+5+4IuQ5iMU3qZ38Mmy28GRi75RkXOBXbx5DpeJOIb7XA== 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-SenderADCheck; bh=RKm4iw+EwoneiFUI7GJXO/xnmR2414zpwu6ciDDH1ps=; b=ZZxD8jvGUci0+Vs1F51Fr7Ho9yYQUCgyFbvL3pUK8kjkKFZOqFTTFmTGYyDnUj99D83xUrf9REf9GYQ4gxUDq/ZJRjbzmO1zWPefVVcospUEkuUkEH3j/Uv1Iz4ZhCTzmJQC/yThtDhF988TDevkZIVy6eWse3nBcwoZC4bhR0dVDMcOXjAFcPRSaudQJf/V6JMAeNhEhcL2249Yg+RnCmB0Io+OBgKuRRI23AsUEfje5ee5hEC9xXPauCnqFx0nSoHW1JJYsdmNHpt9kIpJ2BuzCMke42+9+8PaBSvkIlgrJ3TB1xqfTauWyc8Mhdq35XH9ZpCVowzfKVsXok30sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RKm4iw+EwoneiFUI7GJXO/xnmR2414zpwu6ciDDH1ps=; b=jw20ipU+u1j8xI3dKKDHwf0DFVTu2zJgeyqDLF4ht/rOK7wDlnju/foZT4YZ984+uw57tWprhyeyJUP+rRlwFccx2t2xMCv+PAFqNvDXGu4N/RA1IcafadFgRN2MhTIS/DMw8w0A97ASFrtog9aWjDwzKIflDfVJGVT55qB7MDs= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM6PR05MB6039.eurprd05.prod.outlook.com (2603:10a6:20b:ac::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.19; Sun, 5 Apr 2020 19:46:47 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::f5cd:b10f:5f1b:4b22]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::f5cd:b10f:5f1b:4b22%7]) with mapi id 15.20.2878.018; Sun, 5 Apr 2020 19:46:47 +0000 From: Ori Kam <orika@mellanox.com> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>, Jerin Jacob Kollanukkaran <jerinj@marvell.com>, "xiang.w.wang@intel.com" <xiang.w.wang@intel.com> CC: "dev@dpdk.org" <dev@dpdk.org>, Shahaf Shuler <shahafs@mellanox.com>, "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>, Opher Reviv <opher@mellanox.com>, Alex Rosenbaum <alexr@mellanox.com>, Dovrat Zifroni <dovrat@marvell.com>, Prasun Kapoor <pkapoor@marvell.com>, "nipun.gupta@nxp.com" <nipun.gupta@nxp.com>, "bruce.richardson@intel.com" <bruce.richardson@intel.com>, "yang.a.hong@intel.com" <yang.a.hong@intel.com>, "harry.chang@intel.com" <harry.chang@intel.com>, "gu.jian1@zte.com.cn" <gu.jian1@zte.com.cn>, "shanjiangh@chinatelecom.cn" <shanjiangh@chinatelecom.cn>, "zhangy.yun@chinatelecom.cn" <zhangy.yun@chinatelecom.cn>, "lixingfu@huachentel.com" <lixingfu@huachentel.com>, "wushuai@inspur.com" <wushuai@inspur.com>, "yuyingxia@yxlink.com" <yuyingxia@yxlink.com>, "fanchenggang@sunyainfo.com" <fanchenggang@sunyainfo.com>, "davidfgao@tencent.com" <davidfgao@tencent.com>, "liuzhong1@chinaunicom.cn" <liuzhong1@chinaunicom.cn>, "zhaoyong11@huawei.com" <zhaoyong11@huawei.com>, "oc@yunify.com" <oc@yunify.com>, "jim@netgate.com" <jim@netgate.com>, "hongjun.ni@intel.com" <hongjun.ni@intel.com>, "j.bromhead@titan-ic.com" <j.bromhead@titan-ic.com>, "deri@ntop.org" <deri@ntop.org>, "fc@napatech.com" <fc@napatech.com>, "arthur.su@lionic.com" <arthur.su@lionic.com>, Thomas Monjalon <thomas@monjalon.net> Thread-Topic: [EXT] [PATCH v1 4/4] regexdev: implement regex rte level functions Thread-Index: AQHWBZYC14cVuCMYqUCa+suvSvkE26hpDxQAgAGWWyCAACN1gIAAKxxw Date: Sun, 5 Apr 2020 19:46:47 +0000 Message-ID: <AM6PR05MB51761BC1D961D5E334FD76A4DBC50@AM6PR05MB5176.eurprd05.prod.outlook.com> References: <1585464438-111285-1-git-send-email-orika@mellanox.com> <1585464438-111285-5-git-send-email-orika@mellanox.com> <CY4PR1801MB1863A08938589F62A5081CD4DEC40@CY4PR1801MB1863.namprd18.prod.outlook.com> <AM6PR05MB5176F58F7ED4283BE956F9CBDBC50@AM6PR05MB5176.eurprd05.prod.outlook.com> <CY4PR1801MB186326152FD4A4501E9B92A7DEC50@CY4PR1801MB1863.namprd18.prod.outlook.com> In-Reply-To: <CY4PR1801MB186326152FD4A4501E9B92A7DEC50@CY4PR1801MB1863.namprd18.prod.outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [185.175.32.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8cea7a51-5b86-44fb-7b0a-08d7d99a13ee x-ms-traffictypediagnostic: AM6PR05MB6039:|AM6PR05MB6039: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: <AM6PR05MB60392F09D2C9449922795622DBC50@AM6PR05MB6039.eurprd05.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 03648EFF89 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB5176.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(346002)(376002)(366004)(136003)(39850400004)(4326008)(6506007)(186003)(7696005)(66446008)(66946007)(76116006)(478600001)(66476007)(66556008)(7416002)(86362001)(26005)(2906002)(33656002)(5660300002)(64756008)(71200400001)(52536014)(316002)(8676002)(81156014)(55016002)(9686003)(54906003)(8936002)(110136005)(81166006); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ElHhkHOgFbQnKmpXMQhPRI0IQuI1NMl7qMAPDLAQjYqlFMG3yuWzljC+6wldSE7oCBu7RE7owEBSURQhBj1TKZt1M9cHVrFr9d+O25PvH8r0MMsClzlPELGs5hnfIqyArqejwywyZNujfbw7kbhscLQi4JyIyJ7crzlGSPWmSuuQoXTK5Bl3abzGfVMtHWkNbE+DMQuYZklbLazXozLdxjWG/sLxINUv+L8d6sC3mjG32LoF/jfSvi8LBx4ALdU+M4I3mQEz7sGpe0oXHhmebUS+DB+uqQfByjeRTWBEHJtHnB4f/bhWcpiCu2gI6aqkMbtUCEEGDbS/XtlvpQu8oMJYcTl5PaLo5Bjm5M9kSSqOdntxxeBU643qHNjGtwdIdEWZTHHA9gn6pzCB6oqMPsVEoNejdqfmFhGzAq25bb5RFDK73K9DEmdebvyAUraq x-ms-exchange-antispam-messagedata: 7iNqPvSknbK4dBJRDpLhrZc+gqxpthg2eZUZqmw+ZvXuoekpwTGE2IEwFDnBn4fxiOD0zcye19GZg+xoARIWWaM7RbB8yXV54K6jcKoUB1roSxcJSge2ugnuqaQLDC02xiq0ncOULGxbZFYHxPYI9Q== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cea7a51-5b86-44fb-7b0a-08d7d99a13ee X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2020 19:46:47.7032 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UuWMbf76EBZgucIYEJHuZfg4bh5Uw24nAM4gRZFrMwqNpDicvHAQuPotQGmQz0L3TexaSKgFFmdXsnOeazL2bQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6039 Subject: Re: [dpdk-dev] [EXT] [PATCH v1 4/4] regexdev: implement regex rte level functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> Hi Pavan, > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Pavan Nikhilesh Bhagavatula >=20 > >> >+ > >> >+int > >> >+rte_regexdev_configure(uint8_t dev_id, const struct > >> >rte_regexdev_config *cfg) > >> >+{ > >> >+ if (dev_id >=3D RTE_MAX_REGEXDEV_DEVS) > >> >+ return -EINVAL; > >> >+ if (regex_devices[dev_id] =3D=3D NULL) > >> >+ return -EINVAL; > >> >+ if (cfg =3D=3D NULL) > >> >+ return -EINVAL; > >> > >> Please handle re-configure cases, add error checks for cfg passed > >based on dev > >> info. > >> > > > >I don't think the checks that you suggest should be done in this level. > >The RTE level isn't aware on the specific capabilities of the PMD. >=20 > PMD capabilities are standardized through dev_info. > All the PMD capabilities needs to be exposed to RTE level through dev_inf= o else > how would an application using rte_regexdev would know the capabilities o= f > the driver. >=20 The capabilities are exposed to the application using rte_regexdev_info_get= . > >I think it is the responsibility of the PMD to check. >=20 > The checks would be same for all the pmds which would just be unnecessary > code repetition. > Instead RTE layer should probe dev_info and compare against dev_configure= . >=20 I accept your comment I will add the missing checks, and re-configuration c= ases. > > > >> >+ if (regex_devices[dev_id]->dev_ops->dev_configure =3D=3D NULL) > >> >+ return -ENOTSUP; > >> >+ return regex_devices[dev_id]->dev_ops->dev_configure > >> >+ (regex_devices[dev_id], cfg); > >> >+} > >> >+ > >> > >> <Snip> > >> > >> >+ > >> >+uint16_t > >> >+rte_regexdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, > >> >+ struct rte_regex_ops **ops, uint16_t nb_ops) > >> >+{ > >> >+ return regex_devices[dev_id]- > >> >>enqueue(regex_devices[dev_id], qp_id, > >> >+ ops, nb_ops); > >> >+} > >> > >> Move these functions to .h in-lining them. > >> Also, please add debug checks @see > >rte_eth_rx_burst/rte_eth_tx_burst. > >> > > > >O.K will update. > > > >> >+ > >> >+uint16_t > >> >+rte_regexdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, > >> >+ struct rte_regex_ops **ops, uint16_t nb_ops) > >> >+{ > >> >+ return regex_devices[dev_id]- > >> >>dequeue(regex_devices[dev_id], qp_id, > >> >+ ops, nb_ops); > >> >+} > >> >-- > >> >1.8.3.1