Skip to content

Commit

Permalink
common/cnxk: add API to get MKEX capability
Browse files Browse the repository at this point in the history
Added ROC API to get MKEX capability.

Signed-off-by: Satheesh Paul <[email protected]>
Reviewed-by: Kiran Kumar K <[email protected]>
  • Loading branch information
satheeshpaul authored and jerinjacobk committed Dec 5, 2023
1 parent 87d934b commit 18ad4b5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/common/cnxk/roc_npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,30 @@ roc_npc_profile_name_get(struct roc_npc *roc_npc)
return (char *)npc->profile_name;
}

int
roc_npc_kex_capa_get(struct roc_nix *roc_nix, uint64_t *kex_capability)
{
struct nix *nix = roc_nix_to_nix_priv(roc_nix);
struct npc npc;
int rc = 0;

memset(&npc, 0, sizeof(npc));

npc.mbox = (&nix->dev)->mbox;

rc = npc_mcam_fetch_kex_cfg(&npc);
if (rc)
return rc;

rc = npc_mcam_fetch_hw_cap(&npc, &npc.hash_extract_cap);
if (rc)
return rc;

*kex_capability = npc_get_kex_capability(&npc);

return 0;
}

int
roc_npc_init(struct roc_npc *roc_npc)
{
Expand Down
1 change: 1 addition & 0 deletions drivers/common/cnxk/roc_npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ struct roc_npc {
int __roc_api roc_npc_init(struct roc_npc *roc_npc);
int __roc_api roc_npc_fini(struct roc_npc *roc_npc);
const char *__roc_api roc_npc_profile_name_get(struct roc_npc *roc_npc);
int __roc_api roc_npc_kex_capa_get(struct roc_nix *roc_nix, uint64_t *kex_capability);

struct roc_npc_flow *__roc_api roc_npc_flow_create(struct roc_npc *roc_npc,
const struct roc_npc_attr *attr,
Expand Down
1 change: 1 addition & 0 deletions drivers/common/cnxk/version.map
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ INTERNAL {
roc_npc_flow_parse;
roc_npc_get_low_priority_mcam;
roc_npc_init;
roc_npc_kex_capa_get;
roc_npc_mark_actions_get;
roc_npc_mark_actions_sub_return;
roc_npc_vtag_actions_get;
Expand Down

0 comments on commit 18ad4b5

Please sign in to comment.