> -----Original Message-----
> From: dev <[email protected]> On Behalf Of Guy Kaneti
> Sent: Sunday, June 28, 2020 4:45 PM
> To: Ori Kam <[email protected]>; Jerin Jacob Kollanukkaran
> <[email protected]>; [email protected]
> Cc: [email protected]; Pavan Nikhilesh Bhagavatula
> <[email protected]>; Shahaf Shuler <[email protected]>;
> [email protected]; Opher Reviv <[email protected]>; Alex
> Rosenbaum <[email protected]>; Dovrat Zifroni <[email protected]>;
> Prasun Kapoor <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; Thomas Monjalon
> <[email protected]>
> 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.