提交 be1b6e8b 编写于 作者: D David S. Miller

Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2018-01-24

This series contains updates to fm10k only.

Alex fixes MACVLAN offload for fm10k, where we were not seeing unicast
packets being received because we did not correctly configure the
default VLAN ID for the port and defaulting to 0.

Jake cleans up unnecessary parenthesis in a couple of "if" statements.
Fixed the driver to stop adding VLAN 0 into the VLAN table, since it
would cause the VLAN table to be inconsistent between the PF and VF.
Also fixed an issue where we were assuming that VLAN 1 is enabled when
the default VLAN ID is not set, so resolve by not requesting any filters
for the default_vid if it has not yet been assigned.

Ngai fixes an issue which was generating a dmesg regarding unbale to
kill a particular VLAN ID for the device.  This is due to
ndo_vlan_rx_kill_vid() exits with an error and the handler for this ndo
is fm10k_update_vid() which exits prematurely under PF VLAN management.
So to resolve, we must check the VLAN update action type before exiting
fm10k_update_vid(), and act appropriately based on the action type.
Also corrected code comment typos.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -353,7 +353,7 @@ int fm10k_iov_resume(struct pci_dev *pdev) ...@@ -353,7 +353,7 @@ int fm10k_iov_resume(struct pci_dev *pdev)
struct fm10k_vf_info *vf_info = &iov_data->vf_info[i]; struct fm10k_vf_info *vf_info = &iov_data->vf_info[i];
/* allocate all but the last GLORT to the VFs */ /* allocate all but the last GLORT to the VFs */
if (i == ((~hw->mac.dglort_map) >> FM10K_DGLORTMAP_MASK_SHIFT)) if (i == (~hw->mac.dglort_map >> FM10K_DGLORTMAP_MASK_SHIFT))
break; break;
/* assign GLORT to VF, and restrict it to multicast */ /* assign GLORT to VF, and restrict it to multicast */
...@@ -511,7 +511,7 @@ int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs) ...@@ -511,7 +511,7 @@ int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs)
return err; return err;
/* allocate VFs if not already allocated */ /* allocate VFs if not already allocated */
if (num_vfs && (num_vfs != current_vfs)) { if (num_vfs && num_vfs != current_vfs) {
/* Disable completer abort error reporting as /* Disable completer abort error reporting as
* the VFs can trigger this any time they read a queue * the VFs can trigger this any time they read a queue
* that they don't own. * that they don't own.
......
...@@ -934,8 +934,12 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) ...@@ -934,8 +934,12 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
if (vid >= VLAN_N_VID) if (vid >= VLAN_N_VID)
return -EINVAL; return -EINVAL;
/* Verify we have permission to add VLANs */ /* Verify that we have permission to add VLANs. If this is a request
if (hw->mac.vlan_override) * to remove a VLAN, we still want to allow the user to remove the
* VLAN device. In that case, we need to clear the bit in the
* active_vlans bitmask.
*/
if (set && hw->mac.vlan_override)
return -EACCES; return -EACCES;
/* update active_vlans bitmask */ /* update active_vlans bitmask */
...@@ -954,6 +958,12 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) ...@@ -954,6 +958,12 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
rx_ring->vid &= ~FM10K_VLAN_CLEAR; rx_ring->vid &= ~FM10K_VLAN_CLEAR;
} }
/* If our VLAN has been overridden, there is no reason to send VLAN
* removal requests as they will be silently ignored.
*/
if (hw->mac.vlan_override)
return 0;
/* Do not remove default VLAN ID related entries from VLAN and MAC /* Do not remove default VLAN ID related entries from VLAN and MAC
* tables * tables
*/ */
...@@ -1040,14 +1050,13 @@ static int __fm10k_uc_sync(struct net_device *dev, ...@@ -1040,14 +1050,13 @@ static int __fm10k_uc_sync(struct net_device *dev,
const unsigned char *addr, bool sync) const unsigned char *addr, bool sync)
{ {
struct fm10k_intfc *interface = netdev_priv(dev); struct fm10k_intfc *interface = netdev_priv(dev);
struct fm10k_hw *hw = &interface->hw;
u16 vid, glort = interface->glort; u16 vid, glort = interface->glort;
s32 err; s32 err;
if (!is_valid_ether_addr(addr)) if (!is_valid_ether_addr(addr))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
for (vid = hw->mac.default_vid ? fm10k_find_next_vlan(interface, 0) : 1; for (vid = fm10k_find_next_vlan(interface, 0);
vid < VLAN_N_VID; vid < VLAN_N_VID;
vid = fm10k_find_next_vlan(interface, vid)) { vid = fm10k_find_next_vlan(interface, vid)) {
err = fm10k_queue_mac_request(interface, glort, err = fm10k_queue_mac_request(interface, glort,
...@@ -1106,14 +1115,13 @@ static int __fm10k_mc_sync(struct net_device *dev, ...@@ -1106,14 +1115,13 @@ static int __fm10k_mc_sync(struct net_device *dev,
const unsigned char *addr, bool sync) const unsigned char *addr, bool sync)
{ {
struct fm10k_intfc *interface = netdev_priv(dev); struct fm10k_intfc *interface = netdev_priv(dev);
struct fm10k_hw *hw = &interface->hw;
u16 vid, glort = interface->glort; u16 vid, glort = interface->glort;
s32 err; s32 err;
if (!is_multicast_ether_addr(addr)) if (!is_multicast_ether_addr(addr))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
for (vid = hw->mac.default_vid ? fm10k_find_next_vlan(interface, 0) : 1; for (vid = fm10k_find_next_vlan(interface, 0);
vid < VLAN_N_VID; vid < VLAN_N_VID;
vid = fm10k_find_next_vlan(interface, vid)) { vid = fm10k_find_next_vlan(interface, vid)) {
err = fm10k_queue_mac_request(interface, glort, err = fm10k_queue_mac_request(interface, glort,
...@@ -1157,10 +1165,12 @@ static void fm10k_set_rx_mode(struct net_device *dev) ...@@ -1157,10 +1165,12 @@ static void fm10k_set_rx_mode(struct net_device *dev)
/* update xcast mode first, but only if it changed */ /* update xcast mode first, but only if it changed */
if (interface->xcast_mode != xcast_mode) { if (interface->xcast_mode != xcast_mode) {
/* update VLAN table */ /* update VLAN table when entering promiscuous mode */
if (xcast_mode == FM10K_XCAST_MODE_PROMISC) if (xcast_mode == FM10K_XCAST_MODE_PROMISC)
fm10k_queue_vlan_request(interface, FM10K_VLAN_ALL, fm10k_queue_vlan_request(interface, FM10K_VLAN_ALL,
0, true); 0, true);
/* clear VLAN table when exiting promiscuous mode */
if (interface->xcast_mode == FM10K_XCAST_MODE_PROMISC) if (interface->xcast_mode == FM10K_XCAST_MODE_PROMISC)
fm10k_clear_unused_vlans(interface); fm10k_clear_unused_vlans(interface);
...@@ -1182,9 +1192,10 @@ static void fm10k_set_rx_mode(struct net_device *dev) ...@@ -1182,9 +1192,10 @@ static void fm10k_set_rx_mode(struct net_device *dev)
void fm10k_restore_rx_state(struct fm10k_intfc *interface) void fm10k_restore_rx_state(struct fm10k_intfc *interface)
{ {
struct fm10k_l2_accel *l2_accel = interface->l2_accel;
struct net_device *netdev = interface->netdev; struct net_device *netdev = interface->netdev;
struct fm10k_hw *hw = &interface->hw; struct fm10k_hw *hw = &interface->hw;
int xcast_mode; int xcast_mode, i;
u16 vid, glort; u16 vid, glort;
/* record glort for this interface */ /* record glort for this interface */
...@@ -1211,11 +1222,8 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface) ...@@ -1211,11 +1222,8 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)
fm10k_queue_vlan_request(interface, FM10K_VLAN_ALL, 0, fm10k_queue_vlan_request(interface, FM10K_VLAN_ALL, 0,
xcast_mode == FM10K_XCAST_MODE_PROMISC); xcast_mode == FM10K_XCAST_MODE_PROMISC);
/* Add filter for VLAN 0 */
fm10k_queue_vlan_request(interface, 0, 0, true);
/* update table with current entries */ /* update table with current entries */
for (vid = hw->mac.default_vid ? fm10k_find_next_vlan(interface, 0) : 1; for (vid = fm10k_find_next_vlan(interface, 0);
vid < VLAN_N_VID; vid < VLAN_N_VID;
vid = fm10k_find_next_vlan(interface, vid)) { vid = fm10k_find_next_vlan(interface, vid)) {
fm10k_queue_vlan_request(interface, vid, 0, true); fm10k_queue_vlan_request(interface, vid, 0, true);
...@@ -1234,6 +1242,24 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface) ...@@ -1234,6 +1242,24 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)
__dev_uc_sync(netdev, fm10k_uc_sync, fm10k_uc_unsync); __dev_uc_sync(netdev, fm10k_uc_sync, fm10k_uc_unsync);
__dev_mc_sync(netdev, fm10k_mc_sync, fm10k_mc_unsync); __dev_mc_sync(netdev, fm10k_mc_sync, fm10k_mc_unsync);
/* synchronize macvlan addresses */
if (l2_accel) {
for (i = 0; i < l2_accel->size; i++) {
struct net_device *sdev = l2_accel->macvlan[i];
if (!sdev)
continue;
glort = l2_accel->dglort + 1 + i;
hw->mac.ops.update_xcast_mode(hw, glort,
FM10K_XCAST_MODE_MULTI);
fm10k_queue_mac_request(interface, glort,
sdev->dev_addr,
hw->mac.default_vid, true);
}
}
fm10k_mbx_unlock(interface); fm10k_mbx_unlock(interface);
/* record updated xcast mode state */ /* record updated xcast mode state */
...@@ -1490,7 +1516,7 @@ static void *fm10k_dfwd_add_station(struct net_device *dev, ...@@ -1490,7 +1516,7 @@ static void *fm10k_dfwd_add_station(struct net_device *dev,
hw->mac.ops.update_xcast_mode(hw, glort, hw->mac.ops.update_xcast_mode(hw, glort,
FM10K_XCAST_MODE_MULTI); FM10K_XCAST_MODE_MULTI);
fm10k_queue_mac_request(interface, glort, sdev->dev_addr, fm10k_queue_mac_request(interface, glort, sdev->dev_addr,
0, true); hw->mac.default_vid, true);
} }
fm10k_mbx_unlock(interface); fm10k_mbx_unlock(interface);
...@@ -1530,7 +1556,7 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv) ...@@ -1530,7 +1556,7 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)
hw->mac.ops.update_xcast_mode(hw, glort, hw->mac.ops.update_xcast_mode(hw, glort,
FM10K_XCAST_MODE_NONE); FM10K_XCAST_MODE_NONE);
fm10k_queue_mac_request(interface, glort, sdev->dev_addr, fm10k_queue_mac_request(interface, glort, sdev->dev_addr,
0, false); hw->mac.default_vid, false);
} }
fm10k_mbx_unlock(interface); fm10k_mbx_unlock(interface);
......
...@@ -866,7 +866,7 @@ static s32 fm10k_iov_assign_default_mac_vlan_pf(struct fm10k_hw *hw, ...@@ -866,7 +866,7 @@ static s32 fm10k_iov_assign_default_mac_vlan_pf(struct fm10k_hw *hw,
/* Determine correct default VLAN ID. The FM10K_VLAN_OVERRIDE bit is /* Determine correct default VLAN ID. The FM10K_VLAN_OVERRIDE bit is
* used here to indicate to the VF that it will not have privilege to * used here to indicate to the VF that it will not have privilege to
* write VLAN_TABLE. All policy is enforced on the PF but this allows * write VLAN_TABLE. All policy is enforced on the PF but this allows
* the VF to correctly report errors to userspace rqeuests. * the VF to correctly report errors to userspace requests.
*/ */
if (vf_info->pf_vid) if (vf_info->pf_vid)
vf_vid = vf_info->pf_vid | FM10K_VLAN_OVERRIDE; vf_vid = vf_info->pf_vid | FM10K_VLAN_OVERRIDE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册