Thread (23 messages) 23 messages, 3 authors, 2018-05-02

Re: [PATCH RFC 4/9] veth: Use NAPI for XDP

From: Jesper Dangaard Brouer <hidden>
Date: 2018-05-01 08:43:11

On Tue, 1 May 2018 17:02:34 +0900
Toshiaki Makita [off-list ref] wrote:
On 2018/05/01 16:50, Jesper Dangaard Brouer wrote:
quoted
On Tue, 24 Apr 2018 23:39:18 +0900
Toshiaki Makita [off-list ref] wrote:
  
quoted
+static int veth_xdp_enqueue(struct veth_priv *priv, void *ptr)
+{
+	if (unlikely(ptr_ring_produce(&priv->xdp_ring, ptr)))
+		return -ENOSPC;
+
+	return 0;
+}  
Here we have a lock per (enqueued) packet.  I'm working on changing the
ndo_xdp_xmit API to allow bulking.  And the tun driver have exact same
issue/need.  
Probably I should have noted in commitlog, but this per-packet lock is
removed in patch 9.
I'm curious about if any change is needed by your new API.
Again, I'm just moving this into the generic code, to avoid having to
implement this for every driver.

Plus, with CONFIG_RETPOLINE we have the advantage of only calling
ndo_xdp_xmit once (indirect function pointer call).

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help