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 00645A0577; Sun, 5 Apr 2020 18:48:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1C9A1BED1; Sun, 5 Apr 2020 18:48:52 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 933351BECB for ; Sun, 5 Apr 2020 18:48:51 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 035Gk3W3030250; Sun, 5 Apr 2020 09:48:35 -0700 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-0016f401.pphosted.com with ESMTP id 306srm36pw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 05 Apr 2020 09:48:35 -0700 Received: from m0045851.ppops.net (m0045851.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 035GlYXE031535; Sun, 5 Apr 2020 09:48:35 -0700 Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 306srm36pu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 05 Apr 2020 09:48:35 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 5 Apr 2020 09:48:33 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 5 Apr 2020 09:48:32 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.57) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sun, 5 Apr 2020 09:48:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LkaCfAIX8z5lw2qyJyvG8QCVSavixZzVJgcyz0V0MS6vZzlZt6niiNYWlkg0XoS4Cf2UEQqXatekcROM0SJhqB44mCvFGV84xtys2gVDd6Q43yitlRKUx4e5hEmnGXvWNEpEEyp8F90gwD/vW8AN2Icm2ILgcEx6++I8P0uluEFt4yGWBIeK4307Ln8mV9OfSApIYkxjL08n1Rjtx1/cgi4EXiiEbvAMYhLGpNid2mNkdNhlXvSdAJs0CIqzsR64Is+nBftRW00V+iK/a9oJJYc28pXJoB2KUwD5udL0eEk9SDo68II21qxKmRvb9LXqbAWLqdT9A7GcCoxkIsKaWA== 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=wo7otmZWypoK+jnRWG6/S3utyu2swyXzy0s/BAc0pqU=; b=GAMNjNcowUcGWUCz0/n114fnmh3tRfCjjKXci0hIRnRjm3d8rdaC4ganz24JE2B81H1O9QjV/RCf37DlyLQlwuYRvs/HpzszPU/oL/Eu8mRTZkrRY9nFF2/aipZ+Y+j8dEWufNn+KT6Q3YYKCMpNbURtF0/esZVUlS+DjIloYcxAJUPAnblDKOepfhIqa5HokwJXF6WFBbLI3j+8HV+v3lcC6KYG4vnt2fBo9IfxF+e5JO5lzob14clrZUTq/GEJx4NdabfpoeMEJQ+Sv9mRI5mWhCFNuHSiXUx0wQT0qqvHzRe0TNJykqxMwHN1uYccpzmnoYaWXHyEt7DMNJTxdg== 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=wo7otmZWypoK+jnRWG6/S3utyu2swyXzy0s/BAc0pqU=; b=N7am1+Xl6qRERZIjOuNLYxzc5V0CENQ0262HEJ/hNPI7zobmq8D0J8o2zQAWXbt3j+0O4NXaAxQUJaTKhkoI8HSsHVlKfHssNuWy5+gcpARMjVYqQbixSXsE042ug8iTATwRrO2ojPZksuUqECNWg6h+InAsj14IK3YzBcrQXlk= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (2603:10b6:910:7b::32) by CY4PR1801MB1991.namprd18.prod.outlook.com (2603:10b6:910:7a::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Sun, 5 Apr 2020 16:48:30 +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; Sun, 5 Apr 2020 16:48:30 +0000 From: Pavan Nikhilesh Bhagavatula To: Ori Kam , 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: AQHWBZX54UsASpZbek6bztL98vA/6qhpAT8ggAGqpYCAABu7sA== Date: Sun, 5 Apr 2020 16:48:29 +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-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [106.206.4.68] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ee12a627-6204-4c60-7570-08d7d9812bee x-ms-traffictypediagnostic: CY4PR1801MB1991: 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:CY4PR1801MB1863.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(136003)(39850400004)(376002)(396003)(366004)(346002)(76116006)(66946007)(66446008)(33656002)(7696005)(64756008)(66556008)(66476007)(110136005)(4326008)(52536014)(2906002)(55016002)(54906003)(6506007)(5660300002)(316002)(478600001)(7416002)(186003)(9686003)(86362001)(71200400001)(8676002)(8936002)(81166006)(81156014)(26005); 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: Y4KifiXXCntGjryt2YimvLLODc9vazAX0ywyRsob5rUxOBn4BdYEgAFFl1TN7MZJ0/xruaYOeqJd7PLjxD2O5Or8uO9qBRbRxKRHAl1j45ZwdCTQ7A/stfrdNoFkEOeb2EzgPClVrmOEfMSeJHo9F+/6cggldMS97VM93TQfDWZpnxr4r15qqYKVOo4rskaw+H4bATOZU2gYvSvAt5raiiz+QsZni+ptkWiuhwHechF+SFe5jgZUWCVLxNiVGtF1UMYEX30frGYl5fRm00zOrEJHQJZ4X40if7i2fn7LNju/paQdxz94fQ9LERPv3Pa6lhq2hEk/N0KFCFSotYIP55I6QfMG+UHAtUhQyBu9lCzxUw2xxBSbJ79EyYOXFkCByy+X3kkl/PiPGxq4Qy2WWUhXds+K4VNEcelOI/OWKh2UAfF/e2njWlCY9exGd5NP x-ms-exchange-antispam-messagedata: ymCbC5Xgf25k8WUqn9fQZ8NidbHUx1JXc1IF2zKVC7af+AICQePssNMEP7mq4JHBRNgFTmNFvSx6QGPsr2dCXdjPhjoajZ1QNKcZZR7l2iG2lIVaJnj4XosUiNagqy93Bgx5F3kFbgrXWYEswUH5Pg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ee12a627-6204-4c60-7570-08d7d9812bee X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2020 16:48:30.5731 (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: 2GFSAGG1vy3FcxnRM1xpNIJBiRsCuFvrzXv0CoX0X3wk68XSkKdmqdYZcBKPkYc6pBLZ2duZ9Yhe0sJmGjdqTg4rDrP4xpAiflkO3WJUQP0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1991 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-05_08:2020-04-03, 2020-04-05 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" >> >+ >> >+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. PMD capabilities are standardized through dev_info. All the PMD capabilities needs to be exposed to RTE level through dev_info = else=20 how would an application using rte_regexdev would know the capabilities of = the driver. >I think it is the responsibility of the PMD to check. The checks would be same for all the pmds which would just be unnecessary c= ode repetition. Instead RTE layer should probe dev_info and compare against dev_configure. > >> >+ 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