* Added support for rte_flow_query for COUNT action.
* Added support for rx_burst_mode_get and tx_burst_mode_get.
* Added vector mode support for ARM CPUs.
+ * Added support for VLAN push and pop actions.
* **Updated Mellanox mlx5 driver.**
ULP_BITMAP_SET(prm->act_bitmap.bits, BNXT_ULP_ACTION_BIT_VPORT);
return BNXT_TF_RC_SUCCESS;
}
+
+/* Function to handle the parsing of RTE Flow action pop vlan. */
+int32_t
+ulp_rte_of_pop_vlan_act_handler(const struct rte_flow_action *a __rte_unused,
+ struct ulp_rte_parser_params *params)
+{
+ /* Update the act_bitmap with pop */
+ ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_POP_VLAN);
+ return BNXT_TF_RC_SUCCESS;
+}
+
+/* Function to handle the parsing of RTE Flow action push vlan. */
+int32_t
+ulp_rte_of_push_vlan_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params)
+{
+ const struct rte_flow_action_of_push_vlan *push_vlan;
+ uint16_t ethertype;
+ struct ulp_rte_act_prop *act = ¶ms->act_prop;
+
+ push_vlan = action_item->conf;
+ if (push_vlan) {
+ ethertype = push_vlan->ethertype;
+ if (tfp_cpu_to_be_16(ethertype) != RTE_ETHER_TYPE_VLAN) {
+ BNXT_TF_DBG(ERR,
+ "Parse Err: Ethertype not supported\n");
+ return BNXT_TF_RC_PARSE_ERR;
+ }
+ memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_PUSH_VLAN],
+ ðertype, BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN);
+ /* Update the hdr_bitmap with push vlan */
+ ULP_BITMAP_SET(params->act_bitmap.bits,
+ BNXT_ULP_ACTION_BIT_PUSH_VLAN);
+ return BNXT_TF_RC_SUCCESS;
+ }
+ BNXT_TF_DBG(ERR, "Parse Error: Push vlan arg is invalid\n");
+ return BNXT_TF_RC_ERROR;
+}
+
+/* Function to handle the parsing of RTE Flow action set vlan id. */
+int32_t
+ulp_rte_of_set_vlan_vid_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params)
+{
+ const struct rte_flow_action_of_set_vlan_vid *vlan_vid;
+ uint32_t vid;
+ struct ulp_rte_act_prop *act = ¶ms->act_prop;
+
+ vlan_vid = action_item->conf;
+ if (vlan_vid && vlan_vid->vlan_vid) {
+ vid = vlan_vid->vlan_vid;
+ memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_SET_VLAN_VID],
+ &vid, BNXT_ULP_ACT_PROP_SZ_SET_VLAN_VID);
+ /* Update the hdr_bitmap with vlan vid */
+ ULP_BITMAP_SET(params->act_bitmap.bits,
+ BNXT_ULP_ACTION_BIT_SET_VLAN_VID);
+ return BNXT_TF_RC_SUCCESS;
+ }
+ BNXT_TF_DBG(ERR, "Parse Error: Vlan vid arg is invalid\n");
+ return BNXT_TF_RC_ERROR;
+}
+
+/* Function to handle the parsing of RTE Flow action set vlan pcp. */
+int32_t
+ulp_rte_of_set_vlan_pcp_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params)
+{
+ const struct rte_flow_action_of_set_vlan_pcp *vlan_pcp;
+ uint8_t pcp;
+ struct ulp_rte_act_prop *act = ¶ms->act_prop;
+
+ vlan_pcp = action_item->conf;
+ if (vlan_pcp) {
+ pcp = vlan_pcp->vlan_pcp;
+ memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_SET_VLAN_PCP],
+ &pcp, BNXT_ULP_ACT_PROP_SZ_SET_VLAN_PCP);
+ /* Update the hdr_bitmap with vlan vid */
+ ULP_BITMAP_SET(params->act_bitmap.bits,
+ BNXT_ULP_ACTION_BIT_SET_VLAN_PCP);
+ return BNXT_TF_RC_SUCCESS;
+ }
+ BNXT_TF_DBG(ERR, "Parse Error: Vlan pcp arg is invalid\n");
+ return BNXT_TF_RC_ERROR;
+}
ulp_rte_phy_port_act_handler(const struct rte_flow_action *action_item,
struct ulp_rte_parser_params *params);
+/* Function to handle the parsing of RTE Flow action pop vlan. */
+int32_t
+ulp_rte_of_pop_vlan_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params);
+
+/* Function to handle the parsing of RTE Flow action push vlan. */
+int32_t
+ulp_rte_of_push_vlan_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params);
+
+/* Function to handle the parsing of RTE Flow action set vlan id. */
+int32_t
+ulp_rte_of_set_vlan_vid_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params);
+
+/* Function to handle the parsing of RTE Flow action set vlan pcp. */
+int32_t
+ulp_rte_of_set_vlan_pcp_act_handler(const struct rte_flow_action *action_item,
+ struct ulp_rte_parser_params *params);
+
#endif /* _ULP_RTE_PARSER_H_ */
BNXT_ULP_ACT_PROP_SZ_METER = 4,
BNXT_ULP_ACT_PROP_SZ_SET_MAC_SRC = 8,
BNXT_ULP_ACT_PROP_SZ_SET_MAC_DST = 8,
- BNXT_ULP_ACT_PROP_SZ_OF_PUSH_VLAN = 4,
- BNXT_ULP_ACT_PROP_SZ_OF_SET_VLAN_PCP = 4,
- BNXT_ULP_ACT_PROP_SZ_OF_SET_VLAN_VID = 4,
+ BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN = 2,
+ BNXT_ULP_ACT_PROP_SZ_SET_VLAN_PCP = 1,
+ BNXT_ULP_ACT_PROP_SZ_SET_VLAN_VID = 2,
BNXT_ULP_ACT_PROP_SZ_SET_IPV4_SRC = 4,
BNXT_ULP_ACT_PROP_SZ_SET_IPV4_DST = 4,
BNXT_ULP_ACT_PROP_SZ_SET_IPV6_SRC = 16,
BNXT_ULP_ACT_PROP_IDX_METER = 52,
BNXT_ULP_ACT_PROP_IDX_SET_MAC_SRC = 56,
BNXT_ULP_ACT_PROP_IDX_SET_MAC_DST = 64,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_VLAN = 72,
- BNXT_ULP_ACT_PROP_IDX_OF_SET_VLAN_PCP = 76,
- BNXT_ULP_ACT_PROP_IDX_OF_SET_VLAN_VID = 80,
- BNXT_ULP_ACT_PROP_IDX_SET_IPV4_SRC = 84,
- BNXT_ULP_ACT_PROP_IDX_SET_IPV4_DST = 88,
- BNXT_ULP_ACT_PROP_IDX_SET_IPV6_SRC = 92,
- BNXT_ULP_ACT_PROP_IDX_SET_IPV6_DST = 108,
- BNXT_ULP_ACT_PROP_IDX_SET_TP_SRC = 124,
- BNXT_ULP_ACT_PROP_IDX_SET_TP_DST = 128,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_0 = 132,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_1 = 136,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_2 = 140,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_3 = 144,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_4 = 148,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_5 = 152,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_6 = 156,
- BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_7 = 160,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_L2_DMAC = 164,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_L2_SMAC = 170,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_VTAG = 176,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_IP = 184,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_IP_SRC = 216,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_UDP = 232,
- BNXT_ULP_ACT_PROP_IDX_ENCAP_TUN = 236,
- BNXT_ULP_ACT_PROP_IDX_LAST = 268
+ BNXT_ULP_ACT_PROP_IDX_PUSH_VLAN = 72,
+ BNXT_ULP_ACT_PROP_IDX_SET_VLAN_PCP = 74,
+ BNXT_ULP_ACT_PROP_IDX_SET_VLAN_VID = 75,
+ BNXT_ULP_ACT_PROP_IDX_SET_IPV4_SRC = 77,
+ BNXT_ULP_ACT_PROP_IDX_SET_IPV4_DST = 81,
+ BNXT_ULP_ACT_PROP_IDX_SET_IPV6_SRC = 85,
+ BNXT_ULP_ACT_PROP_IDX_SET_IPV6_DST = 101,
+ BNXT_ULP_ACT_PROP_IDX_SET_TP_SRC = 117,
+ BNXT_ULP_ACT_PROP_IDX_SET_TP_DST = 121,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_0 = 125,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_1 = 129,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_2 = 133,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_3 = 137,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_4 = 141,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_5 = 145,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_6 = 149,
+ BNXT_ULP_ACT_PROP_IDX_OF_PUSH_MPLS_7 = 153,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_L2_DMAC = 157,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_L2_SMAC = 163,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_VTAG = 169,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_IP = 177,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_IP_SRC = 209,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_UDP = 225,
+ BNXT_ULP_ACT_PROP_IDX_ENCAP_TUN = 229,
+ BNXT_ULP_ACT_PROP_IDX_LAST = 261
};
enum bnxt_ulp_class_hid {
BNXT_ULP_ACT_PROP_SZ_SET_MAC_SRC,
[BNXT_ULP_ACT_PROP_IDX_SET_MAC_DST] =
BNXT_ULP_ACT_PROP_SZ_SET_MAC_DST,
- [BNXT_ULP_ACT_PROP_IDX_OF_PUSH_VLAN] =
- BNXT_ULP_ACT_PROP_SZ_OF_PUSH_VLAN,
- [BNXT_ULP_ACT_PROP_IDX_OF_SET_VLAN_PCP] =
- BNXT_ULP_ACT_PROP_SZ_OF_SET_VLAN_PCP,
- [BNXT_ULP_ACT_PROP_IDX_OF_SET_VLAN_VID] =
- BNXT_ULP_ACT_PROP_SZ_OF_SET_VLAN_VID,
+ [BNXT_ULP_ACT_PROP_IDX_PUSH_VLAN] =
+ BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN,
+ [BNXT_ULP_ACT_PROP_IDX_SET_VLAN_PCP] =
+ BNXT_ULP_ACT_PROP_SZ_SET_VLAN_PCP,
+ [BNXT_ULP_ACT_PROP_IDX_SET_VLAN_VID] =
+ BNXT_ULP_ACT_PROP_SZ_SET_VLAN_VID,
[BNXT_ULP_ACT_PROP_IDX_SET_IPV4_SRC] =
BNXT_ULP_ACT_PROP_SZ_SET_IPV4_SRC,
[BNXT_ULP_ACT_PROP_IDX_SET_IPV4_DST] =
.proto_act_func = NULL
},
[RTE_FLOW_ACTION_TYPE_OF_POP_VLAN] = {
- .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
- .proto_act_func = NULL
+ .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
+ .proto_act_func = ulp_rte_of_pop_vlan_act_handler
},
[RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN] = {
- .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
- .proto_act_func = NULL
+ .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
+ .proto_act_func = ulp_rte_of_push_vlan_act_handler
},
[RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID] = {
- .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
- .proto_act_func = NULL
+ .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
+ .proto_act_func = ulp_rte_of_set_vlan_vid_act_handler
},
[RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP] = {
- .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
- .proto_act_func = NULL
+ .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
+ .proto_act_func = ulp_rte_of_set_vlan_pcp_act_handler
},
[RTE_FLOW_ACTION_TYPE_OF_POP_MPLS] = {
.act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,