Skip to contentSkip to conversation

common/cnxk: fix channel mask for SDP interfaces

PATCH Superseded [email protected] 2 participants 8 messages Feb 10, 2023 – Feb 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 common/cnxk: fix channel mask for SDP interfaces

From: Satheesh Paul <[email protected]>

Fix channel mask of SDP interfaces on CN10K.

Fixes f137566333 ("common/cnxk: support setting channel mask for SDP interfaces")
---
 drivers/common/cnxk/roc_npc.c      | 9 +++++++--
 drivers/common/cnxk/roc_npc_priv.h | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/common/cnxk/roc_npc.c +7 -2
index c872548230..9edccb5258 100644
@@ -1380,8 +1380,13 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
 			/* By default set the channel and mask to cover
 			 * the whole SDP channel range.
 			 */
-			npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
-			npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+			if (roc_model_is_cn10k()) {
+				npc->sdp_channel = (uint16_t)CN10K_SDP_CH_START;
+				npc->sdp_channel_mask = (uint16_t)CN10K_SDP_CH_MASK;
+			} else {
+				npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
+				npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+			}
 		}
 	}
 
drivers/common/cnxk/roc_npc_priv.h +3 -0
index 2a7d3137fb..aa27228354 100644
@@ -77,6 +77,9 @@
 #define NPC_LFLAG_LC_OFFSET (NPC_LTYPE_OFFSET_START + 6)
 #define NPC_LTYPE_LC_OFFSET (NPC_LTYPE_OFFSET_START + 8)
 
+#define CN10K_SDP_CH_START 0x80
+#define CN10K_SDP_CH_MASK  0xF80
+
 struct npc_action_vtag_info {
 	uint16_t vlan_id;
 	uint16_t vlan_ethtype;
Signature · 1 line
2.35.3
#1 lore raw

PATCH 2/3 common/cnxk: fix printing IPsec flow rules

From: Satheesh Paul <[email protected]>

When dumping flow data, dump preallocated IPsec rules also.

Fixes 1aa86a170e ("drivers: support IPsec rule reservation scheme")
---
 drivers/common/cnxk/roc_npc.c           |   7 +-
 drivers/common/cnxk/roc_npc_mcam_dump.c | 154 ++++++++++++++++++------
 2 files changed, 120 insertions(+), 41 deletions(-)
drivers/common/cnxk/roc_npc.c +5 -2
index 9edccb5258..579b3dce9a 100644
@@ -1550,11 +1550,14 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc)
 			roc_npc_flow_mcam_dump(file, roc_npc, flow_iter);
 		}
 	}
+
+	TAILQ_FOREACH(flow_iter, &npc->ipsec_list, next) {
+		roc_npc_flow_mcam_dump(file, roc_npc, flow_iter);
+	}
 }
 
 int
-roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc,
-				      struct roc_npc_flow *flow)
+roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
 {
 	struct npc_mcam_read_base_rule_rsp *base_rule_rsp;
 	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
drivers/common/cnxk/roc_npc_mcam_dump.c +115 -39

208 lines not on this page · raw message

Signature · 1 line
2.35.3
#2 lore raw

PATCH 3/3 common/cnxk: fix inline IPsec rule creation

In reply to [email protected]

From: Satheesh Paul <[email protected]>

Use inline IPsec device to create IPsec rules irrespective of RTE_ETH_RX_OFFLOAD_SECURITY offload flag.

Fixes 1aa86a170e ("drivers: support IPsec rule reservation scheme")
---
 drivers/common/cnxk/roc_npc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npc.c +3 -1
index 579b3dce9a..d3efebe663 100644
@@ -562,8 +562,10 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
 				}
 				rq = inl_rq->qid;
 				pf_func = nix_inl_dev_pffunc_get();
-				flow->is_inline_dev = 1;
 			}
+
+			if (roc_nix_inl_dev_is_probed())
+				flow->is_inline_dev = 1;
 			sec_action = actions;
 			break;
 		case ROC_NPC_ACTION_TYPE_VLAN_STRIP:
Signature · 1 line
2.35.3
#3 lore raw
In reply to [email protected]
Quoted 10 lines · On Fri, Feb 10, 2023 at 9:51 AM <[email protected]> wrote:

From: Satheesh Paul <[email protected]>

Fix channel mask of SDP interfaces on CN10K.

Fixes f137566333 ("common/cnxk: support setting channel mask for SDP interfaces")

Please run ./devtools/check-git-log.sh -n 3 and ./devtools/checkpatches.sh -n 3 before pushing the patches to fix below issues.

WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: f13756633330 ("common/cnxk: support setting channel mask for SDP interfaces")' #8:

Fixes f137566333 ("common/cnxk: support setting channel mask for SDP

interfaces")

total: 0 errors, 1 warnings, 24 lines checked

### [PATCH] common/cnxk: fix printing IPsec flow rules

WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: 1aa86a170e27 ("drivers:
support IPsec rule reservation scheme")'
#8:

Fixes 1aa86a170e ("drivers: support IPsec rule reservation scheme")

total: 0 errors, 1 warnings, 224 lines checked

### [PATCH] common/cnxk: fix inline IPsec rule creation

WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: 1aa86a170e27 ("drivers:
support IPsec rule reservation scheme")'

Quoted 42 lines
---
 drivers/common/cnxk/roc_npc.c      | 9 +++++++--
 drivers/common/cnxk/roc_npc_priv.h | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/common/cnxk/roc_npc.c +7 -2
index c872548230..9edccb5258 100644
@@ -1380,8 +1380,13 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
                        /* By default set the channel and mask to cover
                         * the whole SDP channel range.
                         */
-                       npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
-                       npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+                       if (roc_model_is_cn10k()) {
+                               npc->sdp_channel = (uint16_t)CN10K_SDP_CH_START;
+                               npc->sdp_channel_mask = (uint16_t)CN10K_SDP_CH_MASK;
+                       } else {
+                               npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
+                               npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+                       }
                }
        }
 
drivers/common/cnxk/roc_npc_priv.h +3 -1
index 2a7d3137fb..aa27228354 100644
@@ -77,6 +77,9 @@
 #define NPC_LFLAG_LC_OFFSET (NPC_LTYPE_OFFSET_START + 6)
 #define NPC_LTYPE_LC_OFFSET (NPC_LTYPE_OFFSET_START + 8)
 
+#define CN10K_SDP_CH_START 0x80
+#define CN10K_SDP_CH_MASK  0xF80
+
 struct npc_action_vtag_info {
        uint16_t vlan_id;
        uint16_t vlan_ethtype;
--

2.35.3

#4 lore raw

PATCH v2 1/3 common/cnxk: fix channel mask for SDP interfaces

In reply to [email protected]

From: Satheesh Paul <[email protected]>

Fix channel mask of SDP interfaces on CN10K.

Fixes f13756633330 ("common/cnxk: support setting channel mask for SDP interfaces")

---
v2:
* Corrected "Fixes:" tag with 12 char sha1

 drivers/common/cnxk/roc_npc.c      | 9 +++++++--
 drivers/common/cnxk/roc_npc_priv.h | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/common/cnxk/roc_npc.c +7 -2
index c872548230..9edccb5258 100644
@@ -1380,8 +1380,13 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
 			/* By default set the channel and mask to cover
 			 * the whole SDP channel range.
 			 */
-			npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
-			npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+			if (roc_model_is_cn10k()) {
+				npc->sdp_channel = (uint16_t)CN10K_SDP_CH_START;
+				npc->sdp_channel_mask = (uint16_t)CN10K_SDP_CH_MASK;
+			} else {
+				npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
+				npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+			}
 		}
 	}
 
drivers/common/cnxk/roc_npc_priv.h +3 -0
index 2a7d3137fb..aa27228354 100644
@@ -77,6 +77,9 @@
 #define NPC_LFLAG_LC_OFFSET (NPC_LTYPE_OFFSET_START + 6)
 #define NPC_LTYPE_LC_OFFSET (NPC_LTYPE_OFFSET_START + 8)
 
+#define CN10K_SDP_CH_START 0x80
+#define CN10K_SDP_CH_MASK  0xF80
+
 struct npc_action_vtag_info {
 	uint16_t vlan_id;
 	uint16_t vlan_ethtype;
Signature · 1 line
2.35.3
#5 lore raw

PATCH v2 2/3 common/cnxk: fix printing IPsec flow rules

From: Satheesh Paul <[email protected]>

When dumping flow data, dump preallocated IPsec rules also.

Fixes 1aa86a170e27 ("drivers: support IPsec rule reservation scheme")
---
 drivers/common/cnxk/roc_npc.c           |   7 +-
 drivers/common/cnxk/roc_npc_mcam_dump.c | 154 ++++++++++++++++++------
 2 files changed, 120 insertions(+), 41 deletions(-)
drivers/common/cnxk/roc_npc.c +5 -2
index 9edccb5258..579b3dce9a 100644
@@ -1550,11 +1550,14 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc)
 			roc_npc_flow_mcam_dump(file, roc_npc, flow_iter);
 		}
 	}
+
+	TAILQ_FOREACH(flow_iter, &npc->ipsec_list, next) {
+		roc_npc_flow_mcam_dump(file, roc_npc, flow_iter);
+	}
 }
 
 int
-roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc,
-				      struct roc_npc_flow *flow)
+roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
 {
 	struct npc_mcam_read_base_rule_rsp *base_rule_rsp;
 	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
drivers/common/cnxk/roc_npc_mcam_dump.c +115 -39

208 lines not on this page · raw message

Signature · 1 line
2.35.3
#6 lore raw

PATCH v2 3/3 common/cnxk: fix inline IPsec rule creation

In reply to [email protected]

From: Satheesh Paul <[email protected]>

Use inline IPsec device to create IPsec rules irrespective of RTE_ETH_RX_OFFLOAD_SECURITY offload flag.

Fixes 1aa86a170e27 ("drivers: support IPsec rule reservation scheme")
---
 drivers/common/cnxk/roc_npc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npc.c +3 -1
index 579b3dce9a..d3efebe663 100644
@@ -562,8 +562,10 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
 				}
 				rq = inl_rq->qid;
 				pf_func = nix_inl_dev_pffunc_get();
-				flow->is_inline_dev = 1;
 			}
+
+			if (roc_nix_inl_dev_is_probed())
+				flow->is_inline_dev = 1;
 			sec_action = actions;
 			break;
 		case ROC_NPC_ACTION_TYPE_VLAN_STRIP:
Signature · 1 line
2.35.3
#7 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] common/cnxk: fix inline IPsec rule creation

Quoted 6 lines · On Fri, Feb 10, 2023 at 1:56 PM <[email protected]> wrote:

From: Satheesh Paul <[email protected]>

Use inline IPsec device to create IPsec rules irrespective of RTE_ETH_RX_OFFLOAD_SECURITY offload flag.

Quoted 6 lines
Fixes 1aa86a170e27 ("drivers: support IPsec rule reservation scheme")

Series applied to dpdk-next-net-eventdev/for-main. Thanks

Quoted 23 lines
---
 drivers/common/cnxk/roc_npc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npc.c +3 -2
index 579b3dce9a..d3efebe663 100644
@@ -562,8 +562,10 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
                                }
                                rq = inl_rq->qid;
                                pf_func = nix_inl_dev_pffunc_get();
-                               flow->is_inline_dev = 1;
                        }
+
+                       if (roc_nix_inl_dev_is_probed())
+                               flow->is_inline_dev = 1;
                        sec_action = actions;
                        break;
                case ROC_NPC_ACTION_TYPE_VLAN_STRIP:
--

2.35.3