#define NPC_IH_LENGTH 8
#define NPC_TPID_LENGTH 2
+#define NPC_HIGIG2_LENGTH 16
#define NPC_COUNTER_NONE (-1)
/* 32 bytes from LDATA_CFG & 32 bytes from FLAGS_CFG */
#define NPC_MAX_EXTRACT_DATA_LEN (64)
int otx2_flow_parse_la(struct otx2_parse_state *pst);
+int otx2_flow_parse_higig2_hdr(struct otx2_parse_state *pst);
+
int otx2_flow_parse_actions(struct rte_eth_dev *dev,
const struct rte_flow_attr *attr,
const struct rte_flow_action actions[],
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 */
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,