net/ice: enable flow redirect on switch
[dpdk.git] / drivers / net / dpaa2 / dpaa2_ethdev.c
index 848bb42..2cde55e 100644 (file)
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
+               DEV_RX_OFFLOAD_RSS_HASH |
                DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
@@ -128,8 +129,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);
@@ -1288,7 +1289,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
                return -EINVAL;
 
        if (frame_size > RTE_ETHER_MAX_LEN)
-               dev->data->dev_conf.rxmode.offloads &=
+               dev->data->dev_conf.rxmode.offloads |=
                                                DEV_RX_OFFLOAD_JUMBO_FRAME;
        else
                dev->data->dev_conf.rxmode.offloads &=
@@ -1326,8 +1327,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);
@@ -2006,7 +2007,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;
@@ -2014,7 +2015,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)
@@ -2026,11 +2027,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;