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 46C5FA0577; Sun, 5 Apr 2020 17:04:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 211BE1BED0; Sun, 5 Apr 2020 17:04:43 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50061.outbound.protection.outlook.com [40.107.5.61]) by dpdk.org (Postfix) with ESMTP id 63164F12 for ; Sun, 5 Apr 2020 17:04:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jEl6nBxThZh68nRbP+VBHd3sy/MdYEEC++qrJ3AJeP7UdVgF5Yb/dT/dIhNfjiS+zJcAUS4uEvcUM6SiNqD5TO2atd1FvMc2/GAn4T3MbF7lB3ZM6rvusergTYbaHdPTzgABZ98E6tRhuiNHqQYwLdxh3FbCko6glzFN7qahERrP+kpitq4Br/JYCH1BtsGP7nF4jjIQt9CcwTzsHNKk9uTP1kM/x7+63phwVlw5505hLBxKloNciR62ptfl9UJkhzZov7tilf9l7DTup/9ptsmSTU0NKT21xagnNkSE5BQInHciUIRByKa11+lLyoS0SID5c6YMAHwZHV3vv00sKQ== 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=9kwB6YctHENNisWiSxlZW3yq4RX00xN4oG2cuRpTBVE=; b=BRbMDGENwNo1C4KSNc4r0H6a5rr5gi/uV1hsZND730YJD6oAwDRRE1kTywH3RoPsR4wCesflb/HowngEDAi8936pX9a/A2rQn5Z9YmseQb5YabHegypqf2evpSlaz85/nrQBHHTvAFRYJZfRWD/dPCU9WsXCcJK4GQT07dCHrRk8kH/ltFy5499gC0k7/k+s/4xx9VC97jbZ0SvXtA1g7TOCBfd3BtnjC8QjIBRT6JBBq3P9ohUJ/we5azChw2Gc3kaJecwdrdx+eU78ZNCCuROVwbjuhe4/khiN5g9+3Z99EB0/6+mKc3DAgjtZtRP1tvo84o0RLd4I6iPOMe0vLQ== 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=9kwB6YctHENNisWiSxlZW3yq4RX00xN4oG2cuRpTBVE=; b=e+hH+6eM1oyAo8jGEUspV1Yr+TtU1ZGBNzzYlSj7O8+x8bdRZ76o7TS1K/r83ILROOG5McDXIIlMSPzn8ZLc64NBfDqqg/rl9mQ5HKF41RNwekm31+YXupAsD33g0o96o8e7OLl43N8xSA6UDIwVpru9GDDjbOcsJPh16AOPLBI= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM6PR05MB4357.eurprd05.prod.outlook.com (2603:10a6:209:48::23) 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 15:04:41 +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 15:04:41 +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+suvSvkE26hpDxQAgAGWWyA= Date: Sun, 5 Apr 2020 15:04:41 +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: 3c36a638-185c-4290-007f-08d7d972aadb x-ms-traffictypediagnostic: AM6PR05MB4357:|AM6PR05MB4357: 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)(136003)(376002)(396003)(39860400002)(366004)(346002)(478600001)(71200400001)(86362001)(26005)(6506007)(4326008)(55016002)(9686003)(186003)(110136005)(316002)(33656002)(81166006)(76116006)(2906002)(5660300002)(7416002)(66446008)(54906003)(7696005)(66476007)(8936002)(8676002)(64756008)(66556008)(81156014)(66946007)(52536014); 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: QZ0kDzhi6sfaTj5MFcH88ag8dVICMVgsbtH28Xm+W1zDggAzN0VmLcY26N73rtHyRASp0f/IC+GC4yEJNkUxeq17GKFRwRWBpOBezO9aDTvBv+9d4v+d6hE0WIegfvgYINc8Di6oTIDlnoz+KxyJ1NwDRWnJm/5Ax6p7PTLGFJ1AhXVqZJNg4lTbrcXQaKLNPNIEHHmjVKvI15DQ7gwCIRv008Otgygx0wbInmlM9gy02ObdudB+uhX5BhjVgVmbyzmVzdpgM4Xc4VGYo7y9Vh9D/kF7BgB+EbfwhuNTy4iwwB8y4vY23EAG1kHSDtf1zKCk5uZh8wVtlAHpWYcgXb+jo4GuJdYlfusdAoAHCk730crO0hm1BSf4kXWcTiUcBTm9K9YF0SxN23y4ZJ6nCzO3+q6i1qNCmf/hfWaOYFSoICgMYK89PMwWla6VafC+ x-ms-exchange-antispam-messagedata: /9jzepRVqeAzSRsG5iCrf5ehOW1RnaM3nj8EP5WV12GiCkv9BQ0hFnw9oJIgwc8REmtI11jCavh+ZdWiLtcf78djtGOZmBa6tMw2i9mJ/px1VoaTTJVFtphgw9PZCM6QKApvT3bqYls/3QcPOtaB2A== 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: 3c36a638-185c-4290-007f-08d7d972aadb X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2020 15:04:41.0503 (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: 8LJ+zwi9yO/Il7y0WnllrUnR5e71QZ4MYa3Vgz3POxKs8rPHVPTyYINdpzvQ1p+uWzuSLxUofe3N2lQm3R410g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4357 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, Thanks for the review, PSB Thanks, Ori > -----Original Message----- > From: dev On Behalf Of Pavan Nikhilesh Bhagavatula >=20 > >This commit implements all the RegEx public API. > > > >Signed-off-by: Ori Kam > >--- > > lib/librte_regexdev/rte_regexdev.c | 298 > >+++++++++++++++++++++++++++++++++++++ > > 1 file changed, 298 insertions(+) > > > >diff --git a/lib/librte_regexdev/rte_regexdev.c > >b/lib/librte_regexdev/rte_regexdev.c > >index 4396bb5..72f18fb 100644 > >--- a/lib/librte_regexdev/rte_regexdev.c > >+++ b/lib/librte_regexdev/rte_regexdev.c > >@@ -76,3 +76,301 @@ > > { > > regex_devices[dev->dev_id] =3D NULL; > > } > >+ >=20 > >=20 > >+ > >+int > >+rte_regexdev_info_get(uint8_t dev_id, struct rte_regexdev_info > >*dev_info) > >+{ > >+ if (dev_id >=3D RTE_MAX_REGEXDEV_DEVS) > >+ return -EINVAL; >=20 > We should use macro for this similar to ethdev/eventdev across the file. >=20 > RTE_ETH_VALID_PORTID_OR_ERR_RET > RTE_FUNC_PTR_OR_ERR_RET >=20 O.K will move to macro. >=20 > >+ if (regex_devices[dev_id] =3D=3D NULL) > >+ return -EINVAL; > >+ if (dev_info =3D=3D NULL) > >+ return -EINVAL; > >+ if (regex_devices[dev_id]->dev_ops->dev_info_get =3D=3D NULL) > >+ return -ENOTSUP; > >+ return regex_devices[dev_id]->dev_ops->dev_info_get > >+ (regex_devices[dev_id], dev_info); > >+} > >+ > >+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; >=20 > Please handle re-configure cases, add error checks for cfg passed based o= n dev > info. >=20 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. I think it is the responsibility of the PMD to check.=20 > >+ 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); > >+} > >+ >=20 > >=20 > >+ > >+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); > >+} >=20 > Move these functions to .h in-lining them. > Also, please add debug checks @see rte_eth_rx_burst/rte_eth_tx_burst. >=20 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