[PATCH v11 1/4] ethdev: add API for mbufs recycle mode

Feifei Wang Feifei.Wang2 at arm.com
Thu Aug 24 05:16:56 CEST 2023



> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Tuesday, August 22, 2023 10:03 PM
> To: Feifei Wang <Feifei.Wang2 at arm.com>
> Cc: thomas at monjalon.net; Ferruh Yigit <ferruh.yigit at amd.com>; Andrew
> Rybchenko <andrew.rybchenko at oktetlabs.ru>; dev at dpdk.org; nd
> <nd at arm.com>; Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com>;
> Ruifeng Wang <Ruifeng.Wang at arm.com>; Morten Brørup
> <mb at smartsharesystems.com>
> Subject: Re: [PATCH v11 1/4] ethdev: add API for mbufs recycle mode
> 
> On Tue, 22 Aug 2023 15:27:07 +0800
> Feifei Wang <feifei.wang2 at arm.com> wrote:
> 
> > +	if (queue_id >= dev->data->nb_rx_queues) {
> > +		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u\n",
> queue_id);
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (dev->data->rx_queues == NULL ||
> > +			dev->data->rx_queues[queue_id] == NULL) {
> > +		RTE_ETHDEV_LOG(ERR,
> > +			   "Rx queue %"PRIu16" of device with port_id=%"
> > +			   PRIu16" has not been setup\n",
> > +			   queue_id, port_id);
> > +		return -EINVAL;
> > +	}
> 
> This could be changed to something like:
> 
> 	ret = eth_dev_validate_rx_queue(dev, queue_id);
> 	if (unlikely(ret != 0))
> 		return ret;
> 

Good comments, I just know there is an API to check these. Thanks.
> 
> 


More information about the dev mailing list