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 EFB6FA0562; Sat, 4 Apr 2020 16:27:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 46BB914583; Sat, 4 Apr 2020 16:27:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id AADAE4C8A for ; Sat, 4 Apr 2020 16:27:22 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 034EQrKm006708; Sat, 4 Apr 2020 07:27:14 -0700 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-0016f401.pphosted.com with ESMTP id 306qkqrq15-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 04 Apr 2020 07:27:14 -0700 Received: from m0045849.ppops.net (m0045849.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 034EQrJ3006703; Sat, 4 Apr 2020 07:27:13 -0700 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 306qkqrq13-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 04 Apr 2020 07:27:13 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 4 Apr 2020 07:27:12 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sat, 4 Apr 2020 07:27:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmxkO7T21X6qmIIDqCkLcjWoDbaDG8v7AetYk+nZsHq8cY5OKuxnSuSA2XxNk3NK+axTlSZbLWU1om0ZnIRfZFCrnUsorsGLZUCGBf96N2VqpBesxcqTMEgBxa28INONbWbzQuQy3zog/XWwIhEBQtEa0CKM7iR8kMFAuxSFB1Ypqzu2y1m/HyjjMuB6f18bRFKOxnRyKDN3ecif5jOy6FwLLpYbNPUS0bJFLqPiW3fQ2FjcTUWnFlzDKYduybjxGboRQH5ofc8RkIkLo5cAHTjOcB0Zjo0t//uG9h9Z7dhfU29PYLVw8GkI4yl4v+IPelD7YLyOFISbB1hJcVolxA== 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=DK5le8/wJCjRoakJBFEtG76/RSp2AIPZGIxdWzz/Qlo=; b=X4WnAFaMpmyhNKgYHP9BFX6J0k7tWEWtHwqsDI61z2d7Rj+nX28pHt3veoN3SVCZtDkLUwI9+GPhnvn5dSaaoBVXI8qLE+m+L++y/FI/1URY5FaXWuPZsRpzsTL27LEkoO51+aZG0ISCJN63P6Upnr1xjMWQ7Q1RbFfazRVgN4d6WvqP3H80zid3znMdor1/uoZVW0ULReLjwaTIpSIlhiNYWwkHM5JKnpyWl3KSEVqhuhw9RfLp6YLqHq39gEL9d9ENJqfcfWd/wqfuTjK9CXUXLfWmvoieO6Ou0mi78BJTTtfjpc99qWM9sVv0W8/bpJJcz7WP1lRHrYdUbzG17g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DK5le8/wJCjRoakJBFEtG76/RSp2AIPZGIxdWzz/Qlo=; b=ZdJ35s1JpTBVs8GJWU+FUvt5Np4v9McfLoLMIr+YaTPqiyYIMlzyPkb5Z6eBRcboMAqqrNQK+gU8richK57hemCjVPG2B2BHOlFj/bTSqAJC5X3qTbL052rvTgpNSvcwG0vmvOFivZiiaxq1w9aJJhdlVSkv00S+kee6coBUBlM= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (2603:10b6:910:7b::32) by CY4PR1801MB1912.namprd18.prod.outlook.com (2603:10b6:910:76::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Sat, 4 Apr 2020 14:27:10 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::7424:c6cd:94f2:b27b]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::7424:c6cd:94f2:b27b%4]) with mapi id 15.20.2878.017; Sat, 4 Apr 2020 14:27:10 +0000 From: Pavan Nikhilesh Bhagavatula To: Ori Kam , Jerin Jacob Kollanukkaran , "xiang.w.wang@intel.com" CC: "dev@dpdk.org" , "shahafs@mellanox.com" , "hemant.agrawal@nxp.com" , "opher@mellanox.com" , "alexr@mellanox.com" , 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.net" Thread-Topic: [EXT] [PATCH v1 4/4] regexdev: implement regex rte level functions Thread-Index: AQHWBZX54UsASpZbek6bztL98vA/6qhpAT8g Date: Sat, 4 Apr 2020 14:27:10 +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: <1585464438-111285-5-git-send-email-orika@mellanox.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.181.63.42] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 552c511c-7b0a-41cb-4399-08d7d8a4430d x-ms-traffictypediagnostic: CY4PR1801MB1912: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 03630A6A4A x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1801MB1863.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(39850400004)(136003)(366004)(396003)(376002)(346002)(7696005)(8936002)(316002)(6506007)(26005)(71200400001)(8676002)(2906002)(478600001)(110136005)(81156014)(54906003)(186003)(66556008)(76116006)(4326008)(52536014)(7416002)(81166006)(66446008)(64756008)(66946007)(66476007)(86362001)(5660300002)(55016002)(9686003)(33656002); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 08LgB3JgM3pOtdpypjEmq9bYbhenIKDY5lDqMGpVq6c9XwyLPXdoqRpEMiKr3Bv0Lzg1UoAPb78mIQebpZdnh90kh3mrFihnQkG5V8B7xh1Bx6ll08d8WNYXJBkVqVCGMMBhVtIcII47ZYTtsQAsWi8An8UKkx8JvfJTgfBmf+eVu+Jv9Os5QQhjbnMZDC8g7nomGLJgYUq2bvYc0xQnsgVyk6PnrtYXmXnlxGEBR1JTK/1aK1OHV8LnL2Q7Lp17xsDy0tD1ojDdM6Cu8PeDvzQ1X2LDMzQziEkAtFUCFraQUQLb7JAD9qYpbFXGwKl1TRBjNT5bhxz4AxrUx+AOV8cInUW/eWkLfl4bYXR/kLZEgwciWOecLa6ZwiyqRd5CrMHYn+08HEvZpUBAVokn6h42TkYoD/OWolrXlKdtRfjPWjVD1E9aS8GqZnNAZMWO x-ms-exchange-antispam-messagedata: YL0vgbrFr3I6g5lG7g++K9ESKNxLeUiFC6xRlYLNHpl98DG39ycj0YQOJe+cQrtxqH6hwAu3LBSfFW53dKt9+LeyBq2yz7zQ3zeIymzJSJJCya4E2oCFRKkLLzBKttDKGlAKtxaUjDZG4MxR7P8wBg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 552c511c-7b0a-41cb-4399-08d7d8a4430d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2020 14:27:10.5034 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yXawYpwp37I+XS7j37ylxzCsEHsL7L6hExTAUf4OOVNeDqcDYovAfim1LIJdAOSciTZMxDSVT7jJKoC23Gksjo5wIlrx3CNLzIhLoClmAzQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1912 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-04_10:2020-04-03, 2020-04-04 signatures=0 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" >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; > } >+ >+ >+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; We should use macro for this similar to ethdev/eventdev across the file. RTE_ETH_VALID_PORTID_OR_ERR_RET RTE_FUNC_PTR_OR_ERR_RET >+ 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; Please handle re-configure cases, add error checks for cfg passed based on = dev info. >+ 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. >+ >+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