ethdev: allow returning error on VLAN offload ops
[dpdk.git] / drivers / net / nfp / nfp_net.c
index b2ad20e..8c1c1f0 100644 (file)
@@ -2067,7 +2067,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                if ((rxds->rxd.flags & PCIE_DESC_RX_VLAN) &&
                    (hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) {
                        mb->vlan_tci = rte_cpu_to_le_32(rxds->rxd.vlan);
-                       mb->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
+                       mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
                }
 
                /* Adding the mbuff to the mbuff array passed by the app */
@@ -2306,11 +2306,12 @@ xmit_end:
        return i;
 }
 
-static void
+static int
 nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 {
        uint32_t new_ctrl, update;
        struct nfp_net_hw *hw;
+       int ret;
 
        hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        new_ctrl = 0;
@@ -2331,14 +2332,15 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask)
                new_ctrl = hw->ctrl & ~NFP_NET_CFG_CTRL_RXVLAN;
 
        if (new_ctrl == 0)
-               return;
+               return 0;
 
        update = NFP_NET_CFG_UPDATE_GEN;
 
-       if (nfp_net_reconfig(hw, new_ctrl, update) < 0)
-               return;
+       ret = nfp_net_reconfig(hw, new_ctrl, update);
+       if (!ret)
+               hw->ctrl = new_ctrl;
 
-       hw->ctrl = new_ctrl;
+       return ret;
 }
 
 /* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device */