Adding changes to enable keep flow rule device capability.
With this change, flow rules will be kept across device restart.
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
priority, resp_count);
}
+int
+roc_npc_mcam_enable_all_entries(struct roc_npc *roc_npc, bool enable)
+{
+ struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+
+ return npc_flow_enable_all_entries(npc, enable);
+}
+
int
roc_npc_mcam_alloc_entry(struct roc_npc *roc_npc, struct roc_npc_flow *mcam,
struct roc_npc_flow *ref_mcam, int prio,
int __roc_api roc_npc_flow_destroy(struct roc_npc *roc_npc,
struct roc_npc_flow *flow);
int __roc_api roc_npc_mcam_free_entry(struct roc_npc *roc_npc, uint32_t entry);
+int __roc_api roc_npc_mcam_enable_all_entries(struct roc_npc *roc_npc,
+ bool enable);
int __roc_api roc_npc_mcam_alloc_entry(struct roc_npc *roc_npc,
struct roc_npc_flow *mcam,
struct roc_npc_flow *ref_mcam, int prio,
return 0;
}
+int
+npc_flow_enable_all_entries(struct npc *npc, bool enable)
+{
+ struct npc_flow_list *list;
+ struct roc_npc_flow *flow;
+ int rc = 0, idx;
+
+ /* Free any MCAM counters and delete flow list */
+ for (idx = 0; idx < npc->flow_max_priority; idx++) {
+ list = &npc->flow_list[idx];
+ TAILQ_FOREACH(flow, list, next) {
+ flow->enable = enable;
+ rc = npc_mcam_write_entry(npc, flow);
+ if (rc)
+ return rc;
+ }
+ }
+ return rc;
+}
+
int
npc_flow_free_all_resources(struct npc *npc)
{
int npc_mcam_ena_dis_entry(struct npc *npc, struct roc_npc_flow *mcam,
bool enable);
int npc_mcam_write_entry(struct npc *npc, struct roc_npc_flow *mcam);
+int npc_flow_enable_all_entries(struct npc *npc, bool enable);
int npc_update_parse_state(struct npc_parse_state *pst,
struct npc_parse_item_info *info, int lid, int lt,
uint8_t flags);
roc_npc_mcam_alloc_entries;
roc_npc_mcam_alloc_entry;
roc_npc_mcam_clear_counter;
+ roc_npc_mcam_enable_all_entries;
roc_npc_mcam_ena_dis_entry;
roc_npc_mcam_free_all_resources;
roc_npc_mcam_free_counter;
int count, i, j, rc;
void *rxq;
- /* Disable switch hdr pkind */
- roc_nix_switch_hdr_set(&dev->nix, 0, 0, 0, 0);
+ /* Disable all the NPC entries */
+ rc = roc_npc_mcam_enable_all_entries(&dev->npc, 0);
+ if (rc)
+ return rc;
/* Stop link change events */
if (!roc_nix_is_vf_or_sdp(&dev->nix))
return rc;
}
+ rc = roc_npc_mcam_enable_all_entries(&dev->npc, 1);
+ if (rc) {
+ plt_err("Failed to enable NPC entries %d", rc);
+ return rc;
+ }
+
cnxk_nix_toggle_flag_link_cfg(dev, true);
/* Start link change events */
struct roc_nix *nix = &dev->nix;
int rc, i;
+ /* Disable switch hdr pkind */
+ roc_nix_switch_hdr_set(&dev->nix, 0, 0, 0, 0);
+
plt_free(eth_dev->security_ctx);
eth_dev->security_ctx = NULL;
devinfo->speed_capa = dev->speed_capa;
devinfo->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
- RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
- devinfo->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
+ RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP |
+ RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
return 0;
}