[dpdk-dev] [PATCH 2/8] lib/librte_ether: defind RX/TX lock mode

Lu, Wenzhuo wenzhuo.lu at intel.com
Wed Jun 8 09:34:43 CEST 2016

Hi Stephen,

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Wednesday, June 8, 2016 10:16 AM
> To: Lu, Wenzhuo
> Cc: dev at dpdk.org; Tao, Zhe
> Subject: Re: [dpdk-dev] [PATCH 2/8] lib/librte_ether: defind RX/TX lock mode
> On Mon,  6 Jun 2016 13:40:47 +0800
> Wenzhuo Lu <wenzhuo.lu at intel.com> wrote:
> > Define lock mode for RX/TX queue. Because when resetting the device we
> > want the resetting thread to get the lock of the RX/TX queue to make
> > sure the RX/TX is stopped.
> >
> > Using next ABI macro for this ABI change as it has too much impact. 7
> > APIs and 1 global variable are impacted.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
> > Signed-off-by: Zhe Tao <zhe.tao at intel.com>
> Why does this patch set make a different assumption the rest of the DPDK?
> The rest of the DPDK operates on the principle that the application is smart
> enough to stop the device before making changes. There is no equivalent to the
> Linux kernel RTNL mutex. The API assumes application threads are well behaved
> and will not try and sabotage each other.
> If you restrict the reset operation to only being available when RX/TX is stopped,
> then no lock is needed.
> The fact that it requires lots more locking inside each device driver implies to me
> this is not correct way to architect this.
It's a good question. This patch set doesn't follow the regular assumption of DPDK.
But it's a requirement we've got from some customers. The users want the driver does as much as it can. The best is the link state change is transparent to the  users.
The patch set tries to provide another choice if the users don't want to stop their rx/tx to handle the reset event.

And as discussed in the other thread, most probably we will move the lock from the PMD layer to rte lay. It'll avoid the change in every device.

More information about the dev mailing list