> -----Original Message-----
> From: dev <dev-boun...@dpdk.org> On Behalf Of Guy Kaneti
> Sent: Sunday, June 28, 2020 4:45 PM
> To: Ori Kam <or...@mellanox.com>; Jerin Jacob Kollanukkaran
> <jer...@marvell.com>; xiang.w.w...@intel.com
> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula
> <pbhagavat...@marvell.com>; Shahaf Shuler <shah...@mellanox.com>;
> hemant.agra...@nxp.com; Opher Reviv <op...@mellanox.com>; Alex
> Rosenbaum <al...@mellanox.com>; Dovrat Zifroni <dov...@marvell.com>;
> Prasun Kapoor <pkap...@marvell.com>; nipun.gu...@nxp.com;
> bruce.richard...@intel.com; yang.a.h...@intel.com; harry.ch...@intel.com;
> gu.ji...@zte.com.cn; shanjia...@chinatelecom.cn;
> zhangy....@chinatelecom.cn; lixin...@huachentel.com; wush...@inspur.com;
> yuying...@yxlink.com; fanchengg...@sunyainfo.com;
> davidf...@tencent.com; liuzho...@chinaunicom.cn;
> zhaoyon...@huawei.com; o...@yunify.com; j...@netgate.com;
> hongjun...@intel.com; j.bromh...@titan-ic.com; d...@ntop.org;
> f...@napatech.com; arthur...@lionic.com; Thomas Monjalon
> <tho...@monjalon.net>
> Subject: Re: [dpdk-dev] [EXT] [PATCH v3 4/4] regexdev: implement regex rte
> level functions
>
>
> > +int
> > +rte_regexdev_rule_db_export(uint8_t dev_id, char *rule_db) {
> > + struct rte_regexdev *dev;
> > +
> > + RTE_REGEXDEV_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL);
> > + dev = &rte_regex_devices[dev_id];
> > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_db_export,
> > + -ENOTSUP);
> > + if (rule_db == NULL) {
> > + RTE_REGEXDEV_LOG(ERR, "Dev %d rules can't be NULL\n",
> > + dev_id);
> > + return -EINVAL;
> > + }
> > + return (*dev->dev_ops->dev_db_export)(dev, rule_db); }
>
> The test if (rule_db == NULL) is not according to the description of the API
> It is needed to be NULL in order to retrieve rule_db length
>
Correct will fix.
> * @param[out] rule_db
> * Block of memory to insert the rule database. Must be at least size in
> * capacity. If set to NULL, function returns required capacity.