Skip to contentSkip to conversation

xen networking: add basic XDP support for xen-netfront

PATCH Superseded Denis Kirjanov 4 participants 18 messages Mar 16, 2020 – Mar 30, 2020

Subsystems (4)

v4 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 xen networking: add basic XDP support for xen-netfront

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

v4:
- added verbose patch descriprion
- don't expose the XDP headroom offset to the domU guest
- add a modparam to netback to toggle XDP offset
- don't process jumbo frames for now

v3:
- added XDP_TX support (tested with xdping echoserver)
- added XDP_REDIRECT support (tested with modified xdp_redirect_kern)
- moved xdp negotiation to xen-netback

v2:
- avoid data copying while passing to XDP
- tell xen-netback that we need the headroom space

---
 drivers/net/xen-netback/common.h  |   2 +
 drivers/net/xen-netback/netback.c |   7 ++
 drivers/net/xen-netback/rx.c      |   7 +-
 drivers/net/xen-netback/xenbus.c  |  28 +++++
 drivers/net/xen-netfront.c        | 240 +++++++++++++++++++++++++++++++++++++-
 5 files changed, 282 insertions(+), 2 deletions(-)
drivers/net/xen-netback/common.h +2 -0
index 05847eb..4a148d6 100644
@@ -280,6 +280,7 @@ struct xenvif {
 	u8 ip_csum:1;
 	u8 ipv6_csum:1;
 	u8 multicast_control:1;
+	u8 xdp_enabled:1;
 
 	/* Is this interface disabled? True when backend discovers
 	 * frontend is rogue.
@@ -395,6 +396,7 @@ static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue)
 irqreturn_t xenvif_interrupt(int irq, void *dev_id);
 
 extern bool separate_tx_rx_irq;
+extern bool provides_xdp_headroom;
 
 extern unsigned int rx_drain_timeout_msecs;
 extern unsigned int rx_stall_timeout_msecs;
drivers/net/xen-netback/netback.c +7 -0
index 315dfc6..6dfca72 100644
@@ -96,6 +96,13 @@
 module_param_named(hash_cache_size, xenvif_hash_cache_size, uint, 0644);
 MODULE_PARM_DESC(hash_cache_size, "Number of flows in the hash cache");
 
+/* The module parameter tells that we have to put data
+ * for xen-netfront with the XDP_PACKET_HEADROOM offset
+ * needed for XDP processing
+ */
+bool provides_xdp_headroom = true;
+module_param(provides_xdp_headroom, bool, 0644);
+
 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
 			       u8 status);
 
drivers/net/xen-netback/rx.c +6 -1
index ef58870..aba826b 100644
@@ -33,6 +33,11 @@
 #include <xen/xen.h>
 #include <xen/events.h>
 
+static inline int xenvif_rx_xdp_offset(struct xenvif *vif)
+{
+	return (vif->xdp_enabled ? XDP_PACKET_HEADROOM : 0);
+}
+
 static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue)
 {
 	RING_IDX prod, cons;
@@ -356,7 +361,7 @@ static void xenvif_rx_data_slot(struct xenvif_queue *queue,
 				struct xen_netif_rx_request *req,
 				struct xen_netif_rx_response *rsp)
 {
-	unsigned int offset = 0;
+	unsigned int offset = xenvif_rx_xdp_offset(queue->vif);
 	unsigned int flags;
 
 	do {
drivers/net/xen-netback/xenbus.c +28 -0
index 286054b..7c0450e 100644
@@ -393,6 +393,20 @@ static void set_backend_state(struct backend_info *be,
 	}
 }
 
+static void read_xenbus_frontend_xdp(struct backend_info *be,
+				      struct xenbus_device *dev)
+{
+	struct xenvif *vif = be->vif;
+	unsigned int val;
+	int err;
+
+	err = xenbus_scanf(XBT_NIL, dev->otherend,
+			   "feature-xdp", "%u", &val);
+	if (err < 0)
+		return;
+	vif->xdp_enabled = val;
+}
+
 /**
  * Callback received when the frontend's state changes.
  */
@@ -417,6 +431,11 @@ static void frontend_changed(struct xenbus_device *dev,
 		set_backend_state(be, XenbusStateConnected);
 		break;
 
+	case XenbusStateReconfiguring:
+		read_xenbus_frontend_xdp(be, dev);
+		xenbus_switch_state(dev, XenbusStateReconfigured);
+		break;
+
 	case XenbusStateClosing:
 		set_backend_state(be, XenbusStateClosing);
 		break;
@@ -1036,6 +1055,15 @@ static int netback_probe(struct xenbus_device *dev,
 			goto abort_transaction;
 		}
 
+		/* we can adjust a headroom for netfront XDP processing */
+		err = xenbus_printf(xbt, dev->nodename,
+				    "feature-xdp-headroom", "%d",
+				    !!provides_xdp_headroom);
+		if (err) {
+			message = "writing feature-xdp-headroom";
+			goto abort_transaction;
+		}
+
 		/* We don't support rx-flip path (except old guests who
 		 * don't grok this feature flag).
 		 */
drivers/net/xen-netfront.c +239 -1

331 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 4 lines · On Mon, 16 Mar 2020 16:09:36 +0300 Denis Kirjanov <[email protected]> wrote:
drivers/net/xen-netfront.c +0 -0
index 482c6c8..c06ae57 100644

[...]

Quoted 16 lines
drivers/net/xen-netfront.c +12 -0
@@ -778,6 +790,52 @@ static int xennet_get_extras(struct netfront_queue *queue,
 	return err;
 }
 
+u32 xennet_run_xdp(struct netfront_queue *queue, struct page *pdata,
+		   struct xen_netif_rx_response *rx, struct bpf_prog *prog,
+		   struct xdp_buff *xdp)
+{
+	struct xdp_frame *xdpf;
+	u32 len = rx->status;
+	u32 act = XDP_PASS;
+	int err;
+
+	xdp->data_hard_start = page_address(pdata);
+	xdp->data = xdp->data_hard_start + XDP_PACKET_HEADROOM;
+	xdp_set_data_meta_invalid(xdp);

drivers/net/xen-netfront.c static int xennet_get_extras(struct netfront_queue *queue, · line 814

Quoted 10 lines
drivers/net/xen-netfront.c +10 -0
+	xdp->data_end = xdp->data + len;
+	xdp->rxq = &queue->xdp_rxq;
+	xdp->handle = 0;
+
+	act = bpf_prog_run_xdp(prog, xdp);
+	switch (act) {
+	case XDP_TX:
+		xdpf = convert_to_xdp_frame(xdp);
+		err = xennet_xdp_xmit(queue->info->netdev, 1,
+				&xdpf, 0);

Strange line wrap, I don't think this is needed, please fix.

drivers/net/xen-netfront.c static int xennet_get_extras(struct netfront_queue *queue, · line 819

Quoted 5 lines
drivers/net/xen-netfront.c +5 -0
+		if (unlikely(err < 0))
+			trace_xdp_exception(queue->info->netdev, prog, act);
+		break;
+	case XDP_REDIRECT:
+		err = xdp_do_redirect(queue->info->netdev, xdp, prog);

What is the frame size of the packet memory?

Quoted 19 lines
drivers/net/xen-netfront.c +19 -0
+		if (unlikely(err))
+			trace_xdp_exception(queue->info->netdev, prog, act);
+		xdp_do_flush();
+		break;
+	case XDP_PASS:
+	case XDP_DROP:
+		break;
+
+	case XDP_ABORTED:
+		trace_xdp_exception(queue->info->netdev, prog, act);
+		break;
+
+	default:
+		bpf_warn_invalid_xdp_action(act);
+	}
+
+	return act;
+}
+
Signature · 4 lines
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
#2 lore raw
Quoted 39 lines · Jesper Dangaard Brouer
Quoted 4 lines · On Mon, 16 Mar 2020 16:09:36 +0300 Denis Kirjanov <[email protected]> wrote:
drivers/net/xen-netfront.c +0 -0
index 482c6c8..c06ae57 100644

[...]

Quoted 17 lines
drivers/net/xen-netfront.c +12 -0
@@ -778,6 +790,52 @@ static int xennet_get_extras(struct netfront_queue
 *queue,
 	return err;
 }
 
+u32 xennet_run_xdp(struct netfront_queue *queue, struct page *pdata,
+		   struct xen_netif_rx_response *rx, struct bpf_prog *prog,
+		   struct xdp_buff *xdp)
+{
+	struct xdp_frame *xdpf;
+	u32 len = rx->status;
+	u32 act = XDP_PASS;
+	int err;
+
+	xdp->data_hard_start = page_address(pdata);
+	xdp->data = xdp->data_hard_start + XDP_PACKET_HEADROOM;
+	xdp_set_data_meta_invalid(xdp);

drivers/net/xen-netfront.c static int xennet_get_extras(struct netfront_queue · line 815

Quoted 10 lines
drivers/net/xen-netfront.c +10 -0
+	xdp->data_end = xdp->data + len;
+	xdp->rxq = &queue->xdp_rxq;
+	xdp->handle = 0;
+
+	act = bpf_prog_run_xdp(prog, xdp);
+	switch (act) {
+	case XDP_TX:
+		xdpf = convert_to_xdp_frame(xdp);
+		err = xennet_xdp_xmit(queue->info->netdev, 1,
+				&xdpf, 0);

Strange line wrap, I don't think this is needed, please fix.

Quoted 7 lines

drivers/net/xen-netfront.c static int xennet_get_extras(struct netfront_queue *queue, · line 819

Quoted 5 lines
drivers/net/xen-netfront.c +5 -0
+		if (unlikely(err < 0))
+			trace_xdp_exception(queue->info->netdev, prog, act);
+		break;
+	case XDP_REDIRECT:
+		err = xdp_do_redirect(queue->info->netdev, xdp, prog);

What is the frame size of the packet memory?

It's XEN_PAGE_SIZE (4k)

Quoted 29 lines
Quoted 11 lines
drivers/net/xen-netfront.c +9 -0
+		if (unlikely(err))
+			trace_xdp_exception(queue->info->netdev, prog, act);
+		xdp_do_flush();
+		break;
+	case XDP_PASS:
+	case XDP_DROP:
+		break;
+
+	case XDP_ABORTED:

drivers/net/xen-netfront.c static int xennet_get_extras(struct netfront_queue *queue, · line 838

Quoted 10 lines
drivers/net/xen-netfront.c +10 -0
+		trace_xdp_exception(queue->info->netdev, prog, act);
+		break;
+
+	default:
+		bpf_warn_invalid_xdp_action(act);
+	}
+
+	return act;
+}
+

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer

#3 lore raw
In reply to Denis Kirjanov
Quoted 3 lines · On Mon, 16 Mar 2020 16:09:36 +0300 Denis Kirjanov <[email protected]> wrote:

v3:
- added XDP_TX support (tested with xdping echoserver)
- added XDP_REDIRECT support (tested with modified xdp_redirect_kern)

Please test XDP_REDIRECT with xdp_redirect_cpu from samples/bpf/.

Signature · 4 lines
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
#4 lore raw
Quoted 8 lines · Jesper Dangaard Brouer
Quoted 3 lines · On Mon, 16 Mar 2020 16:09:36 +0300 Denis Kirjanov <[email protected]> wrote:

v3:
- added XDP_TX support (tested with xdping echoserver)
- added XDP_REDIRECT support (tested with modified xdp_redirect_kern)

Please test XDP_REDIRECT with xdp_redirect_cpu from samples/bpf/.

./xdp_redirect_cpu --dev eth0 --prog xdp_cpu_map0 --cpu 1

Running XDP/eBPF prog_name:xdp_cpu_map0

XDP-cpumap      CPU:to  pps            drop-pps    extra-info
XDP-RX          0       5,964          0           0
XDP-RX          total   5,964          0
cpumap-enqueue    0:1   5,964          0           1.00       bulk-average
cpumap-enqueue  sum:1   5,964          0           1.00       bulk-average
cpumap_kthread  1       5,963          0           5,939      sched
cpumap_kthread  total   5,963          0           5,939      sched-sum
redirect_err    total   0              0
xdp_exception   total   0              0

I can see increase in RES:
RES: 129814 484285 198201 359270 Rescheduling interrupts

Quoted 8 lines

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer

#5 lore raw
In reply to Denis Kirjanov
Quoted 81 lines

-----Original Message-----
From: Denis Kirjanov <[email protected]>
Sent: 16 March 2020 13:10
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Denis Kirjanov <[email protected]>
Subject: [PATCH net-next v4] xen networking: add basic XDP support for xen-netfront

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

v4:
- added verbose patch descriprion
- don't expose the XDP headroom offset to the domU guest
- add a modparam to netback to toggle XDP offset
- don't process jumbo frames for now

v3:
- added XDP_TX support (tested with xdping echoserver)
- added XDP_REDIRECT support (tested with modified xdp_redirect_kern)
- moved xdp negotiation to xen-netback

v2:
- avoid data copying while passing to XDP
- tell xen-netback that we need the headroom space

---
 drivers/net/xen-netback/common.h  |   2 +
 drivers/net/xen-netback/netback.c |   7 ++
 drivers/net/xen-netback/rx.c      |   7 +-
 drivers/net/xen-netback/xenbus.c  |  28 +++++
 drivers/net/xen-netfront.c        | 240 +++++++++++++++++++++++++++++++++++++-
 5 files changed, 282 insertions(+), 2 deletions(-)
drivers/net/xen-netback/common.h +2 -0
index 05847eb..4a148d6 100644
@@ -280,6 +280,7 @@ struct xenvif {
 	u8 ip_csum:1;
 	u8 ipv6_csum:1;
 	u8 multicast_control:1;
+	u8 xdp_enabled:1;
 
 	/* Is this interface disabled? True when backend discovers
 	 * frontend is rogue.
@@ -395,6 +396,7 @@ static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue)
 irqreturn_t xenvif_interrupt(int irq, void *dev_id);
 
 extern bool separate_tx_rx_irq;
+extern bool provides_xdp_headroom;
 
 extern unsigned int rx_drain_timeout_msecs;
 extern unsigned int rx_stall_timeout_msecs;
drivers/net/xen-netback/netback.c +7 -0
index 315dfc6..6dfca72 100644
@@ -96,6 +96,13 @@
 module_param_named(hash_cache_size, xenvif_hash_cache_size, uint, 0644);
 MODULE_PARM_DESC(hash_cache_size, "Number of flows in the hash cache");
 
+/* The module parameter tells that we have to put data
+ * for xen-netfront with the XDP_PACKET_HEADROOM offset
+ * needed for XDP processing
+ */
+bool provides_xdp_headroom = true;
+module_param(provides_xdp_headroom, bool, 0644);
+
 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
 			       u8 status);
 
drivers/net/xen-netback/rx.c +0 -0
index ef58870..aba826b 100644

drivers/net/xen-netback/rx.c line 40

Quoted 8 lines
drivers/net/xen-netback/rx.c +5 -0
@@ -33,6 +33,11 @@
 #include <xen/xen.h>
 #include <xen/events.h>
 
+static inline int xenvif_rx_xdp_offset(struct xenvif *vif)
+{
+	return (vif->xdp_enabled ? XDP_PACKET_HEADROOM : 0);
+}
+

No need for the brackets here.

[snip]

Quoted 11 lines
drivers/net/xen-netback/rx.c +3 -0
@@ -167,6 +175,9 @@ struct netfront_rx_info {
 	struct xen_netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX - 1];
 };
 
+static int xennet_xdp_xmit(struct net_device *dev, int n,
+			   struct xdp_frame **frames, u32 flags);
+
 static void skb_entry_set_link(union skb_entry *list, unsigned short id)
 {
 	list->link = id;

drivers/net/xen-netback/rx.c static void xennet_tx_buf_gc(struct netfront_queue *queue) · line 421

Quoted 6 lines
drivers/net/xen-netback/rx.c +2 -1
@@ -406,7 +417,8 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
 			queue->grant_tx_ref[id] = GRANT_INVALID_REF;
 			queue->grant_tx_page[id] = NULL;
 			add_id_to_freelist(&queue->tx_skb_freelist, queue->tx_skbs, id);
-			dev_kfree_skb_irq(skb);
+			if (skb)
+				dev_kfree_skb_irq(skb);

Can you drop this? I said previously that it is unnecessary.

Paul

maintainer
#6 lore raw
In reply to Denis Kirjanov
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

- Reasoning why the suggested changes of frontend and backend state are no problem for special cases like hot-remove of an interface or live migration or suspend of the guest.

Finally I'd like to ask you to split up the patch into a netfront and a netback one.

Juergen

#7 lore raw
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

Quoted 8 lines

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

Ok, I'll try to measure some numbers.

Quoted 6 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 4 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

Currently we need only a header offset from netback driver so that we can put custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

- Reasoning why the suggested changes of frontend and backend state are no problem for special cases like hot-remove of an interface or live migration or suspend of the guest.

I've put the code to talk_to_netback which is called "when first setting up, and when resuming"
If you see a problem with that please share.

Quoted 3 lines

Finally I'd like to ask you to split up the patch into a netfront and a netback one.

Ok, will do.

Thanks!

Quoted 4 lines

Juergen

maintainer
#8 lore raw
Quoted 33 lines · Denis Kirjanov
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

Quoted 8 lines

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

Ok, I'll try to measure some numbers.

Quoted 6 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 4 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

Quoted 6 lines

Currently we need only a header offset from netback driver so that we can put custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 8 lines
Quoted 4 lines

- Reasoning why the suggested changes of frontend and backend state are no problem for special cases like hot-remove of an interface or live migration or suspend of the guest.

I've put the code to talk_to_netback which is called "when first setting up, and when resuming"
If you see a problem with that please share.

What happens if a migration is just starting when netfront has switched its state to "Reconfigured"? Will the new device activation at the target host work as desired? In which state will XDP be on the frontend after that (i.e. is a direct state transition on the frontend from "Reconfigured" to "Initializing" fine)? It should be spelled out in the commit message that this scenario has been thought of and that it will work.

Quoted 6 lines
Quoted 4 lines

Finally I'd like to ask you to split up the patch into a netfront and a netback one.

Ok, will do.

Thanks.

Juergen

#9 lore raw
Quoted 42 lines · Jürgen Groß
Quoted 33 lines · Denis Kirjanov
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

Quoted 8 lines

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

Ok, I'll try to measure some numbers.

Quoted 6 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 4 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

Quoted 7 lines

Currently we need only a header offset from netback driver so that we can put
custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

Quoted 10 lines
Quoted 9 lines
Quoted 5 lines

- Reasoning why the suggested changes of frontend and backend state are no problem for special cases like hot-remove of an interface or live migration or suspend of the guest.

I've put the code to talk_to_netback which is called "when first setting up, and when resuming"
If you see a problem with that please share.

Quoted 7 lines

What happens if a migration is just starting when netfront has switched its state to "Reconfigured"? Will the new device activation at the target host work as desired? In which state will XDP be on the frontend after that (i.e. is a direct state transition on the frontend from "Reconfigured" to "Initializing" fine)? It should be spelled out in the commit message that this scenario has been thought of and that it will work.

Well, that definitely means that I have to play with that scenario.

Moreover, I've found a problem with memory consumption while testing a pktgen load with
xen-netfront.

Thank!

Quoted 13 lines
Quoted 7 lines
Quoted 5 lines

Finally I'd like to ask you to split up the patch into a netfront and a netback one.

Ok, will do.

Thanks.

Juergen

maintainer
#10 lore raw
Quoted 48 lines · Denis Kirjanov
Quoted 42 lines · Jürgen Groß
Quoted 33 lines · Denis Kirjanov
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

Quoted 8 lines

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

Ok, I'll try to measure some numbers.

Quoted 6 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 4 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

Quoted 7 lines

Currently we need only a header offset from netback driver so that we can put
custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

This doesn't answer my question.

You have basically two communication channels: the state of the frontend and backend for activation/deactivation of XDP, and the ring pages with the rx and tx requests and responses. How is the synchronization between those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Juergen

#11 lore raw
Quoted 57 lines · Jürgen Groß
Quoted 49 lines · Denis Kirjanov
Quoted 43 lines · Jürgen Groß
Quoted 33 lines · Denis Kirjanov
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

Quoted 8 lines

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

Ok, I'll try to measure some numbers.

Quoted 6 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 4 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

Quoted 8 lines

Currently we need only a header offset from netback driver so that we can
put
custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

Quoted 7 lines

This doesn't answer my question.

You have basically two communication channels: the state of the frontend and backend for activation/deactivation of XDP, and the ring pages with the rx and tx requests and responses. How is the synchronization between those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

Quoted 4 lines

Juergen

maintainer
#12 lore raw
Quoted 66 lines · Denis Kirjanov
Quoted 57 lines · Jürgen Groß
Quoted 49 lines · Denis Kirjanov
Quoted 43 lines · Jürgen Groß
Quoted 33 lines · Denis Kirjanov
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

Quoted 8 lines

This is in no way a "verbose patch descriprion".

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an idea of the improvement to expect, or which additional functionality for the user is available.

Ok, I'll try to measure some numbers.

Quoted 6 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to some more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and normal SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 4 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is silencing of the virtual adapter required, ...).

Quoted 8 lines

Currently we need only a header offset from netback driver so that we can
put
custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

Quoted 7 lines

This doesn't answer my question.

You have basically two communication channels: the state of the frontend and backend for activation/deactivation of XDP, and the ring pages with the rx and tx requests and responses. How is the synchronization between those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Quoted 7 lines

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

And before that all in-flight requests in the ring pages are being processed and no new requests are guaranteed to be enqueued?

Juergen

#13 lore raw
Quoted 80 lines · Jürgen Groß
Quoted 71 lines · Denis Kirjanov
Quoted 62 lines · Jürgen Groß
Quoted 54 lines · Denis Kirjanov
Quoted 48 lines · Jürgen Groß
Quoted 38 lines · Denis Kirjanov
Quoted 9 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

This is in no way a "verbose patch descriprion".

Quoted 8 lines

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an
idea
of the improvement to expect, or which additional
functionality
for the user is available.

Ok, I'll try to measure some numbers.

Quoted 8 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to
some
more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and
normal
SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 5 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is
silencing
of the virtual adapter required, ...).

Quoted 8 lines

Currently we need only a header offset from netback driver so that we can
put
custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

Quoted 7 lines

This doesn't answer my question.

You have basically two communication channels: the state of the frontend and backend for activation/deactivation of XDP, and the ring pages with the rx and tx requests and responses. How is the synchronization between those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Quoted 7 lines

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

Quoted 2 lines

And before that all in-flight requests in the ring pages are being processed and no new requests are guaranteed to be enqueued?

Actually I don't see the need to sync these requests since that all we have to do is to copy
data with specified offset:
with xdp->enabled=1: copy with the offset XDP_PACKET_HEADROOM with xdd->enabled=0: copy without the offset

Thanks!

Quoted 4 lines

Juergen

maintainer
#14 lore raw
Quoted 81 lines · Denis Kirjanov
Quoted 80 lines · Jürgen Groß
Quoted 78 lines · Denis Kirjanov
Quoted 62 lines · Jürgen Groß
Quoted 54 lines · Denis Kirjanov
Quoted 48 lines · Jürgen Groß
Quoted 38 lines · Denis Kirjanov
Quoted 9 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

This is in no way a "verbose patch descriprion".

Quoted 8 lines

I'm missing:

- Why are you doing this. "Add XDP support" is not enough, for such a change I'd like to see some performance numbers to get an
idea
of the improvement to expect, or which additional
functionality
for the user is available.

Ok, I'll try to measure some numbers.

Quoted 8 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to
some
more detailed doc is enough, of course) and how the interface is working (especially for switching between XDP mode and
normal
SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 5 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is
silencing
of the virtual adapter required, ...).

Quoted 8 lines

Currently we need only a header offset from netback driver so that we can
put
custom encapsulation header if required and that's done using xen bus state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 4 lines

Yes, but how is this synchronized with currently running network load? Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

Quoted 7 lines

This doesn't answer my question.

You have basically two communication channels: the state of the frontend and backend for activation/deactivation of XDP, and the ring pages with the rx and tx requests and responses. How is the synchronization between those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

Quoted 8 lines
Quoted 2 lines

And before that all in-flight requests in the ring pages are being processed and no new requests are guaranteed to be enqueued?

Actually I don't see the need to sync these requests since that all we have to do is to copy
data with specified offset:
with xdp->enabled=1: copy with the offset XDP_PACKET_HEADROOM with xdd->enabled=0: copy without the offset

Isn't that racy?

In xennet_xdp_set() you set queue->xdp_prog and then you change the state to Reconfiguring. From the time queue->xdp_prog is set you'll do the Xdp processing in xennet_get_responses(), even if the response you are working on doesn't have the headroom you need, as the backend didn't create it with headroom (it needs some time until it has seen the new state and could react on it by sending _new_ responses with headroom).

Or am I missing something about Xdp programs?

Juergen

#15 lore raw
Quoted 102 lines · Jürgen Groß
Quoted 90 lines · Denis Kirjanov
Quoted 89 lines · Jürgen Groß
Quoted 87 lines · Denis Kirjanov
Quoted 69 lines · Jürgen Groß
Quoted 59 lines · Denis Kirjanov
Quoted 52 lines · Jürgen Groß
Quoted 40 lines · Denis Kirjanov
Quoted 11 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

This is in no way a "verbose patch descriprion".

I'm missing:

Quoted 7 lines

- Why are you doing this. "Add XDP support" is not enough, for such
a change I'd like to see some performance numbers to get an
idea
of the improvement to expect, or which additional
functionality
for the user is available.

Ok, I'll try to measure some numbers.

Quoted 9 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to
some
more detailed doc is enough, of course) and how the
interface
is working (especially for switching between XDP mode and
normal
SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 5 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is
silencing
of the virtual adapter required, ...).

Quoted 10 lines

Currently we need only a header offset from netback driver so that we
can
put
custom encapsulation header if required and that's done using xen bus
state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 5 lines

Yes, but how is this synchronized with currently running network load?
Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

This doesn't answer my question.

Quoted 8 lines

You have basically two communication channels: the state of the frontend
and backend for activation/deactivation of XDP, and the ring pages with
the rx and tx requests and responses. How is the synchronization between
those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to
adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

Quoted 8 lines
Quoted 2 lines

And before that all in-flight requests in the ring pages are being processed and no new requests are guaranteed to be enqueued?

Actually I don't see the need to sync these requests since that all we have to do is to copy
data with specified offset:
with xdp->enabled=1: copy with the offset XDP_PACKET_HEADROOM with xdd->enabled=0: copy without the offset

Isn't that racy?

Quoted 7 lines

In xennet_xdp_set() you set queue->xdp_prog and then you change the state to Reconfiguring. From the time queue->xdp_prog is set you'll do the Xdp processing in xennet_get_responses(), even if the response you are working on doesn't have the headroom you need, as the backend didn't create it with headroom (it needs some time until it has seen the new state and could react on it by sending _new_ responses with headroom).

Ah, I see. You mean that we have to wait until XenbusStateReconfigured is set in
xen-netfront and only after that it's safe to process packets.

Quoted 6 lines

Or am I missing something about Xdp programs?

Juergen

maintainer
#16 lore raw
Quoted 111 lines · Denis Kirjanov
Quoted 102 lines · Jürgen Groß
Quoted 90 lines · Denis Kirjanov
Quoted 89 lines · Jürgen Groß
Quoted 87 lines · Denis Kirjanov
Quoted 69 lines · Jürgen Groß
Quoted 59 lines · Denis Kirjanov
Quoted 52 lines · Jürgen Groß
Quoted 40 lines · Denis Kirjanov
Quoted 11 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

This is in no way a "verbose patch descriprion".

I'm missing:

Quoted 7 lines

- Why are you doing this. "Add XDP support" is not enough, for such
a change I'd like to see some performance numbers to get an
idea
of the improvement to expect, or which additional
functionality
for the user is available.

Ok, I'll try to measure some numbers.

Quoted 9 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link to
some
more detailed doc is enough, of course) and how the
interface
is working (especially for switching between XDP mode and
normal
SKB processing).

You can search for the "A practical introduction to XDP" tutorial. Actually there is a lot of information available regarding XDP, you can easily find it.

Quoted 5 lines

- A proper description of the netfront/netback communication when enabling or disabling XDP mode (who is doing what, is
silencing
of the virtual adapter required, ...).

Quoted 10 lines

Currently we need only a header offset from netback driver so that we
can
put
custom encapsulation header if required and that's done using xen bus
state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 5 lines

Yes, but how is this synchronized with currently running network load?
Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on the XDP headroom is available?

Quoted 6 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the networking device.
Assigning an xdp program means that we have to adjust a pointer which is RCU protected.

This doesn't answer my question.

Quoted 8 lines

You have basically two communication channels: the state of the frontend
and backend for activation/deactivation of XDP, and the ring pages with
the rx and tx requests and responses. How is the synchronization between
those two channels done? So how does the other side know which of the packets in flight will then have XDP on or off?

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to
adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

Quoted 8 lines
Quoted 2 lines

And before that all in-flight requests in the ring pages are being processed and no new requests are guaranteed to be enqueued?

Actually I don't see the need to sync these requests since that all we have to do is to copy
data with specified offset:
with xdp->enabled=1: copy with the offset XDP_PACKET_HEADROOM with xdd->enabled=0: copy without the offset

Isn't that racy?

Quoted 7 lines

In xennet_xdp_set() you set queue->xdp_prog and then you change the state to Reconfiguring. From the time queue->xdp_prog is set you'll do the Xdp processing in xennet_get_responses(), even if the response you are working on doesn't have the headroom you need, as the backend didn't create it with headroom (it needs some time until it has seen the new state and could react on it by sending _new_ responses with headroom).

Quoted 3 lines

Ah, I see. You mean that we have to wait until XenbusStateReconfigured is set in
xen-netfront and only after that it's safe to process packets.

Right. That is the problem of using a different communication channel for enabling/disabling XDP.

Juergen

#17 lore raw
Quoted 123 lines · Jürgen Groß
Quoted 122 lines · Denis Kirjanov
Quoted 120 lines · Jürgen Groß
Quoted 101 lines · Denis Kirjanov
Quoted 100 lines · Jürgen Groß
Quoted 98 lines · Denis Kirjanov
Quoted 79 lines · Jürgen Groß
Quoted 67 lines · Denis Kirjanov
Quoted 59 lines · Jürgen Groß
Quoted 46 lines · Denis Kirjanov
Quoted 11 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov

The patch adds a basic XDP processing to xen-netfront driver.

We ran an XDP program for an RX response received from netback driver. Also we request xen-netback to adjust data offset for bpf_xdp_adjust_head() header space for custom headers.

This is in no way a "verbose patch descriprion".

I'm missing:

Quoted 8 lines

- Why are you doing this. "Add XDP support" is not enough, for such
a change I'd like to see some performance numbers to get
an
idea
of the improvement to expect, or which additional
functionality
for the user is available.

Ok, I'll try to measure some numbers.

Quoted 11 lines

- A short description for me as a Xen maintainer with only basic networking know-how, what XDP programs are about (a link
to
some
more detailed doc is enough, of course) and how the
interface
is working (especially for switching between XDP mode
and
normal
SKB processing).

You can search for the "A practical introduction to XDP" tutorial.
Actually there is a lot of information available regarding XDP, you
can easily find it.

Quoted 6 lines

- A proper description of the netfront/netback communication when
enabling or disabling XDP mode (who is doing what, is
silencing
of the virtual adapter required, ...).

Quoted 11 lines

Currently we need only a header offset from netback driver so that
we
can
put
custom encapsulation header if required and that's done using xen bus
state switching,
so that:
- netback tells that it can adjust the header offset
- netfront part reads it

Quoted 6 lines

Yes, but how is this synchronized with currently running network load?
Assume you are starting without XDP being active and then you are activating it. How is the synchronization done from which request on
the XDP headroom is available?

Quoted 8 lines

Hi Jurgen,

basically XDP is activated when you've assigned an xdp program to the
networking device.
Assigning an xdp program means that we have to adjust a pointer which
is RCU protected.

This doesn't answer my question.

Quoted 9 lines

You have basically two communication channels: the state of the frontend
and backend for activation/deactivation of XDP, and the ring pages with
the rx and tx requests and responses. How is the synchronization between
those two channels done? So how does the other side know which of the
packets in flight will then have XDP on or off?

Right,
that's done in xen-netback using xenbus state:
- in xennet_xdp_set() we call xenbus_switch_state to tell xen-netback to
adjust offset for an RX response.
-xen-netback reads the value from xenstore and adjusts the offset for xen-netback
in xenvif_rx_data_slot() using vif->xdp_enabled flag.

Quoted 8 lines
Quoted 2 lines

And before that all in-flight requests in the ring pages are being processed and no new requests are guaranteed to be enqueued?

Actually I don't see the need to sync these requests since that all we have to do is to copy
data with specified offset:
with xdp->enabled=1: copy with the offset XDP_PACKET_HEADROOM with xdd->enabled=0: copy without the offset

Isn't that racy?

In xennet_xdp_set() you set queue->xdp_prog and then you change the state to Reconfiguring. From the time queue->xdp_prog is set you'll do the Xdp processing in xennet_get_responses(), even if the response you are working on doesn't have the headroom you need, as the backend didn't create it with headroom (it needs some time until it has seen the new state and could react on it by sending _new_ responses with headroom).

Quoted 6 lines
Quoted 3 lines

Ah, I see. You mean that we have to wait until XenbusStateReconfigured is set in
xen-netfront and only after that it's safe to process packets.

Right. That is the problem of using a different communication channel for enabling/disabling XDP.

Ok, I'll update my patch.

Thanks for review!

Quoted 4 lines

Juergen