+ /*Init fields w.r.t. classficaition*/
+ memset(&priv->extract.qos_key_extract, 0,
+ sizeof(struct dpaa2_key_extract));
+ priv->extract.qos_extract_param = (size_t)rte_malloc(NULL, 256, 64);
+ if (!priv->extract.qos_extract_param) {
+ DPAA2_PMD_ERR(" Error(%d) in allocation resources for flow "
+ " classificaiton ", ret);
+ goto init_err;
+ }
+ priv->extract.qos_key_extract.key_info.ipv4_src_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ priv->extract.qos_key_extract.key_info.ipv4_dst_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ priv->extract.qos_key_extract.key_info.ipv6_src_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ priv->extract.qos_key_extract.key_info.ipv6_dst_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+
+ for (i = 0; i < MAX_TCS; i++) {
+ memset(&priv->extract.tc_key_extract[i], 0,
+ sizeof(struct dpaa2_key_extract));
+ priv->extract.tc_extract_param[i] =
+ (size_t)rte_malloc(NULL, 256, 64);
+ if (!priv->extract.tc_extract_param[i]) {
+ DPAA2_PMD_ERR(" Error(%d) in allocation resources for flow classificaiton",
+ ret);
+ goto init_err;
+ }
+ priv->extract.tc_key_extract[i].key_info.ipv4_src_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ priv->extract.tc_key_extract[i].key_info.ipv4_dst_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ priv->extract.tc_key_extract[i].key_info.ipv6_src_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ priv->extract.tc_key_extract[i].key_info.ipv6_dst_offset =
+ IP_ADDRESS_OFFSET_INVALID;
+ }
+
+ ret = dpni_set_max_frame_length(dpni_dev, CMD_PRI_LOW, priv->token,
+ RTE_ETHER_MAX_LEN - RTE_ETHER_CRC_LEN
+ + VLAN_TAG_SIZE);
+ if (ret) {
+ DPAA2_PMD_ERR("Unable to set mtu. check config");
+ goto init_err;
+ }
+
+ /*TODO To enable soft parser support DPAA2 driver needs to integrate
+ * with external entity to receive byte code for software sequence
+ * and same will be offload to the H/W using MC interface.
+ * Currently it is assumed that DPAA2 driver has byte code by some
+ * mean and same if offloaded to H/W.
+ */
+ if (getenv("DPAA2_ENABLE_SOFT_PARSER")) {
+ WRIOP_SS_INITIALIZER(priv);
+ ret = dpaa2_eth_load_wriop_soft_parser(priv, DPNI_SS_INGRESS);
+ if (ret < 0) {
+ DPAA2_PMD_ERR(" Error(%d) in loading softparser\n",
+ ret);
+ return ret;
+ }
+
+ ret = dpaa2_eth_enable_wriop_soft_parser(priv,
+ DPNI_SS_INGRESS);
+ if (ret < 0) {
+ DPAA2_PMD_ERR(" Error(%d) in enabling softparser\n",
+ ret);
+ return ret;
+ }
+ }