public/io/netif.h: add a new extra type for XDP
PATCH v4 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.
The offset value from a guest is passed via xenstore.
---
v4:
- updated the commit and documenation
v3:
- updated the commit message
v2:
- added documentation
- fixed padding for netif_extra_info
---
--- xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
xen/include/public/io/netif.h +17 -1
@@ -161,6 +161,17 @@*/ /* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by +* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing. +* +* "feature-xdp-headroom" is set to "1" by the netback side like other features +* so a guest can check if an XDP program can be processed. +*/ + +/* * Control ring * ============ *
@@ -985,7 +996,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 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom; + uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; };
Signature · 1 line
1.8.3.1
Quoted 27 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.
The offset value from a guest is passed via xenstore.
Signed-off-by Denis Kirjanov <[email protected]>---
v4:
- updated the commit and documenationv3:
- updated the commit messagev2:
- added documentation
- fixed padding fornetif_extra_info
------ xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +0
-0
xen/include/public/io/netif.h line 165
Quoted 5 lines
xen/include/public/io/netif.h +2
-0@@ -161,6 +161,17 @@*/ /* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by
not sure that we should use word "bytes" here as the rest of the protocol (mostly)
talks about octets. It is somewhat mixed here, no strong opinion
Quoted 23 lines
xen/include/public/io/netif.h +11
-1+* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing. +* +* "feature-xdp-headroom" is set to "1" by the netback side like other features +* so a guest can check if an XDP program can be processed. +*/ + +/* * Control ring * ============ * @@ -985,7 +996,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 1034
Quoted 5 lines
xen/include/public/io/netif.h +2
-0@@ -1018,6 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom;
why do you need "pad" field here?
Quoted 5 lines
xen/include/public/io/netif.h +2
-0+ uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; };
Quoted 31 lines · Oleksandr Andrushchenko
Quoted 30 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.
The offset value from a guest is passed via xenstore.
Signed-off-by Denis Kirjanov <[email protected]>---
v4:
- updated the commit and documenationv3:
- updated the commit messagev2:
- added documentation
- fixed padding fornetif_extra_info
------ xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +0
-0@@ -161,6 +161,17 @@*/
Quoted 8 lines
xen/include/public/io/netif.h line 165
Quoted 3 lines
xen/include/public/io/netif.h +2
-0/* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by not sure that we should use word "bytes" here as the rest of the protocol (mostly)
talks about octets. It is somewhat mixed here, no strong opinion
sure, but since the public header mixes it I've decided to use that word.
Quoted 23 lines
Quoted 23 lines
xen/include/public/io/netif.h +3
-0+* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing.
+ *
+ * "feature-xdp-headroom" is set to "1" by the netback side like other features
+ * so a guest can check if an XDP program can be processed.
+ */xen/include/public/io/netif.h +4
-1+ +/* * Control ring * ============ * @@ -985,7 +996,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)
Quoted 9 lines
xen/include/public/io/netif.h struct netif_extra_info { · line 1034
Quoted 8 lines
xen/include/public/io/netif.h +2
-0/* netif_extra_info_t flags. */ #define _XEN_NETIF_EXTRA_FLAG_MORE (0)@@ -1018,6 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom;why do you need "pad" field here?
To state that we have a fixed size available.
Quoted 5 lines
Quoted 5 lines
xen/include/public/io/netif.h +2
-0+ uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; };
Quoted 73 lines · Denis Kirjanov
Quoted 31 lines · Oleksandr Andrushchenko
Quoted 30 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.
The offset value from a guest is passed via xenstore.
Signed-off-by Denis Kirjanov <[email protected]>---
v4:
- updated the commit and documenationv3:
- updated the commit messagev2:
- added documentation
- fixed padding fornetif_extra_info
------ xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +0
-0@@ -161,6 +161,17 @@*/ Quoted 7 lines
xen/include/public/io/netif.h line 165
Quoted 3 lines
xen/include/public/io/netif.h +2
-0/* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by not sure that we should use word "bytes" here as the rest of the protocol (mostly)
talks about octets. It is somewhat mixed here, no strong opinion
sure, but since the public header mixes it I've decided to use that word.
Quoted 22 lines
Quoted 22 lines
xen/include/public/io/netif.h +3
-0+* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing.
+ *
+ * "feature-xdp-headroom" is set to "1" by the netback side like other features
+ * so a guest can check if an XDP program can be processed.
+ */xen/include/public/io/netif.h +4
-1+ +/* * Control ring * ============ * @@ -985,7 +996,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)Quoted 9 lines
xen/include/public/io/netif.h struct netif_extra_info { · line 1034
Quoted 8 lines
xen/include/public/io/netif.h +2
-0/* netif_extra_info_t flags. */ #define _XEN_NETIF_EXTRA_FLAG_MORE (0)@@ -1018,6 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom;why do you need "pad" field here?
Quoted 1 line
To state that we have a fixed size available.
Well, I would expect "reserved" or something in that case and "pad" in case
there are other fields following (see gso above).
But here I think "pad" is not required, just like mcast doesn't add any
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
xen/include/public/io/netif.h +2
-0+ uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; };
Quoted 75 lines · Oleksandr Andrushchenko
Quoted 74 lines · Denis Kirjanov
Quoted 31 lines · Oleksandr Andrushchenko
Quoted 30 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.
The offset value from a guest is passed via xenstore.
Signed-off-by Denis Kirjanov <[email protected]>---
v4:
- updated the commit and documenationv3:
- updated the commit messagev2:
- added documentation
- fixed padding fornetif_extra_info
------ xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +0
-0@@ -161,6 +161,17 @@*/ Quoted 7 lines
xen/include/public/io/netif.h line 165
Quoted 3 lines
xen/include/public/io/netif.h +2
-0/* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by not sure that we should use word "bytes" here as the rest of the protocol (mostly)
talks about octets. It is somewhat mixed here, no strong opinion
sure, but since the public header mixes it I've decided to use that word.
Quoted 31 lines
Quoted 25 lines
xen/include/public/io/netif.h +3
-0+* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing.
+ *
+ * "feature-xdp-headroom" is set to "1" by the netback side like other features
+ * so a guest can check if an XDP program can be processed.
+ */xen/include/public/io/netif.h +4
-1+ +/* * Control ring * ============ * @@ -985,7 +996,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 1034
Quoted 5 lines
xen/include/public/io/netif.h +2
-0@@ -1018,6 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom;why do you need "pad" field here?
Quoted 5 lines
Quoted 1 line
To state that we have a fixed size available.
Well, I would expect "reserved" or something in that case and "pad" in case
there are other fields following (see gso above).
it can be consistent with other names like pad at then end of the structure.
If it really matters I can change it, no problem.
Quoted 2 lines
But here I think "pad" is not required, just like mcast doesn't add any
because it's already 6-bytes long
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
xen/include/public/io/netif.h +2
-0+ uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; };
Quoted 76 lines · Denis Kirjanov
Quoted 75 lines · Oleksandr Andrushchenko
Quoted 74 lines · Denis Kirjanov
Quoted 31 lines · Oleksandr Andrushchenko
Quoted 30 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.
The offset value from a guest is passed via xenstore.
Signed-off-by Denis Kirjanov <[email protected]>---
v4:
- updated the commit and documenationv3:
- updated the commit messagev2:
- added documentation
- fixed padding fornetif_extra_info
------ xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +0
-0@@ -161,6 +161,17 @@*/ Quoted 7 lines
xen/include/public/io/netif.h line 165
Quoted 3 lines
xen/include/public/io/netif.h +2
-0/* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by not sure that we should use word "bytes" here as the rest of the protocol (mostly)
talks about octets. It is somewhat mixed here, no strong opinion
sure, but since the public header mixes it I've decided to use that word.
Quoted 31 lines
Quoted 25 lines
xen/include/public/io/netif.h +3
-0+* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing.
+ *
+ * "feature-xdp-headroom" is set to "1" by the netback side like other features
+ * so a guest can check if an XDP program can be processed.
+ */xen/include/public/io/netif.h +4
-1+ +/* * Control ring * ============ * @@ -985,7 +996,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 1034
Quoted 5 lines
xen/include/public/io/netif.h +2
-0@@ -1018,6 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom;why do you need "pad" field here?
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
To state that we have a fixed size available.
Well, I would expect "reserved" or something in that case and "pad" in case
there are other fields following (see gso above).
it can be consistent with other names like pad at then end of the structure.
If it really matters I can change it, no problem.
My point is that IMO it is not required at all, but this is up to maintainers to decide
Quoted 3 lines
Quoted 2 lines
But here I think "pad" is not required, just like mcast doesn't add any
because it's already 6-bytes long
you are right
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
xen/include/public/io/netif.h +2
-0+ uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; };
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.
The offset value from a guest is passed via xenstore.
I'm going to send a new version for Linux with the above changes applied.
Quoted 65 lines
Signed-off-by Denis Kirjanov <[email protected]>---
v4:
- updated the commit and documenationv3:
- updated the commit messagev2:
- added documentation
- fixed padding fornetif_extra_info
------ xen/include/public/io/netif.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)xen/include/public/io/netif.h +7
-0@@ -161,6 +161,17 @@*/ /* +* "xdp-headroom" is used to request that extra space is added +* for XDP processing. The value is measured in bytes and passed by +* the frontend to be consistent between both ends. +* If the value is greater than zero that means that +* an RX response is going to be passed to an XDP program for processing. +* +* "feature-xdp-headroom" is set to "1" by the netback side like other features
+ * so a guest can check if an XDP program can be processed.
+ */xen/include/public/io/netif.h +8
-2+ +/* * Control ring * ============ * @@ -985,7 +996,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 +1030,10 @@ struct netif_extra_info {uint8_t algorithm;uint8_t value[4 ]; } hash; +struct { +uint16_t headroom; + uint16_t pad[2] + } xdp;uint16_t pad[3 ]; } u; }; --1.8.3.1