common/cnxk: add ROC API to merge base steering rule
PATCH 1/1 common/cnxk: add ROC API to merge base steering rule
From: Satheesh Paul <[email protected]>
This patch adds an ROC API to merge base steering rule with rules added by VF.
--- drivers/common/cnxk/roc_npc.c | 27 +++++++++++++++++++++++++++ drivers/common/cnxk/roc_npc.h | 5 ++--- drivers/common/cnxk/version.map | 1 + 3 files changed, 30 insertions(+), 3 deletions(-)
drivers/common/cnxk/roc_npc.c +27 -0
@@ -1136,3 +1136,30 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc) } } } + +int +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); +struct mcam_entry *base_entry; +int idx, rc; + +if (roc_nix_is_pf (roc_npc->roc_nix)) +return 0 ; + + (void )mbox_alloc_msg_npc_read_base_steer_rule (npc->mbox); + rc =mbox_process_msg (npc->mbox, (void *)&base_rule_rsp); +if (rc) { +plt_err ("Failed to fetch VF's base MCAM entry" ); +return rc; + } + base_entry = &base_rule_rsp->entry_data; +for (idx =0 ; idx <ROC_NPC_MAX_MCAM_WIDTH_DWORDS ; idx++) { + flow->mcam_data[idx] |= base_entry->kw[idx]; + flow->mcam_mask[idx] |= base_entry->kw_mask[idx]; + } + +return 0 ; +}
drivers/common/cnxk/roc_npc.h +2 -3
@@ -215,15 +215,12 @@ int __roc_api roc_npc_flow_parse(struct roc_npc *roc_npc,const struct roc_npc_action actions[], struct roc_npc_flow *flow); int __roc_api roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc); - int __roc_api roc_npc_mcam_free_counter(struct roc_npc *roc_npc,uint16_t ctr_id); - int __roc_api roc_npc_mcam_read_counter(struct roc_npc *roc_npc,uint32_t ctr_id,uint64_t *count); int __roc_api roc_npc_mcam_clear_counter(struct roc_npc *roc_npc,uint32_t ctr_id); - int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc); void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc); void __roc_api roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc,
@@ -234,4 +231,6 @@ int __roc_api roc_npc_mark_actions_sub_return(struct roc_npc *roc_npc, int __roc_api roc_npc_vtag_actions_get(struct roc_npc *roc_npc); int __roc_api roc_npc_vtag_actions_sub_return(struct roc_npc *roc_npc,uint32_t count); +int __roc_api roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, +struct roc_npc_flow *flow);#endif /* _ROC_NPC_H_ */
drivers/common/cnxk/version.map +1 -0
@@ -234,6 +234,7 @@ INTERNAL { roc_npc_mcam_free_all_resources; roc_npc_mcam_free_counter; roc_npc_mcam_free_entry; + roc_npc_mcam_merge_base_steering_rule; roc_npc_mcam_write_entry; roc_npc_mcam_read_counter; roc_npc_profile_name_get;
Signature · 1 line
2.25.4
Quoted 69 lines · On 31/08/2021 05:16, [email protected] wrote:
From: Satheesh Paul <[email protected]>
This patch adds an ROC API to merge base steering rule with rules added by VF.
Signed-off-by Satheesh Paul <[email protected]>Reviewed-by Kiran Kumar Kokkilagadda <[email protected]>--- drivers/common/cnxk/roc_npc.c | 27 +++++++++++++++++++++++++++ drivers/common/cnxk/roc_npc.h | 5 ++--- drivers/common/cnxk/version.map | 1 + 3 files changed, 30 insertions(+), 3 deletions(-)drivers/common/cnxk/roc_npc.c +27
-0@@ -1136,3 +1136,30 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc) } } } + +int +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); +struct mcam_entry *base_entry; +int idx, rc; + +if (roc_nix_is_pf (roc_npc->roc_nix)) +return 0 ; + + (void )mbox_alloc_msg_npc_read_base_steer_rule (npc->mbox); + rc =mbox_process_msg (npc->mbox, (void *)&base_rule_rsp); +if (rc) { +plt_err ("Failed to fetch VF's base MCAM entry" ); +return rc; + } + base_entry = &base_rule_rsp->entry_data; +for (idx =0 ; idx <ROC_NPC_MAX_MCAM_WIDTH_DWORDS ; idx++) { + flow->mcam_data[idx] |= base_entry->kw[idx]; + flow->mcam_mask[idx] |= base_entry->kw_mask[idx]; + } + +return 0 ; +}drivers/common/cnxk/roc_npc.h +0
-3@@ -215,15 +215,12 @@ int __roc_api roc_npc_flow_parse(struct roc_npc *roc_npc,const struct roc_npc_action actions[], struct roc_npc_flow *flow); int __roc_api roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc); - int __roc_api roc_npc_mcam_free_counter(struct roc_npc *roc_npc,uint16_t ctr_id); - int __roc_api roc_npc_mcam_read_counter(struct roc_npc *roc_npc,uint32_t ctr_id,uint64_t *count); int __roc_api roc_npc_mcam_clear_counter(struct roc_npc *roc_npc,uint32_t ctr_id); - int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc); void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc); void __roc_api roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc,
drivers/common/cnxk/roc_npc.h int __roc_api roc_npc_mark_actions_sub_return(struct roc_npc *roc_npc, · line 235
Quoted 5 lines
drivers/common/cnxk/roc_npc.h +2
-0@@ -234,4 +231,6 @@ int __roc_api roc_npc_mark_actions_sub_return(struct roc_npc *roc_npc, int __roc_api roc_npc_vtag_actions_get(struct roc_npc *roc_npc); int __roc_api roc_npc_vtag_actions_sub_return(struct roc_npc *roc_npc,uint32_t count); +int __roc_api roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, +struct roc_npc_flow *flow);
Missing __rte_internal ?
Quoted 14 lines
drivers/common/cnxk/roc_npc.h +0
-0#endif /* _ROC_NPC_H_ */ drivers/common/cnxk/version.map +1
-0@@ -234,6 +234,7 @@ INTERNAL { roc_npc_mcam_free_all_resources; roc_npc_mcam_free_counter; roc_npc_mcam_free_entry; + roc_npc_mcam_merge_base_steering_rule; roc_npc_mcam_write_entry; roc_npc_mcam_read_counter; roc_npc_profile_name_get;
Please find reply inline.
-----Original Message-----
From: Kinsella, Ray <[email protected]>
Sent: 31 August 2021 09:11 PM
To: Satheesh Paul <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>
Cc: [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] common/cnxk: add ROC API to merge base steering rule
External Email
----------------------------------------------------------------------
Quoted 75 lines · On 31/08/2021 05:16, [email protected] wrote:
From: Satheesh Paul <[email protected]>
This patch adds an ROC API to merge base steering rule with rules added by VF.
Signed-off-by Satheesh Paul <[email protected]>Reviewed-by Kiran Kumar Kokkilagadda <[email protected]>--- drivers/common/cnxk/roc_npc.c | 27 +++++++++++++++++++++++++++ drivers/common/cnxk/roc_npc.h | 5 ++--- drivers/common/cnxk/version.map | 1 + 3 files changed, 30 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/common/cnxk/roc_npc.cindexaff4eef554..53074bed99100644drivers/common/cnxk/roc_npc.c +27
-0@@ -1136,3 +1136,30 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc) } } } + +int +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); +struct mcam_entry *base_entry; +int idx, rc; + +if (roc_nix_is_pf (roc_npc->roc_nix)) +return 0 ; + + (void )mbox_alloc_msg_npc_read_base_steer_rule (npc->mbox); + rc =mbox_process_msg (npc->mbox, (void *)&base_rule_rsp); +if (rc) { +plt_err ("Failed to fetch VF's base MCAM entry" ); +return rc; + } + base_entry = &base_rule_rsp->entry_data; +for (idx =0 ; idx <ROC_NPC_MAX_MCAM_WIDTH_DWORDS ; idx++) { + flow->mcam_data[idx] |= base_entry->kw[idx]; + flow->mcam_mask[idx] |= base_entry->kw_mask[idx]; + } + +return 0 ; +}(quoted diff) +0
-0
b/drivers/common/cnxk/roc_npc.hindexbab25fd72e..1f9d29e2dd100644drivers/common/cnxk/roc_npc.h +0
-3@@ -215,15 +215,12 @@ int __roc_api roc_npc_flow_parse(struct roc_npc *roc_npc,const struct roc_npc_action actions[], struct roc_npc_flow *flow); int __roc_api roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc); - int __roc_api roc_npc_mcam_free_counter(struct roc_npc *roc_npc,uint16_t ctr_id); - int __roc_api roc_npc_mcam_read_counter(struct roc_npc *roc_npc, uint32_t ctr_id, uint64_t *count); int __roc_apiroc_npc_mcam_clear_counter (struct roc_npc *roc_npc,uint32_t ctr_id); - int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc); void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc); void __roc_api roc_npc_flow_mcam_dump(FILE *file,struct
roc_npc*roc_npc, @@ -234,4 +231,6 @@ int__roc_api
roc_npc_mark_actions_sub_return(structroc_npc*roc_npc, int__roc_apiroc_npc_vtag_actions_get(struct roc_npc *roc_npc); int__roc_apiroc_npc_vtag_actions_sub_return(structroc_npc*roc_npc,drivers/common/cnxk/roc_npc.h +2
-0uint32_t count); +int __roc_api roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, +struct roc_npc_flow *flow);
Quoted 1 line
Missing
__rte_internal?
__roc_api is defined as __rte_internal in "drivers/common/cnxk/roc_platform.h".
Quoted 14 lines
#endif /* _ROC_NPC_H_ */
(quoted diff) +0
-0b/drivers/common/cnxk/version.map index
2cbcc4b93a..13231fcf04100644drivers/common/cnxk/version.map +1
-0@@ -234,6 +234,7 @@ INTERNAL { roc_npc_mcam_free_all_resources; roc_npc_mcam_free_counter; roc_npc_mcam_free_entry; + roc_npc_mcam_merge_base_steering_rule; roc_npc_mcam_write_entry; roc_npc_mcam_read_counter; roc_npc_profile_name_get;
Quoted 5 lines · On 31/08/2021 05:16, [email protected] wrote:
From: Satheesh Paul <[email protected]>
This patch adds an ROC API to merge base steering rule with rules added by VF.
Quoted 8 lines
Signed-off-by Satheesh Paul <[email protected]>Reviewed-by Kiran Kumar Kokkilagadda <[email protected]>--- drivers/common/cnxk/roc_npc.c | 27 +++++++++++++++++++++++++++ drivers/common/cnxk/roc_npc.h | 5 ++--- drivers/common/cnxk/version.map | 1 + 3 files changed, 30 insertions(+), 3 deletions(-)
Quoted 18 lines · Ray
Quoted 5 lines · On 31/08/2021 05:16, [email protected] wrote:
From: Satheesh Paul <[email protected]>
This patch adds an ROC API to merge base steering rule with rules added by VF.
Quoted 8 lines
Signed-off-by Satheesh Paul <[email protected]>Reviewed-by Kiran Kumar Kokkilagadda <[email protected]>--- drivers/common/cnxk/roc_npc.c | 27 +++++++++++++++++++++++++++ drivers/common/cnxk/roc_npc.h | 5 ++--- drivers/common/cnxk/version.map | 1 + 3 files changed, 30 insertions(+), 3 deletions(-)
Quoted 1 line
Acked-by Ray Kinsella <[email protected]>
Change the subject to common/cnxk: support merging base steering rule Applied to dpdk-next-net-mrvl/for-next-net. Thanks