From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 ; 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 To: Pavan Nikhilesh Bhagavatula , Jerin Jacob Kollanukkaran , "xiang.w.wang@intel.com" CC: "dev@dpdk.org" , Shahaf Shuler , "hemant.agrawal@nxp.com" , Opher Reviv , Alex Rosenbaum , Dovrat Zifroni , Prasun Kapoor , "nipun.gupta@nxp.com" , "bruce.richardson@intel.com" , "yang.a.hong@intel.com" , "harry.chang@intel.com" , "gu.jian1@zte.com.cn" , "shanjiangh@chinatelecom.cn" , "zhangy.yun@chinatelecom.cn" , "lixingfu@huachentel.com" , "wushuai@inspur.com" , "yuyingxia@yxlink.com" , "fanchenggang@sunyainfo.com" , "davidfgao@tencent.com" , "liuzhong1@chinaunicom.cn" , "zhaoyong11@huawei.com" , "oc@yunify.com" , "jim@netgate.com" , "hongjun.ni@intel.com" , "j.bromhead@titan-ic.com" , "deri@ntop.org" , "fc@napatech.com" , "arthur.su@lionic.com" , Thomas Monjalon 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: References: <1585464438-111285-1-git-send-email-orika@mellanox.com> <1585464438-111285-5-git-send-email-orika@mellanox.com> In-Reply-To: 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: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Pavan, > -----Original Message----- > From: dev 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); > >> >+} > >> >+ > >> > >> > >> > >> >+ > >> >+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