Re: [PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 23:55, Johannes Berg wrote: On Thu, 2024-07-04 at 21:16 +0100, Anton Ivanov wrote: - qi->queue_depth = 0; + wmb(); /* Ensure that RX processing elsewhere sees the changes */ + atomic_set(&qi->queue_depth, 0); } I don't understand this. prep_queue_for_rx() is

Re: [PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Johannes Berg
On Thu, 2024-07-04 at 21:16 +0100, Anton Ivanov wrote: > > > - qi->queue_depth = 0; > > > + wmb(); /* Ensure that RX processing elsewhere sees the changes */ > > > + atomic_set(&qi->queue_depth, 0); > > > } > > I don't understand this. > > > > prep_queue_for_rx() is called by vector_mmsg_rx(),

Re: [PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 17:12, Johannes Berg wrote: On Thu, 2024-07-04 at 13:22 +0100, anton.iva...@cambridgegreys.com wrote: @@ -675,11 +657,20 @@ static void prep_queue_for_rx(struct vector_queue *qi) struct vector_private *vp = netdev_priv(qi->dev); struct mmsghdr *mmsg_vector = qi->mms

Re: [PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Johannes Berg
On Thu, 2024-07-04 at 13:22 +0100, anton.iva...@cambridgegreys.com wrote: > > @@ -675,11 +657,20 @@ static void prep_queue_for_rx(struct vector_queue *qi) > struct vector_private *vp = netdev_priv(qi->dev); > struct mmsghdr *mmsg_vector = qi->mmsg_vector; > void **skbuff_vector =

[PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread anton . ivanov
From: Anton Ivanov UML vector drivers use ring buffer structures which map preallocated skbs onto mmsg vectors for use with sendmmsg and recvmmsg. They are designed around a single consumer, single producer pattern allowing simultaneous enqueue and dequeue. Lock debugging with preemption showed