X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Focteontx2%2Fotx2_flow_parse.c;h=2d9a5857c0be9e043f08016ed122d0900c2865f8;hb=9a6ea33af9fac4c2a00a4bb595875a393a90b12d;hp=71650b53bc4e9ec14d700c7009c3e52e8377d8b6;hpb=2e0061dbb4d2d3aac54d6fcf1b53293da6aab132;p=dpdk.git diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c index 71650b53bc..2d9a5857c0 100644 --- a/drivers/net/octeontx2/otx2_flow_parse.c +++ b/drivers/net/octeontx2/otx2_flow_parse.c @@ -458,7 +458,7 @@ otx2_flow_parse_ld(struct otx2_parse_state *pst) info.hw_hdr_len = 4; break; case RTE_FLOW_ITEM_TYPE_NVGRE: - lt = NPC_LT_LD_GRE; + lt = NPC_LT_LD_NVGRE; lflags = NPC_F_GRE_NVGRE; info.def_mask = &rte_flow_item_nvgre_mask; info.len = sizeof(struct rte_flow_item_nvgre); @@ -675,6 +675,15 @@ otx2_flow_parse_la(struct otx2_parse_state *pst) if (pst->flow->nix_intf == NIX_INTF_TX) { lt = NPC_LT_LA_IH_NIX_ETHER; info.hw_hdr_len = NPC_IH_LENGTH; + if (pst->npc->switch_header_type == OTX2_PRIV_FLAGS_HIGIG) { + lt = NPC_LT_LA_IH_NIX_HIGIG2_ETHER; + info.hw_hdr_len += NPC_HIGIG2_LENGTH; + } + } else { + if (pst->npc->switch_header_type == OTX2_PRIV_FLAGS_HIGIG) { + lt = NPC_LT_LA_HIGIG2_ETHER; + info.hw_hdr_len = NPC_HIGIG2_LENGTH; + } } /* Prepare for parsing the item */ @@ -694,6 +703,44 @@ otx2_flow_parse_la(struct otx2_parse_state *pst) return otx2_flow_update_parse_state(pst, &info, lid, lt, 0); } +int +otx2_flow_parse_higig2_hdr(struct otx2_parse_state *pst) +{ + struct rte_flow_item_higig2_hdr hw_mask; + struct otx2_flow_item_info info; + int lid, lt; + int rc; + + /* Identify the pattern type into lid, lt */ + if (pst->pattern->type != RTE_FLOW_ITEM_TYPE_HIGIG2) + return 0; + + lid = NPC_LID_LA; + lt = NPC_LT_LA_HIGIG2_ETHER; + info.hw_hdr_len = 0; + + if (pst->flow->nix_intf == NIX_INTF_TX) { + lt = NPC_LT_LA_IH_NIX_HIGIG2_ETHER; + info.hw_hdr_len = NPC_IH_LENGTH; + } + + /* Prepare for parsing the item */ + info.def_mask = &rte_flow_item_higig2_hdr_mask; + info.hw_mask = &hw_mask; + info.len = sizeof(struct rte_flow_item_higig2_hdr); + otx2_flow_get_hw_supp_mask(pst, &info, lid, lt); + info.spec = NULL; + info.mask = NULL; + + /* Basic validation of item parameters */ + rc = otx2_flow_parse_item_basic(pst->pattern, &info, pst->error); + if (rc) + return rc; + + /* Update pst if not validate only? clash check? */ + return otx2_flow_update_parse_state(pst, &info, lid, lt, 0); +} + static int parse_rss_action(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, @@ -833,14 +880,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;