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 BD675A0561; Mon, 20 Apr 2020 12:48:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B954A1D548; Mon, 20 Apr 2020 12:48:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id CCAEF1D419 for ; Mon, 20 Apr 2020 12:48:27 +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 03KAjHiQ006273; Mon, 20 Apr 2020 03:48:17 -0700 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-0016f401.pphosted.com with ESMTP id 30fxwp6qmv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Apr 2020 03:48:17 -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 03KAkYwf007086; Mon, 20 Apr 2020 03:48:16 -0700 Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 30fxwp6qmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 20 Apr 2020 03:48:16 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 20 Apr 2020 03:48:14 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.107) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 20 Apr 2020 03:48:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VOb3sc74W716x73MWBrB+f6oykj/mEKkjB6Qhq/y5Cr7AOz3XN/bz+Uh2VCW1EZTaNDWmvBQxPKzD19umtzjmyi48QCCsKLA22goSZSkEMtIQS7eZA7n5lbLXwAD83SRplWRp2oNgnfkKfvE6mnwr8xhbEjU/Oq0sHltJgH+fiUP1FF+fINIHZ8H49NhmU2RZ2nCPtwZfXUbg96476NhKvQ562v74ApvVe+EecUOXxFTRsYU5UD8VOCxdq9mHAyi1my0Jr06/KE1YFNWCEosmwRD6AyDivUu5GoebgxLd49k73Isg7e8jCJhTbaLKyP+4sKbRddukRZFdsJLBgNLqg== 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=d84jP51bxrauWC7cQvpLO9yo0n7Uvulx7REMik9Go6k=; b=d/r4rPsxxHkML9v31G0S6p+eueBWhSS1PWvVFBXBwgvCRRoJJjsnOZE2pA3kOWg0s+NYd9sQt2VQT36ONB//s70H0Sk1bgRVjYPcfc9c0AyFfloOtobG3oRDfIbGetbfe5nPJ/1ACH2EufJahehp2T2Vfz33gRQCmq56SQDKbaPKPN+L70w/EoWd42+Yl0DrsvvkxABj3baoTX+ItCAkD1piIjFhsYgdDPTPaySlpA5wgO1Ta/WdO78dwcAZWSZQoN8ToxEZt/fF2Jier7CNk+m6B1aSsfHK1dS3BKFsyCGjue29Se8JO8TohJK3WwiI5KRR14PBMlvES4zofkrP6w== 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=d84jP51bxrauWC7cQvpLO9yo0n7Uvulx7REMik9Go6k=; b=atDmvAp/DgzRzEXMrqYLFgBQvFI6QtYgL6lADjm4C3FuPiZ0IUnjzhJUYBs8Od0kLcXKk7zEqWcbnBnbdO6UxprhZ9RkFM36URFjG9sw8Af0DWVeVWb+wB2ltsDguHKlHrAqpe/joFA44bhRARZAAFmfnfJbjezrsd0P8snclGk= Received: from DM6PR18MB2410.namprd18.prod.outlook.com (2603:10b6:5:187::16) by DM6PR18MB3723.namprd18.prod.outlook.com (2603:10b6:5:cc::20) 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 10:48:13 +0000 Received: from DM6PR18MB2410.namprd18.prod.outlook.com ([fe80::60e0:765a:d168:e1ec]) by DM6PR18MB2410.namprd18.prod.outlook.com ([fe80::60e0:765a:d168:e1ec%7]) with mapi id 15.20.2921.030; Mon, 20 Apr 2020 10:48:13 +0000 From: Guy Kaneti To: Ori Kam , 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" Thread-Topic: [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file Thread-Index: AQHWFLX9vBH967p35UOkl0m8CLXXd6iB00/Q Date: Mon, 20 Apr 2020 10:48:12 +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: <1587127417-82492-3-git-send-email-orika@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [176.231.70.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7ac0b3c0-d707-4545-11d5-08d7e5185316 x-ms-traffictypediagnostic: DM6PR18MB3723: 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:DM6PR18MB2410.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(366004)(8676002)(81156014)(8936002)(26005)(86362001)(498600001)(55016002)(6506007)(53546011)(71200400001)(186003)(9686003)(66556008)(66446008)(66476007)(64756008)(76116006)(5660300002)(4326008)(110136005)(2906002)(7416002)(52536014)(7696005)(66946007)(54906003)(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: PqXOqU1uQvKtoUVtsx03JpeV0usKhIFaykCKUWtiPSuf6HkvuB90nmt2voZzG57N2T0AoDMrtHzlT5rGMYjK3VMKcZg/1Vu1TNW1WqiD0s/B58kcIBxgmVgkrJPq2f114qbFAIOomhe+Gf4cf1UMdc5fqad7K1dM0utcNE3h86mMZFWqxRp5nA0h1vbFzkJjfrQ72k29VfAKEEekBsIwrtOci9hRPdbhMMWgFm7+uo5Tk2Sq2ZydmIHYAmiYooiU6egOBkoAoC916/PvKognYzfS/UgHMAJkkq0dlg+soMw85WW2C2WMBrv+WbQ0+OmTrZwJV/sunoKR/OwrxY7hKduGSWTgcYAxXvjb/7Bu39s3HHQlMshtgMnW4C9bkoCZ1Goy2YeOJ64q2DzYL9zmMYQmE+G4XSAYdNi0ewRDRHXmNcoOCA5tMBGx6LvWgC1u x-ms-exchange-antispam-messagedata: ryiURX0O2TdrOd7VOAhNLIYOiN2FtmSBLu03utbYgR3k6vz1hKQc4GsYh+XFg1bka9eSpV4/JvuQL6c4O/MKyYYIsvJV5awgy2zslJNzJCt6N5qZwu6KcJYcG9i9dgHLgwsELzTW8bjXduzgsmnvUw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7ac0b3c0-d707-4545-11d5-08d7e5185316 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2020 10:48:12.9976 (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: x5IQ4Vx0InNOm7dH2iadUHuaprCikR3a1ezqUrN3+Fu/qJ/xnctAXJQEs0k9nzjU1aLIB8LHSoBbrld8scogPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3723 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-20_03:2020-04-20, 2020-04-20 signatures=0 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, > -----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 >=20 > This commit introduce the rte_regexdev_core.h file. > This file holds internal structures and API that are used by the regexdev= . >=20 > 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 >=20 > diff --git a/lib/librte_regexdev/Makefile b/lib/librte_regexdev/Makefile > 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 >=20 > # export include files > SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include +=3D rte_regexdev.h > +SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include +=3D > rte_regexdev_core.h >=20 > # 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 @@ >=20 > 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); >=20 > +#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 RegEx > +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 id, > + const struct rte_regexdev_qp_conf > *qp_conf); /**< @internal > +Setup a queue pair.*/ 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); id is uint8_t opposed to uint16_t > + > +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); char *rule_db is not const > + > +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 xstats > +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. */ > + rte_regexdev_enqueue_burst() returns uint16_t > +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. */ > + rte_regexdev_dequeue_burst() returns uint16_t > +/** > + * 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 RegEx > 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 are > + * located at the beginning of the structure, along with the pointer to > + * where all the data elements for the particular device are stored in > +shared > + * memory. This split allows the function pointer and driver data to be > +per- > + * process, while the actual configuration data for the device is shared= . > + */ > +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