From 25c6855d419cb1c74b50fd22daa5d71163ba47f5 Mon Sep 17 00:00:00 2001 From: Vamsi Attunuru Date: Tue, 29 Oct 2019 23:20:59 +0530 Subject: [PATCH] net/octeontx2: fix VF index in VF action VF index needs to be checked against maxvf count before incrementing it for preparing pf_func. Fixes: 520270d5184a ("net/octeontx2: support PF and VF action") Cc: stable@dpdk.org Signed-off-by: Vamsi Attunuru Acked-by: Jerin Jacob --- drivers/net/octeontx2/otx2_flow_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c index 2cba0a4473..6b2617b8a4 100644 --- a/drivers/net/octeontx2/otx2_flow_parse.c +++ b/drivers/net/octeontx2/otx2_flow_parse.c @@ -833,14 +833,14 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, actions->conf; req_act |= OTX2_FLOW_ACT_VF; if (vf_act->original == 0) { - vf_id = (vf_act->id & RVU_PFVF_FUNC_MASK) + 1; + vf_id = vf_act->id & RVU_PFVF_FUNC_MASK; if (vf_id >= hw->maxvf) { errmsg = "invalid vf specified"; errcode = EINVAL; goto err_exit; } pf_func &= (0xfc00); - pf_func = (pf_func | vf_id); + pf_func = (pf_func | (vf_id + 1)); } break; -- 2.20.1