ethdev: add HIGIG2 key field to flow API
PATCH 1/1 ethdev: add HIGIG2 key field to flow API
From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
--- doc/guides/prog_guide/rte_flow.rst | 8 ++++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 77 ++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+)
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1290,6 +1290,14 @@ Matches a IP Authentication Header (RFC 4302). - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 7 lines · On 10/14/19 7:29 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
Quoted 5 lines
Signed-off-by Kiran Kumar K <[email protected]>--- doc/guides/prog_guide/rte_flow.rst | 8 ++++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 77 ++++++++++++++++++++++++++++++
As far as I remember support in testpmd is a must requirement to add new RTE flow API feature.
Quoted 8 lines
3 files changed, 86 insertions(+)doc/guides/prog_guide/rte_flow.rst +0
-0@@ -1290,6 +1290,14 @@ Matches a IP Authentication Header (RFC 4302). - Default ``mask`` matches spi.
doc/guides/prog_guide/rte_flow.rst Matches a IP Authentication Header (RFC 4302). · line 1300
Quoted 10 lines
doc/guides/prog_guide/rte_flow.rst +8
-0+Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches. + +- Default ``mask`` matches classification and vlan. +
Right now there is one empty line between items and two between the last item and actions. It should be preserved.
Quoted 80 lines
doc/guides/prog_guide/rte_flow.rst +0
-0Actions ~~~~~~~lib/librte_ethdev/rte_flow.c +1
-0@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */ lib/librte_ethdev/rte_flow.h +50
-0@@ -491,6 +491,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/** @@ -515,6 +521,77 @@ static const struct rte_flow_item_any rte_flow_item_any_mask = { };#endif +/** +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header. +*/ +struct rte_higig2_frc { +uint32_t ksop:8 ; +uint32_t resv:3 ; +uint32_t mcst:1 ; +uint32_t tc:4 ; +uint32_t dst_modid:8 ; +uint32_t dst_pid:8 ; +uint32_t src_modid:8 ; +uint32_t src_pid:8 ; +uint32_t lbid:8 ; +uint32_t dp:2 ; +uint32_t resv1:3 ; +uint32_t ppd_type:3 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type0 { +uint32_t dst_t:1 ; +uint32_t dst_tgid:3 ; +uint32_t ingress_tagged:1 ; +uint32_t mirror_only:1 ; +uint32_t mirror_done:1 ; +uint32_t mirror:1 ; +uint32_t res:2 ; +uint32_t l3:1 ; +uint32_t label_present:1 ; +uint32_t vc_label2:4 ; +uint32_t vc_label1:8 ; +uint32_t vc_label0:8 ; +uint32_t vid_high:8 ; +uint32_t vid_low:8 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t res1:2 ; +uint32_t opcode:3 ; +uint32_t hdr_ext_len:3 ; +uint32_t res2:5 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type1 { +uint32_t classification:16 ;
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_any rte_flow_item_any_mask = { · line 577
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +10
-0+ uint32_t resv:16; + uint32_t vid:16; + uint32_t pfm:2; + uint32_t src_t:1; + uint32_t resv1:2; + uint32_t opcode:3; + uint32_t hdr_ext_len:3; + uint32_t resv2:5; +} __attribute__((packed)); +
Usage of bit fields in network headers require big/little endian handling. See lib/librte_net/rte_gre.h Also other network protocol headers are defined in lib/librte_net.
Quoted 5 lines
lib/librte_ethdev/rte_flow.h +5
-0+RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_frc fcr; +union { +struct rte_higig2_ppt_type0 ppt0;
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_any rte_flow_item_any_mask = { · line 592
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +10
-0+struct rte_higig2_ppt_type1 ppt1; + }; +} __attribute__((packed)); + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .ppt1.classification =0xffff , + .ppt1.vid =0xfff , +};
It would be useful to see default mask choice motivation.
Quoted 5 lines
lib/librte_ethdev/rte_flow.h +2
-0+#endif +/** * RTE_FLOW_ITEM_TYPE_VF *
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, October 14, 2019 12:38 PM
To: Kiran Kumar Kokkilagadda <[email protected]>; Adrien Mazarguil <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>
Cc: [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: add HIGIG2 key field to flow API
External Email
----------------------------------------------------------------------
Quoted 16 lines · On 10/14/19 7:29 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header.It is a layer 2.5 protocol and used in broadcom switches.
Header format is based on the following document.
Signed-off-by Kiran Kumar K <[email protected]>
Quoted 7 lines
---
doc/guides/prog_guide/rte_flow.rst | 8 ++++lib/librte_ethdev/rte_flow.c | 1 +lib/librte_ethdev/rte_flow.h | 77 ++++++++++++++++++++++++++++++
As far as I remember support in testpmd is a must requirement
to add new RTE flow API feature.
Quoted 27 lines
Quoted 1 line
Will add support to parse this item in testpmd, Will be adding basic fields/ non bitmap fields to parse, like classification and vid.
3 files changed, 86 insertions(+)doc/guides/prog_guide/rte_flow.rst +0
-0index
1c837ff13..71365b159100644---
a/doc/guides/prog_guide/rte_flow.rst+++
b/doc/guides/prog_guide/rte_flow.rstdoc/guides/prog_guide/rte_flow.rst +3
-0@@ -1290,6 +1290,14 @@ Matches a IP Authentication Header (RFC 4302). - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ +
doc/guides/prog_guide/rte_flow.rst Matches a IP Authentication Header (RFC 4302).
Quoted 10 lines
doc/guides/prog_guide/rte_flow.rst +5
-0+Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches. + +- Default ``mask`` matches classification and vlan. +
Right now there is one empty line between items and two between
the last item and actions. It should be preserved.
Quoted 172 lines
Quoted 1 line
Ack, Will add this change.
Actions
~~~~~~~
lib/librte_ethdev/rte_flow.c +0
-0index
81a85b995..ca0f68016100644---
a/lib/librte_ethdev/rte_flow.c+++
b/lib/librte_ethdev/rte_flow.clib/librte_ethdev/rte_flow.c +1
-0@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */ lib/librte_ethdev/rte_flow.h +0
-0index
bcfc06cdc..59e37f714100644---
a/lib/librte_ethdev/rte_flow.h+++
b/lib/librte_ethdev/rte_flow.hlib/librte_ethdev/rte_flow.h +55
-0@@ -491,6 +491,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/** @@ -515,6 +521,77 @@ static const struct rte_flow_item_any rte_flow_item_any_mask = { };#endif +/** +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header. +*/ +struct rte_higig2_frc { +uint32_t ksop:8 ; +uint32_t resv:3 ; +uint32_t mcst:1 ; +uint32_t tc:4 ; +uint32_t dst_modid:8 ; +uint32_t dst_pid:8 ; +uint32_t src_modid:8 ; +uint32_t src_pid:8 ; +uint32_t lbid:8 ; +uint32_t dp:2 ; +uint32_t resv1:3 ; +uint32_t ppd_type:3 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type0 { +uint32_t dst_t:1 ; +uint32_t dst_tgid:3 ; +uint32_t ingress_tagged:1 ; +uint32_t mirror_only:1 ; +uint32_t mirror_done:1 ; +uint32_t mirror:1 ; +uint32_t res:2 ; +uint32_t l3:1 ; +uint32_t label_present:1 ; +uint32_t vc_label2:4 ; +uint32_t vc_label1:8 ; +uint32_t vc_label0:8 ; +uint32_t vid_high:8 ; +uint32_t vid_low:8 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t res1:2 ; +uint32_t opcode:3 ; +uint32_t hdr_ext_len:3 ; +uint32_t res2:5 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type1 { +uint32_t classification:16 ; +uint32_t resv:16 ; +uint32_t vid:16 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t resv1:2 ;
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_any rte_flow_item_any_mask = {
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +5
-0+ uint32_t opcode:3; + uint32_t hdr_ext_len:3; + uint32_t resv2:5; +} __attribute__((packed)); +
Usage of bit fields in network headers require
big/little endian handling. See lib/librte_net/rte_gre.h
Also other network protocol headers are defined in
lib/librte_net.
Quoted 21 lines
Quoted 1 line
Will move the header to new file
lib/librte_net/rte_higig.hlib/librte_ethdev/rte_flow.h +10
-0+RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_frc fcr; +union { +struct rte_higig2_ppt_type0 ppt0; +struct rte_higig2_ppt_type1 ppt1; + }; +} __attribute__((packed)); + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_any rte_flow_item_any_mask = { · line 592
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +5
-0+#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .ppt1.classification =0xffff , + .ppt1.vid =0xfff , +};
It would be useful to see default mask choice motivation.
Quoted 12 lines
Quoted 1 line
Most of the use case scenarios we have, the traffic will be scattered based on classification and vid fields, so added these 2 fields as default mask.
lib/librte_ethdev/rte_flow.h +2
-0+#endif +/** * RTE_FLOW_ITEM_TYPE_VF *
PATCH 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++ 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +7 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,6 +492,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/**
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/rte_higig.h new file +138 -0
138 lines not on this page · raw message
--
2.17.1
Quoted 25 lines · On Tue, Oct 15, 2019 at 11:51 AM <[email protected]> wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>---
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in docinclude $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/rte_higig.h new file +0
-0
lib/librte_net/rte_higig.h line 3
Quoted 3 lines
lib/librte_net/rte_higig.h new file +3
-0@@ -0,0 +1,138 @@ + +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2016 6WIND S.A.
Copy and paste error.
Quoted 77 lines
-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Tuesday, October 15, 2019 11:57 AM
To: Kiran Kumar Kokkilagadda <[email protected]>
Cc: Adrien Mazarguil <[email protected]>; Wenzhuo Lu <[email protected]>; Jingjing Wu <[email protected]>; Bernard Iremonger <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>; Olivier Matz <[email protected]>; dpdk-dev <[email protected]>; Ajit Khaparde <[email protected]>
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: add HIGIG2 key field to flow APIExternal Email
----------------------------------------------------------------------
Quoted 6 lines · On Tue, Oct 15, 2019 at 11:51 AM <[email protected]> wrote:
From: Kiran Kumar K <[email protected]>
Quoted 7 lines
Add new
rte_flow_item_higig2_hdrin order to match higig2 header.It is a layer 2.5 protocol and used in broadcom switches.
Header format is based on the following document.
3A__read.pudn.com_downloads558_doc_comm_2301468_HiGig- 5Fprotocol.pdf&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=owEKckYY4FTmil1 Z6oBURwkTThyuRbLAY9LdfiaT6HA&m=kbv0TGqV_dyrvJzNCIfrjTjIAgmu6mgNlOL jUHoUDtk&s=2HV-LJRoSlEnhpQ2fYyq0qul2PeVtgHyWI3H75vbrbc&e=
Quoted 37 lines
Signed-off-by Kiran Kumar K <[email protected]>---
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/rte_higig.h +0
-0new file mode 100644
index 000000000..121c0a850
---
/dev/null+++
b/lib/librte_net/rte_higig.hlib/librte_net/rte_higig.h +1
-0@@ -0,0 +1,138 @@ +
Quoted 7 lines
Quoted 3 lines
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2016 6WIND S.A.
Copy and paste error.
Will fix in V3.
Quoted 13 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Jerin Jacob
Sent: Tuesday, October 15, 2019 7:27 AM
To: Kiran Kumar K <[email protected]>
Cc: Adrien Mazarguil <[email protected]>; Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>; Iremonger, Bernard <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; Olivier Matz <[email protected]>; dpdk-dev <[email protected]>; Ajit Khaparde <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] ethdev: add HIGIG2 key field to flow API
Quoted 13 lines
Quoted 12 lines · On Tue, Oct 15, 2019 at 11:51 AM <[email protected]> wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>---
V2 Changes:
If it is a v2, then I think it has to be reflected in subject, i.e:
[PATCH v2] ....
Quoted 18 lines
Quoted 13 lines
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in docinclude $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/rte_higig.h new file +0
-0lib/librte_net/rte_higig.h line 3
Quoted 3 lines
lib/librte_net/rte_higig.h new file +3
-0@@ -0,0 +1,138 @@ + +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2016 6WIND S.A. Copy and paste error.
PATCH v3 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++ 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +7 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,6 +492,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/**
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/rte_higig.h new file +138 -0
138 lines not on this page · raw message
--
2.17.1
PATCH v4 1/1 ethdev: add HIGIG2 key field to flow API
From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++ 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +7 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,6 +492,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/**
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/rte_higig.h new file +138 -0
138 lines not on this page · raw message
--
2.17.1
Quoted 4 lines · On 10/17/19 7:15 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in broadcom switches.
broadcom -> Broadcom
Quoted 17 lines
Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>---
V4 Changes:
* Removed packed attributeV3 Changes:
* Fixed Copyright header
* Fixed version info in the subjectV2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
Quoted 6 lines
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++
meson.build should be updated as well
[snip]
doc/guides/prog_guide/rte_flow.rst Matches a IP Authentication Header (RFC 4302). · line 1296
Quoted 13 lines
doc/guides/prog_guide/rte_flow.rst +5
-0@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +broadcom switches.
broadcom -> Broadcom
[snip]
lib/librte_net/rte_higig.h line 7
Quoted 13 lines
lib/librte_net/rte_higig.h new file +7
-0@@ -0,0 +1,138 @@ + +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/ + +#ifndef _RTE_HIGIG2_H_ +#define _RTE_HIGIG2_H_
It is inconsistent vs header name. Should be _RTE_HIGIG_H_.
Quoted 121 lines
lib/librte_net/rte_higig.h new file +121
-0+ +#include <stdint.h> +#include <rte_byteorder.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * RTE_FLOW_ITEM_TYPE_HIGIG2 + * Matches higig2 header. + */ +struct rte_higig2_frc { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint32_t ksop:8; + uint32_t tc:4; + uint32_t mcst:1; + uint32_t resv:3; + uint32_t dst_modid:8; + uint32_t dst_pid:8; + uint32_t src_modid:8; + uint32_t src_pid:8; + uint32_t lbid:8; + uint32_t ppd_type:3; + uint32_t resv1:3; + uint32_t dp:2; +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint32_t ksop:8; + uint32_t resv:3; + uint32_t mcst:1; + uint32_t tc:4; + uint32_t dst_modid:8; + uint32_t dst_pid:8; + uint32_t src_modid:8; + uint32_t src_pid:8; + uint32_t lbid:8; + uint32_t dp:2; + uint32_t resv1:3; + uint32_t ppd_type:3; +#endif +}; + +struct rte_higig2_ppt_type0 { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint32_t mirror:1; + uint32_t mirror_done:1; + uint32_t mirror_only:1; + uint32_t ingress_tagged:1; + uint32_t dst_tgid:3; + uint32_t dst_t:1; + uint32_t vc_label2:4; + uint32_t label_present:1; + uint32_t l3:1; + uint32_t res:2; + uint32_t vc_label1:8; + uint32_t vc_label0:8; + uint32_t vid_high:8; + uint32_t vid_low:8; + uint32_t opcode:3; + uint32_t res1:2; + uint32_t src_t:1; + uint32_t pfm:2; + uint32_t res2:5; + uint32_t hdr_ext_len:3; +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint32_t dst_t:1; + uint32_t dst_tgid:3; + uint32_t ingress_tagged:1; + uint32_t mirror_only:1; + uint32_t mirror_done:1; + uint32_t mirror:1; + uint32_t res:2; + uint32_t l3:1; + uint32_t label_present:1; + uint32_t vc_label2:4; + uint32_t vc_label1:8; + uint32_t vc_label0:8; + uint32_t vid_high:8; + uint32_t vid_low:8; + uint32_t pfm:2; + uint32_t src_t:1; + uint32_t res1:2; + uint32_t opcode:3; + uint32_t hdr_ext_len:3; + uint32_t res2:5; +#endif +}; + +struct rte_higig2_ppt_type1 { + uint16_t classification; + uint16_t resv; + uint16_t vid; +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint16_t opcode:3; + uint16_t resv1:2; + uint16_t src_t:1; + uint16_t pfm:2; + uint16_t resv2:5; + uint16_t hdr_ext_len:3; +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint16_t pfm:2; + uint16_t src_t:1; + uint16_t resv1:2; + uint16_t opcode:3; + uint16_t hdr_ext_len:3; + uint16_t resv2:5; +#endif +}; + +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { + struct rte_higig2_frc fcr; + union { + struct rte_higig2_ppt_type0 ppt0; + struct rte_higig2_ppt_type1 ppt1; + }; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = {
lib/librte_net/rte_higig.h line 138
Quoted 10 lines
lib/librte_net/rte_higig.h new file +10
-0+ .ppt1.classification = 0xffff, + .ppt1.vid = 0xfff, +}; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* RTE_HIGIG2_H_ */
Inconsistent as well.
PATCH v5 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V5 changes:
* Changed broadcom to Broadcom
* Changed RTE_HIGIG2_H to RTE_HIGIG_H
* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +7 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,6 +492,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/**
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/meson.build +2 -1
@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']
lib/librte_net/rte_higig.h new file +138 -0
138 lines not on this page · raw message
--
2.17.1
Quoted 8 lines · On 10/18/19 7:13 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>
Quoted 6 lines · On 10/18/2019 5:13 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
+1 to have protocol documentation, but what is 'pudn.com'? Is it kind of download site? Isn't there any official web site for the protocol?
Quoted 20 lines
Signed-off-by Kiran Kumar K <[email protected]>---
V5 changes:
* Changed broadcom to Broadcom
* ChangedRTE_HIGIG2_HtoRTE_HIGIG_H
* Fixed meson buildV4 Changes:
* Removed packed attributeV3 Changes:
* Fixed Copyright header
* Fixed version info in the subjectV2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
Quoted 7 lines
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++
'lib/librte_net/' maintainer is Olivier, so by default new file maintainer will be Olivier, it is good to get his ack to confirm this before merging patch.
Also can you please update "doc/api/doxy-api-index.md" to add new 'rte_higig.h' file so that it can be part of our API documentation.
btw, 'rte_gre.h' & 'rte_mpls.h' are seems missing in API documentation, another patch to add them would be nice if possible.
Quoted 40 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, October 18, 2019 11:06 PM
To: Kiran Kumar Kokkilagadda <[email protected]>; Adrien Mazarguil <[email protected]>; Wenzhuo Lu <[email protected]>; Jingjing Wu <[email protected]>; Bernard Iremonger <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>; Olivier Matz <[email protected]>
Cc: [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH v5] ethdev: add HIGIG2 key field to flow APIExternal Email
----------------------------------------------------------------------
Quoted 11 lines · On 10/18/2019 5:13 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header.It is a layer 2.5 protocol and used in Broadcom switches.
Header format is based on the following document.
3A__read.pudn.com_downloads558_doc_comm_2301468_HiGig- 5Fprotocol.pdf&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=owEKckYY4FTmil 1Z6oBURwkTThyuRbLAY9LdfiaT6HA&m=QfogB8qcVeClwPxCAkPab3S- eGGVwAH1QH3LGdaNa4U&s=8ADdrFBPBhaij7nUt6QRpmlHoVBc2sPtE8egdS58d w8&e=
Quoted 5 lines
+1 to have protocol documentation, but what is 'pudn.com'? Is it kind of
download site? Isn't there any official web site for the protocol?
There is no official doc available for this protocol. This is the only place we find the public doc.
Quoted 59 lines
Quoted 47 lines
Signed-off-by Kiran Kumar K <[email protected]>---
V5 changes:
* Changed broadcom to Broadcom
* Changed
RTE_HIGIG2_HtoRTE_HIGIG_H* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++doc/guides/prog_guide/rte_flow.rst | 8 ++lib/librte_ethdev/rte_flow.c | 1 +Quoted 7 lines
lib/librte_ethdev/rte_flow.h | 7 ++lib/librte_net/Makefile | 2 +-lib/librte_net/meson.build | 3 +-lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++'
lib/librte_net/' maintainer is Olivier, so by default new file maintainer will
Quoted 9 lines
be Olivier, it is good to get his ack to confirm this before merging patch.
Also can you please update "
doc/api/doxy-api-index.md" to add new 'rte_higig.h'file so that it can be part of our API documentation.
Will update and send v6.
Quoted 5 lines
btw, '
rte_gre.h' & 'rte_mpls.h' are seems missing in API documentation, anotherpatch to add them would be nice if possible.
PATCH v6 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V6 changes:
* Updated doxy-api
V5 changes:
* Changed broadcom to Broadcom
* Changed RTE_HIGIG2_H to RTE_HIGIG_H
* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/api/doxy-api-index.md | 3 +- doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 7 ++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 138 +++++++++++++++++++++++++++++ 8 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/api/doxy-api-index.md +2 -1
@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h) - **QoS**: [metering] (@ref rte_meter.h),
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +7 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,6 +492,12 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, };/**
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/meson.build +2 -1
@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']
lib/librte_net/rte_higig.h new file +138 -0
138 lines not on this page · raw message
--
2.17.1
Quoted 14 lines · On Sat, Oct 19, 2019 at 10:27 AM <[email protected]> wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>index 000000000..7c0dec449
lib/librte_net/rte_higig.h new file +0
-0@@ -0,0 +1,138 @@
[snip]
Quoted 4 lines
+/**
+ *RTE_FLOW_ITEM_TYPE_HIGIG2
+ * Matches higig2 header.
+ */
rte_higig.h is a generic file, it should not have any reference to rte_flow
Doxygen comment could be "higig2 frc header"
lib/librte_net/rte_higig.h line 48
Quoted 2 lines
lib/librte_net/rte_higig.h new file +2
-0+struct rte_higig2_frc { +};
Missing doxygen comments here.
lib/librte_net/rte_higig.h line 94
Quoted 5 lines
lib/librte_net/rte_higig.h new file +4
-0+struct rte_higig2_ppt_type0 { +#if RTE_BYTE_ORDER ==RTE_LITTLE_ENDIAN +#endif +};
Missing Doxygen comments here.
lib/librte_net/rte_higig.h line 116
Quoted 4 lines
lib/librte_net/rte_higig.h new file +4
-0+struct rte_higig2_ppt_type1 { +#endif +}; +
Missing Doxygen comments here.
lib/librte_net/rte_higig.h line 118
Quoted 2 lines
lib/librte_net/rte_higig.h new file +2
-0+RTE_STD_C11 +struct rte_flow_item_higig2_hdr {
Change to rte_higig2_hdr and see below.
Quoted 4 lines
lib/librte_net/rte_higig.h new file +4
-0+struct rte_higig2_frc fcr; +union { +struct rte_higig2_ppt_type0 ppt0; +struct rte_higig2_ppt_type1 ppt1;
lib/librte_net/rte_higig.h line 132
Quoted 10 lines
lib/librte_net/rte_higig.h new file +9
-0+ }; +}; +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .ppt1.classification =0xffff , + .ppt1.vid =0xfff , +}; +#endif
move this to rte_flow.h and add the following rte_flow.h so that rte_higig.h is standalone it can be used for other purposes other than rte_flow.
/**
* RTE_FLOW_ITEM_TYPE_HIGIG2.
*
* Matches higig2 header.
*/
struct rte_flow_item_higig2_hdr {
struct rte_higig2_hdr hdr; /**< Higig2 header definition. */
};
See rte_flow_item_tcp and rte_tcp_hdr as reference usage.
Quoted 9 lines
lib/librte_net/rte_higig.h new file +6
-1+ +#ifdef __cplusplus +} +#endif + +#endif /* RTE_HIGIG_H_ */ --2.17.1
PATCH v7 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V7 changes:
* Added doxygen comments
* Moved rte_flow specific code to rte_flow.h
V6 changes:
* Updated doxy-api
V5 changes:
* Changed broadcom to Broadcom
* Changed RTE_HIGIG2_H to RTE_HIGIG_H
* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/api/doxy-api-index.md | 3 +- doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 27 ++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 144 +++++++++++++++++++++++++++++ 8 files changed, 218 insertions(+), 3 deletions(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/api/doxy-api-index.md +2 -1
@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h) - **QoS**: [metering] (@ref rte_meter.h),
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +27 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,8 +492,34 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, }; +/** +* +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header +*/ +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .hdr = { + .ppt1.classification =0xffff , + .ppt1.vid =0xfff , + }, +}; +#endif +/** * RTE_FLOW_ITEM_TYPE_ANY *
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/meson.build +2 -1
@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']
lib/librte_net/rte_higig.h new file +144 -0
144 lines not on this page · raw message
--
2.17.1
Quoted 10 lines · On Sun, Oct 20, 2019 at 10:22 AM <[email protected]> wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>Acked-by Andrew Rybchenko <[email protected]>
The old 4.8.5 compiler doesn't like "opcode" under two structures with the anonymous union.
http://mails.dpdk.org/archives/test-report/2019-October/103432.html
Probably one can change to "opc" or something like that.
With 4.8.5 compiler fix,
PATCH v8 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V8 Changes:
* Fixed gcc 4.8 compile issue
V7 changes:
* Added doxygen comments
* Moved rte_flow specific code to rte_flow.h
V6 changes:
* Updated doxy-api
V5 changes:
* Changed broadcom to Broadcom
* Changed RTE_HIGIG2_H to RTE_HIGIG_H
* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/api/doxy-api-index.md | 3 +- doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 27 ++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 144 +++++++++++++++++++++++++++++ 8 files changed, 218 insertions(+), 3 deletions(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/api/doxy-api-index.md +2 -1
@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h) - **QoS**: [metering] (@ref rte_meter.h),
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +27 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,8 +492,34 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, }; +/** +* +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header +*/ +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .hdr = { + .ppt1.classification =0xffff , + .ppt1.vid =0xfff , + }, +}; +#endif +/** * RTE_FLOW_ITEM_TYPE_ANY *
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/meson.build +2 -1
@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']
lib/librte_net/rte_higig.h new file +144 -0
144 lines not on this page · raw message
--
2.17.1
PATCH v9 1/1 ethdev: add HIGIG2 key field to flow API
From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V9 Changes:
* Fix gcc 4.8 compile issue
V8 Changes:
* Fixed gcc 4.8 compile issue
V7 changes:
* Added doxygen comments
* Moved rte_flow specific code to rte_flow.h
V6 changes:
* Updated doxy-api
V5 changes:
* Changed broadcom to Broadcom
* Changed RTE_HIGIG2_H to RTE_HIGIG_H
* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/api/doxy-api-index.md | 3 +- doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 29 ++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 144 +++++++++++++++++++++++++++++ 8 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/api/doxy-api-index.md +2 -1
@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h) - **QoS**: [metering] (@ref rte_meter.h),
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +29 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,8 +492,36 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, }; +/** +* +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header +*/ +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .hdr = { + .ppt1 = { + .classification =0xffff , + .vid =0xfff , + }, + }, +}; +#endif +/** * RTE_FLOW_ITEM_TYPE_ANY *
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/meson.build +2 -1
@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']
lib/librte_net/rte_higig.h new file +144 -0
144 lines not on this page · raw message
--
2.17.1
Hi,
Quoted 357 lines · On Mon, Oct 21, 2019 at 02:46:17PM +0530, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>Acked-by Andrew Rybchenko <[email protected]>---
V9 Changes:
* Fix gcc 4.8 compile issueV8 Changes:
* Fixed gcc 4.8 compile issueV7 changes:
* Added doxygen comments
* Movedrte_flowspecific code torte_flow.hV6 changes:
* Updated doxy-apiV5 changes:
* Changed broadcom to Broadcom
* ChangedRTE_HIGIG2_HtoRTE_HIGIG_H
* Fixed meson buildV4 Changes:
* Removed packed attributeV3 Changes:
* Fixed Copyright header
* Fixed version info in the subjectV2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in docapp/test-pmd/cmdline_flow.c | 33 +++++++ doc/api/doxy-api-index.md | 3 +- doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 29 ++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 144 +++++++++++++++++++++++++++++ 8 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 lib/librte_net/rte_higig.happ/test-pmd/cmdline_flow.c +33
-0@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",doc/api/doxy-api-index.md +2
-1@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h) - **QoS**: [metering] (@ref rte_meter.h),doc/guides/prog_guide/rte_flow.rst +8
-0@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~lib/librte_ethdev/rte_flow.c +1
-0@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */ lib/librte_ethdev/rte_flow.h +29
-0@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {@@ -491,8 +492,36 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, }; +/** +* +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header +*/ +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .hdr = { + .ppt1 = { + .classification =0xffff , + .vid =0xfff , + }, + }, +}; +#endif +/** * RTE_FLOW_ITEM_TYPE_ANY * lib/librte_net/Makefile +1
-1@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mklib/librte_net/meson.build +2
-1@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']lib/librte_net/rte_higig.h new file +115
-0@@ -0,0 +1,144 @@ + +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/ + +#ifndef _RTE_HIGIG_H_ +#define _RTE_HIGIG_H_ + +#include <stdint.h> +#include <rte_byteorder.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * + * higig2 frc header. + */ +struct rte_higig2_frc { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint32_t ksop:8; + uint32_t tc:4; + uint32_t mcst:1; + uint32_t resv:3; + uint32_t dst_modid:8; + uint32_t dst_pid:8; + uint32_t src_modid:8; + uint32_t src_pid:8; + uint32_t lbid:8; + uint32_t ppd_type:3; + uint32_t resv1:3; + uint32_t dp:2; +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint32_t ksop:8; + uint32_t resv:3; + uint32_t mcst:1; + uint32_t tc:4; + uint32_t dst_modid:8; + uint32_t dst_pid:8; + uint32_t src_modid:8; + uint32_t src_pid:8; + uint32_t lbid:8; + uint32_t dp:2; + uint32_t resv1:3; + uint32_t ppd_type:3; +#endif +}; + + +/** + * + * higig2 ppt type0 header + */ +struct rte_higig2_ppt_type0 { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint32_t mirror:1; + uint32_t mirror_done:1; + uint32_t mirror_only:1; + uint32_t ingress_tagged:1; + uint32_t dst_tgid:3; + uint32_t dst_t:1; + uint32_t vc_label2:4; + uint32_t label_present:1; + uint32_t l3:1; + uint32_t res:2; + uint32_t vc_label1:8; + uint32_t vc_label0:8; + uint32_t vid_high:8; + uint32_t vid_low:8; + uint32_t opc:3; + uint32_t res1:2; + uint32_t srce_t:1; + uint32_t pf:2; + uint32_t res2:5; + uint32_t hdr_ext_length:3; +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint32_t dst_t:1; + uint32_t dst_tgid:3; + uint32_t ingress_tagged:1; + uint32_t mirror_only:1; + uint32_t mirror_done:1; + uint32_t mirror:1; + uint32_t res:2; + uint32_t l3:1; + uint32_t label_present:1; + uint32_t vc_label2:4; + uint32_t vc_label1:8; + uint32_t vc_label0:8; + uint32_t vid_high:8; + uint32_t vid_low:8; + uint32_t pf:2; + uint32_t srce_t:1; + uint32_t res1:2; + uint32_t opc:3; + uint32_t hdr_ext_length:3; + uint32_t res2:5; +#endif +}; + + +/** + * + * higig2 ppt type1 header. + */ +struct rte_higig2_ppt_type1 { + uint16_t classification; + uint16_t resv; + uint16_t vid; +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint32_t opcode:3; + uint32_t resv1:2; + uint32_t src_t:1; + uint32_t pfm:2; + uint32_t resv2:5;
lib/librte_net/rte_higig.h line 125
Quoted 10 lines
lib/librte_net/rte_higig.h new file +10
-0+ uint32_t hdr_ext_len:3; +#elif RTE_BYTE_ORDER ==RTE_BIG_ENDIAN + uint32_t pfm:2; + uint32_t src_t:1; + uint32_t resv1:2; + uint32_t opcode:3; + uint32_t hdr_ext_len:3; + uint32_t resv2:5; +#endif +};
I don't know this protocol, but the output of pahole for this struct (little endian version) is:
struct rte_higig2_ppt_type1 {
uint16_t classification; /* 0 2 */ uint16_t resv; /* 2 2 */ uint16_t vid; /* 4 2 */
/* Bitfield combined with previous fields */
uint32_t opcode:3; /* 4:13 4 */
uint32_t resv1:2; /* 4:11 4 */
uint32_t src_t:1; /* 4:10 4 */
uint32_t pfm:2; /* 4: 8 4 */
uint32_t resv2:5; /* 4: 3 4 */
uint32_t hdr_ext_len:3; /* 4: 0 4 */
/* size: 8, cachelines: 1, members: 9 */
/* bit_padding: 16 bits */
/* last cacheline: 8 bytes */
};
There is a 16 bits padding at the end, is it expected?
Apart from this comment:
PATCH v10 1/1 ethdev: add HIGIG2 key field to flow API
In reply to [email protected]From: Kiran Kumar K <[email protected]>
Add new rte_flow_item_higig2_hdr in order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf
---
V10 Changes:
* Avoid structure padding
V9 Changes:
* Fix gcc 4.8 compile issue
V8 Changes:
* Fixed gcc 4.8 compile issue
V7 changes:
* Added doxygen comments
* Moved rte_flow specific code to rte_flow.h
V6 changes:
* Updated doxy-api
V5 changes:
* Changed broadcom to Broadcom
* Changed RTE_HIGIG2_H to RTE_HIGIG_H
* Fixed meson build
V4 Changes:
* Removed packed attribute
V3 Changes:
* Fixed Copyright header
* Fixed version info in the subject
V2 Changes:
* Added support in testpmd to parse the higig2 item
* Moved the higig2 header to new file
* Added indentation in doc
app/test-pmd/cmdline_flow.c | 33 +++++++ doc/api/doxy-api-index.md | 3 +- doc/guides/prog_guide/rte_flow.rst | 8 ++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 29 ++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/meson.build | 3 +- lib/librte_net/rte_higig.h | 145 +++++++++++++++++++++++++++++ 8 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 lib/librte_net/rte_higig.h
app/test-pmd/cmdline_flow.c +33 -0
@@ -203,6 +203,9 @@ enum index {ITEM_PPPOED ,ITEM_PPPOE_SEID ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 , +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID ,/* Validate/create actions. */ ACTIONS,
@@ -675,6 +678,7 @@ static const enum index next_item[] = {ITEM_PPPOES ,ITEM_PPPOED ,ITEM_PPPOE_PROTO_ID , +ITEM_HIGIG2 ,END_SET , ZERO, };
@@ -939,6 +943,13 @@ static const enum index item_pppoe_proto_id[] = { ZERO, }; +static const enum index item_higig2[] = { +ITEM_HIGIG2_CLASSIFICATION , +ITEM_HIGIG2_VID , +ITEM_NEXT , +ZERO , +}; +static const enum index next_action[] = {ACTION_END ,ACTION_VOID ,
@@ -2419,6 +2430,28 @@ static const struct token token_list[] = { .next = NEXT(item_pppoe_proto_id), .call = parse_vc, }, + [ITEM_HIGIG2] = { + .name = "higig2", + .help = "matches higig2 header", + .priv =PRIV_ITEM (HIGIG2 , + sizeof(struct rte_flow_item_higig2_hdr)), + .next = NEXT(item_higig2), + .call = parse_vc, + }, + [ITEM_HIGIG2_CLASSIFICATION] = { + .name = "classification", + .help = "matches classification of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.classification)), + }, + [ITEM_HIGIG2_VID] = { + .name = "vid", + .help = "matches vid of higig2 header", + .next = NEXT(item_higig2, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr, + hdr.ppt1.vid)), + },/* Validate/create actions. */ [ACTIONS] = { .name = "actions",
doc/api/doxy-api-index.md +2 -1
@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h) - **QoS**: [metering] (@ref rte_meter.h),
doc/guides/prog_guide/rte_flow.rst +8 -0
@@ -1289,6 +1289,14 @@ Matches a IP Authentication Header (RFC 4302). - ``seq_num``: counter value increased by 1 on each packet sent. - Default ``mask`` matches spi. +Item: ``HIGIG2`` +^^^^^^^^^^^^^^^^^ + +Matches a HIGIG2 header field. It is layer 2.5 protocol and used in +Broadcom switches. + +- Default ``mask`` matches classification and vlan. + Actions ~~~~~~~
lib/librte_ethdev/rte_flow.c +1 -0
@@ -83,6 +83,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {MK_FLOW_ITEM (NSH ,sizeof (struct rte_flow_item_nsh )),MK_FLOW_ITEM (IGMP ,sizeof (struct rte_flow_item_igmp )),MK_FLOW_ITEM (AH ,sizeof (struct rte_flow_item_ah )), + MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), };/** Generate flow_action[] entry. */
lib/librte_ethdev/rte_flow.h +29 -0
@@ -27,6 +27,7 @@#include <rte_udp.h> #include <rte_byteorder.h> #include <rte_esp.h> +#include <rte_higig.h> #ifdef __cplusplusextern "C" {
@@ -491,8 +492,36 @@ enum rte_flow_item_type {* */ RTE_FLOW_ITEM_TYPE_AH , + +/** +* Matches a HIGIG header. +* see struct rte_flow_item_higig2_hdr. +*/ + RTE_FLOW_ITEM_TYPE_HIGIG2, }; +/** +* +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header +*/ +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .hdr = { + .ppt1 = { + .classification =0xffff , + .vid =0xfff , + }, + }, +}; +#endif +/** * RTE_FLOW_ITEM_TYPE_ANY *
lib/librte_net/Makefile +1 -1
@@ -21,6 +21,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_arp.c SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h rte_mpls.h rte_higig.h include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_net/meson.build +2 -1
@@ -14,7 +14,8 @@ headers = files('rte_ip.h', 'rte_gre.h', 'rte_net.h', 'rte_net_crc.h', - 'rte_mpls.h') + 'rte_mpls.h', + 'rte_higig.h') sources = files('rte_arp.c', 'rte_ether.c', 'rte_net.c', 'rte_net_crc.c') deps += ['mbuf']
lib/librte_net/rte_higig.h new file +145 -0
145 lines not on this page · raw message
--
2.17.1
Ferruh Yigit
AppliedQuoted 10 lines · On 10/22/2019 5:16 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdfSigned-off-by Kiran Kumar K <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Olivier Matz <[email protected]>
Applied to dpdk-next-net/master, thanks.
Hi,
This patch broke the compilation of MLX5 PMD in debug mode:
from /root/dpdk/x86_64-native-linux-gcc/include/rte_ethdev_driver.h:18,
from /root/dpdk/drivers/net/mlx5/mlx5_mp.c:11:/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:112:2: error: type of bit-field 'opcode' is a GCC extension [-Werror=pedantic]
uint16_t opcode:3;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:113:2: error: type of bit-field 'resv1' is a GCC extension [-Werror=pedantic]
uint16_t resv1:2;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:114:2: error: type of bit-field 'src_t' is a GCC extension [-Werror=pedantic]
uint16_t src_t:1;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:115:2: error: type of bit-field 'pfm' is a GCC extension [-Werror=pedantic]
uint16_t pfm:2;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:116:2: error: type of bit-field 'resv2' is a GCC extension [-Werror=pedantic]
uint16_t resv2:5;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:117:2: error: type of bit-field 'hdr_ext_len' is a GCC extension [-Werror=pedantic]
uint16_t hdr_ext_len:3;
and this is with gcc 4.8.5
Kindest regards,
Raslan Darawsheh
Quoted 34 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: Tuesday, October 22, 2019 12:20 PM
To: [email protected]; Adrien Mazarguil <[email protected]>; Wenzhuo Lu <[email protected]>; Jingjing Wu <[email protected]>; Bernard Iremonger <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>; Olivier Matz <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v10] ethdev: add HIGIG2 key field to flow APIQuoted 6 lines · On 10/22/2019 5:16 AM, [email protected] wrote:
From: Kiran Kumar K <[email protected]>
Add new
rte_flow_item_higig2_hdrin order to match higig2 header. It is a layer 2.5 protocol and used in Broadcom switches. Header format is based on the following document.https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fread.p
udn.com%2Fdownloads558%2Fdoc%2Fcomm%2F2301468%2FHiGig_protocol .pdf&data=02%7C01%7Crasland%40mellanox.com%7C316c5935a21b41ff 8e5708d756d10626%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C1%7C6 37073328075459541&sdata=3sL1lSFraI2KMD6UAJj%2FP2cFwloEflX1vNCY lv%2B4fG4%3D&reserved=0Quoted 4 lines
Signed-off-by Kiran Kumar K <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Olivier Matz <[email protected]>Applied to dpdk-next-net/master, thanks.
Hi,
Quoted 24 lines · Raslan Darawsheh
Hi,
This patch broke the compilation of MLX5 PMD in debug mode:
from /root/dpdk/x86_64-native-linux-gcc/include/rte_ethdev_driver.h:18, from /root/dpdk/drivers/net/mlx5/mlx5_mp.c:11:
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:112:2: error: type of bit-field 'opcode' is a GCC extension [-Werror=pedantic]
uint16_topcode:3;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:113:2: error: type of bit-field 'resv1' is a GCC extension [-Werror=pedantic]
uint16_tresv1:2;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:114:2: error: type of bit-field 'src_t' is a GCC extension [-Werror=pedantic]
uint16_tsrc_t:1;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:115:2: error: type of bit-field 'pfm' is a GCC extension [-Werror=pedantic]
uint16_tpfm:2;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:116:2: error: type of bit-field 'resv2' is a GCC extension [-Werror=pedantic]
uint16_tresv2:5;
^/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:117:2: error: type of bit-field 'hdr_ext_len' is a GCC extension [-Werror=pedantic]
uint16_thdr_ext_len:3;
Quoted 1 line
and this is with gcc 4.8.5
From https://stackoverflow.com/questions/10906238/warning-when-using-bitfield-with-unsigned-char
it seems that it is allowed in c99, so I guess it's a gcc 4.8 bug.
Adding __extension__ above the struct solves the warnings, I suggest to add it.
Olivier
Quoted 91 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Wednesday, October 23, 2019 5:09 PM
To: Raslan Darawsheh <[email protected]>
Cc: Ferruh Yigit <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Adrien Mazarguil <[email protected]>; Wenzhuo Lu <[email protected]>; Jingjing Wu <[email protected]>; Bernard Iremonger <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH v10] ethdev: add HIGIG2 key field to flow APIExternal Email
----------------------------------------------------------------------
Hi,Quoted 9 lines · Raslan Darawsheh
Hi,
This patch broke the compilation of MLX5 PMD in debug mode:
from /root/dpdk/x86_64-native-linux-
gcc/include/rte_ethdev_driver.h:18,Quoted 3 lines
from /root/dpdk/drivers/net/mlx5/mlx5_mp.c:11:
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:112:2: error: type ofbit-field 'opcode' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_topcode:3;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:113:2: error: type ofbit-field 'resv1' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tresv1:2;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:114:2: error: type ofbit-field '
src_t' is a GCC extension [-Werror=pedantic]Quoted 5 lines
uint16_tsrc_t:1;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:115:2: error: type ofbit-field 'pfm' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tpfm:2;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:116:2: error: type ofbit-field 'resv2' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tresv2:5;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:117:2: error: type ofbit-field '
hdr_ext_len' is a GCC extension [-Werror=pedantic]Quoted 5 lines
uint16_thdr_ext_len:3;and this is with gcc 4.8.5
From https://urldefense.proofpoint.com/v2/url?u=https-
3A__stackoverflow.com_questions_10906238_warning-2Dwhen-2Dusing- 2Dbitfield-2Dwith-2Dunsigned- 2Dchar&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=owEKckYY4FTmil1Z6oBUR wkTThyuRbLAY9LdfiaT6HA&m=GZ- 6cngPycaUlGJT20VEOf9oTcp5PMwk7j1JV1vAQfs&s=SCg5yVPS4zZa8GSn9bl_eUtI vBmoDzi35PspWUttIUY&e=
Quoted 7 lines
it seems that it is allowed in c99, so I guess it's a gcc 4.8 bug.
Adding
__extension__above the struct solves the warnings, I suggest toadd it.
/**
*
* higig2 ppt type1 header.
*/RTE_STD_C11
struct rte_higig2_ppt_type1 {
uint16_t classification;
uint16_t resv;
uint16_t vid;
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
uint16_t opcode:3;
uint16_t resv1:2;
uint16_t src_t:1;
uint16_t pfm:2;
uint16_t resv2:5;
uint16_t hdr_ext_len:3;
#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
uint16_t pfm:2;
uint16_t src_t:1;
uint16_t resv1:2;
uint16_t opcode:3;
uint16_t hdr_ext_len:3;
uint16_t resv2:5;#endif
};
I have already added it. RTE_STD_C11 , this is a macro for __extension__. /** C extension macro for environments lacking C11 features. */ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L #define RTE_STD_C11 __extension__
#else
#define RTE_STD_C11
#endif
Quoted 6 lines
Olivier
Quoted 125 lines · Kiran Kumar Kokkilagadda
Quoted 91 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Wednesday, October 23, 2019 5:09 PM
To: Raslan Darawsheh <[email protected]>
Cc: Ferruh Yigit <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Adrien Mazarguil <[email protected]>; Wenzhuo Lu <[email protected]>; Jingjing Wu <[email protected]>; Bernard Iremonger <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH v10] ethdev: add HIGIG2 key field to flow APIExternal Email
----------------------------------------------------------------------
Hi,Quoted 9 lines · Raslan Darawsheh
Hi,
This patch broke the compilation of MLX5 PMD in debug mode:
from /root/dpdk/x86_64-native-linux-
gcc/include/rte_ethdev_driver.h:18,Quoted 3 lines
from /root/dpdk/drivers/net/mlx5/mlx5_mp.c:11:
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:112:2: error: type ofbit-field 'opcode' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_topcode:3;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:113:2: error: type ofbit-field 'resv1' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tresv1:2;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:114:2: error: type ofbit-field '
src_t' is a GCC extension [-Werror=pedantic]Quoted 5 lines
uint16_tsrc_t:1;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:115:2: error: type ofbit-field 'pfm' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tpfm:2;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:116:2: error: type ofbit-field 'resv2' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tresv2:5;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:117:2: error: type ofbit-field '
hdr_ext_len' is a GCC extension [-Werror=pedantic]Quoted 5 lines
uint16_thdr_ext_len:3;and this is with gcc 4.8.5
From https://urldefense.proofpoint.com/v2/url?u=https-
3A__stackoverflow.com_questions_10906238_warning-2Dwhen-2Dusing- 2Dbitfield-2Dwith-2Dunsigned- 2Dchar&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=owEKckYY4FTmil1Z6oBUR wkTThyuRbLAY9LdfiaT6HA&m=GZ- 6cngPycaUlGJT20VEOf9oTcp5PMwk7j1JV1vAQfs&s=SCg5yVPS4zZa8GSn9bl_eUtI vBmoDzi35PspWUttIUY&e=Quoted 7 lines
it seems that it is allowed in c99, so I guess it's a gcc 4.8 bug.
Adding
__extension__above the struct solves the warnings, I suggest toadd it.
/**
*
* higig2 ppt type1 header.
*/RTE_STD_C11struct rte_higig2_ppt_type1 { uint16_t classification; uint16_t resv; uint16_t vid; #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint16_t opcode:3; uint16_t resv1:2; uint16_t src_t:1; uint16_t pfm:2; uint16_t resv2:5; uint16_t hdr_ext_len:3; #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint16_t pfm:2; uint16_t src_t:1; uint16_t resv1:2; uint16_t opcode:3; uint16_t hdr_ext_len:3; uint16_t resv2:5;#endif
};
Quoted 7 lines
I have already added it.
RTE_STD_C11, this is a macro for__extension__. /** C extension macro for environments lacking C11 features. */ #if !defined(__STDC_VERSION__) ||__STDC_VERSION__< 201112L #defineRTE_STD_C11__extension__
#else
#defineRTE_STD_C11
#endif
The __extension__ is only added if compiled for < c11. But there is apparently a problem with gcc-4.8: even in c11, it does not support bitfields on u16. See: https://godbolt.org/z/hRIbgg
On gcc-4.9, the problem disappeared: https://godbolt.org/z/kkzz9v
So as a workaround, using __extension__ should work, probably with a short explanation.
Quoted 134 lines · Olivier Matz
Quoted 125 lines · Kiran Kumar Kokkilagadda
Quoted 91 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Wednesday, October 23, 2019 5:09 PM
To: Raslan Darawsheh <[email protected]>
Cc: Ferruh Yigit <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Adrien Mazarguil <[email protected]>; Wenzhuo Lu <[email protected]>; Jingjing Wu <[email protected]>; Bernard Iremonger <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH v10] ethdev: add HIGIG2 key field to flow APIExternal Email
----------------------------------------------------------------------
Hi,Quoted 9 lines · Raslan Darawsheh
Hi,
This patch broke the compilation of MLX5 PMD in debug mode:
from /root/dpdk/x86_64-native-linux-
gcc/include/rte_ethdev_driver.h:18,Quoted 3 lines
from /root/dpdk/drivers/net/mlx5/mlx5_mp.c:11:
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:112:2: error: type ofbit-field 'opcode' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_topcode:3;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:113:2: error: type ofbit-field 'resv1' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tresv1:2;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:114:2: error: type ofbit-field '
src_t' is a GCC extension [-Werror=pedantic]Quoted 5 lines
uint16_tsrc_t:1;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:115:2: error: type ofbit-field 'pfm' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tpfm:2;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:116:2: error: type ofbit-field 'resv2' is a GCC extension [-Werror=pedantic]
Quoted 5 lines
uint16_tresv2:5;^
/root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:117:2: error: type ofbit-field '
hdr_ext_len' is a GCC extension [-Werror=pedantic]Quoted 5 lines
uint16_thdr_ext_len:3;and this is with gcc 4.8.5
From https://urldefense.proofpoint.com/v2/url?u=https-
3A__stackoverflow.com_questions_10906238_warning-2Dwhen-2Dusing- 2Dbitfield-2Dwith-2Dunsigned- 2Dchar&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=owEKckYY4FTmil1Z6oBUR wkTThyuRbLAY9LdfiaT6HA&m=GZ- 6cngPycaUlGJT20VEOf9oTcp5PMwk7j1JV1vAQfs&s=SCg5yVPS4zZa8GSn9bl_eUtI vBmoDzi35PspWUttIUY&e=Quoted 7 lines
it seems that it is allowed in c99, so I guess it's a gcc 4.8 bug.
Adding
__extension__above the struct solves the warnings, I suggest toadd it.
/**
*
* higig2 ppt type1 header.
*/RTE_STD_C11struct rte_higig2_ppt_type1 { uint16_t classification; uint16_t resv; uint16_t vid; #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint16_t opcode:3; uint16_t resv1:2; uint16_t src_t:1; uint16_t pfm:2; uint16_t resv2:5; uint16_t hdr_ext_len:3; #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint16_t pfm:2; uint16_t src_t:1; uint16_t resv1:2; uint16_t opcode:3; uint16_t hdr_ext_len:3; uint16_t resv2:5;#endif
};Quoted 7 lines
I have already added it.
RTE_STD_C11, this is a macro for__extension__. /** C extension macro for environments lacking C11 features. */ #if !defined(__STDC_VERSION__) ||__STDC_VERSION__< 201112L #defineRTE_STD_C11__extension__
#else
#defineRTE_STD_C11
#endif
Quoted 9 lines
The
__extension__is only added if compiled for < c11. But there is apparently a problem with gcc-4.8: even in c11, it does not support bitfields on u16. See: https://godbolt.org/z/hRIbggOn gcc-4.9, the problem disappeared: https://godbolt.org/z/kkzz9v
So as a workaround, using
__extension__should work, probably with a short explanation.
Thanks Olivier, this was also our finding with Raslan and he sent the fix already.
https://patches.dpdk.org/patch/61748/
Also it looks like gcc4.8 thinks this is not c11 standard but extension only for uint16_t type, structs with uint32_t bit-fieds works as expected.
22/10/2019 06:16, [email protected]:
doc/api/doxy-api-index.md The public API headers are grouped by topics: · line 105
Quoted 9 lines
doc/api/doxy-api-index.md +2
-1@@ -101,7 +101,8 @@ The public API headers are grouped by topics: [GSO] (@ref rte_gso.h), [frag/reass] (@ref rte_ip_frag.h), [LPM IPv4 route] (@ref rte_lpm.h), - [LPM IPv6 route] (@ref rte_lpm6.h) + [LPM IPv6 route] (@ref rte_lpm6.h), + [HIGIG] (@ref rte_higig.h)
Sorry, my comment is a bit late, but I would prefer to see HIGIG earlier in this list. You say it is a protocol at layer 2.5, so it should be listed probably close to ICMP. What is your opinion?
Quoted 61 lines · On Mon, 14 Oct 2019 09:59:56 +0530 <[email protected]> wrote:
lib/librte_ethdev/rte_flow.h +61
-0+/** +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header. +*/ +struct rte_higig2_frc { +uint32_t ksop:8 ; +uint32_t resv:3 ; +uint32_t mcst:1 ; +uint32_t tc:4 ; +uint32_t dst_modid:8 ; +uint32_t dst_pid:8 ; +uint32_t src_modid:8 ; +uint32_t src_pid:8 ; +uint32_t lbid:8 ; +uint32_t dp:2 ; +uint32_t resv1:3 ; +uint32_t ppd_type:3 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type0 { +uint32_t dst_t:1 ; +uint32_t dst_tgid:3 ; +uint32_t ingress_tagged:1 ; +uint32_t mirror_only:1 ; +uint32_t mirror_done:1 ; +uint32_t mirror:1 ; +uint32_t res:2 ; +uint32_t l3:1 ; +uint32_t label_present:1 ; +uint32_t vc_label2:4 ; +uint32_t vc_label1:8 ; +uint32_t vc_label0:8 ; +uint32_t vid_high:8 ; +uint32_t vid_low:8 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t res1:2 ; +uint32_t opcode:3 ; +uint32_t hdr_ext_len:3 ; +uint32_t res2:5 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type1 { +uint32_t classification:16 ; +uint32_t resv:16 ; +uint32_t vid:16 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t resv1:2 ; +uint32_t opcode:3 ; +uint32_t hdr_ext_len:3 ; +uint32_t resv2:5 ; +} __attribute__((packed)); + +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_frc fcr; +union { +struct rte_higig2_ppt_type0 ppt0; +struct rte_higig2_ppt_type1 ppt1; + };
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_any rte_flow_item_any_mask = { · line 594
Quoted 10 lines
lib/librte_ethdev/rte_flow.h +10
-0+} __attribute__((packed)); + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ +#ifndef __cplusplus +static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask = { + .ppt1.classification =0xffff , + .ppt1.vid =0xfff , +}; +#endif +
Why do all these structures have to be packed. They are all uint32.
Quoted 84 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Tuesday, October 15, 2019 10:17 PM
To: Kiran Kumar Kokkilagadda <[email protected]>
Cc: Adrien Mazarguil <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: add HIGIG2 key field to flow APIExternal Email
----------------------------------------------------------------------
Quoted 65 lines · On Mon, 14 Oct 2019 09:59:56 +0530 <[email protected]> wrote:
lib/librte_ethdev/rte_flow.h +65
-0+/** +* RTE_FLOW_ITEM_TYPE_HIGIG2 +* Matches higig2 header. +*/ +struct rte_higig2_frc { +uint32_t ksop:8 ; +uint32_t resv:3 ; +uint32_t mcst:1 ; +uint32_t tc:4 ; +uint32_t dst_modid:8 ; +uint32_t dst_pid:8 ; +uint32_t src_modid:8 ; +uint32_t src_pid:8 ; +uint32_t lbid:8 ; +uint32_t dp:2 ; +uint32_t resv1:3 ; +uint32_t ppd_type:3 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type0 { +uint32_t dst_t:1 ; +uint32_t dst_tgid:3 ; +uint32_t ingress_tagged:1 ; +uint32_t mirror_only:1 ; +uint32_t mirror_done:1 ; +uint32_t mirror:1 ; +uint32_t res:2 ; +uint32_t l3:1 ; +uint32_t label_present:1 ; +uint32_t vc_label2:4 ; +uint32_t vc_label1:8 ; +uint32_t vc_label0:8 ; +uint32_t vid_high:8 ; +uint32_t vid_low:8 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t res1:2 ; +uint32_t opcode:3 ; +uint32_t hdr_ext_len:3 ; +uint32_t res2:5 ; +} __attribute__((packed)); + +struct rte_higig2_ppt_type1 { +uint32_t classification:16 ; +uint32_t resv:16 ; +uint32_t vid:16 ; +uint32_t pfm:2 ; +uint32_t src_t:1 ; +uint32_t resv1:2 ; +uint32_t opcode:3 ; +uint32_t hdr_ext_len:3 ; +uint32_t resv2:5 ; +} __attribute__((packed)); + +RTE_STD_C11 +struct rte_flow_item_higig2_hdr { +struct rte_higig2_frc fcr; +union { +struct rte_higig2_ppt_type0 ppt0; +struct rte_higig2_ppt_type1 ppt1; + }; +} __attribute__((packed)); + +/** Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2. */ #ifndef +__cplusplus static const struct rte_flow_item_higig2_hdr
Quoted 8 lines
lib/librte_ethdev/rte_flow.h static const struct rte_flow_item_any rte_flow_item_any_mask = { · line 594
Quoted 6 lines
lib/librte_ethdev/rte_flow.h +6
-0+rte_flow_item_higig2_hdr_mask = { + .ppt1.classification = 0xffff, + .ppt1.vid = 0xfff, +}; +#endif +Why do all these structures have to be packed. They are all uint32.
Will fix in V4.