DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx2: use updated LB ltypes
@ 2019-09-06  0:13 viveksharma
  2019-09-29  4:29 ` Vivek Kumar Sharma
  0 siblings, 1 reply; 3+ messages in thread
From: viveksharma @ 2019-09-06  0:13 UTC (permalink / raw)
  To: dev; +Cc: jerinj, Vivek Sharma

From: Vivek Sharma <viveksharma@marvell.com>

Update LB ltypes and use the updated ones so as replace
LB_STAG and LB_QINQ by single LB_STAG_QINQ ltype.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
---
 drivers/common/octeontx2/hw/otx2_npc.h  |  9 +++++++--
 drivers/net/octeontx2/otx2_flow_parse.c |  4 ++--
 drivers/net/octeontx2/otx2_lookup.c     |  2 +-
 drivers/net/octeontx2/otx2_vlan.c       | 14 +++++++++-----
 4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/common/octeontx2/hw/otx2_npc.h b/drivers/common/octeontx2/hw/otx2_npc.h
index 0f85d7f..5eccb9e 100644
--- a/drivers/common/octeontx2/hw/otx2_npc.h
+++ b/drivers/common/octeontx2/hw/otx2_npc.h
@@ -186,10 +186,15 @@ enum npc_kpu_la_ltype {
 enum npc_kpu_lb_ltype {
 	NPC_LT_LB_ETAG = 1,
 	NPC_LT_LB_CTAG,
-	NPC_LT_LB_STAG,
+	NPC_LT_LB_STAG_QINQ,
 	NPC_LT_LB_BTAG,
-	NPC_LT_LB_QINQ,
 	NPC_LT_LB_ITAG,
+	NPC_LT_LB_DSA,
+	NPC_LT_LB_DSA_VLAN,
+	NPC_LT_LB_EDSA,
+	NPC_LT_LB_EDSA_VLAN,
+	NPC_LT_LB_EXDSA,
+	NPC_LT_LB_EXDSA_VLAN,
 };
 
 enum npc_kpu_lc_ltype {
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a..71650b5 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -599,11 +599,11 @@ otx2_flow_parse_lb(struct otx2_parse_state *pst)
 			lt = NPC_LT_LB_CTAG;
 			break;
 		case 2:
-			lt = NPC_LT_LB_STAG;
+			lt = NPC_LT_LB_STAG_QINQ;
 			lflags = NPC_F_STAG_CTAG;
 			break;
 		case 3:
-			lt = NPC_LT_LB_STAG;
+			lt = NPC_LT_LB_STAG_QINQ;
 			lflags = NPC_F_STAG_STAG_CTAG;
 			break;
 		default:
diff --git a/drivers/net/octeontx2/otx2_lookup.c b/drivers/net/octeontx2/otx2_lookup.c
index 99199d0..2511386 100644
--- a/drivers/net/octeontx2/otx2_lookup.c
+++ b/drivers/net/octeontx2/otx2_lookup.c
@@ -88,7 +88,7 @@ nix_create_non_tunnel_ptype_array(uint16_t *ptype)
 		val = RTE_PTYPE_UNKNOWN;
 
 		switch (lb) {
-		case NPC_LT_LB_QINQ:
+		case NPC_LT_LB_STAG_QINQ:
 			val |= RTE_PTYPE_L2_ETHER_QINQ;
 			break;
 		case NPC_LT_LB_CTAG:
diff --git a/drivers/net/octeontx2/otx2_vlan.c b/drivers/net/octeontx2/otx2_vlan.c
index c01089b..14e3ee9 100644
--- a/drivers/net/octeontx2/otx2_vlan.c
+++ b/drivers/net/octeontx2/otx2_vlan.c
@@ -300,8 +300,11 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev,
 
 	/* Adds vlan_id & LB CTAG flag to MCAM KW */
 	if (flags & VLAN_ID_MATCH) {
-		entry.kw[kwi] |= NPC_LT_LB_CTAG << mkex->lb_lt_offset;
-		entry.kw_mask[kwi] |= 0xFULL << mkex->lb_lt_offset;
+		entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG_QINQ)
+							<< mkex->lb_lt_offset;
+		entry.kw_mask[kwi] |=
+			(0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ))
+							<< mkex->lb_lt_offset;
 
 		mcam_data = ((uint32_t)vlan_id << 16);
 		mcam_mask = (BIT_ULL(16) - 1) << 16;
@@ -313,15 +316,16 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev,
 
 	/* Adds LB STAG flag to MCAM KW */
 	if (flags & QINQ_F_MATCH) {
-		entry.kw[kwi] |= NPC_LT_LB_STAG << mkex->lb_lt_offset;
+		entry.kw[kwi] |= NPC_LT_LB_STAG_QINQ << mkex->lb_lt_offset;
 		entry.kw_mask[kwi] |= 0xFULL << mkex->lb_lt_offset;
 	}
 
 	/* Adds LB CTAG & LB STAG flags to MCAM KW */
 	if (flags & VTAG_F_MATCH) {
-		entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG)
+		entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG_QINQ)
 							<< mkex->lb_lt_offset;
-		entry.kw_mask[kwi] |= (NPC_LT_LB_CTAG & NPC_LT_LB_STAG)
+		entry.kw_mask[kwi] |=
+			(0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ))
 							<< mkex->lb_lt_offset;
 	}
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/octeontx2: use updated LB ltypes
  2019-09-06  0:13 [dpdk-dev] [PATCH] net/octeontx2: use updated LB ltypes viveksharma
@ 2019-09-29  4:29 ` Vivek Kumar Sharma
  2019-10-03 15:26   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Vivek Kumar Sharma @ 2019-09-29  4:29 UTC (permalink / raw)
  To: dev; +Cc: Jerin Jacob Kollanukkaran

Ping!


Thanks,
Vivek

________________________________________
From: viveksharma@marvell.com <viveksharma@marvell.com>
Sent: 06 September 2019 05:43
To: dev@dpdk.org
Cc: Jerin Jacob Kollanukkaran; Vivek Kumar Sharma
Subject: [PATCH] net/octeontx2: use updated LB ltypes

From: Vivek Sharma <viveksharma@marvell.com>

Update LB ltypes and use the updated ones so as replace
LB_STAG and LB_QINQ by single LB_STAG_QINQ ltype.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
---
 drivers/common/octeontx2/hw/otx2_npc.h  |  9 +++++++--
 drivers/net/octeontx2/otx2_flow_parse.c |  4 ++--
 drivers/net/octeontx2/otx2_lookup.c     |  2 +-
 drivers/net/octeontx2/otx2_vlan.c       | 14 +++++++++-----
 4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/common/octeontx2/hw/otx2_npc.h b/drivers/common/octeontx2/hw/otx2_npc.h
index 0f85d7f..5eccb9e 100644
--- a/drivers/common/octeontx2/hw/otx2_npc.h
+++ b/drivers/common/octeontx2/hw/otx2_npc.h
@@ -186,10 +186,15 @@ enum npc_kpu_la_ltype {
 enum npc_kpu_lb_ltype {
        NPC_LT_LB_ETAG = 1,
        NPC_LT_LB_CTAG,
-       NPC_LT_LB_STAG,
+       NPC_LT_LB_STAG_QINQ,
        NPC_LT_LB_BTAG,
-       NPC_LT_LB_QINQ,
        NPC_LT_LB_ITAG,
+       NPC_LT_LB_DSA,
+       NPC_LT_LB_DSA_VLAN,
+       NPC_LT_LB_EDSA,
+       NPC_LT_LB_EDSA_VLAN,
+       NPC_LT_LB_EXDSA,
+       NPC_LT_LB_EXDSA_VLAN,
 };

 enum npc_kpu_lc_ltype {
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a..71650b5 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -599,11 +599,11 @@ otx2_flow_parse_lb(struct otx2_parse_state *pst)
                        lt = NPC_LT_LB_CTAG;
                        break;
                case 2:
-                       lt = NPC_LT_LB_STAG;
+                       lt = NPC_LT_LB_STAG_QINQ;
                        lflags = NPC_F_STAG_CTAG;
                        break;
                case 3:
-                       lt = NPC_LT_LB_STAG;
+                       lt = NPC_LT_LB_STAG_QINQ;
                        lflags = NPC_F_STAG_STAG_CTAG;
                        break;
                default:
diff --git a/drivers/net/octeontx2/otx2_lookup.c b/drivers/net/octeontx2/otx2_lookup.c
index 99199d0..2511386 100644
--- a/drivers/net/octeontx2/otx2_lookup.c
+++ b/drivers/net/octeontx2/otx2_lookup.c
@@ -88,7 +88,7 @@ nix_create_non_tunnel_ptype_array(uint16_t *ptype)
                val = RTE_PTYPE_UNKNOWN;

                switch (lb) {
-               case NPC_LT_LB_QINQ:
+               case NPC_LT_LB_STAG_QINQ:
                        val |= RTE_PTYPE_L2_ETHER_QINQ;
                        break;
                case NPC_LT_LB_CTAG:
diff --git a/drivers/net/octeontx2/otx2_vlan.c b/drivers/net/octeontx2/otx2_vlan.c
index c01089b..14e3ee9 100644
--- a/drivers/net/octeontx2/otx2_vlan.c
+++ b/drivers/net/octeontx2/otx2_vlan.c
@@ -300,8 +300,11 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev,

        /* Adds vlan_id & LB CTAG flag to MCAM KW */
        if (flags & VLAN_ID_MATCH) {
-               entry.kw[kwi] |= NPC_LT_LB_CTAG << mkex->lb_lt_offset;
-               entry.kw_mask[kwi] |= 0xFULL << mkex->lb_lt_offset;
+               entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG_QINQ)
+                                                       << mkex->lb_lt_offset;
+               entry.kw_mask[kwi] |=
+                       (0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ))
+                                                       << mkex->lb_lt_offset;

                mcam_data = ((uint32_t)vlan_id << 16);
                mcam_mask = (BIT_ULL(16) - 1) << 16;
@@ -313,15 +316,16 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev,

        /* Adds LB STAG flag to MCAM KW */
        if (flags & QINQ_F_MATCH) {
-               entry.kw[kwi] |= NPC_LT_LB_STAG << mkex->lb_lt_offset;
+               entry.kw[kwi] |= NPC_LT_LB_STAG_QINQ << mkex->lb_lt_offset;
                entry.kw_mask[kwi] |= 0xFULL << mkex->lb_lt_offset;
        }

        /* Adds LB CTAG & LB STAG flags to MCAM KW */
        if (flags & VTAG_F_MATCH) {
-               entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG)
+               entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG_QINQ)
                                                        << mkex->lb_lt_offset;
-               entry.kw_mask[kwi] |= (NPC_LT_LB_CTAG & NPC_LT_LB_STAG)
+               entry.kw_mask[kwi] |=
+                       (0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ))
                                                        << mkex->lb_lt_offset;
        }

--
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/octeontx2: use updated LB ltypes
  2019-09-29  4:29 ` Vivek Kumar Sharma
@ 2019-10-03 15:26   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2019-10-03 15:26 UTC (permalink / raw)
  To: Vivek Kumar Sharma; +Cc: dev, Jerin Jacob Kollanukkaran, Ferruh Yigit

On Sun, Sep 29, 2019 at 9:59 AM Vivek Kumar Sharma
<viveksharma@marvell.com> wrote:
>
> Ping!
>
>
> Thanks,
> Vivek
>
> ________________________________________
> From: viveksharma@marvell.com <viveksharma@marvell.com>
> Sent: 06 September 2019 05:43
> To: dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran; Vivek Kumar Sharma
> Subject: [PATCH] net/octeontx2: use updated LB ltypes
>
> From: Vivek Sharma <viveksharma@marvell.com>
>
> Update LB ltypes and use the updated ones so as replace
> LB_STAG and LB_QINQ by single LB_STAG_QINQ ltype.
>
> Signed-off-by: Vivek Sharma <viveksharma@marvell.com>


Changed the subject to net/octeontx2: update KPU parser profile

Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied to dpdk-next-net-mrvl/master. Thanks


> ---
>  drivers/common/octeontx2/hw/otx2_npc.h  |  9 +++++++--
>  drivers/net/octeontx2/otx2_flow_parse.c |  4 ++--
>  drivers/net/octeontx2/otx2_lookup.c     |  2 +-
>  drivers/net/octeontx2/otx2_vlan.c       | 14 +++++++++-----
>  4 files changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/common/octeontx2/hw/otx2_npc.h b/drivers/common/octeontx2/hw/otx2_npc.h
> index 0f85d7f..5eccb9e 100644
> --- a/drivers/common/octeontx2/hw/otx2_npc.h
> +++ b/drivers/common/octeontx2/hw/otx2_npc.h
> @@ -186,10 +186,15 @@ enum npc_kpu_la_ltype {
>  enum npc_kpu_lb_ltype {
>         NPC_LT_LB_ETAG = 1,
>         NPC_LT_LB_CTAG,
> -       NPC_LT_LB_STAG,
> +       NPC_LT_LB_STAG_QINQ,
>         NPC_LT_LB_BTAG,
> -       NPC_LT_LB_QINQ,
>         NPC_LT_LB_ITAG,
> +       NPC_LT_LB_DSA,
> +       NPC_LT_LB_DSA_VLAN,
> +       NPC_LT_LB_EDSA,
> +       NPC_LT_LB_EDSA_VLAN,
> +       NPC_LT_LB_EXDSA,
> +       NPC_LT_LB_EXDSA_VLAN,
>  };
>
>  enum npc_kpu_lc_ltype {
> diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
> index 6670c1a..71650b5 100644
> --- a/drivers/net/octeontx2/otx2_flow_parse.c
> +++ b/drivers/net/octeontx2/otx2_flow_parse.c
> @@ -599,11 +599,11 @@ otx2_flow_parse_lb(struct otx2_parse_state *pst)
>                         lt = NPC_LT_LB_CTAG;
>                         break;
>                 case 2:
> -                       lt = NPC_LT_LB_STAG;
> +                       lt = NPC_LT_LB_STAG_QINQ;
>                         lflags = NPC_F_STAG_CTAG;
>                         break;
>                 case 3:
> -                       lt = NPC_LT_LB_STAG;
> +                       lt = NPC_LT_LB_STAG_QINQ;
>                         lflags = NPC_F_STAG_STAG_CTAG;
>                         break;
>                 default:
> diff --git a/drivers/net/octeontx2/otx2_lookup.c b/drivers/net/octeontx2/otx2_lookup.c
> index 99199d0..2511386 100644
> --- a/drivers/net/octeontx2/otx2_lookup.c
> +++ b/drivers/net/octeontx2/otx2_lookup.c
> @@ -88,7 +88,7 @@ nix_create_non_tunnel_ptype_array(uint16_t *ptype)
>                 val = RTE_PTYPE_UNKNOWN;
>
>                 switch (lb) {
> -               case NPC_LT_LB_QINQ:
> +               case NPC_LT_LB_STAG_QINQ:
>                         val |= RTE_PTYPE_L2_ETHER_QINQ;
>                         break;
>                 case NPC_LT_LB_CTAG:
> diff --git a/drivers/net/octeontx2/otx2_vlan.c b/drivers/net/octeontx2/otx2_vlan.c
> index c01089b..14e3ee9 100644
> --- a/drivers/net/octeontx2/otx2_vlan.c
> +++ b/drivers/net/octeontx2/otx2_vlan.c
> @@ -300,8 +300,11 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev,
>
>         /* Adds vlan_id & LB CTAG flag to MCAM KW */
>         if (flags & VLAN_ID_MATCH) {
> -               entry.kw[kwi] |= NPC_LT_LB_CTAG << mkex->lb_lt_offset;
> -               entry.kw_mask[kwi] |= 0xFULL << mkex->lb_lt_offset;
> +               entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG_QINQ)
> +                                                       << mkex->lb_lt_offset;
> +               entry.kw_mask[kwi] |=
> +                       (0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ))
> +                                                       << mkex->lb_lt_offset;
>
>                 mcam_data = ((uint32_t)vlan_id << 16);
>                 mcam_mask = (BIT_ULL(16) - 1) << 16;
> @@ -313,15 +316,16 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev,
>
>         /* Adds LB STAG flag to MCAM KW */
>         if (flags & QINQ_F_MATCH) {
> -               entry.kw[kwi] |= NPC_LT_LB_STAG << mkex->lb_lt_offset;
> +               entry.kw[kwi] |= NPC_LT_LB_STAG_QINQ << mkex->lb_lt_offset;
>                 entry.kw_mask[kwi] |= 0xFULL << mkex->lb_lt_offset;
>         }
>
>         /* Adds LB CTAG & LB STAG flags to MCAM KW */
>         if (flags & VTAG_F_MATCH) {
> -               entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG)
> +               entry.kw[kwi] |= (NPC_LT_LB_CTAG | NPC_LT_LB_STAG_QINQ)
>                                                         << mkex->lb_lt_offset;
> -               entry.kw_mask[kwi] |= (NPC_LT_LB_CTAG & NPC_LT_LB_STAG)
> +               entry.kw_mask[kwi] |=
> +                       (0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ))
>                                                         << mkex->lb_lt_offset;
>         }
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-03 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  0:13 [dpdk-dev] [PATCH] net/octeontx2: use updated LB ltypes viveksharma
2019-09-29  4:29 ` Vivek Kumar Sharma
2019-10-03 15:26   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).