bus/fslmc: improve debug log messages
[dpdk.git] / drivers / net / mlx5 / mlx5_vlan.c
index 3b9b771..36ffbba 100644 (file)
 #include <assert.h>
 #include <stdint.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
-#endif
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5.h"
@@ -87,7 +80,8 @@ vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
                --priv->vlan_filter_n;
                memmove(&priv->vlan_filter[i],
                        &priv->vlan_filter[i + 1],
-                       priv->vlan_filter_n - i);
+                       sizeof(priv->vlan_filter[i]) *
+                       (priv->vlan_filter_n - i));
                priv->vlan_filter[priv->vlan_filter_n] = 0;
        } else {
                assert(i == priv->vlan_filter_n);
@@ -144,20 +138,22 @@ static void
 priv_vlan_strip_queue_set(struct priv *priv, uint16_t idx, int on)
 {
        struct rxq *rxq = (*priv->rxqs)[idx];
-       struct ibv_exp_wq_attr mod;
+       struct rxq_ctrl *rxq_ctrl = container_of(rxq, struct rxq_ctrl, rxq);
+       struct ibv_wq_attr mod;
        uint16_t vlan_offloads =
-               (on ? IBV_EXP_RECEIVE_WQ_CVLAN_STRIP : 0) |
+               (on ? IBV_WQ_FLAGS_CVLAN_STRIPPING : 0) |
                0;
        int err;
 
        DEBUG("set VLAN offloads 0x%x for port %d queue %d",
              vlan_offloads, rxq->port_id, idx);
-       mod = (struct ibv_exp_wq_attr){
-               .attr_mask = IBV_EXP_WQ_ATTR_VLAN_OFFLOADS,
-               .vlan_offloads = vlan_offloads,
+       mod = (struct ibv_wq_attr){
+               .attr_mask = IBV_WQ_ATTR_FLAGS,
+               .flags_mask = IBV_WQ_FLAGS_CVLAN_STRIPPING,
+               .flags = vlan_offloads,
        };
 
-       err = ibv_exp_modify_wq(rxq->wq, &mod);
+       err = ibv_modify_wq(rxq_ctrl->wq, &mod);
        if (err) {
                ERROR("%p: failed to modified stripping mode: %s",
                      (void *)priv, strerror(err));