Skip to content

Commit f40ede3

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix crash in ipvs tot_stats estimator, from Julian Anastasov. 2) Fix OOPS in nf_nat on netns removal, from Florian Westphal. 3) Really really really fix locking issues in slip and slcan tty write wakeups, from Tyler Hall. 4) Fix checksum offloading in fec driver, from Fugang Duan. 5) Off by one in BPF instruction limit test, from Kees Cook. 6) Need to clear all TSO capability flags when doing software TSO in tg3 driver, from Prashant Sreedharan. 7) Fix memory leak in vlan_reorder_header() error path, from Li RongQing. 8) Fix various bugs in xen-netfront and xen-netback multiqueue support, from David Vrabel and Wei Liu. 9) Fix deadlock in cxgb4 driver, from Li RongQing. 10) Prevent double free of no-cache DST entries, from Eric Dumazet. 11) Bad csum_start handling in skb_segment() leads to crashes when forwarding, from Tom Herbert. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (76 commits) net: fix setting csum_start in skb_segment() ipv4: fix dst race in sk_dst_get() net: filter: Use kcalloc/kmalloc_array to allocate arrays trivial: net: filter: Change kerneldoc parameter order trivial: net: filter: Fix typo in comment net: allwinner: emac: Add missing free_irq cxgb4: use dev_port to identify ports xen-netback: bookkeep number of active queues in our own module tg3: Change nvram command timeout value to 50ms cxgb4: Not need to hold the adap_rcu_lock lock when read adap_rcu_list be2net: fix qnq mode detection on VFs of: mdio: fixup of_phy_register_fixed_link parsing of new bindings at86rf230: fix irq setup net: phy: at803x: fix coccinelle warnings net/mlx4_core: Fix the error flow when probing with invalid VF configuration tulip: Poll link status more frequently for Comet chips net: huawei_cdc_ncm: increase command buffer size drivers: net: cpsw: fix dual EMAC stall when connected to same switch xen-netfront: recreate queues correctly when reconnecting xen-netfront: fix oops when disconnected from backend ...
2 parents ec71fea + de84372 commit f40ede3

Some content is hidden

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

68 files changed

+741
-366
lines changed

Documentation/ptp/testptp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1919
*/
20+
#define _GNU_SOURCE
2021
#include <errno.h>
2122
#include <fcntl.h>
2223
#include <inttypes.h>
@@ -46,12 +47,14 @@
4647
#define CLOCK_INVALID -1
4748
#endif
4849

49-
/* When glibc offers the syscall, this will go away. */
50+
/* clock_adjtime is not available in GLIBC < 2.14 */
51+
#if !__GLIBC_PREREQ(2, 14)
5052
#include <sys/syscall.h>
5153
static int clock_adjtime(clockid_t id, struct timex *tx)
5254
{
5355
return syscall(__NR_clock_adjtime, id, tx);
5456
}
57+
#endif
5558

5659
static clockid_t get_clockid(int fd)
5760
{

MAINTAINERS

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,14 +3189,6 @@ L: [email protected]
31893189
S: Maintained
31903190
F: drivers/scsi/eata_pio.*
31913191

3192-
EBTABLES
3193-
3194-
W: http://ebtables.sourceforge.net/
3195-
S: Orphan
3196-
F: include/linux/netfilter_bridge/ebt_*.h
3197-
F: include/uapi/linux/netfilter_bridge/ebt_*.h
3198-
F: net/bridge/netfilter/ebt*.c
3199-
32003192
EC100 MEDIA DRIVER
32013193
M: Antti Palosaari <[email protected]>
32023194
@@ -6105,12 +6097,11 @@ F: Documentation/networking/s2io.txt
61056097
F: Documentation/networking/vxge.txt
61066098
F: drivers/net/ethernet/neterion/
61076099

6108-
NETFILTER/IPTABLES
6100+
NETFILTER ({IP,IP6,ARP,EB,NF}TABLES)
61096101
M: Pablo Neira Ayuso <[email protected]>
61106102
M: Patrick McHardy <[email protected]>
61116103
M: Jozsef Kadlecsik <[email protected]>
61126104
6113-
61146105
61156106
W: http://www.netfilter.org/
61166107
W: http://www.iptables.org/

drivers/isdn/hisax/Kconfig

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config ISDN_DRV_HISAX
1616
also to the configuration option of the driver for your particular
1717
card, below.
1818

19-
if ISDN_DRV_HISAX!=n
19+
if ISDN_DRV_HISAX
2020

2121
comment "D-channel protocol features"
2222

@@ -348,10 +348,6 @@ config HISAX_ENTERNOW_PCI
348348
This enables HiSax support for the Formula-n enter:now PCI
349349
ISDN card.
350350

351-
endif
352-
353-
if ISDN_DRV_HISAX
354-
355351
config HISAX_DEBUG
356352
bool "HiSax debugging"
357353
help
@@ -420,11 +416,6 @@ config HISAX_FRITZ_PCIPNP
420416
(the latter also needs you to select "ISA Plug and Play support"
421417
from the menu "Plug and Play configuration")
422418

423-
config HISAX_AVM_A1_PCMCIA
424-
bool
425-
depends on HISAX_AVM_A1_CS
426-
default y
427-
428419
endif
429420

430421
endmenu

drivers/net/bonding/bond_main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,14 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
10251025
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
10261026
NETIF_F_HIGHDMA | NETIF_F_LRO)
10271027

1028+
#define BOND_ENC_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
1029+
NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL)
1030+
10281031
static void bond_compute_features(struct bonding *bond)
10291032
{
10301033
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
10311034
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
1035+
netdev_features_t enc_features = BOND_ENC_FEATURES;
10321036
struct net_device *bond_dev = bond->dev;
10331037
struct list_head *iter;
10341038
struct slave *slave;
@@ -1044,6 +1048,9 @@ static void bond_compute_features(struct bonding *bond)
10441048
vlan_features = netdev_increment_features(vlan_features,
10451049
slave->dev->vlan_features, BOND_VLAN_FEATURES);
10461050

1051+
enc_features = netdev_increment_features(enc_features,
1052+
slave->dev->hw_enc_features,
1053+
BOND_ENC_FEATURES);
10471054
dst_release_flag &= slave->dev->priv_flags;
10481055
if (slave->dev->hard_header_len > max_hard_header_len)
10491056
max_hard_header_len = slave->dev->hard_header_len;
@@ -1054,6 +1061,7 @@ static void bond_compute_features(struct bonding *bond)
10541061

10551062
done:
10561063
bond_dev->vlan_features = vlan_features;
1064+
bond_dev->hw_enc_features = enc_features;
10571065
bond_dev->hard_header_len = max_hard_header_len;
10581066
bond_dev->gso_max_segs = gso_max_segs;
10591067
netif_set_gso_max_size(bond_dev, gso_max_size);
@@ -3975,6 +3983,7 @@ void bond_setup(struct net_device *bond_dev)
39753983
NETIF_F_HW_VLAN_CTAG_FILTER;
39763984

39773985
bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
3986+
bond_dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
39783987
bond_dev->features |= bond_dev->hw_features;
39793988
}
39803989

drivers/net/can/slcan.c

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <linux/delay.h>
5353
#include <linux/init.h>
5454
#include <linux/kernel.h>
55+
#include <linux/workqueue.h>
5556
#include <linux/can.h>
5657
#include <linux/can/skb.h>
5758

@@ -85,6 +86,7 @@ struct slcan {
8586
struct tty_struct *tty; /* ptr to TTY structure */
8687
struct net_device *dev; /* easy for intr handling */
8788
spinlock_t lock;
89+
struct work_struct tx_work; /* Flushes transmit buffer */
8890

8991
/* These are pointers to the malloc()ed frame buffers. */
9092
unsigned char rbuff[SLC_MTU]; /* receiver buffer */
@@ -309,36 +311,46 @@ static void slc_encaps(struct slcan *sl, struct can_frame *cf)
309311
sl->dev->stats.tx_bytes += cf->can_dlc;
310312
}
311313

312-
/*
313-
* Called by the driver when there's room for more data. If we have
314-
* more packets to send, we send them here.
315-
*/
316-
static void slcan_write_wakeup(struct tty_struct *tty)
314+
/* Write out any remaining transmit buffer. Scheduled when tty is writable */
315+
static void slcan_transmit(struct work_struct *work)
317316
{
317+
struct slcan *sl = container_of(work, struct slcan, tx_work);
318318
int actual;
319-
struct slcan *sl = (struct slcan *) tty->disc_data;
320319

320+
spin_lock_bh(&sl->lock);
321321
/* First make sure we're connected. */
322-
if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev))
322+
if (!sl->tty || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) {
323+
spin_unlock_bh(&sl->lock);
323324
return;
325+
}
324326

325-
spin_lock_bh(&sl->lock);
326327
if (sl->xleft <= 0) {
327328
/* Now serial buffer is almost free & we can start
328329
* transmission of another packet */
329330
sl->dev->stats.tx_packets++;
330-
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
331+
clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
331332
spin_unlock_bh(&sl->lock);
332333
netif_wake_queue(sl->dev);
333334
return;
334335
}
335336

336-
actual = tty->ops->write(tty, sl->xhead, sl->xleft);
337+
actual = sl->tty->ops->write(sl->tty, sl->xhead, sl->xleft);
337338
sl->xleft -= actual;
338339
sl->xhead += actual;
339340
spin_unlock_bh(&sl->lock);
340341
}
341342

343+
/*
344+
* Called by the driver when there's room for more data.
345+
* Schedule the transmit.
346+
*/
347+
static void slcan_write_wakeup(struct tty_struct *tty)
348+
{
349+
struct slcan *sl = tty->disc_data;
350+
351+
schedule_work(&sl->tx_work);
352+
}
353+
342354
/* Send a can_frame to a TTY queue. */
343355
static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev)
344356
{
@@ -528,6 +540,7 @@ static struct slcan *slc_alloc(dev_t line)
528540
sl->magic = SLCAN_MAGIC;
529541
sl->dev = dev;
530542
spin_lock_init(&sl->lock);
543+
INIT_WORK(&sl->tx_work, slcan_transmit);
531544
slcan_devs[i] = dev;
532545

533546
return sl;
@@ -626,8 +639,12 @@ static void slcan_close(struct tty_struct *tty)
626639
if (!sl || sl->magic != SLCAN_MAGIC || sl->tty != tty)
627640
return;
628641

642+
spin_lock_bh(&sl->lock);
629643
tty->disc_data = NULL;
630644
sl->tty = NULL;
645+
spin_unlock_bh(&sl->lock);
646+
647+
flush_work(&sl->tx_work);
631648

632649
/* Flush network side */
633650
unregister_netdev(sl->dev);

drivers/net/ethernet/allwinner/sun4i-emac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ static int emac_open(struct net_device *dev)
736736

737737
ret = emac_mdio_probe(dev);
738738
if (ret < 0) {
739+
free_irq(dev->irq, dev);
739740
netdev_err(dev, "cannot probe MDIO bus\n");
740741
return ret;
741742
}

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,15 +3224,15 @@ static int tg3_nvram_read_using_eeprom(struct tg3 *tp,
32243224
return 0;
32253225
}
32263226

3227-
#define NVRAM_CMD_TIMEOUT 100
3227+
#define NVRAM_CMD_TIMEOUT 5000
32283228

32293229
static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd)
32303230
{
32313231
int i;
32323232

32333233
tw32(NVRAM_CMD, nvram_cmd);
32343234
for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) {
3235-
udelay(10);
3235+
usleep_range(10, 40);
32363236
if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
32373237
udelay(10);
32383238
break;
@@ -7854,8 +7854,8 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
78547854
netif_wake_queue(tp->dev);
78557855
}
78567856

7857-
segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO);
7858-
if (IS_ERR(segs))
7857+
segs = skb_gso_segment(skb, tp->dev->features & ~(NETIF_F_TSO | NETIF_F_TSO6));
7858+
if (IS_ERR(segs) || !segs)
78597859
goto tg3_tso_bug_end;
78607860

78617861
do {

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4057,22 +4057,19 @@ int cxgb4_unregister_uld(enum cxgb4_uld type)
40574057
EXPORT_SYMBOL(cxgb4_unregister_uld);
40584058

40594059
/* Check if netdev on which event is occured belongs to us or not. Return
4060-
* suceess (1) if it belongs otherwise failure (0).
4060+
* success (true) if it belongs otherwise failure (false).
4061+
* Called with rcu_read_lock() held.
40614062
*/
4062-
static int cxgb4_netdev(struct net_device *netdev)
4063+
static bool cxgb4_netdev(const struct net_device *netdev)
40634064
{
40644065
struct adapter *adap;
40654066
int i;
40664067

4067-
spin_lock(&adap_rcu_lock);
40684068
list_for_each_entry_rcu(adap, &adap_rcu_list, rcu_node)
40694069
for (i = 0; i < MAX_NPORTS; i++)
4070-
if (adap->port[i] == netdev) {
4071-
spin_unlock(&adap_rcu_lock);
4072-
return 1;
4073-
}
4074-
spin_unlock(&adap_rcu_lock);
4075-
return 0;
4070+
if (adap->port[i] == netdev)
4071+
return true;
4072+
return false;
40764073
}
40774074

40784075
static int clip_add(struct net_device *event_dev, struct inet6_ifaddr *ifa,
@@ -6396,6 +6393,7 @@ static void remove_one(struct pci_dev *pdev)
63966393
adapter->flags &= ~DEV_ENABLED;
63976394
}
63986395
pci_release_regions(pdev);
6396+
synchronize_rcu();
63996397
kfree(adapter);
64006398
} else
64016399
pci_release_regions(pdev);

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3962,6 +3962,7 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf)
39623962
p->lport = j;
39633963
p->rss_size = rss_size;
39643964
memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN);
3965+
adap->port[i]->dev_port = j;
39653966

39663967
ret = ntohl(c.u.info.lstatus_to_modtype);
39673968
p->mdio_addr = (ret & FW_PORT_CMD_MDIOCAP) ?

drivers/net/ethernet/dec/tulip/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void comet_timer(unsigned long data)
158158
{
159159
struct net_device *dev = (struct net_device *)data;
160160
struct tulip_private *tp = netdev_priv(dev);
161-
int next_tick = 60*HZ;
161+
int next_tick = 2*HZ;
162162

163163
if (tulip_debug > 1)
164164
netdev_dbg(dev, "Comet link status %04x partner capability %04x\n",

drivers/net/ethernet/emulex/benet/be.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,7 @@ static inline u16 be_max_qs(struct be_adapter *adapter)
557557
#define be_pvid_tagging_enabled(adapter) (adapter->pvid)
558558

559559
/* Is BE in QNQ multi-channel mode */
560-
#define be_is_qnq_mode(adapter) (adapter->mc_type == FLEX10 || \
561-
adapter->mc_type == vNIC1 || \
562-
adapter->mc_type == UFP)
560+
#define be_is_qnq_mode(adapter) (adapter->function_mode & QNQ_MODE)
563561

564562
#define lancer_chip(adapter) (adapter->pdev->device == OC_DEVICE_ID3 || \
565563
adapter->pdev->device == OC_DEVICE_ID4)

drivers/net/ethernet/emulex/benet/be_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ struct be_cmd_resp_modify_eq_delay {
10911091
* based on the skew/IPL.
10921092
*/
10931093
#define RDMA_ENABLED 0x4
1094-
#define FLEX10_MODE 0x400
1094+
#define QNQ_MODE 0x400
10951095
#define VNIC_MODE 0x20000
10961096
#define UMC_ENABLED 0x1000000
10971097
struct be_cmd_req_query_fw_cfg {

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,9 +3254,9 @@ static int be_vf_setup(struct be_adapter *adapter)
32543254

32553255
static u8 be_convert_mc_type(u32 function_mode)
32563256
{
3257-
if (function_mode & VNIC_MODE && function_mode & FLEX10_MODE)
3257+
if (function_mode & VNIC_MODE && function_mode & QNQ_MODE)
32583258
return vNIC1;
3259-
else if (function_mode & FLEX10_MODE)
3259+
else if (function_mode & QNQ_MODE)
32603260
return FLEX10;
32613261
else if (function_mode & VNIC_MODE)
32623262
return vNIC2;

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ static void *swap_buffer(void *bufaddr, int len)
320320
return bufaddr;
321321
}
322322

323+
static inline bool is_ipv4_pkt(struct sk_buff *skb)
324+
{
325+
return skb->protocol == htons(ETH_P_IP) && ip_hdr(skb)->version == 4;
326+
}
327+
323328
static int
324329
fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
325330
{
@@ -330,7 +335,8 @@ fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
330335
if (unlikely(skb_cow_head(skb, 0)))
331336
return -1;
332337

333-
ip_hdr(skb)->check = 0;
338+
if (is_ipv4_pkt(skb))
339+
ip_hdr(skb)->check = 0;
334340
*(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0;
335341

336342
return 0;

drivers/net/ethernet/marvell/skge.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4199,6 +4199,13 @@ static struct dmi_system_id skge_32bit_dma_boards[] = {
41994199
DMI_MATCH(DMI_BOARD_NAME, "P5NSLI")
42004200
},
42014201
},
4202+
{
4203+
.ident = "FUJITSU SIEMENS A8NE-FM",
4204+
.matches = {
4205+
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
4206+
DMI_MATCH(DMI_BOARD_NAME, "A8NE-FM")
4207+
},
4208+
},
42024209
{}
42034210
};
42044211

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,8 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data)
24392439
(num_vfs_argc > 1 || probe_vfs_argc > 1)) {
24402440
mlx4_err(dev,
24412441
"Invalid syntax of num_vfs/probe_vfs with IB port - single port VFs syntax is only supported when all ports are configured as ethernet\n");
2442-
goto err_close;
2442+
err = -EINVAL;
2443+
goto err_master_mfunc;
24432444
}
24442445
for (i = 0; i < sizeof(nvfs)/sizeof(nvfs[0]); i++) {
24452446
unsigned j;

0 commit comments

Comments
 (0)