ethdev: update qfi definition
PATCH 1/1 ethdev: update qfi definition
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier)
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -1
@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.
lib/librte_ethdev/rte_flow.h +2 -2
@@ -1392,14 +1392,14 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {*/ struct rte_flow_item_gtp_psc {uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ };/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .qfi =0xff , };#endif
Signature · 1 line
2.17.1
Quoted 4 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier)
Can you please put a reference for above information?
Quoted 36 lines
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +0
-0
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1396
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +1
-1@@ -1392,14 +1392,14 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {*/ struct rte_flow_item_gtp_psc {uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ };
By design requirement, rte_flow_item_* should start with the relevant protocol header.
There is already a deprecation notice for using protocol header directly in the rte_flow_item* [1] and Adrew/Ivan already fixed a few of them [2].
Your patch is not directly related on this, but since you are touching to the flow_item, would you mind create a protocol struct for it first, and use it in the "struct rte_flow_item_gtp_psc"? So the protocol related update can be done in the protocol header, instead of rte_flow struct.
[1]
https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v21.02#n99
[2]
https://git.dpdk.org/next/dpdk-next-net/commit/?id=4a061a7bd70bfa023de23e8e654e
Hi
Quoted 60 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Subject: Re: [dpdk-dev] [PATCH] ethdev: update qfi definitionQuoted 4 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier)
Can you please put a reference for above information?
Quoted 11 lines
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Review
Quoted 7 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and their
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items and theirattributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 14 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +0
-0@@ -1392,14 +1392,14 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1396
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +1
-1*/ struct rte_flow_item_gtp_psc {uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ };By design requirement, rte_flow_item_* should start with the relevant protocol header.
Quoted 9 lines
There is already a deprecation notice for using protocol header directly in the rte_flow_item* [1] and Adrew/Ivan already fixed a few of them [2].
Your patch is not directly related on this, but since you are touching to the
flow_item, would you mind create a protocol struct for it first, and use it in the "structrte_flow_item_gtp_psc"?
So the protocol related update can be done in the protocol header, instead ofrte_flowstruct.
+1
Quoted 20 lines
[1]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.dpdk.
org%2Fdpdk%2Ftree%2Fdoc%2Fguides%2Frel_notes%2Fdeprecation.rst%3Fh%3 Dv21.02%23n99&data=04%7C01%7Corika%40nvidia.com%7C6391a4c0640 f4592b70b08d8f058e322%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0 %7C637523611870497932%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdat a=vU%2F5oO47zb9erTnZL1pl9j0nHCKzea3NJgOeo1FTW0Q%3D&reserved= 0[2]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.dpdk.
org%2Fnext%2Fdpdk-next- net%2Fcommit%2F%3Fid%3D4a061a7bd70bfa023de23e8e654e&data=04% 7C01%7Corika%40nvidia.com%7C6391a4c0640f4592b70b08d8f058e322%7C43 083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637523611870497932%7CU nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik 1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WurlQ5VSLqFGVthfRj363xZsC No3xJuvxNQCFVcxdkk%3D&reserved=0
Hi,
Quoted 12 lines
-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Monday, March 29, 2021 11:53 AM
To: Ferruh Yigit <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; Andrew Rybchenko <[email protected]>; Ivan Malov <[email protected]>
Cc: Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]; [email protected]; NBU- Contact-Thomas Monjalon <[email protected]>; Olivier Matz <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] ethdev: update qfi definition
Quoted 14 lines
Hi
Quoted 12 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Subject: Re: [dpdk-dev] [PATCH] ethdev: update qfi definitionQuoted 4 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier)
Can you please put a reference for above information?
Quoted 1 line
Sure, will send in V2,
Quoted 54 lines
Quoted 16 lines
Quoted 16 lines
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)Quoted 6 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir
Quoted 16 lines
attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 14 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +0
-0@@ -1392,14 +1392,14 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 8 lines
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1396
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +1
-1*/ struct rte_flow_item_gtp_psc {uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ };By design requirement, rte_flow_item_* should start with the relevant
protocol
Quoted 3 lines
header.
There is already a deprecation notice for using protocol header directly in
the
Quoted 2 lines
rte_flow_item* [1] and Adrew/Ivan already fixed a few of them [2].
Quoted 8 lines
Quoted 4 lines
Your patch is not directly related on this, but since you are touching to the
flow_item, would you mind create a protocol struct for it first, and use it in the "structrte_flow_item_gtp_psc"?
So the protocol related update can be done in the protocol header, insteadof
Quoted 2 lines
rte_flowstruct.+1
Sure, I can create the new protocol and use it , and will send in V2. But, wouldn't it cause any ABI breakage ?
Quoted 44 lines
Quoted 4 lines
[1]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.d
pdk.Quoted 1 line
org%2Fdpdk%2Ftree%2Fdoc%2Fguides%2Frel_notes%2Fdeprecation.rst%3F h%3
Quoted 1 line
Dv21.02%23n99&data=04%7C01%7Corika%40nvidia.com%7C6391a4c064 0
Quoted 1 line
f4592b70b08d8f058e322%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
Quoted 1 line
%7C637523611870497932%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA w
Quoted 1 line
MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sda t
Quoted 1 line
a=vU%2F5oO47zb9erTnZL1pl9j0nHCKzea3NJgOeo1FTW0Q%3D&reserve d=
Quoted 4 lines
0
[2]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.d
pdk.Quoted 2 lines
org%2Fnext%2Fdpdk-next-
net%2Fcommit%2F%3Fid%3D4a061a7bd70bfa023de23e8e654e&data=0 4%
Quoted 1 line
7C01%7Corika%40nvidia.com%7C6391a4c0640f4592b70b08d8f058e322%7C43
Quoted 1 line
083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637523611870497932%7CU
Quoted 1 line
nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI 6Ik
Quoted 1 line
1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WurlQ5VSLqFGVthfRj363xZs C
Quoted 1 line
No3xJuvxNQCFVcxdkk%3D&reserved=0
Quoted 88 lines · Raslan Darawsheh
Hi,
Quoted 12 lines
-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Monday, March 29, 2021 11:53 AM
To: Ferruh Yigit <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; Andrew Rybchenko <[email protected]>; Ivan Malov <[email protected]>
Cc: Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]; [email protected]; NBU- Contact-Thomas Monjalon <[email protected]>; Olivier Matz <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] ethdev: update qfi definitionQuoted 14 lines
Hi
Quoted 12 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Subject: Re: [dpdk-dev] [PATCH] ethdev: update qfi definitionQuoted 4 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier)
Can you please put a reference for above information?
Quoted 1 line
Sure, will send in V2,
Quoted 58 lines
Quoted 16 lines
Quoted 16 lines
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)Quoted 6 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir
Quoted 16 lines
attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 14 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +0
-0@@ -1392,14 +1392,14 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 8 lines
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1396
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +1
-1*/ struct rte_flow_item_gtp_psc {uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ };By design requirement, rte_flow_item_* should start with the relevant
protocol
Quoted 3 lines
header.
There is already a deprecation notice for using protocol header directly in
the
Quoted 6 lines
rte_flow_item* [1] and Adrew/Ivan already fixed a few of them [2].
Your patch is not directly related on this, but since you are touching to the
flow_item, would you mind create a protocol struct for it first, and use it in the "structrte_flow_item_gtp_psc"?
So the protocol related update can be done in the protocol header, instead
Quoted 5 lines
Quoted 4 lines
of
Quoted 2 lines
rte_flowstruct.+1
Sure, I can create the new protocol and use it , and will send in V2. But, wouldn't it cause any ABI breakage ?
For the protocol header, it won't be problem since it is a new struct.
For the flow item struct, it may be, that is why need to use a union for now, please check what Adrew/Ivan did.
Quoted 45 lines
Quoted 44 lines
Quoted 4 lines
[1]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.d
pdk.Quoted 1 line
org%2Fdpdk%2Ftree%2Fdoc%2Fguides%2Frel_notes%2Fdeprecation.rst%3F h%3
Quoted 1 line
Dv21.02%23n99&data=04%7C01%7Corika%40nvidia.com%7C6391a4c064 0
Quoted 1 line
f4592b70b08d8f058e322%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
Quoted 1 line
%7C637523611870497932%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA w
Quoted 1 line
MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sda t
Quoted 1 line
a=vU%2F5oO47zb9erTnZL1pl9j0nHCKzea3NJgOeo1FTW0Q%3D&reserve d=
Quoted 4 lines
0
[2]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.d
pdk.Quoted 2 lines
org%2Fnext%2Fdpdk-next-
net%2Fcommit%2F%3Fid%3D4a061a7bd70bfa023de23e8e654e&data=0 4%
Quoted 1 line
7C01%7Corika%40nvidia.com%7C6391a4c0640f4592b70b08d8f058e322%7C43
Quoted 1 line
083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637523611870497932%7CU
Quoted 1 line
nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI 6Ik
Quoted 1 line
1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WurlQ5VSLqFGVthfRj363xZs C
Quoted 1 line
No3xJuvxNQCFVcxdkk%3D&reserved=0
v2 cover fix gtp psc qfi support
In reply to Raslan DarawshehThis is fixing the gtp psc support to match the RFC 38415-g30
v2: introduce new header definition for gtp psc
update commit msg for rte flow item change.
Raslan Darawsheh (2):
ethdev: add new ext hdr for gtp psc
ethdev: update qfi definition
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +- lib/librte_ethdev/rte_flow.h | 18 +++++++++-- lib/librte_net/rte_gtp.h | 34 +++++++++++++++++++++ 3 files changed, 51 insertions(+), 4 deletions(-)
Signature · 1 line
2.29.0
PATCH v2 1/2 ethdev: add new ext hdr for gtp psc
Define new rte header for gtp PDU session container based on RFC 38415-g30
--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
lib/librte_net/rte_gtp.h +34 -0
@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extention for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t snp_ul1:1 ;/**< Sequence number presence ul */ + }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ + }; + }; +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Signature · 1 line
2.29.0
v3 cover fix gtp psc qfi support
This is fixing the gtp psc support to match the RFC 38415-g30
v2: introduce new header definition for gtp psc
update commit msg for rte flow item change.
v3: fixed typo in comment
Cc relevant people.
Raslan Darawsheh (2):
ethdev: add new ext hdr for gtp psc
ethdev: update qfi definition
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +- lib/librte_ethdev/rte_flow.h | 18 +++++++++-- lib/librte_net/rte_gtp.h | 34 +++++++++++++++++++++ 3 files changed, 51 insertions(+), 4 deletions(-)
Signature · 1 line
2.29.0
PATCH v3 1/2 ethdev: add new ext hdr for gtp psc
Define new rte header for gtp PDU session container based on RFC 38415-g30
--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
lib/librte_net/rte_gtp.h +34 -0
@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t snp_ul1:1 ;/**< Sequence number presence ul */ + }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ + }; + }; +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Signature · 1 line
2.29.0
Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add new ext hdr for gtp psc
Quoted 13 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +0
-0
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 69
Quoted 9 lines
lib/librte_net/rte_gtp.h +6
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc {
general consensus in other protocols seems having '_hdr' suffix in the struct name, I can see this is extension but do you think does it make to add suffix?
Quoted 32 lines
lib/librte_net/rte_gtp.h +28
-0+uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t snp_ul1:1 ;/**< Sequence number presence ul */ + }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add new ext hdr for gtp psc
Quoted 27 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, April 1, 2021 7:51 PM
To: Raslan Darawsheh <[email protected]>; [email protected]
Cc: Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [PATCH v3 1/2] ethdev: add new ext hdr for gtp pscQuoted 16 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +0
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed;
Quoted 9 lines
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 69
Quoted 6 lines
lib/librte_net/rte_gtp.h +6
-0+/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc {general consensus in other protocols seems having '
_hdr' suffix in the struct name, I can see this is extension but do you think does it make to add suffix?
Yes sure, will send in a new version.
Quoted 26 lines
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word {
Quoted 11 lines
lib/librte_net/rte_gtp.h +10
-0+uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 80
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t ul_delay_ind:1; /**< ul delay result presence*/
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 81
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t snp_ul1:1; /**< Sequence number presenceul */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word {
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+ }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */
Quoted 11 lines
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 100
Quoted 11 lines
lib/librte_net/rte_gtp.h +7
-0+ uint8_t spare_ul2:1; /**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Kindest regards
Raslan Darawsheh
PATCH v3 2/2 ethdev: update qfi definition
In reply to Raslan Darawshehqfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-)
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -1
@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.
lib/librte_ethdev/rte_flow.h +15 -3
@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h>
@@ -1421,16 +1422,27 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +union { +struct { +/* +* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc gtp_psc; + }; };/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .qfi =0xff , };#endif
Signature · 1 line
2.29.0
Quoted 56 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-)doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +3
-2@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,27 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +union {
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1437
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +10
-0+struct { +/* +* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc gtp_psc;
Again for consistency, what do you think to rename the variable as 'hdr'?
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1445
Quoted 9 lines
lib/librte_ethdev/rte_flow.h +2
-1+ }; };/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi = 0x3f, + .qfi = 0xff,
Since the protocol header is the preferred way, (individual fields may be deprecated in the future), can you please switch to new field, like:
.gtp_psc.qfi = 0xff,
Quoted 4 lines
lib/librte_ethdev/rte_flow.h +0
-0};#endif
Hi Ferruh,
Quoted 74 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, April 1, 2021 7:54 PM
To: Raslan Darawsheh <[email protected]>; [email protected]
Cc: Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]
Subject: Re: [PATCH v3 2/2] ethdev: update qfi definitionQuoted 15 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Review
Quoted 7 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 22 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +1
-0@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,27 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 12 lines
lib/librte_ethdev/rte_flow.h +6
-2* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ + union { + struct { +/* +* These fields are retained for compatibility. +* Please switch to the new header field below.
Quoted 8 lines
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1437
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +6
-0+*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc gtp_psc;Again for consistency, what do you think to rename the variable as 'hdr'?
Will do,
Quoted 4 lines
Quoted 4 lines
lib/librte_ethdev/rte_flow.h +1
-0+ }; };
Quoted 9 lines
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1445
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +1
-1/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi = 0x3f, + .qfi = 0xff,Since the protocol header is the preferred way, (individual fields may be deprecated in the future), can you please switch to new field, like:
Yes, will do it accordingly
Quoted 6 lines
.gtp_psc.qfi =
0xff,Quoted 4 lines
lib/librte_ethdev/rte_flow.h +0
-0};#endif
v4 cover fix gtp psc qfi support
In reply to Raslan DarawshehThis is fixing the gtp psc support to match the RFC 38415-g30
v2: introduce new header definition for gtp psc
update commit msg for rte flow item change.
v3: fixed typo in comment
Cc relevant people.
v4: update hdr definition to have hdr suffix.
update variable name to be hdr in the gtp_psc item. update default max to use the new added hdr.
Raslan Darawsheh (2):
ethdev: add new ext hdr for gtp psc
ethdev: update qfi definition
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +- lib/librte_ethdev/rte_flow.h | 20 ++++++++++-- lib/librte_net/rte_gtp.h | 34 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-)
Signature · 1 line
2.29.0
PATCH v4 1/2 ethdev: add new ext hdr for gtp psc
Define new rte header for gtp PDU session container based on RFC 38415-g30
--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
lib/librte_net/rte_gtp.h +34 -0
@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t snp_ul1:1 ;/**< Sequence number presence ul */ + }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ + }; + }; +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Signature · 1 line
2.29.0
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
Hi Raslan,
Quoted 2 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Do you have a link to this RFC?
Quoted 36 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +23
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + union { + struct { + uint8_t snp:1; /**< Sequence number presence */ + uint8_t spare_dl1:2; /**< spare down link bits */ + }; + struct { + uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */ + uint8_t snp_ul1:1; /**< Sequence number presence ul */ + }; + }; + union { + struct { + uint8_t ppp:1; /**< Paging policy presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 96
Quoted 10 lines
lib/librte_net/rte_gtp.h +10
-0+ uint8_t rqi:1; /**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed;
With this header, sizeof(rte_gtp_psc_hdr) = 5, is it really expected?
It would help to see the specification to have a better idea of how to split, but a possible solution is to do something like this:
struct rte_gtp_psc_generic_hdr {
uint8_t ext_hdr_len;
uint8_t type:4
uint8_t qmp:1;
uint8_t pad:3;
};struct rte_gtp_psc_<name1>_hdr {
uint8_t ext_hdr_len;
uint8_t type:4
uint8_t qmp:1;
uint8_t uint8_t snp:1;
uint8_t spare_dl1:2;
...
};...
struct rte_gtp_psc_hdr {
union {
struct rte_gtp_psc_generic_hdr generic;
struct rte_gtp_psc_<name1>_hdr <name1>;
struct rte_gtp_psc_<name2>_hdr <name2>;
};
};Also, you need to take care about endianness.
Regards,
Olivier
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
Hi Olivier,
Quoted 10 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Thursday, April 8, 2021 3:30 PM
To: Raslan Darawsheh <[email protected]>
Cc: [email protected]; [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
Quoted 7 lines
Hi Raslan,
Quoted 2 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Do you have a link to this RFC?
Yes sure,
https://www.3gpp.org/ftp/Specs/archive/38_series/38.415/38415-g30.zip
Quoted 45 lines
Quoted 20 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +6
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr {lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 79
Quoted 10 lines
lib/librte_net/rte_gtp.h +10
-0+uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 80
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t ul_delay_ind:1; /**< ul delay result presence*/
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 81
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t snp_ul1:1; /**< Sequence number presenceul */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word {
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+ }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */
Quoted 8 lines
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 96
Quoted 6 lines
lib/librte_net/rte_gtp.h +6
-0+ uint8_t spare_ul2:1; /**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed;With this header,
sizeof(rte_gtp_psc_hdr)= 5, is it really expected?
The data[0] is variable length data, I guess I should send another version to mention that in the comment maybe. The header size according to the spec should be 4 octets aligned in general.
Quoted 2 lines
It would help to see the specification to have a better idea of how to
Sure, I've just posted the link above, please let me know of any suggestion that you have, and I'll be glad to do accordingly.
Quoted 28 lines
split, but a possible solution is to do something like this:
struct rte_gtp_psc_generic_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t pad:3; };struct rte_gtp_psc_<name1>_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t uint8_t snp:1; uint8_t spare_dl1:2; ... };...
struct rte_gtp_psc_hdr { union { struct rte_gtp_psc_generic_hdr generic; struct rte_gtp_psc_<name1>_hdr <name1>; struct rte_gtp_psc_<name2>_hdr <name2>; }; };
Quoted 5 lines
Also, you need to take care about endianness.
Regards,
Olivier
Kindest regards
Raslan Darawsheh
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
Quoted 75 lines · Raslan Darawsheh
Hi Olivier,
Quoted 10 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Thursday, April 8, 2021 3:30 PM
To: Raslan Darawsheh <[email protected]>
Cc: [email protected]; [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp pscQuoted 7 lines
Hi Raslan,
Quoted 2 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Do you have a link to this RFC?
Yes sure,
https://www.3gpp.org/ftp/Specs/archive/38_series/38.415/38415-g30.zipQuoted 45 lines
Quoted 20 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +6
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr {lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 79
Quoted 10 lines
lib/librte_net/rte_gtp.h +10
-0+uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 80
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t ul_delay_ind:1; /**< ul delay result presence*/
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 81
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t snp_ul1:1; /**< Sequence number presenceul */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word {
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+ }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */
Quoted 8 lines
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 96
Quoted 6 lines
lib/librte_net/rte_gtp.h +6
-0+ uint8_t spare_ul2:1; /**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed;With this header,
sizeof(rte_gtp_psc_hdr)= 5, is it really expected?
Quoted 2 lines
The data[0] is variable length data, I guess I should send another version to mention that in the comment maybe. The header size according to the spec should be 4 octets aligned in general.
The struct is 5 btyes, this is not related to data[0], please check the pahole output:
http://inbox.dpdk.org/dev/[email protected]/
Quoted 40 lines
Quoted 2 lines
It would help to see the specification to have a better idea of how to
Sure, I've just posted the link above, please let me know of any suggestion that you have, and I'll be glad to do accordingly.
Quoted 28 lines
split, but a possible solution is to do something like this:
struct rte_gtp_psc_generic_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t pad:3; };struct rte_gtp_psc_<name1>_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t uint8_t snp:1; uint8_t spare_dl1:2; ... };...
struct rte_gtp_psc_hdr { union { struct rte_gtp_psc_generic_hdr generic; struct rte_gtp_psc_<name1>_hdr <name1>; struct rte_gtp_psc_<name2>_hdr <name2>; }; };Quoted 5 lines
Also, you need to take care about endianness.
Regards,
OlivierKindest regards
Raslan Darawsheh
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
In reply to Raslan DarawshehQuoted 75 lines · Raslan Darawsheh
Hi Olivier,
Quoted 10 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Thursday, April 8, 2021 3:30 PM
To: Raslan Darawsheh <[email protected]>
Cc: [email protected]; [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp pscQuoted 7 lines
Hi Raslan,
Quoted 2 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Do you have a link to this RFC?
Yes sure,
https://www.3gpp.org/ftp/Specs/archive/38_series/38.415/38415-g30.zipQuoted 45 lines
Quoted 20 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +6
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr {lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 79
Quoted 10 lines
lib/librte_net/rte_gtp.h +10
-0+uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 80
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t ul_delay_ind:1; /**< ul delay result presence*/
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 81
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t snp_ul1:1; /**< Sequence number presenceul */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word {
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+ }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */
Quoted 8 lines
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 96
Quoted 6 lines
lib/librte_net/rte_gtp.h +6
-0+ uint8_t spare_ul2:1; /**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed;With this header,
sizeof(rte_gtp_psc_hdr)= 5, is it really expected?
Quoted 2 lines
The data[0] is variable length data, I guess I should send another version to mention that in the comment maybe. The header size according to the spec should be 4 octets aligned in general.
What I wanted to highlight is that using union of structs containing bitfields does not work as you expect: each union is at least 1 byte. This results in a structure that does not match the expected header.
Quoted 31 lines
Quoted 2 lines
It would help to see the specification to have a better idea of how to
Sure, I've just posted the link above, please let me know of any suggestion that you have, and I'll be glad to do accordingly.
Quoted 27 lines
split, but a possible solution is to do something like this:
struct rte_gtp_psc_generic_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t pad:3; };struct rte_gtp_psc_<name1>_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t uint8_t snp:1; uint8_t spare_dl1:2; ... };...
struct rte_gtp_psc_hdr { union { struct rte_gtp_psc_generic_hdr generic; struct rte_gtp_psc_<name1>_hdr <name1>; struct rte_gtp_psc_<name2>_hdr <name2>; }; };
From what I see in the documation, I think this approach should work. From afar, I suggest:
struct rte_gtp_psc_generic_hdr {
#if big endian uint8_t type:4 uint8_t qmp:1; uint8_t pad:3; #else uint8_t pad:3; uint8_t qmp:1; uint8_t type:4
#endif
};
struct rte_gtp_psc_type0_hdr {
#if big endian uint8_t type:4 uint8_t qmp:1; uint8_t snp:1; uint8_t spare:2; uint8_t ppp:1; ... #else uint8_t pad:3; uint8_t qmp:1; uint8_t type:4 uint8_t spare:2; uint8_t snp:1; ...
#endif
uint8_t data[0]; /* for variable fields */
};
struct rte_gtp_psc_type1_hdr {
... same for fixed fields of type1
uint8_t data[0]; /* for variable fields */
};
I don't see in the spec where is the reference to ext_hdr_len.
Regards,
Olivier
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
Hi and sorry for late response,
Quoted 95 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Thursday, April 8, 2021 5:11 PM
To: Raslan Darawsheh <[email protected]>
Cc: [email protected]; [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp pscQuoted 12 lines · Raslan Darawsheh
Hi Olivier,
Quoted 10 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Thursday, April 8, 2021 3:30 PM
To: Raslan Darawsheh <[email protected]>
Cc: [email protected]; [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp pscQuoted 9 lines
Quoted 7 lines
Hi Raslan,
Quoted 2 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Do you have a link to this RFC?
Yes sure,
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w.3gpp.org%2Fftp%2FSpecs%2Farchive%2F38_series%2F38.415%2F38415- g30.zip&data=04%7C01%7Crasland%40nvidia.com%7C5279dde172024bc d1f6b08d8fa981668%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6 37534878435191995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata= LuD7%2FvJgqJbZ78ncaM7UrpiLNPUt7zbPPfSMemyb2Y8%3D&reserved =0Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/librte_net/rte_gtp.h | 34++++++++++++++++++++++++++++++++++
Quoted 49 lines
Quoted 49 lines
Quoted 16 lines
1 file changed, 34 insertions(+)lib/librte_net/rte_gtp.h +6
-0@@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr {lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 79
Quoted 10 lines
lib/librte_net/rte_gtp.h +10
-0+uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ +union { +struct { +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ + }; +struct { +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 80
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t ul_delay_ind:1; /**< ul delay result presence*/
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 81
Quoted 1 line
lib/librte_net/rte_gtp.h +1
-0+ uint8_t snp_ul1:1; /**< Sequence number presenceul */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word {
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+ }; + }; +union { +struct { +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ + }; +struct { +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 96
Quoted 6 lines
lib/librte_net/rte_gtp.h +6
-0+ uint8_t spare_ul2:1; /**< spare up link bits */ + }; + }; + uint8_t qfi:6; /**< Qos Flow Identifier */ +uint8_t data[0 ];/**< data feilds */ +} __rte_packed;With this header,
sizeof(rte_gtp_psc_hdr)= 5, is it really expected?
Quoted 7 lines
Quoted 1 line
The data[0] is variable length data, I guess I should send another version to
mention that in the comment maybe.
Quoted 1 line
The header size according to the spec should be 4 octets aligned in general.
What I wanted to highlight is that using union of structs containing bitfields does not work as you expect: each union is at least 1 byte. This results in a structure that does not match the expected header.
I see thanks for explaining.
Quoted 70 lines
Quoted 4 lines
Quoted 3 lines
It would help to see the specification to have a better idea of how to
Sure, I've just posted the link above, please let me know of any suggestion
that you have, and I'll be glad to do accordingly.
Quoted 21 lines
Quoted 21 lines
split, but a possible solution is to do something like this:
struct rte_gtp_psc_generic_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t pad:3; };struct rte_gtp_psc_<name1>_hdr { uint8_t ext_hdr_len; uint8_t type:4 uint8_t qmp:1; uint8_t uint8_t snp:1; uint8_t spare_dl1:2; ... };...
Quoted 7 lines
Quoted 7 lines
struct rte_gtp_psc_hdr { union { struct rte_gtp_psc_generic_hdr generic; struct rte_gtp_psc_<name1>_hdr <name1>; struct rte_gtp_psc_<name2>_hdr <name2>; }; };From what I see in the documation, I think this approach should work. From afar, I suggest:
struct
rte_gtp_psc_generic_hdr{#if big endian uint8_t type:4 uint8_t qmp:1; uint8_t pad:3; #else uint8_t pad:3; uint8_t qmp:1; uint8_t type:4#endif
};struct
rte_gtp_psc_type0_hdr{#if big endian uint8_t type:4 uint8_t qmp:1; uint8_t snp:1; uint8_t spare:2; uint8_t ppp:1; ... #else uint8_t pad:3; uint8_t qmp:1; uint8_t type:4 uint8_t spare:2; uint8_t snp:1; ...#endif
uint8_tdata[0]; /* for variable fields */
};
Quoted 7 lines
struct
rte_gtp_psc_type1_hdr{
... same for fixed fields of type1
uint8_tdata[0]; /* for variable fields */
};
Sure, will consider and do it this way in the next version.
Quoted 2 lines
I don't see in the spec where is the reference to
ext_hdr_len.
The ext_hdr_len is part of the definition for all ext_hdrs see this link for more details:
https://en.wikipedia.org/wiki/GPRS_Tunnelling_Protocol
So, it's not mentioned in the doc.
Quoted 2 lines
Regards,
Olivier
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
In reply to Olivier MatzQuoted 11 lines · Olivier Matz
Hi Raslan,
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 72
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */
would it be a lot ot ask to have the structure defined using standard C instead of using compiler specific extensions?
Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc
Quoted 16 lines · Tyler Retzlaff
Quoted 11 lines · Olivier Matz
Hi Raslan,
lib/librte_net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 72
Quoted 9 lines
lib/librte_net/rte_gtp.h +9
-0+/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */would it be a lot ot ask to have the structure defined using standard C instead of using compiler specific extensions?
It is a valid request, but I'm afraid bit fields are used in many-many core DPDK libraries. So, change of the approach or at least direction for a new code should be discussed and approved by techboard.
PATCH v4 2/2 ethdev: update qfi definition
In reply to Raslan Darawshehqfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-)
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -1
@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.
lib/librte_ethdev/rte_flow.h +17 -3
@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h>
@@ -1421,16 +1422,29 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +union { +struct { +/* +* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc_hdr hdr; + }; };/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .hdr.ppp =1 , + .hdr.rqi =1 , + .hdr.qfi =0x3f , };#endif
Signature · 1 line
2.29.0
Quoted 58 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-)doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +5
-2@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,29 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ + union { + struct { +/*
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1439
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +9
-0+* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc_hdr hdr; + }; };
This will change the struct size even with union, since old version is missing all fields from protocol header. Struct size will go from 2 --> 5 bytes [1].
Since this is public struct, we can't change its size.
@Ori, Andrew,
Do you have a suggestion for next step?
- We can still add the "struct rte_gtp_psc_hdr", and add a deprecation notice for "struct rte_flow_item_gtp_psc" to say it will use "struct rte_gtp_psc_hdr" on 21.11.
- And for this release use the Raslan's first version:
- uint8_t qfi; /**< QoS flow identifier. */
+ uint8_t qfi; /**< PPP, RQI, QoS flow identifier. */
Does it make sense? Any comments?
[1]
struct rte_gtp_psc_hdr {
uint8_t ext_hdr_len; /* 0 1 */
uint8_t type:4; /* 1: 0 1 */
uint8_t qmp:1; /* 1: 4 1 */
/* XXX 3 bits hole, try to pack */
union {
struct {
uint8_t snp:1; /* 2: 0 1 */
uint8_t spare_dl1:2; /* 2: 1 1 */
}; /* 2 1 */
struct {
uint8_t dl_delay_ind:1; /* 2: 0 1 */
uint8_t ul_delay_ind:1; /* 2: 1 1 */
uint8_t snp_ul1:1; /* 2: 2 1 */
}; /* 2 1 */
}; /* 2 1 */
union {
struct {
uint8_t ppp:1; /* 3: 0 1 */
uint8_t rqi:1; /* 3: 1 1 */
}; /* 3 1 */
struct {
uint8_t n_delay_ind:1; /* 3: 0 1 */
uint8_t spare_ul2:1; /* 3: 1 1 */
}; /* 3 1 */
}; /* 3 1 */
uint8_t qfi:6; /* 4: 0 1 */
/* XXX 2 bits hole, try to pack */
uint8_t data[]; /* 5 0 */
/* size: 5, cachelines: 1, members: 7 */
/* sum members: 3 */
/* sum bitfield members: 11 bits, bit holes: 2, sum bit holes: 5 bits */
/* last cacheline: 5 bytes */
};Quoted 13 lines
lib/librte_ethdev/rte_flow.h +3
-1/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .hdr.ppp =1 , + .hdr.rqi =1 , + .hdr.qfi =0x3f , };#endif
Hi,
Quoted 99 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, April 6, 2021 7:10 PM
To: Raslan Darawsheh <[email protected]>; [email protected]; Ori Kam <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]; David Marchand <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Subject: Re: [PATCH v4 2/2] ethdev: update qfi definitionQuoted 15 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Review
Quoted 7 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 22 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +1
-0@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,29 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 10 lines
lib/librte_ethdev/rte_flow.h +4
-2* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ + union { + struct { +/* lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1439
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +9
-0+* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc_hdr hdr; + }; };This will change the struct size even with union, since old version is missing all fields from protocol header. Struct size will go from 2 --> 5 bytes [1].
Since this is public struct, we can't change its size.
@Ori, Andrew,
Do you have a suggestion for next step?
- We can still add the "struct
rte_gtp_psc_hdr", and add a deprecation notice for "structrte_flow_item_gtp_psc" to say it will use "structrte_gtp_psc_hdr"
on 21.11.
Quoted 7 lines
- And for this release use the Raslan's first version:
-uint8_tqfi; /**< QoS flow identifier. */
+uint8_tqfi; /**< PPP, RQI, QoS flow identifier. */Does it make sense? Any comments?
@Ori Kam, @[email protected],
This is a kind remainder of this patch,
Quoted 56 lines
[1]
struct rte_gtp_psc_hdr { uint8_t ext_hdr_len; /* 0 1 */ uint8_t type:4; /* 1: 0 1 */ uint8_t qmp:1; /* 1: 4 1 */ /* XXX 3 bits hole, try to pack */ union { struct { uint8_t snp:1; /* 2: 0 1 */ uint8_t spare_dl1:2; /* 2: 1 1 */ }; /* 2 1 */ struct { uint8_t dl_delay_ind:1; /* 2: 0 1 */ uint8_t ul_delay_ind:1; /* 2: 1 1 */ uint8_t snp_ul1:1; /* 2: 2 1 */ }; /* 2 1 */ }; /* 2 1 */ union { struct { uint8_t ppp:1; /* 3: 0 1 */ uint8_t rqi:1; /* 3: 1 1 */ }; /* 3 1 */ struct { uint8_t n_delay_ind:1; /* 3: 0 1 */ uint8_t spare_ul2:1; /* 3: 1 1 */ }; /* 3 1 */ }; /* 3 1 */ uint8_t qfi:6; /* 4: 0 1 */ /* XXX 2 bits hole, try to pack */ uint8_t data[]; /* 5 0 */ /* size: 5, cachelines: 1, members: 7 */ /* sum members: 3 */ /* sum bitfield members: 11 bits, bit holes: 2, sum bit holes: 5 bits */ /* last cacheline: 5 bytes */ };Quoted 13 lines
lib/librte_ethdev/rte_flow.h +3
-1/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .hdr.ppp =1 , + .hdr.rqi =1 , + .hdr.qfi =0x3f , };#endif
Hi Raslan,
Quoted 4 lines
-----Original Message-----
From: Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH v4 2/2] ethdev: update qfi definition
Quoted 96 lines
Hi,
Quoted 94 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, April 6, 2021 7:10 PM
To: Raslan Darawsheh <[email protected]>; [email protected]; Ori Kam <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]; David Marchand <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Subject: Re: [PATCH v4 2/2] ethdev: update qfi definitionQuoted 15 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Review
Quoted 7 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 22 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +1
-0@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,29 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 10 lines
lib/librte_ethdev/rte_flow.h +4
-2* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ + union { + struct { +/* lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1439
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +9
-0+* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc_hdr hdr; + }; };This will change the struct size even with union, since old version is missing all fields from protocol header. Struct size will go from 2 --> 5 bytes [1].
Since this is public struct, we can't change its size.
@Ori, Andrew,
Do you have a suggestion for next step?
I think Ferruh is right, and I think that we should at this point just update the documentation. Sorry for the detour
Just small comment about the original patch.
I don’t think you should change the default mask since it may break existing apps.
Quoted 71 lines
Quoted 5 lines
- We can still add the "struct
rte_gtp_psc_hdr", and add a deprecation notice for "structrte_flow_item_gtp_psc" to say it will use "structrte_gtp_psc_hdr"
on 21.11.Quoted 7 lines
- And for this release use the Raslan's first version:
-uint8_tqfi; /**< QoS flow identifier. */
+uint8_tqfi; /**< PPP, RQI, QoS flow identifier. */Does it make sense? Any comments?
@Ori Kam, @[email protected],
This is a kind remainder of this patch,Quoted 56 lines
[1]
struct rte_gtp_psc_hdr { uint8_t ext_hdr_len; /* 0 1 */ uint8_t type:4; /* 1: 0 1 */ uint8_t qmp:1; /* 1: 4 1 */ /* XXX 3 bits hole, try to pack */ union { struct { uint8_t snp:1; /* 2: 0 1 */ uint8_t spare_dl1:2; /* 2: 1 1 */ }; /* 2 1 */ struct { uint8_t dl_delay_ind:1; /* 2: 0 1 */ uint8_t ul_delay_ind:1; /* 2: 1 1 */ uint8_t snp_ul1:1; /* 2: 2 1 */ }; /* 2 1 */ }; /* 2 1 */ union { struct { uint8_t ppp:1; /* 3: 0 1 */ uint8_t rqi:1; /* 3: 1 1 */ }; /* 3 1 */ struct { uint8_t n_delay_ind:1; /* 3: 0 1 */ uint8_t spare_ul2:1; /* 3: 1 1 */ }; /* 3 1 */ }; /* 3 1 */ uint8_t qfi:6; /* 4: 0 1 */ /* XXX 2 bits hole, try to pack */ uint8_t data[]; /* 5 0 */ /* size: 5, cachelines: 1, members: 7 */ /* sum members: 3 */ /* sum bitfield members: 11 bits, bit holes: 2, sum bit holes: 5 bits */ /* last cacheline: 5 bytes */ };Quoted 13 lines
lib/librte_ethdev/rte_flow.h +3
-1/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .hdr.ppp =1 , + .hdr.rqi =1 , + .hdr.qfi =0x3f , };#endif
Quoted 100 lines · Ori Kam
Hi Raslan,
Quoted 98 lines
-----Original Message-----
From: Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH v4 2/2] ethdev: update qfi definitionHi,
Quoted 92 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, April 6, 2021 7:10 PM
To: Raslan Darawsheh <[email protected]>; [email protected]; Ori Kam <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]; David Marchand <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Subject: Re: [PATCH v4 2/2] ethdev: update qfi definitionQuoted 15 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Review
Quoted 7 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 22 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +1
-0@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,29 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 10 lines
lib/librte_ethdev/rte_flow.h +4
-2* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ + union { + struct { +/* lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1439
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +9
-0+* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc_hdr hdr; + }; };This will change the struct size even with union, since old version is missing all fields from protocol header. Struct size will go from 2 --> 5 bytes [1].
Since this is public struct, we can't change its size.
@Ori, Andrew,
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Do you have a suggestion for next step?
I think Ferruh is right, and I think that we should at this point just update the documentation. Sorry for the detour
Just small comment about the original patch.
I don’t think you should change the default mask since it may break existing apps.
I will continue with first patch [1], and will update the protocol reference in the commit log.
Meanwhile adding 'struct rte_gtp_psc_hdr' (patch v4 1/2) work can continue separately.
And when it is added we can send a deprecation notice to update 'struct rte_flow_item_gtp_psc' and finally update it on v21.11 to have 'struct rte_gtp_psc_hdr' in it. Makes sense?
[1]
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
Quoted 72 lines
Quoted 71 lines
Quoted 5 lines
- We can still add the "struct
rte_gtp_psc_hdr", and add a deprecation notice for "structrte_flow_item_gtp_psc" to say it will use "structrte_gtp_psc_hdr"
on 21.11.Quoted 7 lines
- And for this release use the Raslan's first version:
- uint8_t qfi; /**< QoS flow identifier. */ + uint8_t qfi; /**< PPP, RQI, QoS flow identifier. */Does it make sense? Any comments?
@Ori Kam, @[email protected],
This is a kind remainder of this patch,Quoted 56 lines
[1]
struct rte_gtp_psc_hdr { uint8_t ext_hdr_len; /* 0 1 */ uint8_t type:4; /* 1: 0 1 */ uint8_t qmp:1; /* 1: 4 1 */ /* XXX 3 bits hole, try to pack */ union { struct { uint8_t snp:1; /* 2: 0 1 */ uint8_t spare_dl1:2; /* 2: 1 1 */ }; /* 2 1 */ struct { uint8_t dl_delay_ind:1; /* 2: 0 1 */ uint8_t ul_delay_ind:1; /* 2: 1 1 */ uint8_t snp_ul1:1; /* 2: 2 1 */ }; /* 2 1 */ }; /* 2 1 */ union { struct { uint8_t ppp:1; /* 3: 0 1 */ uint8_t rqi:1; /* 3: 1 1 */ }; /* 3 1 */ struct { uint8_t n_delay_ind:1; /* 3: 0 1 */ uint8_t spare_ul2:1; /* 3: 1 1 */ }; /* 3 1 */ }; /* 3 1 */ uint8_t qfi:6; /* 4: 0 1 */ /* XXX 2 bits hole, try to pack */ uint8_t data[]; /* 5 0 */ /* size: 5, cachelines: 1, members: 7 */ /* sum members: 3 */ /* sum bitfield members: 11 bits, bit holes: 2, sum bit holes: 5 bits */ /* last cacheline: 5 bytes */ };Quoted 13 lines
lib/librte_ethdev/rte_flow.h +3
-1/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .hdr.ppp =1 , + .hdr.rqi =1 , + .hdr.qfi =0x3f , };#endif
Kindest regards,
Raslan Darawsheh
Quoted 126 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, April 14, 2021 3:17 PM
To: Ori Kam <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>; [email protected]; David Marchand <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Subject: Re: [PATCH v4 2/2] ethdev: update qfi definitionQuoted 15 lines · Ori Kam
Hi Raslan,
Quoted 13 lines
-----Original Message-----
From: Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH v4 2/2] ethdev: update qfi definitionHi,
Quoted 7 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, April 6, 2021 7:10 PM
To: Raslan Darawsheh <[email protected]>; [email protected]; Ori Kam <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>;Shiri
Quoted 71 lines
Quoted 71 lines
Quoted 71 lines
Kuzin <[email protected]>; [email protected]; David Marchand <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Subject: Re: [PATCH v4 2/2] ethdev: update qfi definitionQuoted 15 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Review
Quoted 7 lines
Signed-off-by Raslan Darawsheh <[email protected]>--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported pattern items and
Quoted 4 lines
index
f59eb8a27d..dd39c4c3c2100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -3742,7 +3742,8 @@ This section lists supported pattern items andtheir attributes, if any.
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta
Quoted 22 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-1- ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.lib/librte_ethdev/rte_flow.h +1
-0@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h> @@ -1421,16 +1422,29 @@ static const struct rte_flow_item_meta
rte_flow_item_meta_mask= {Quoted 14 lines
lib/librte_ethdev/rte_flow.h +8
-2* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ + union { + struct { + /* + * These fields are retained for compatibility. + * Please switch to the new header field below. + */ + uint8_t pdu_type; /**< PDU type. */Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_meta rte_flow_item_meta_mask = { · line 1439
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +5
-0+uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc_hdr hdr; + }; };This will change the struct size even with union, since old version is
missing
Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
all fields from protocol header. Struct size will go from 2 --> 5 bytes [1].
Since this is public struct, we can't change its size.
@Ori, Andrew,
Do you have a suggestion for next step?
I think Ferruh is right, and I think that we should at this point just update
the documentation.
Quoted 3 lines
Sorry for the detour
Just small comment about the original patch.
I don't think you should change the default mask since it may break existingapps.
Quoted 1 line
Quoted 9 lines
I will continue with first patch [1], and will update the protocol reference in the commit log.
Meanwhile adding 'struct
rte_gtp_psc_hdr' (patch v4 1/2) work can continue separately.
And when it is added we can send a deprecation notice to update 'structrte_flow_item_gtp_psc' and finally update it on v21.11 to have 'structrte_gtp_psc_hdr' in it. Makes sense?
Yes, makes sense to me,
I'll work in the meanwhile on providing the new hdrs definition .
Quoted 78 lines
[1]
https://patches.dpdk.org/project/dpdk/patch/20210323121134.19113-1-
[email protected]/Quoted 1 line
Quoted 1 line
Quoted 1 line
- We can still add the "struct
rte_gtp_psc_hdr", and add a deprecationnotice
Quoted 47 lines
Quoted 47 lines
Quoted 11 lines
for "struct
rte_flow_item_gtp_psc" to say it will use "structrte_gtp_psc_hdr"
on 21.11.- And for this release use the Raslan's first version:
- uint8_t qfi; /**< QoS flow identifier. */ + uint8_t qfi; /**< PPP, RQI, QoS flow identifier. */Does it make sense? Any comments?
@Ori Kam, @[email protected],
This is a kind remainder of this patch,Quoted 33 lines
[1]
struct rte_gtp_psc_hdr { uint8_t ext_hdr_len; /* 0 1 */ uint8_t type:4; /* 1: 0 1 */ uint8_t qmp:1; /* 1: 4 1 */ /* XXX 3 bits hole, try to pack */ union { struct { uint8_t snp:1; /* 2: 0 1 */ uint8_t spare_dl1:2; /* 2: 1 1 */ }; /* 2 1 */ struct { uint8_t dl_delay_ind:1; /* 2: 0 1 */ uint8_t ul_delay_ind:1; /* 2: 1 1 */ uint8_t snp_ul1:1; /* 2: 2 1 */ }; /* 2 1 */ }; /* 2 1 */ union { struct { uint8_t ppp:1; /* 3: 0 1 */ uint8_t rqi:1; /* 3: 1 1 */ }; /* 3 1 */ struct { uint8_t n_delay_ind:1; /* 3: 0 1 */ uint8_t spare_ul2:1; /* 3: 1 1 */ }; /* 3 1 */ }; /* 3 1 */ uint8_t qfi:6; /* 4: 0 1 */Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
/* XXX 2 bits hole, try to pack */ uint8_t data[]; /* 5 0 */ /* size: 5, cachelines: 1, members: 7 */ /* sum members: 3 */ /* sum bitfield members: 11 bits, bit holes: 2, sum bit holes: 5 bits*/
Quoted 17 lines
Quoted 16 lines
Quoted 16 lines
/* last cacheline: 5 bytes */ };Quoted 13 lines
lib/librte_ethdev/rte_flow.h +3
-1/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .hdr.ppp =1 , + .hdr.rqi =1 , + .hdr.qfi =0x3f , };#endif
v5 cover add new hdr for gtp qfi
In reply to Raslan DarawshehThis is introducin a new hdr definition of gtp psc support to match the RFC 38415-g30
v2: introduce new header definition for gtp psc
update commit msg for rte flow item change.
v3: fixed typo in comment
Cc relevant people.
v4: update hdr definition to have hdr suffix.
update variable name to be hdr in the gtp_psc item. update default max to use the new added hdr.
v5: updated the hdr definition after code review.
dropped the change for rte_flow item psc to avoid ABI breakage added hdr definition for type0 and type1 psc's
Raslan Darawsheh (1):
ethdev: add new ext hdr for gtp psc
lib/net/rte_gtp.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)
Signature · 1 line
2.25.1
PATCH v5 1/1 ethdev: add new ext hdr for gtp psc
Define new rte header for gtp PDU session container based on RFC 38415-g30
--- lib/net/rte_gtp.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)
lib/net/rte_gtp.h +78 -0
@@ -61,6 +61,84 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_generic_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t pad:3 ;/**< type specfic pad bits */ +uint8_t spare:2 ;/**< type specific spare bits */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t spare:2 ;/**< type specific spare bits */ +uint8_t pad:3 ;/**< type specfic pad bits */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; + +/** +* Optional extension for GTP with next_ext set to 0x85 +* type0 defined based on RFC 38415-g30 +*/ +__extension__ +struct rte_gtp_psc_type0_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; + +/** +* Optional extension for GTP with next_ext set to 0x85 +* type1 defined based on RFC 38415-g30 +*/ +__extension__ +struct rte_gtp_psc_type1_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t snp:1 ;/**< Sequence number presence ul */ +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t snp:1 ;/**< Sequence number presence ul */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH v5 1/1] ethdev: add new ext hdr for gtp psc
Quoted 4 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Signed-off-by Raslan Darawsheh <[email protected]>
This patch has not urgent for this release, postponing it to next release.
Re: [dpdk-dev] [PATCH v5 1/1] ethdev: add new ext hdr for gtp psc
In reply to Raslan DarawshehQuoted 88 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/net/rte_gtp.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)lib/net/rte_gtp.h +71
-0@@ -61,6 +61,84 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_generic_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t pad:3 ;/**< type specfic pad bits */ +uint8_t spare:2 ;/**< type specific spare bits */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t spare:2 ;/**< type specific spare bits */ +uint8_t pad:3 ;/**< type specfic pad bits */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; + +/** +* Optional extension for GTP with next_ext set to 0x85 +* type0 defined based on RFC 38415-g30 +*/ +__extension__ +struct rte_gtp_psc_type0_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; + +/** +* Optional extension for GTP with next_ext set to 0x85 +* type1 defined based on RFC 38415-g30 +*/ +__extension__ +struct rte_gtp_psc_type1_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */ + uint8_t snp:1; /**< Sequence number presence ul */ + uint8_t n_delay_ind:1; /**< N3/N9 delay result presence */ + uint8_t spare_ul2:1; /**< spare up link bits */ + uint8_t qfi:6; /**< Qos Flow Identifier */ +#else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t spare_ul2:1; /**< spare up link bits */ + uint8_t n_delay_ind:1; /**< N3/N9 delay result presence */ + uint8_t snp:1; /**< Sequence number presence ul */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */
lib/net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 144
Quoted 10 lines
lib/net/rte_gtp.h +7
-0+ uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t type:4; /**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
This way the structure is very hard to read.
May I ask to indent field comments as it is done in other rte_net structures (e.g. rte_ipv4_hdr, rte_udp_hdr, rte_geneve_hdr). Personally I don't care if it will be indent by TABs or spaces, however, it looks like TABs are used in more places.
Re: [dpdk-dev] [PATCH v5 1/1] ethdev: add new ext hdr for gtp psc
Quoted 98 lines · Andrew Rybchenko
Quoted 97 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/net/rte_gtp.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)lib/net/rte_gtp.h +78
-0@@ -61,6 +61,84 @@ struct rte_gtp_hdr_ext_word {uint8_t next_ext;/**< Next Extension Header Type. */ } __rte_packed; +/** +* Optional extension for GTP with next_ext set to 0x85 +* defined based on RFC 38415-g30. +*/ +__extension__ +struct rte_gtp_psc_generic_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t pad:3 ;/**< type specfic pad bits */ +uint8_t spare:2 ;/**< type specific spare bits */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t spare:2 ;/**< type specific spare bits */ +uint8_t pad:3 ;/**< type specfic pad bits */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; + +/** +* Optional extension for GTP with next_ext set to 0x85 +* type0 defined based on RFC 38415-g30 +*/ +__extension__ +struct rte_gtp_psc_type0_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t rqi:1 ;/**< Reflective Qos Indicator */ +uint8_t ppp:1 ;/**< Paging policy presence */ +uint8_t spare_dl1:2 ;/**< spare down link bits */ +uint8_t snp:1 ;/**< Sequence number presence */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; + +/** +* Optional extension for GTP with next_ext set to 0x85 +* type1 defined based on RFC 38415-g30 +*/ +__extension__ +struct rte_gtp_psc_type1_hdr { +uint8_t ext_hdr_len;/**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER ==RTE_BIG_ENDIAN +uint8_t type:4 ;/**< PDU type */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t snp:1 ;/**< Sequence number presence ul */ +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +#else +uint8_t qfi:6 ;/**< Qos Flow Identifier */ +uint8_t spare_ul2:1 ;/**< spare up link bits */ +uint8_t n_delay_ind:1 ;/**< N3/N9 delay result presence */ +uint8_t snp:1 ;/**< Sequence number presence ul */ +uint8_t ul_delay_ind:1 ;/**< ul delay result presence */ +uint8_t dl_delay_ind:1 ;/**< dl delay result presence */ +uint8_t qmp:1 ;/**< Qos Monitoring Packet */ +uint8_t type:4 ;/**< PDU type */ +#endif +uint8_t data[0 ];/**< variable length data feilds */ +} __rte_packed; +/** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
Quoted 9 lines
Quoted 1 line
This way the structure is very hard to read.
May I ask to indent field comments as it is done in otherrte_netstructures (e.g.rte_ipv4_hdr,rte_udp_hdr,rte_geneve_hdr). Personally I don't care if it will be indent by TABs or spaces, however, it looks like TABs are used in more places.
Also there are spelling bugs [1].
[1] http://mails.dpdk.org/archives/test-report/2021-April/191649.html
Re: [dpdk-dev] [PATCH v5 1/1] ethdev: add new ext hdr for gtp psc
Hi Andrew,
Thanks for your comments and review, I'll attempt to handle and fix in the next version.
Kindest regards,
Raslan Darawsheh
Quoted 114 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, June 8, 2021 3:19 PM
To: Raslan Darawsheh <[email protected]>; [email protected]
Cc: [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; [email protected]; Slava Ovsiienko <[email protected]>; Shiri Kuzin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v5 1/1] ethdev: add new ext hdr for gtp pscQuoted 91 lines · Andrew Rybchenko
Quoted 90 lines · Raslan Darawsheh
Define new rte header for gtp PDU session container based on RFC 38415-g30
Signed-off-by Raslan Darawsheh <[email protected]>--- lib/net/rte_gtp.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)lib/net/rte_gtp.h index renamed from lib/net/rte_gtp.h +0
-0
6a6f9b238d..5a850a26e4100644lib/net/rte_gtp.h +71
-0@@ -61,6 +61,84 @@ struct rte_gtp_hdr_ext_word { uint8_t next_ext; /**< Next Extension Header Type. */ } __rte_packed; +/** + * Optional extension for GTP with next_ext set to 0x85 + * defined based on RFC 38415-g30. + */ +__extension__ +struct rte_gtp_psc_generic_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes +*/ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t pad:3; /**< type specfic pad bits */ + uint8_t spare:2; /**< type specific spare bits */ + uint8_t qfi:6; /**< Qos Flow Identifier */ #else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t spare:2; /**< type specific spare bits */ + uint8_t pad:3; /**< type specfic pad bits */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t type:4; /**< PDU type */ +#endif + uint8_t data[0]; /**< variable length data feilds */ } +__rte_packed; + +/** + * Optional extension for GTP with next_ext set to 0x85 + * type0 defined based on RFC 38415-g30 */ __extension__ struct +rte_gtp_psc_type0_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes +*/ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t snp:1; /**< Sequence number presence */ + uint8_t spare_dl1:2; /**< spare down link bits */ + uint8_t ppp:1; /**< Paging policy presence */ + uint8_t rqi:1; /**< Reflective Qos Indicator */ + uint8_t qfi:6; /**< Qos Flow Identifier */ #else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t rqi:1; /**< Reflective Qos Indicator */ + uint8_t ppp:1; /**< Paging policy presence */ + uint8_t spare_dl1:2; /**< spare down link bits */ + uint8_t snp:1; /**< Sequence number presence */ + uint8_t type:4; /**< PDU type */ +#endif + uint8_t data[0]; /**< variable length data feilds */ } +__rte_packed; + +/** + * Optional extension for GTP with next_ext set to 0x85 + * type1 defined based on RFC 38415-g30 */ __extension__ struct +rte_gtp_psc_type1_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes +*/ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */ + uint8_t snp:1; /**< Sequence number presence ul */ + uint8_t n_delay_ind:1; /**< N3/N9 delay result presence */ + uint8_t spare_ul2:1; /**< spare up link bits */ + uint8_t qfi:6; /**< Qos Flow Identifier */ #else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t spare_ul2:1; /**< spare up link bits */ + uint8_t n_delay_ind:1; /**< N3/N9 delay result presence */ + uint8_t snp:1; /**< Sequence number presence ul */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */ + uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t type:4; /**< PDU type */ +#endif + uint8_t data[0]; /**< variable length data feilds */ } +__rte_packed; + /** GTP header length */ #define RTE_ETHER_GTP_HLEN \Quoted 9 lines
lib/net/rte_gtp.h struct rte_gtp_hdr_ext_word { · line 144
Quoted 2 lines
lib/net/rte_gtp.h +0
-0(sizeof (struct rte_udp_hdr ) +sizeof (struct rte_gtp_hdr ))This way the structure is very hard to read.
May I ask to indent field comments as it is done in otherrte_netstructures (e.g.rte_ipv4_hdr,rte_udp_hdr,rte_geneve_hdr). Personally I don't care if it will be indent by TABs or spaces, however, it looks like TABs are used in more places.Also there are spelling bugs [1].
[1] http://mails.dpdk.org/archives/test-report/2021-April/191649.html
PATCH v2 2/2 ethdev: update qfi definition
In reply to Raslan Darawshehqfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier) based on RFC 38415-g30
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
note: changing the default mask would cause different patterns generated by testpmd.
--- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/librte_ethdev/rte_flow.h | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-)
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -1
@@ -3742,7 +3742,8 @@ This section lists supported pattern items and their attributes, if any. - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header.
lib/librte_ethdev/rte_flow.h +15 -3
@@ -20,6 +20,7 @@#include <rte_arp.h> #include <rte_common.h> #include <rte_ether.h> +#include <rte_gtp.h> #include <rte_icmp.h> #include <rte_ip.h> #include <rte_sctp.h>
@@ -1421,16 +1422,27 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {* * Matches a GTP PDU extension header with type 0x85. */ +RTE_STD_C11 struct rte_flow_item_gtp_psc { -uint8_t pdu_type;/**< PDU type. */ -uint8_t qfi;/**< QoS flow identifier. */ +union { +struct { +/* +* These fields are retained for compatibility. +* Please switch to the new header field below. +*/ +uint8_t pdu_type;/**< PDU type. */ +uint8_t qfi;/**< PPP, RQI, QoS flow identifier. */ + + }; +struct rte_gtp_psc gtp_psc; + }; };/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplusstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi =0x3f , + .qfi =0xff , };#endif
Signature · 1 line
2.29.0
Quoted 8 lines · Raslan Darawsheh
qfi field is 8 bits which represent single bit for PPP (paging Policy Presence) single bit for RQI (Reflective QoS Indicator) and 6 bits for qfi (QoS Flow Identifier)
This update the doxygen format and the mask for qfi to properly identify the full 8 bits of the field.
Quoted 8 lines
note: changing the default mask would cause different patterns generated by testpmd.
Fixes 346553db5bd1 ("ethdev: add GTP extension header to flow API")Signed-off-by Raslan Darawsheh <[email protected]>
Applied to dpdk-next-net/main, thanks.
Sorry for going through multiple versions, hopefully proper solution can be merged after deprecation notice on v21.11.