net/mlx: fix setting interface flags
[dpdk.git] / drivers / net / mlx5 / mlx5_vlan.c
index fa9e3b8..4719e69 100644 (file)
@@ -98,9 +98,10 @@ vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
                priv->vlan_filter[priv->vlan_filter_n] = vlan_id;
                ++priv->vlan_filter_n;
        }
-       /* Rehash MAC flows in all hash RX queues. */
+       /* Rehash flows in all hash RX queues. */
        priv_mac_addrs_disable(priv);
-       return priv_mac_addrs_enable(priv);
+       priv_special_flow_disable_all(priv);
+       return priv_rehash_flows(priv);
 }
 
 /**
@@ -143,7 +144,7 @@ static void
 priv_vlan_strip_queue_set(struct priv *priv, uint16_t idx, int on)
 {
        struct rxq *rxq = (*priv->rxqs)[idx];
-#ifdef HAVE_EXP_DEVICE_ATTR_VLAN_OFFLOADS
+       struct rxq_ctrl *rxq_ctrl = container_of(rxq, struct rxq_ctrl, rxq);
        struct ibv_exp_wq_attr mod;
        uint16_t vlan_offloads =
                (on ? IBV_EXP_RECEIVE_WQ_CVLAN_STRIP : 0) |
@@ -157,15 +158,13 @@ priv_vlan_strip_queue_set(struct priv *priv, uint16_t idx, int on)
                .vlan_offloads = vlan_offloads,
        };
 
-       err = ibv_exp_modify_wq(rxq->wq, &mod);
+       err = ibv_exp_modify_wq(rxq_ctrl->wq, &mod);
        if (err) {
                ERROR("%p: failed to modified stripping mode: %s",
                      (void *)priv, strerror(err));
                return;
        }
 
-#endif /* HAVE_EXP_DEVICE_ATTR_VLAN_OFFLOADS */
-
        /* Update related bits in RX queue. */
        rxq->vlan_strip = !!on;
 }
@@ -217,7 +216,7 @@ mlx5_vlan_offload_set(struct rte_eth_dev *dev, int mask)
        unsigned int i;
 
        if (mask & ETH_VLAN_STRIP_MASK) {
-               int hw_vlan_strip = dev->data->dev_conf.rxmode.hw_vlan_strip;
+               int hw_vlan_strip = !!dev->data->dev_conf.rxmode.hw_vlan_strip;
 
                if (!priv->hw_vlan_strip) {
                        ERROR("VLAN stripping is not supported");