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 A5358A0561; Mon, 20 Apr 2020 17:49:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D59A81D67F; Mon, 20 Apr 2020 17:49:10 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2052.outbound.protection.outlook.com [40.107.21.52]) by dpdk.org (Postfix) with ESMTP id EAB851D178 for ; Mon, 20 Apr 2020 17:49:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W1tXKTwxASORJejeU8XBYAHbvnOT24WgHBJm1/bf6Yg3055CvfJu8+wsaNmoTfkZQ2ui+MATofF1GcqvEv2sQu4uWCac6PzO5G7GBPFl8XvJi401s8iyF9V+9nLf6c8C30MnBMRoitTJAKsE1+rfMEKv4NgIGuXOeVQTIooD0s+GL2U6LtCJ1f8FxWt2LJlQco17QuQoSS1ExSNZJBqlbSuxOSKgEgFMCCXVIjXz+7O5GbmIdPuz16r2FptkUHKDfvfDTMW77XrAONPg0CGn3gxiqOT9y77CwFR1RWwLBB7wVEDmDn84QC+SWwPDcei6XTCjISDGAdbyP4BmzPV03g== 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=y7jN1AFO4VPF6kx6hxLbwkMptMrWM2C0lIaHAsCnrHs=; b=YhEcxQlyNHU7G44Tv/PS80ClGEL7cDoAvrnzoCdXZxBUdN3yQkkp/3Qma+GoyRPFRm4zRVT31YVQLvkE2oZYJm+XbkU69hQXcEWn08enEa1C155qIFFAoAfAOp/plvoSJBglQa1bk40UZkMb9Tq8P0Ny7rr6vfQsDPGBHBPrWiqPul99E8sBOKS5Pxzi+Xsl4OeHZ77AJYddIYGpkGOJLvhFH6Vjp8Yb/RGwZB7ks5xg/atXOC/JEKa82WGA0Jh+r6MyY3B/UDt1Y8obPTRqUOJt7A92/5jd8iYYGMzvPghZd2SjFLBkLh8yfcCjemUhL8d05a9BuuvnkIetrjSYZg== 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=y7jN1AFO4VPF6kx6hxLbwkMptMrWM2C0lIaHAsCnrHs=; b=KAiC2P58Q4XM2smujLYQiBxLVl/tIQR2yzPkpaBBRmDRtUQOLEQvE3izlvCAb95hpuTn9PNZwm6ajMbAWoxPEYy/gZtAuaEwCvcZ4DvGlYyG/janbPGXxxqCuTVWoJ/2IhT6G50zF50oddUfoskvwociCxDUzoLZ7dFcZtpTeNs= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM6PR05MB5095.eurprd05.prod.outlook.com (2603:10a6:20b:1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Mon, 20 Apr 2020 15:49:07 +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.2921.030; Mon, 20 Apr 2020 15:49:07 +0000 From: Ori Kam To: Guy Kaneti , Jerin Jacob Kollanukkaran , "xiang.w.wang@intel.com" CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula , 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: [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file Thread-Index: AQHWFLX3YdD9jpA2EUWStg98EPds0qiB2PMAgABQv+A= Date: Mon, 20 Apr 2020 15:49:06 +0000 Message-ID: References: <1585464438-111285-1-git-send-email-orika@mellanox.com> <1587127417-82492-1-git-send-email-orika@mellanox.com> <1587127417-82492-3-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.149.253.12] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0e720ace-343d-4afb-2675-08d7e5425c1b x-ms-traffictypediagnostic: AM6PR05MB5095:|AM6PR05MB5095: 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:305; x-forefront-prvs: 03793408BA 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)(39860400002)(346002)(366004)(376002)(136003)(8936002)(71200400001)(2906002)(81156014)(8676002)(30864003)(5660300002)(7406005)(7696005)(7416002)(26005)(110136005)(316002)(54906003)(53546011)(6506007)(478600001)(66556008)(66446008)(4326008)(86362001)(76116006)(52536014)(33656002)(186003)(66946007)(55016002)(9686003)(64756008)(66476007); 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: /fqj31njdxwMv9klNHajGHrQioQTMjzPvNPTO+ykZ/xPADE3gS/OIba2m5EthHNy2IzkKuAfYsTKuKAFblcDv53WP39uae+fbR87tv90ykmYpXmGP//T3IjJbVH07sjhjTSmqo6vjOF9yPowasipIgH7lX39xRWhVFVzJA5XKUfoenArUKad639pfkYaHst6JFm351MNbO+4FsWpXFrEfoy50HbFmTAUPXq+g4OtyGTCZYgGoWxXYqQVWYwBw37qJi1tWAxWeKJh4W4q7z8bZ1OwHonQz4OCaeATGfMu5x7cyRl4xCZQUzbjGdTwdH1aUOLJTBLbKjPWwItiKLom1mrN0yjPkP39jzm5ROFD+v8MXx+GcDayPtUrhAgUjaJAis0c0nAy/sWxKw/dn3Bk8/8CGOAvB6E29fCAFs9CCjXY6MM4tF+yvRmfzwNnSYJp x-ms-exchange-antispam-messagedata: RiqWo1GZ80VzpuuGxsmLaQ+AuZP/aKFHVo8+t+0WsNbaxnaVlBr1HT2J4Tkgvt/wazx/OlpLKev8Xs3JiV7461KaALixaRNZroEIzqAOu4sbhOGwmeVR0b+MaKS+Y/61ovqNtZi0wYPfTFWHyKG1jw== 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: 0e720ace-343d-4afb-2675-08d7e5425c1b X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2020 15:49:06.9731 (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: ySMusVUJuu6qUU1XDSVyTdPcx6gEcZx6LsQRqdaVQVkfisSfhQEjbCSXINSQwHYGcB0YJEO5nN059ArraFYybQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5095 Subject: Re: [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file 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, Nice catch. Best, Ori > -----Original Message----- > From: dev On Behalf Of Guy Kaneti > Sent: Monday, April 20, 2020 1:48 PM > To: Ori Kam ; Jerin Jacob Kollanukkaran > ; xiang.w.wang@intel.com > Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula > ; 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 > > Subject: Re: [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file >=20 > Hi, >=20 >=20 > > -----Original Message----- > > From: dev On Behalf Of Ori Kam > > Sent: Friday, April 17, 2020 3:44 PM > > To: Jerin Jacob Kollanukkaran ; > > xiang.w.wang@intel.com > > Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula > > ; 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; orika@mellanox.com > > Subject: [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file > > > > This commit introduce the rte_regexdev_core.h file. > > This file holds internal structures and API that are used by the regexd= ev. > > > > Signed-off-by: Ori Kam > > --- > > v2: > > * Move private data to rte_regexdev struct. > > --- > > lib/librte_regexdev/Makefile | 1 + > > lib/librte_regexdev/meson.build | 2 +- > > lib/librte_regexdev/rte_regexdev.h | 2 + > > lib/librte_regexdev/rte_regexdev_core.h | 160 > > ++++++++++++++++++++++++++++++++ > > 4 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 > > lib/librte_regexdev/rte_regexdev_core.h > > > > diff --git a/lib/librte_regexdev/Makefile b/lib/librte_regexdev/Makefil= e > > index 6f4cc63..9012d29 100644 > > --- a/lib/librte_regexdev/Makefile > > +++ b/lib/librte_regexdev/Makefile > > @@ -24,6 +24,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REGEXDEV) :=3D > > rte_regexdev.c > > > > # export include files > > SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include +=3D rte_regexdev.h > > +SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include +=3D > > rte_regexdev_core.h > > > > # versioning export map > > EXPORT_MAP :=3D rte_regexdev_version.map > > diff --git a/lib/librte_regexdev/meson.build > > b/lib/librte_regexdev/meson.build index f4db748..1816754 100644 > > --- a/lib/librte_regexdev/meson.build > > +++ b/lib/librte_regexdev/meson.build > > @@ -3,5 +3,5 @@ > > > > allow_experimental_apis =3D true > > sources =3D files('rte_regexdev.c') > > -headers =3D files('rte_regexdev.h') > > +headers =3D files('rte_regexdev.h', 'rte_regexdev_core.h') > > deps +=3D ['mbuf'] > > diff --git a/lib/librte_regexdev/rte_regexdev.h > > b/lib/librte_regexdev/rte_regexdev.h > > index 7e688d9..bbc56f9 100644 > > --- a/lib/librte_regexdev/rte_regexdev.h > > +++ b/lib/librte_regexdev/rte_regexdev.h > > @@ -1466,6 +1466,8 @@ struct rte_regex_ops { > > rte_regexdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, > > struct rte_regex_ops **ops, uint16_t nb_ops); > > > > +#include "rte_regexdev_core.h" > > + > > #ifdef __cplusplus > > } > > #endif > > diff --git a/lib/librte_regexdev/rte_regexdev_core.h > > b/lib/librte_regexdev/rte_regexdev_core.h > > new file mode 100644 > > index 0000000..fb7a27e > > --- /dev/null > > +++ b/lib/librte_regexdev/rte_regexdev_core.h > > @@ -0,0 +1,160 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright(c) 2019 Mellanox Corporation */ > > + > > +#ifndef _RTE_REGEX_CORE_H_ > > +#define _RTE_REGEX_CORE_H_ > > + > > +/** > > + * @file > > + * > > + * RTE RegEx Device internal header. > > + * > > + * This header contains internal data types, that are used by the RegE= x > > +devices > > + * in order to expose their ops to the class. > > + * > > + * Applications should not use these API directly. > > + * > > + */ > > + > > +struct rte_regexdev; > > + > > +typedef int (*regexdev_info_get_t)(struct rte_regexdev *dev, > > + struct rte_regexdev_info *info); /**< > > @internal Get the RegEx > > +device info. */ > > + > > +typedef int (*regexdev_configure_t)(struct rte_regexdev *dev, > > + const struct rte_regexdev_config *cfg); > > /**< @internal > > +Configure the RegEx device. */ > > + > > +typedef int (*regexdev_qp_setup_t)(struct rte_regexdev *dev, uint8_t i= d, > > + const struct rte_regexdev_qp_conf > > *qp_conf); /**< @internal > > +Setup a queue pair.*/ >=20 > The API is defined as: > int > rte_regexdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, > const struct rte_regexdev_qp_conf *qp_conf); >=20 > id is uint8_t opposed to uint16_t Will fix. >=20 > > + > > +typedef int (*regexdev_start_t)(struct rte_regexdev *dev); /**< > > +@internal Start the RegEx device. */ > > + > > +typedef int (*regexdev_stop_t)(struct rte_regexdev *dev); /**< > > +@internal Stop the RegEx device. */ > > + > > +typedef int (*regexdev_close_t)(struct rte_regexdev *dev); /**< > > +@internal Close the RegEx device. */ > > + > > +typedef int (*regexdev_attr_get_t)(struct rte_regexdev *dev, > > + enum rte_regexdev_attr_id id, > > + void *value); > > +/**< @internal Get selected attribute from RegEx device. */ > > + > > +typedef int (*regexdev_attr_set_t)(struct rte_regexdev *dev, > > + enum rte_regexdev_attr_id id, > > + const void *value); > > +/**< @internal Set selected attribute to RegEx device. */ > > + > > +typedef int (*regexdev_rule_db_update_t)(struct rte_regexdev *dev, > > + const struct rte_regexdev_rule > > *rules, > > + uint16_t nb_rules); > > +/**< @internal Update the rule database for the RegEx device. */ > > + > > +typedef int (*regexdev_rule_db_compile_activate_t)(struct rte_regexdev > > +*dev); /**< @internal Compile the rule database and activate it. */ > > + > > +typedef int (*regexdev_rule_db_import_t)(struct rte_regexdev *dev, > > + const char *rule_db, > > + uint32_t rule_db_len); > > +/**< @internal Upload a pre created rule database to the RegEx device. > > +*/ > > + > > +typedef int (*regexdev_rule_db_export_t)(struct rte_regexdev *dev, > > + const char *rule_db); > > +/**< @internal Export the current rule database from the RegEx device. > > +*/ > The API is defined as: > int > rte_regexdev_rule_db_export(uint8_t dev_id, char *rule_db); >=20 > char *rule_db is not const >=20 Will fix. > > + > > +typedef int (*regexdev_xstats_names_get_t)(struct rte_regexdev *dev, > > + struct rte_regexdev_xstats_map > > + *xstats_map); > > +/**< @internal Get xstats name map for the RegEx device. */ > > + > > +typedef int (*regexdev_xstats_get_t)(struct rte_regexdev *dev, > > + const uint16_t *ids, uint64_t *values, > > + uint16_t nb_values); > > +/**< @internal Get xstats values for the RegEx device. */ > > + > > +typedef int (*regexdev_xstats_by_name_get_t)(struct rte_regexdev > > *dev, > > + const char *name, uint16_t *id, > > + uint64_t *value); > > +/**< @internal Get xstat value for the RegEx device based on the xstat= s > > +name. */ > > + > > +typedef int (*regexdev_xstats_reset_t)(struct rte_regexdev *dev, > > + const uint16_t *ids, > > + uint16_t nb_ids); > > +/**< @internal Reset xstats values for the RegEx device. */ > > + > > +typedef int (*regexdev_selftest_t)(struct rte_regexdev *dev); /**< > > +@internal Trigger RegEx self test. */ > > + > > +typedef int (*regexdev_dump_t)(struct rte_regexdev *dev, FILE *f); /**= < > > +@internal Dump internal information about the RegEx device. */ > > + > > +typedef int (*regexdev_enqueue_t)(struct rte_regexdev *dev, uint16_t > > qp_id, > > + struct rte_regex_ops **ops, uint16_t > > nb_ops); /**< @internal > > +Enqueue a burst of scan requests to a queue on RegEx device. */ > > + >=20 > rte_regexdev_enqueue_burst() returns uint16_t >=20 Will fix. > > +typedef int (*regexdev_dequeue_t)(struct rte_regexdev *dev, uint16_t > > qp_id, > > + struct rte_regex_ops **ops, > > + uint16_t nb_ops); > > +/**< @internal Dequeue a burst of scan response from a queue on RegEx > > +device. */ > > + >=20 > rte_regexdev_dequeue_burst() returns uint16_t >=20 Will fix. > > +/** > > + * RegEx device operations > > + */ > > +struct rte_regexdev_ops { > > + regexdev_info_get_t dev_info_get; > > + regexdev_configure_t dev_configure; > > + regexdev_qp_setup_t dev_qp_setup; > > + regexdev_start_t dev_start; > > + regexdev_stop_t dev_stop; > > + regexdev_close_t dev_close; > > + regexdev_attr_get_t dev_attr_get; > > + regexdev_attr_set_t dev_attr_set; > > + regexdev_rule_db_update_t dev_rule_db_update; > > + regexdev_rule_db_compile_activate_t > > dev_rule_db_compile_activate; > > + regexdev_rule_db_import_t dev_db_import; > > + regexdev_rule_db_export_t dev_db_export; > > + regexdev_xstats_names_get_t dev_xstats_names_get; > > + regexdev_xstats_get_t dev_xstats_get; > > + regexdev_xstats_by_name_get_t dev_xstats_by_name_get; > > + regexdev_xstats_reset_t dev_xstats_reset; > > + regexdev_selftest_t dev_selftest; > > + regexdev_dump_t dev_dump; > > +}; > > + > > +#define RTE_REGEXDEV_NAME_MAX_LEN > > +/** > > + * @internal > > + * The data part, with no function pointers, associated with each RegE= x > > device. > > + * > > + * This structure is safe to place in shared memory to be common among > > +different > > + * processes in a multi-process configuration. > > + */ > > +struct rte_regexdev_data { > > + void *dev_private; /**< PMD-specific private data. */ } > > +__rte_cache_aligned; > > + > > +/** > > + * @internal > > + * The generic data structure associated with each RegEx device. > > + * > > + * Pointers to burst-oriented packet receive and transmit functions ar= e > > + * located at the beginning of the structure, along with the pointer t= o > > + * where all the data elements for the particular device are stored in > > +shared > > + * memory. This split allows the function pointer and driver data to b= e > > +per- > > + * process, while the actual configuration data for the device is shar= ed. > > + */ > > +struct rte_regexdev { > > + regexdev_enqueue_t enqueue; > > + regexdev_dequeue_t dequeue; > > + const struct rte_regexdev_ops *dev_ops; > > + /**< Functions exported by PMD */ > > + struct rte_device *device; /**< Backing device */ > > + struct rte_regexdev_data *data; /**< Pointer to device data. */ } > > +__rte_cache_aligned; > > + > > +#endif /* _RTE_REGEX_CORE_H_ */ > > -- > > 1.8.3.1