Commit 41e544cd authored by Don Skidmore's avatar Don Skidmore Committed by Jeff Kirsher

ixgbevf: Add support for VF promiscuous mode

This patch extends the mailbox message to allow for VF promiscuous
mode support.
Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b3eb4e18
...@@ -464,6 +464,7 @@ enum ixgbevf_xcast_modes { ...@@ -464,6 +464,7 @@ enum ixgbevf_xcast_modes {
IXGBEVF_XCAST_MODE_NONE = 0, IXGBEVF_XCAST_MODE_NONE = 0,
IXGBEVF_XCAST_MODE_MULTI, IXGBEVF_XCAST_MODE_MULTI,
IXGBEVF_XCAST_MODE_ALLMULTI, IXGBEVF_XCAST_MODE_ALLMULTI,
IXGBEVF_XCAST_MODE_PROMISC,
}; };
extern const struct ixgbevf_info ixgbevf_82599_vf_info; extern const struct ixgbevf_info ixgbevf_82599_vf_info;
......
...@@ -1930,6 +1930,16 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev) ...@@ -1930,6 +1930,16 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev)
(flags & (IFF_BROADCAST | IFF_MULTICAST)) ? (flags & (IFF_BROADCAST | IFF_MULTICAST)) ?
IXGBEVF_XCAST_MODE_MULTI : IXGBEVF_XCAST_MODE_NONE; IXGBEVF_XCAST_MODE_MULTI : IXGBEVF_XCAST_MODE_NONE;
/* request the most inclusive mode we need */
if (flags & IFF_PROMISC)
xcast_mode = IXGBEVF_XCAST_MODE_PROMISC;
else if (flags & IFF_ALLMULTI)
xcast_mode = IXGBEVF_XCAST_MODE_ALLMULTI;
else if (flags & (IFF_BROADCAST | IFF_MULTICAST))
xcast_mode = IXGBEVF_XCAST_MODE_MULTI;
else
xcast_mode = IXGBEVF_XCAST_MODE_NONE;
spin_lock_bh(&adapter->mbx_lock); spin_lock_bh(&adapter->mbx_lock);
hw->mac.ops.update_xcast_mode(hw, xcast_mode); hw->mac.ops.update_xcast_mode(hw, xcast_mode);
...@@ -2071,7 +2081,8 @@ static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter) ...@@ -2071,7 +2081,8 @@ static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter)
static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter) static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter)
{ {
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
int api[] = { ixgbe_mbox_api_12, int api[] = { ixgbe_mbox_api_13,
ixgbe_mbox_api_12,
ixgbe_mbox_api_11, ixgbe_mbox_api_11,
ixgbe_mbox_api_10, ixgbe_mbox_api_10,
ixgbe_mbox_api_unknown }; ixgbe_mbox_api_unknown };
...@@ -2373,6 +2384,7 @@ static void ixgbevf_set_num_queues(struct ixgbevf_adapter *adapter) ...@@ -2373,6 +2384,7 @@ static void ixgbevf_set_num_queues(struct ixgbevf_adapter *adapter)
switch (hw->api_version) { switch (hw->api_version) {
case ixgbe_mbox_api_11: case ixgbe_mbox_api_11:
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13:
adapter->num_rx_queues = rss; adapter->num_rx_queues = rss;
adapter->num_tx_queues = rss; adapter->num_tx_queues = rss;
default: default:
...@@ -4117,6 +4129,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -4117,6 +4129,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
switch (adapter->hw.api_version) { switch (adapter->hw.api_version) {
case ixgbe_mbox_api_11: case ixgbe_mbox_api_11:
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13:
netdev->max_mtu = IXGBE_MAX_JUMBO_FRAME_SIZE - netdev->max_mtu = IXGBE_MAX_JUMBO_FRAME_SIZE -
(ETH_HLEN + ETH_FCS_LEN); (ETH_HLEN + ETH_FCS_LEN);
break; break;
......
...@@ -84,6 +84,7 @@ enum ixgbe_pfvf_api_rev { ...@@ -84,6 +84,7 @@ enum ixgbe_pfvf_api_rev {
ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */ ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */
ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */ ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */
ixgbe_mbox_api_12, /* API version 1.2, linux/freebsd VF driver */ ixgbe_mbox_api_12, /* API version 1.2, linux/freebsd VF driver */
ixgbe_mbox_api_13, /* API version 1.3, linux/freebsd VF driver */
/* This value should always be last */ /* This value should always be last */
ixgbe_mbox_api_unknown, /* indicates that API version is not known */ ixgbe_mbox_api_unknown, /* indicates that API version is not known */
}; };
......
...@@ -330,9 +330,14 @@ int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues) ...@@ -330,9 +330,14 @@ int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues)
* Thus return an error if API doesn't support RETA querying or querying * Thus return an error if API doesn't support RETA querying or querying
* is not supported for this device type. * is not supported for this device type.
*/ */
if (hw->api_version != ixgbe_mbox_api_12 || switch (hw->api_version) {
hw->mac.type >= ixgbe_mac_X550_vf) case ixgbe_mbox_api_13:
case ixgbe_mbox_api_12:
if (hw->mac.type >= ixgbe_mac_X550_vf)
break;
default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
}
msgbuf[0] = IXGBE_VF_GET_RETA; msgbuf[0] = IXGBE_VF_GET_RETA;
...@@ -391,9 +396,14 @@ int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key) ...@@ -391,9 +396,14 @@ int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key)
* Thus return an error if API doesn't support RSS Random Key retrieval * Thus return an error if API doesn't support RSS Random Key retrieval
* or if the operation is not supported for this device type. * or if the operation is not supported for this device type.
*/ */
if (hw->api_version != ixgbe_mbox_api_12 || switch (hw->api_version) {
hw->mac.type >= ixgbe_mac_X550_vf) case ixgbe_mbox_api_13:
case ixgbe_mbox_api_12:
if (hw->mac.type >= ixgbe_mac_X550_vf)
break;
default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
}
msgbuf[0] = IXGBE_VF_GET_RSS_KEY; msgbuf[0] = IXGBE_VF_GET_RSS_KEY;
err = hw->mbx.ops.write_posted(hw, msgbuf, 1); err = hw->mbx.ops.write_posted(hw, msgbuf, 1);
...@@ -545,6 +555,11 @@ static s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) ...@@ -545,6 +555,11 @@ static s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
switch (hw->api_version) { switch (hw->api_version) {
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
/* promisc introduced in 1.3 version */
if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
return -EOPNOTSUPP;
/* Fall threw */
case ixgbe_mbox_api_13:
break; break;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -884,6 +899,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, ...@@ -884,6 +899,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
switch (hw->api_version) { switch (hw->api_version) {
case ixgbe_mbox_api_11: case ixgbe_mbox_api_11:
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13:
break; break;
default: default:
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment