public/io/netif.h: add a new extra type for XDP
PATCH 1/1 public/io/netif.h: add a new extra type for XDP
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
For Linux the offset value is going to be passed via xenstore.
--- xen/include/public/io/netif.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
xen/include/public/io/netif.h +6 -1
@@ -985,7 +985,8 @@ typedef struct netif_tx_request netif_tx_request_t;#define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2)/* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)/* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_HASH (4)/* u.hash */ -#define XEN_NETIF_EXTRA_TYPE_MAX (5) +#define XEN_NETIF_EXTRA_TYPE_XDP (5)/* u.xdp */ +#define XEN_NETIF_EXTRA_TYPE_MAX (6)/* netif_extra_info_t flags. */ #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
@@ -1018,6 +1019,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom; +uint32_t pad; + } xdp;uint16_t pad[3 ]; } u; };
Signature · 1 line
1.8.3.1
Quoted 5 lines · Denis Kirjanov
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
For Linux the offset value is going to be passed via xenstore.
Why? I can only see disadvantages by using a different communication mechanism.
Quoted 21 lines
Signed-off-by Denis Kirjanov <[email protected]>--- xen/include/public/io/netif.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +2
-1@@ -985,7 +985,8 @@ typedef struct netif_tx_request netif_tx_request_t;#define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2)/* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)/* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_HASH (4)/* u.hash */ -#define XEN_NETIF_EXTRA_TYPE_MAX (5) +#define XEN_NETIF_EXTRA_TYPE_XDP (5)/* u.xdp */ +#define XEN_NETIF_EXTRA_TYPE_MAX (6)/* netif_extra_info_t flags. */ #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
xen/include/public/io/netif.h struct netif_extra_info { · line 1024
Quoted 6 lines
xen/include/public/io/netif.h +3
-0@@ -1018,6 +1019,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom; +uint32_t pad;
Please use uint16_t pad[2] in order to avoid padding holes.
Additionally you are missing the addition of the related feature Xenstore nodes in the comment area further up in the same file.
Juergen
Quoted 9 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
For Linux the offset value is going to be passed via xenstore.
Why? I can only see disadvantages by using a different communication mechanism.
I see it like other features passed through xenstore and it requires less changes to
other structures with the same final result.
Quoted 32 lines
Quoted 23 lines
Signed-off-by Denis Kirjanov <[email protected]>--- xen/include/public/io/netif.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +2
-1@@ -985,7 +985,8 @@ typedef struct netif_tx_request netif_tx_request_t;#define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2)/* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)/* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_HASH (4)/* u.hash */ -#define XEN_NETIF_EXTRA_TYPE_MAX (5) +#define XEN_NETIF_EXTRA_TYPE_XDP (5)/* u.xdp */ +#define XEN_NETIF_EXTRA_TYPE_MAX (6)/* netif_extra_info_t flags. */ #define _XEN_NETIF_EXTRA_FLAG_MORE (0)xen/include/public/io/netif.h struct netif_extra_info { · line 1024
Quoted 6 lines
xen/include/public/io/netif.h +3
-0@@ -1018,6 +1019,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom; +uint32_t pad;Please use
uint16_tpad[2] in order to avoid padding holes.
Quoted 2 lines
Additionally you are missing the addition of the related feature Xenstore nodes in the comment area further up in the same file.
Done.
Quoted 4 lines
Juergen
Quoted 6 lines · Denis Kirjanov
Quoted 5 lines · Jürgen Groß
Quoted 4 lines · Denis Kirjanov
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
For Linux the offset value is going to be passed via xenstore.
Why? I can only see disadvantages by using a different communication mechanism.
I see it like other features passed through xenstore and it requires less changes to
other structures with the same final result.
This is okay as long there is no Xenstore interaction required when the interface has been setup completely (i.e. only defining the needed offset for XDP is fine, enabling/disabling XDP at runtime should not be done via Xenstore IMO).
And please, no guest type special casing. Please replace "Linux" by e.g. "The guest" (with additional tweaking of the following sentence).
Juergen
Quoted 11 lines · Jürgen Groß
Quoted 10 lines · Denis Kirjanov
Quoted 9 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
For Linux the offset value is going to be passed via xenstore.
Why? I can only see disadvantages by using a different communication mechanism.
Quoted 8 lines
Quoted 3 lines
I see it like other features passed through xenstore and it requires less changes to
other structures with the same final result.This is okay as long there is no Xenstore interaction required when the interface has been setup completely (i.e. only defining the needed offset for XDP is fine, enabling/disabling XDP at runtime should not be done via Xenstore IMO).
I've checked netfront-<--->netback interaction and found no problems with it. Paul found an issue that the value of the netfront state hasn't been re-read (during unbind-bind sequence in dom0) and I've fixed it the patch for the guest
Quoted 3 lines
And please, no guest type special casing. Please replace "Linux" by e.g. "The guest" (with additional tweaking of the following sentence).
Oh, just sent v2. I'll fix a comment.
Quoted 4 lines
Juergen
Quoted 18 lines
-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 18 May 2020 11:28
To: Denis Kirjanov <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH]public/io/netif.h: add a new extra type for XDPQuoted 10 lines · Denis Kirjanov
Quoted 9 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
For Linux the offset value is going to be passed via xenstore.
Why? I can only see disadvantages by using a different communication mechanism.
Quoted 8 lines
Quoted 3 lines
I see it like other features passed through xenstore and it requires less changes to
other structures with the same final result.This is okay as long there is no Xenstore interaction required when the interface has been setup completely (i.e. only defining the needed offset for XDP is fine, enabling/disabling XDP at runtime should not be done via Xenstore IMO).
FWIW it is for this kind of thing that I introduced the control ring, but that may be overkill for this.
Paul
Quoted 6 lines
And please, no guest type special casing. Please replace "Linux" by e.g. "The guest" (with additional tweaking of the following sentence).
Juergen
Quoted 16 lines · Denis Kirjanov
Quoted 15 lines · Jürgen Groß
Quoted 13 lines · Denis Kirjanov
Quoted 9 lines · Jürgen Groß
Quoted 5 lines · Denis Kirjanov
The patch adds a new extra type to be able to diffirentiate between RX responses on xen-netfront side with the adjusted offset required for XDP processing.
For Linux the offset value is going to be passed via xenstore.
Why? I can only see disadvantages by using a different communication mechanism.
I see it like other features passed through xenstore and it requires less changes to
other structures with the same final result.
Quoted 8 lines
Quoted 4 lines
This is okay as long there is no Xenstore interaction required when the interface has been setup completely (i.e. only defining the needed offset for XDP is fine, enabling/disabling XDP at runtime should not be done via Xenstore IMO).
I've checked netfront-<--->netback interaction and found no problems with it. Paul found an issue that the value of the netfront state hasn't been re-read (during unbind-bind sequence in dom0) and I've fixed it the patch for the guest
I don't say your variant isn't working, but a feature being switchable dynamically AND needing a ring page synchronization anyway should IMO be switched via a specific ring page request.
I might have not the complete picture, so in case you have a good reason to do it via Xenstore, fine, but "I'm seeing no problem with it" is no good reason for a specific design decision.
Quoted 6 lines
Quoted 4 lines
And please, no guest type special casing. Please replace "Linux" by e.g. "The guest" (with additional tweaking of the following sentence).
Oh, just sent v2. I'll fix a comment.
Thanks.
Juergen