Skip to content

Commit b175293

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Always increment IPV4 ID field in encapsulated GSO packets, even when DF is set. Regression fix from Pravin B Shelar. 2) Fix per-net subsystem initialization in netfilter conntrack, otherwise we may access dynamically allocated memory before it is actually allocated. From Gao Feng. 3) Fix DMA buffer lengths in iwl3945 driver, from Stanislaw Gruszka. 4) Fix race between submission of sync vs async commands in mwifiex driver, from Amitkumar Karwar. 5) Add missing cancel of command timer in mwifiex driver, from Bing Zhao. 6) Missing SKB free in rtlwifi USB driver, from Jussi Kivilinna. 7) Thermal layer tries to use a genetlink multicast string that is longer than the 16 character limit. Fix it and add a BUG check to prevent this kind of thing from happening in the future. From Masatake YAMATO. 8) Fix many bugs in the handling of the teardown of L2TP connections, UDP encapsulation instances, and sockets. From Tom Parkin. 9) Missing socket release in IRDA, from Kees Cook. 10) Fix fec driver modular build, from Fabio Estevam. 11) Erroneous use of kfree() instead of free_netdev() in lantiq_etop, from Wei Yongjun. 12) Fix bugs in handling of queue numbers and steering rules in mlx4 driver, from Moshe Lazer, Hadar Hen Zion, and Or Gerlitz. 13) Some FOO_DIAG_MAX constants were defined off by one, fix from Andrey Vagin. 14) TCP segmentation deferral is unintentionally done too strongly, breaking ACK clocking. Fix from Eric Dumazet. 15) net_enable_timestamp() can legitimately be invoked from software interrupts, and in a way that is safe, so remove the WARN_ON(). Also from Eric Dumazet. 16) Fix use after free in VLANs, from Cong Wang. 17) Fix TCP slow start retransmit storms after SACK reneging, from Yuchung Cheng. 18) Unix socket release should mark a socket dead before NULL'ing out sock->sk, otherwise we can race. Fix from Paul Moore. 19) IPV6 addrconf code can try to free static memory, from Hong Zhiguo. 20) Fix register mis-programming, NULL pointer derefs, and wrong PHC clock frequency in IGB driver. From Lior LevyAlex Williamson, Jiri Benc, and Jeff Kirsher. 21) skb->ip_summed logic in pch_gbe driver is reversed, breaking packet forwarding. Fix from Veaceslav Falico. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits) ipv4: Fix ip-header identification for gso packets. bonding: remove already created master sysfs link on failure af_unix: dont send SCM_CREDENTIAL when dest socket is NULL pch_gbe: fix ip_summed checksum reporting on rx igb: fix PHC stopping on max freq igb: make sensor info static igb: SR-IOV init reordering igb: Fix null pointer dereference igb: fix i350 anti spoofing config ixgbevf: don't release the soft entries ipv6: fix bad free of addrconf_init_net unix: fix a race condition in unix_release() tcp: undo spurious timeout after SACK reneging bnx2x: fix assignment of signed expression to unsigned variable bridge: fix crash when set mac address of br interface 8021q: fix a potential use-after-free net: remove a WARN_ON() in net_enable_timestamp() tcp: preserve ACK clocking in TSO net: fix *_DIAG_MAX constants net/mlx4_core: Disallow releasing VF QPs which have steering rules ...
2 parents 5d53848 + 330305c commit b175293

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+540
-459
lines changed

Documentation/networking/ipvs-sysctl.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ amemthresh - INTEGER
1515
enabled and the variable is automatically set to 2, otherwise
1616
the strategy is disabled and the variable is set to 1.
1717

18+
backup_only - BOOLEAN
19+
0 - disabled (default)
20+
not 0 - enabled
21+
22+
If set, disable the director function while the server is
23+
in backup mode to avoid packet loops for DR/TUN methods.
24+
1825
conntrack - BOOLEAN
1926
0 - disabled (default)
2027
not 0 - enabled

drivers/bluetooth/ath3k.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ static struct usb_device_id ath3k_table[] = {
7373
{ USB_DEVICE(0x03F0, 0x311D) },
7474

7575
/* Atheros AR3012 with sflash firmware*/
76+
{ USB_DEVICE(0x0CF3, 0x0036) },
7677
{ USB_DEVICE(0x0CF3, 0x3004) },
7778
{ USB_DEVICE(0x0CF3, 0x3008) },
7879
{ USB_DEVICE(0x0CF3, 0x311D) },
80+
{ USB_DEVICE(0x0CF3, 0x817a) },
7981
{ USB_DEVICE(0x13d3, 0x3375) },
8082
{ USB_DEVICE(0x04CA, 0x3004) },
8183
{ USB_DEVICE(0x04CA, 0x3005) },
@@ -107,9 +109,11 @@ MODULE_DEVICE_TABLE(usb, ath3k_table);
107109
static struct usb_device_id ath3k_blist_tbl[] = {
108110

109111
/* Atheros AR3012 with sflash firmware*/
112+
{ USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
110113
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
111114
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
112115
{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
116+
{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
113117
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
114118
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
115119
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },

drivers/bluetooth/btusb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ static struct usb_device_id blacklist_table[] = {
131131
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
132132

133133
/* Atheros 3012 with sflash firmware */
134+
{ USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
134135
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
135136
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
136137
{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
138+
{ USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
137139
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
138140
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
139141
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },

drivers/net/bonding/bond_sysfs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ int bond_create_slave_symlinks(struct net_device *master,
183183
sprintf(linkname, "slave_%s", slave->name);
184184
ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
185185
linkname);
186+
187+
/* free the master link created earlier in case of error */
188+
if (ret)
189+
sysfs_remove_link(&(slave->dev.kobj), "master");
190+
186191
return ret;
187192

188193
}

drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,12 +2139,12 @@ static u8 bnx2x_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap)
21392139
break;
21402140
default:
21412141
BNX2X_ERR("Non valid capability ID\n");
2142-
rval = -EINVAL;
2142+
rval = 1;
21432143
break;
21442144
}
21452145
} else {
21462146
DP(BNX2X_MSG_DCB, "DCB disabled\n");
2147-
rval = -EINVAL;
2147+
rval = 1;
21482148
}
21492149

21502150
DP(BNX2X_MSG_DCB, "capid %d:%x\n", capid, *cap);
@@ -2170,12 +2170,12 @@ static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
21702170
break;
21712171
default:
21722172
BNX2X_ERR("Non valid TC-ID\n");
2173-
rval = -EINVAL;
2173+
rval = 1;
21742174
break;
21752175
}
21762176
} else {
21772177
DP(BNX2X_MSG_DCB, "DCB disabled\n");
2178-
rval = -EINVAL;
2178+
rval = 1;
21792179
}
21802180

21812181
return rval;
@@ -2188,7 +2188,7 @@ static int bnx2x_dcbnl_set_numtcs(struct net_device *netdev, int tcid, u8 num)
21882188
return -EINVAL;
21892189
}
21902190

2191-
static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
2191+
static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
21922192
{
21932193
struct bnx2x *bp = netdev_priv(netdev);
21942194
DP(BNX2X_MSG_DCB, "state = %d\n", bp->dcbx_local_feat.pfc.enabled);
@@ -2390,12 +2390,12 @@ static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev, int featid,
23902390
break;
23912391
default:
23922392
BNX2X_ERR("Non valid featrue-ID\n");
2393-
rval = -EINVAL;
2393+
rval = 1;
23942394
break;
23952395
}
23962396
} else {
23972397
DP(BNX2X_MSG_DCB, "DCB disabled\n");
2398-
rval = -EINVAL;
2398+
rval = 1;
23992399
}
24002400

24012401
return rval;
@@ -2431,12 +2431,12 @@ static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev, int featid,
24312431
break;
24322432
default:
24332433
BNX2X_ERR("Non valid featrue-ID\n");
2434-
rval = -EINVAL;
2434+
rval = 1;
24352435
break;
24362436
}
24372437
} else {
24382438
DP(BNX2X_MSG_DCB, "dcbnl call not valid\n");
2439-
rval = -EINVAL;
2439+
rval = 1;
24402440
}
24412441

24422442
return rval;

drivers/net/ethernet/freescale/fec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
13321332
static void fec_enet_free_buffers(struct net_device *ndev)
13331333
{
13341334
struct fec_enet_private *fep = netdev_priv(ndev);
1335-
int i;
1335+
unsigned int i;
13361336
struct sk_buff *skb;
13371337
struct bufdesc *bdp;
13381338

@@ -1356,7 +1356,7 @@ static void fec_enet_free_buffers(struct net_device *ndev)
13561356
static int fec_enet_alloc_buffers(struct net_device *ndev)
13571357
{
13581358
struct fec_enet_private *fep = netdev_priv(ndev);
1359-
int i;
1359+
unsigned int i;
13601360
struct sk_buff *skb;
13611361
struct bufdesc *bdp;
13621362

@@ -1598,7 +1598,7 @@ static int fec_enet_init(struct net_device *ndev)
15981598
struct fec_enet_private *fep = netdev_priv(ndev);
15991599
struct bufdesc *cbd_base;
16001600
struct bufdesc *bdp;
1601-
int i;
1601+
unsigned int i;
16021602

16031603
/* Allocate memory for buffer descriptors. */
16041604
cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma,

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ void fec_ptp_start_cyclecounter(struct net_device *ndev)
128128

129129
spin_unlock_irqrestore(&fep->tmreg_lock, flags);
130130
}
131+
EXPORT_SYMBOL(fec_ptp_start_cyclecounter);
131132

132133
/**
133134
* fec_ptp_adjfreq - adjust ptp cycle frequency
@@ -318,6 +319,7 @@ int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
318319
return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
319320
-EFAULT : 0;
320321
}
322+
EXPORT_SYMBOL(fec_ptp_ioctl);
321323

322324
/**
323325
* fec_time_keep - call timecounter_read every second to avoid timer overrun
@@ -383,3 +385,4 @@ void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev)
383385
pr_info("registered PHC device on %s\n", ndev->name);
384386
}
385387
}
388+
EXPORT_SYMBOL(fec_ptp_init);

drivers/net/ethernet/intel/igb/e1000_82575.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,27 +1818,32 @@ static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw)
18181818
**/
18191819
void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
18201820
{
1821-
u32 dtxswc;
1821+
u32 reg_val, reg_offset;
18221822

18231823
switch (hw->mac.type) {
18241824
case e1000_82576:
1825+
reg_offset = E1000_DTXSWC;
1826+
break;
18251827
case e1000_i350:
1826-
dtxswc = rd32(E1000_DTXSWC);
1827-
if (enable) {
1828-
dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
1829-
E1000_DTXSWC_VLAN_SPOOF_MASK);
1830-
/* The PF can spoof - it has to in order to
1831-
* support emulation mode NICs */
1832-
dtxswc ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
1833-
} else {
1834-
dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
1835-
E1000_DTXSWC_VLAN_SPOOF_MASK);
1836-
}
1837-
wr32(E1000_DTXSWC, dtxswc);
1828+
reg_offset = E1000_TXSWC;
18381829
break;
18391830
default:
1840-
break;
1831+
return;
1832+
}
1833+
1834+
reg_val = rd32(reg_offset);
1835+
if (enable) {
1836+
reg_val |= (E1000_DTXSWC_MAC_SPOOF_MASK |
1837+
E1000_DTXSWC_VLAN_SPOOF_MASK);
1838+
/* The PF can spoof - it has to in order to
1839+
* support emulation mode NICs
1840+
*/
1841+
reg_val ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
1842+
} else {
1843+
reg_val &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
1844+
E1000_DTXSWC_VLAN_SPOOF_MASK);
18411845
}
1846+
wr32(reg_offset, reg_val);
18421847
}
18431848

18441849
/**

drivers/net/ethernet/intel/igb/igb_hwmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <linux/pci.h>
4040

4141
#ifdef CONFIG_IGB_HWMON
42-
struct i2c_board_info i350_sensor_info = {
42+
static struct i2c_board_info i350_sensor_info = {
4343
I2C_BOARD_INFO("i350bb", (0Xf8 >> 1)),
4444
};
4545

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,8 +2542,8 @@ static void igb_probe_vfs(struct igb_adapter *adapter)
25422542
if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211))
25432543
return;
25442544

2545-
igb_enable_sriov(pdev, max_vfs);
25462545
pci_sriov_set_totalvfs(pdev, 7);
2546+
igb_enable_sriov(pdev, max_vfs);
25472547

25482548
#endif /* CONFIG_PCI_IOV */
25492549
}
@@ -2652,7 +2652,7 @@ static int igb_sw_init(struct igb_adapter *adapter)
26522652
if (max_vfs > 7) {
26532653
dev_warn(&pdev->dev,
26542654
"Maximum of 7 VFs per PF, using max\n");
2655-
adapter->vfs_allocated_count = 7;
2655+
max_vfs = adapter->vfs_allocated_count = 7;
26562656
} else
26572657
adapter->vfs_allocated_count = max_vfs;
26582658
if (adapter->vfs_allocated_count)

drivers/net/ethernet/intel/igb/igb_ptp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
740740
case e1000_82576:
741741
snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
742742
adapter->ptp_caps.owner = THIS_MODULE;
743-
adapter->ptp_caps.max_adj = 1000000000;
743+
adapter->ptp_caps.max_adj = 999999881;
744744
adapter->ptp_caps.n_ext_ts = 0;
745745
adapter->ptp_caps.pps = 0;
746746
adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82576;

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,17 @@ static int ixgbevf_request_msix_irqs(struct ixgbevf_adapter *adapter)
944944
free_irq(adapter->msix_entries[vector].vector,
945945
adapter->q_vector[vector]);
946946
}
947-
pci_disable_msix(adapter->pdev);
948-
kfree(adapter->msix_entries);
949-
adapter->msix_entries = NULL;
947+
/* This failure is non-recoverable - it indicates the system is
948+
* out of MSIX vector resources and the VF driver cannot run
949+
* without them. Set the number of msix vectors to zero
950+
* indicating that not enough can be allocated. The error
951+
* will be returned to the user indicating device open failed.
952+
* Any further attempts to force the driver to open will also
953+
* fail. The only way to recover is to unload the driver and
954+
* reload it again. If the system has recovered some MSIX
955+
* vectors then it may succeed.
956+
*/
957+
adapter->num_msix_vectors = 0;
950958
return err;
951959
}
952960

@@ -2572,6 +2580,15 @@ static int ixgbevf_open(struct net_device *netdev)
25722580
struct ixgbe_hw *hw = &adapter->hw;
25732581
int err;
25742582

2583+
/* A previous failure to open the device because of a lack of
2584+
* available MSIX vector resources may have reset the number
2585+
* of msix vectors variable to zero. The only way to recover
2586+
* is to unload/reload the driver and hope that the system has
2587+
* been able to recover some MSIX vector resources.
2588+
*/
2589+
if (!adapter->num_msix_vectors)
2590+
return -ENOMEM;
2591+
25752592
/* disallow open during test */
25762593
if (test_bit(__IXGBEVF_TESTING, &adapter->state))
25772594
return -EBUSY;
@@ -2628,7 +2645,6 @@ static int ixgbevf_open(struct net_device *netdev)
26282645

26292646
err_req_irq:
26302647
ixgbevf_down(adapter);
2631-
ixgbevf_free_irq(adapter);
26322648
err_setup_rx:
26332649
ixgbevf_free_all_rx_resources(adapter);
26342650
err_setup_tx:

drivers/net/ethernet/lantiq_etop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ ltq_etop_probe(struct platform_device *pdev)
769769
return 0;
770770

771771
err_free:
772-
kfree(dev);
772+
free_netdev(dev);
773773
err_out:
774774
return err;
775775
}

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,17 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
16371637
/* Flush multicast filter */
16381638
mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 1, MLX4_MCAST_CONFIG);
16391639

1640+
/* Remove flow steering rules for the port*/
1641+
if (mdev->dev->caps.steering_mode ==
1642+
MLX4_STEERING_MODE_DEVICE_MANAGED) {
1643+
ASSERT_RTNL();
1644+
list_for_each_entry_safe(flow, tmp_flow,
1645+
&priv->ethtool_list, list) {
1646+
mlx4_flow_detach(mdev->dev, flow->id);
1647+
list_del(&flow->list);
1648+
}
1649+
}
1650+
16401651
mlx4_en_destroy_drop_qp(priv);
16411652

16421653
/* Free TX Rings */
@@ -1657,17 +1668,6 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
16571668
if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN))
16581669
mdev->mac_removed[priv->port] = 1;
16591670

1660-
/* Remove flow steering rules for the port*/
1661-
if (mdev->dev->caps.steering_mode ==
1662-
MLX4_STEERING_MODE_DEVICE_MANAGED) {
1663-
ASSERT_RTNL();
1664-
list_for_each_entry_safe(flow, tmp_flow,
1665-
&priv->ethtool_list, list) {
1666-
mlx4_flow_detach(mdev->dev, flow->id);
1667-
list_del(&flow->list);
1668-
}
1669-
}
1670-
16711671
/* Free RX Rings */
16721672
for (i = 0; i < priv->rx_ring_num; i++) {
16731673
mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]);

drivers/net/ethernet/mellanox/mlx4/eq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ int mlx4_MAP_EQ_wrapper(struct mlx4_dev *dev, int slave,
771771
struct mlx4_slave_event_eq_info *event_eq =
772772
priv->mfunc.master.slave_state[slave].event_eq;
773773
u32 in_modifier = vhcr->in_modifier;
774-
u32 eqn = in_modifier & 0x1FF;
774+
u32 eqn = in_modifier & 0x3FF;
775775
u64 in_param = vhcr->in_param;
776776
int err = 0;
777777
int i;

0 commit comments

Comments
 (0)