summaryrefslogtreecommitdiff
path: root/drivers/net/vmxnet3
diff options
context:
space:
mode:
authorDavid Harton <dharton@cisco.com>2017-08-31 22:36:28 -0400
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-26 02:33:01 +0200
commit289ba0c0f52a6577fd324f4b47bbde58d17305be (patch)
tree74efafb109b78295bcd09c52100e61dbd4d3e783 /drivers/net/vmxnet3
parent6abd94d72ab5b6787391a823d246e0288bd3ace0 (diff)
downloaddpdk-next-eventdev-289ba0c0f52a6577fd324f4b47bbde58d17305be.zip
dpdk-next-eventdev-289ba0c0f52a6577fd324f4b47bbde58d17305be.tar.gz
dpdk-next-eventdev-289ba0c0f52a6577fd324f4b47bbde58d17305be.tar.xz
ethdev: allow returning error on VLAN offload ops
Some devices may not support or fail setting VLAN offload configuration based on dynamic circumstances so the vlan_offload_set_t vector is modified to return an int so the caller can determine success or not. rte_eth_dev_set_vlan_offload is updated to return the value provided by the vector when called along with restoring the original offload configs on failure. Existing vlan_offload_set_t vectors are modified to return an int. Majority of cases return 0 but a few that actually can fail now return their failure codes. Finally, a vlan_offload_set_t vector is added to virtio to facilitate dynamically turning VLAN strip on or off. Signed-off-by: David Harton <dharton@cisco.com> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethdev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 6f5cadf..6328464 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -100,7 +100,7 @@ static const uint32_t *
vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
uint16_t vid, int on);
-static void vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
+static int vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
static void vmxnet3_mac_addr_set(struct rte_eth_dev *dev,
struct ether_addr *mac_addr);
static void vmxnet3_interrupt_handler(void *param);
@@ -729,8 +729,10 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
devRead->rssConfDesc.confPA = hw->rss_confPA;
}
- vmxnet3_dev_vlan_offload_set(dev,
- ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
+ ret = vmxnet3_dev_vlan_offload_set(dev,
+ ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
+ if (ret)
+ return ret;
vmxnet3_write_mac(hw, dev->data->mac_addrs->addr_bytes);
@@ -1278,7 +1280,7 @@ vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vid, int on)
return 0;
}
-static void
+static int
vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
{
struct vmxnet3_hw *hw = dev->data->dev_private;
@@ -1304,6 +1306,8 @@ vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
VMXNET3_CMD_UPDATE_VLAN_FILTERS);
}
+
+ return 0;
}
static void