net/dpaa2: update MC firmware version
[dpdk.git] / drivers / net / dpaa2 / dpaa2_ethdev.c
index 0b3cc82..03131b9 100644 (file)
@@ -26,6 +26,7 @@
 #include <dpaa2_hw_dpio.h>
 #include <mc/fsl_dpmng.h>
 #include "dpaa2_ethdev.h"
+#include "dpaa2_sparser.h"
 #include <fsl_qbman_debug.h>
 
 #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -127,8 +128,8 @@ dpaa2_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
        }
 
        if (on)
-               ret = dpni_add_vlan_id(dpni, CMD_PRI_LOW,
-                                      priv->token, vlan_id);
+               ret = dpni_add_vlan_id(dpni, CMD_PRI_LOW, priv->token,
+                                      vlan_id, 0, 0, 0);
        else
                ret = dpni_remove_vlan_id(dpni, CMD_PRI_LOW,
                                          priv->token, vlan_id);
@@ -1325,8 +1326,8 @@ dpaa2_dev_add_mac_addr(struct rte_eth_dev *dev,
                return -1;
        }
 
-       ret = dpni_add_mac_addr(dpni, CMD_PRI_LOW,
-                               priv->token, addr->addr_bytes);
+       ret = dpni_add_mac_addr(dpni, CMD_PRI_LOW, priv->token,
+                               addr->addr_bytes, 0, 0, 0);
        if (ret)
                DPAA2_PMD_ERR(
                        "error: Adding the MAC ADDR failed: err = %d", ret);
@@ -2005,7 +2006,7 @@ dpaa2_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 
 int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
                int eth_rx_queue_id,
-               uint16_t dpcon_id,
+               struct dpaa2_dpcon_dev *dpcon,
                const struct rte_event_eth_rx_adapter_queue_conf *queue_conf)
 {
        struct dpaa2_dev_priv *eth_priv = dev->data->dev_private;
@@ -2013,7 +2014,7 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
        struct dpaa2_queue *dpaa2_ethq = eth_priv->rx_vq[eth_rx_queue_id];
        uint8_t flow_id = dpaa2_ethq->flow_id;
        struct dpni_queue cfg;
-       uint8_t options;
+       uint8_t options, priority;
        int ret;
 
        if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL)
@@ -2025,11 +2026,14 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
        else
                return -EINVAL;
 
+       priority = (RTE_EVENT_DEV_PRIORITY_LOWEST / queue_conf->ev.priority) *
+                  (dpcon->num_priorities - 1);
+
        memset(&cfg, 0, sizeof(struct dpni_queue));
        options = DPNI_QUEUE_OPT_DEST;
        cfg.destination.type = DPNI_DEST_DPCON;
-       cfg.destination.id = dpcon_id;
-       cfg.destination.priority = queue_conf->ev.priority;
+       cfg.destination.id = dpcon->dpcon_id;
+       cfg.destination.priority = priority;
 
        if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_ATOMIC) {
                options |= DPNI_QUEUE_OPT_HOLD_ACTIVE;
@@ -2509,6 +2513,29 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
                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;
+               }
+       }
        RTE_LOG(INFO, PMD, "%s: netdev created\n", eth_dev->data->name);
        return 0;
 init_err: