Skip to content

Commit 188d1f7

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/intel/e1000e/ethtool.c drivers/net/vmxnet3/vmxnet3_drv.c drivers/net/wireless/iwlwifi/dvm/tx.c net/ipv6/route.c The ipv6 route.c conflict is simple, just ignore the 'net' side change as we fixed the same problem in 'net-next' by eliminating cached neighbours from ipv6 routes. The e1000e conflict is an addition of a new statistic in the ethtool code, trivial. The vmxnet3 conflict is about one change in 'net' removing a guarding conditional, whilst in 'net-next' we had a netdev_info() conversion. The iwlwifi conflict is dealing with a WARN_ON() conversion in 'net-next' vs. a revert happening in 'net'. Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 577ae39 + bf414b3 commit 188d1f7

File tree

38 files changed

+291
-166
lines changed

38 files changed

+291
-166
lines changed

drivers/bcma/driver_chipcommon_nflash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int bcma_nflash_init(struct bcma_drv_cc *cc)
2121
struct bcma_bus *bus = cc->core->bus;
2222

2323
if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 &&
24-
cc->core->id.rev != 0x38) {
24+
cc->core->id.rev != 38) {
2525
bcma_err(bus, "NAND flash on unsupported board!\n");
2626
return -ENOTSUPP;
2727
}

drivers/net/bonding/bond_sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,7 @@ static ssize_t bonding_store_primary(struct device *d,
10531053
pr_info("%s: Setting primary slave to None.\n",
10541054
bond->dev->name);
10551055
bond->primary_slave = NULL;
1056+
memset(bond->params.primary, 0, sizeof(bond->params.primary));
10561057
bond_select_active_slave(bond);
10571058
goto out;
10581059
}

drivers/net/can/c_can/c_can.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,12 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface,
491491

492492
priv->write_reg(priv, C_CAN_IFACE(MASK1_REG, iface),
493493
IFX_WRITE_LOW_16BIT(mask));
494+
495+
/* According to C_CAN documentation, the reserved bit
496+
* in IFx_MASK2 register is fixed 1
497+
*/
494498
priv->write_reg(priv, C_CAN_IFACE(MASK2_REG, iface),
495-
IFX_WRITE_HIGH_16BIT(mask));
499+
IFX_WRITE_HIGH_16BIT(mask) | BIT(13));
496500

497501
priv->write_reg(priv, C_CAN_IFACE(ARB1_REG, iface),
498502
IFX_WRITE_LOW_16BIT(id));

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636

3737
#define DRV_VER "4.6.62.0u"
3838
#define DRV_NAME "be2net"
39-
#define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC"
40-
#define BE3_NAME "ServerEngines BladeEngine3 10Gbps NIC"
41-
#define OC_NAME "Emulex OneConnect 10Gbps NIC"
39+
#define BE_NAME "Emulex BladeEngine2"
40+
#define BE3_NAME "Emulex BladeEngine3"
41+
#define OC_NAME "Emulex OneConnect"
4242
#define OC_NAME_BE OC_NAME "(be3)"
4343
#define OC_NAME_LANCER OC_NAME "(Lancer)"
4444
#define OC_NAME_SH OC_NAME "(Skyhawk)"
45-
#define DRV_DESC "ServerEngines BladeEngine 10Gbps NIC Driver"
45+
#define DRV_DESC "Emulex OneConnect 10Gbps NIC Driver"
4646

4747
#define BE_VENDOR_ID 0x19a2
4848
#define EMULEX_VENDOR_ID 0x10df

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
MODULE_VERSION(DRV_VER);
2626
MODULE_DEVICE_TABLE(pci, be_dev_ids);
2727
MODULE_DESCRIPTION(DRV_DESC " " DRV_VER);
28-
MODULE_AUTHOR("ServerEngines Corporation");
28+
MODULE_AUTHOR("Emulex Corporation");
2929
MODULE_LICENSE("GPL");
3030

3131
static unsigned int num_vfs;

drivers/net/ethernet/via/via-rhine.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ static void rhine_tx(struct net_device *dev)
18121812
rp->tx_skbuff[entry]->len,
18131813
PCI_DMA_TODEVICE);
18141814
}
1815-
dev_kfree_skb_irq(rp->tx_skbuff[entry]);
1815+
dev_kfree_skb(rp->tx_skbuff[entry]);
18161816
rp->tx_skbuff[entry] = NULL;
18171817
entry = (++rp->dirty_tx) % TX_RING_SIZE;
18181818
}
@@ -2024,11 +2024,7 @@ static void rhine_slow_event_task(struct work_struct *work)
20242024
if (intr_status & IntrPCIErr)
20252025
netif_warn(rp, hw, dev, "PCI error\n");
20262026

2027-
napi_disable(&rp->napi);
2028-
rhine_irq_disable(rp);
2029-
/* Slow and safe. Consider __napi_schedule as a replacement ? */
2030-
napi_enable(&rp->napi);
2031-
napi_schedule(&rp->napi);
2027+
iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable);
20322028

20332029
out_unlock:
20342030
mutex_unlock(&rp->task_lock);

drivers/net/tun.c

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,12 @@ static void tun_flow_cleanup(unsigned long data)
298298
}
299299

300300
static void tun_flow_update(struct tun_struct *tun, u32 rxhash,
301-
u16 queue_index)
301+
struct tun_file *tfile)
302302
{
303303
struct hlist_head *head;
304304
struct tun_flow_entry *e;
305305
unsigned long delay = tun->ageing_time;
306+
u16 queue_index = tfile->queue_index;
306307

307308
if (!rxhash)
308309
return;
@@ -311,7 +312,9 @@ static void tun_flow_update(struct tun_struct *tun, u32 rxhash,
311312

312313
rcu_read_lock();
313314

314-
if (tun->numqueues == 1)
315+
/* We may get a very small possibility of OOO during switching, not
316+
* worth to optimize.*/
317+
if (tun->numqueues == 1 || tfile->detached)
315318
goto unlock;
316319

317320
e = tun_flow_find(head, rxhash);
@@ -411,21 +414,21 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
411414

412415
tun = rtnl_dereference(tfile->tun);
413416

414-
if (tun) {
417+
if (tun && !tfile->detached) {
415418
u16 index = tfile->queue_index;
416419
BUG_ON(index >= tun->numqueues);
417420
dev = tun->dev;
418421

419422
rcu_assign_pointer(tun->tfiles[index],
420423
tun->tfiles[tun->numqueues - 1]);
421-
rcu_assign_pointer(tfile->tun, NULL);
422424
ntfile = rtnl_dereference(tun->tfiles[index]);
423425
ntfile->queue_index = index;
424426

425427
--tun->numqueues;
426-
if (clean)
428+
if (clean) {
429+
rcu_assign_pointer(tfile->tun, NULL);
427430
sock_put(&tfile->sk);
428-
else
431+
} else
429432
tun_disable_queue(tun, tfile);
430433

431434
synchronize_net();
@@ -439,10 +442,13 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
439442
}
440443

441444
if (clean) {
442-
if (tun && tun->numqueues == 0 && tun->numdisabled == 0 &&
443-
!(tun->flags & TUN_PERSIST))
444-
if (tun->dev->reg_state == NETREG_REGISTERED)
445+
if (tun && tun->numqueues == 0 && tun->numdisabled == 0) {
446+
netif_carrier_off(tun->dev);
447+
448+
if (!(tun->flags & TUN_PERSIST) &&
449+
tun->dev->reg_state == NETREG_REGISTERED)
445450
unregister_netdevice(tun->dev);
451+
}
446452

447453
BUG_ON(!test_bit(SOCK_EXTERNALLY_ALLOCATED,
448454
&tfile->socket.flags));
@@ -470,6 +476,10 @@ static void tun_detach_all(struct net_device *dev)
470476
rcu_assign_pointer(tfile->tun, NULL);
471477
--tun->numqueues;
472478
}
479+
list_for_each_entry(tfile, &tun->disabled, next) {
480+
wake_up_all(&tfile->wq.wait);
481+
rcu_assign_pointer(tfile->tun, NULL);
482+
}
473483
BUG_ON(tun->numqueues != 0);
474484

475485
synchronize_net();
@@ -500,7 +510,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
500510
goto out;
501511

502512
err = -EINVAL;
503-
if (rtnl_dereference(tfile->tun))
513+
if (rtnl_dereference(tfile->tun) && !tfile->detached)
504514
goto out;
505515

506516
err = -EBUSY;
@@ -1203,7 +1213,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
12031213
tun->dev->stats.rx_packets++;
12041214
tun->dev->stats.rx_bytes += len;
12051215

1206-
tun_flow_update(tun, rxhash, tfile->queue_index);
1216+
tun_flow_update(tun, rxhash, tfile);
12071217
return total_len;
12081218
}
12091219

@@ -1662,10 +1672,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
16621672
device_create_file(&tun->dev->dev, &dev_attr_owner) ||
16631673
device_create_file(&tun->dev->dev, &dev_attr_group))
16641674
pr_err("Failed to create tun sysfs files\n");
1665-
1666-
netif_carrier_on(tun->dev);
16671675
}
16681676

1677+
netif_carrier_on(tun->dev);
1678+
16691679
tun_debug(KERN_INFO, tun, "tun_set_iff\n");
16701680

16711681
if (ifr->ifr_flags & IFF_NO_PI)
@@ -1817,7 +1827,7 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
18171827
ret = tun_attach(tun, file);
18181828
} else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {
18191829
tun = rtnl_dereference(tfile->tun);
1820-
if (!tun || !(tun->flags & TUN_TAP_MQ))
1830+
if (!tun || !(tun->flags & TUN_TAP_MQ) || tfile->detached)
18211831
ret = -EINVAL;
18221832
else
18231833
__tun_detach(tfile, false);

drivers/net/usb/qmi_wwan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ static const struct usb_device_id products[] = {
461461
{QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
462462
{QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
463463
{QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
464+
{QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
464465

465466
/* 4. Gobi 1000 devices */
466467
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */

drivers/net/usb/usbnet.c

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,12 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
380380
unsigned long lockflags;
381381
size_t size = dev->rx_urb_size;
382382

383+
/* prevent rx skb allocation when error ratio is high */
384+
if (test_bit(EVENT_RX_KILL, &dev->flags)) {
385+
usb_free_urb(urb);
386+
return -ENOLINK;
387+
}
388+
383389
skb = __netdev_alloc_skb_ip_align(dev->net, size, flags);
384390
if (!skb) {
385391
netif_dbg(dev, rx_err, dev->net, "no rx skb\n");
@@ -539,6 +545,17 @@ static void rx_complete (struct urb *urb)
539545
break;
540546
}
541547

548+
/* stop rx if packet error rate is high */
549+
if (++dev->pkt_cnt > 30) {
550+
dev->pkt_cnt = 0;
551+
dev->pkt_err = 0;
552+
} else {
553+
if (state == rx_cleanup)
554+
dev->pkt_err++;
555+
if (dev->pkt_err > 20)
556+
set_bit(EVENT_RX_KILL, &dev->flags);
557+
}
558+
542559
state = defer_bh(dev, skb, &dev->rxq, state);
543560

544561
if (urb) {
@@ -791,6 +808,11 @@ int usbnet_open (struct net_device *net)
791808
(dev->driver_info->flags & FLAG_FRAMING_AX) ? "ASIX" :
792809
"simple");
793810

811+
/* reset rx error state */
812+
dev->pkt_cnt = 0;
813+
dev->pkt_err = 0;
814+
clear_bit(EVENT_RX_KILL, &dev->flags);
815+
794816
// delay posting reads until we're fully open
795817
tasklet_schedule (&dev->bh);
796818
if (info->manage_power) {
@@ -1103,13 +1125,11 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
11031125
if (info->tx_fixup) {
11041126
skb = info->tx_fixup (dev, skb, GFP_ATOMIC);
11051127
if (!skb) {
1106-
if (netif_msg_tx_err(dev)) {
1107-
netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n");
1108-
goto drop;
1109-
} else {
1110-
/* cdc_ncm collected packet; waits for more */
1128+
/* packet collected; minidriver waiting for more */
1129+
if (info->flags & FLAG_MULTI_PACKET)
11111130
goto not_drop;
1112-
}
1131+
netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n");
1132+
goto drop;
11131133
}
11141134
}
11151135
length = skb->len;
@@ -1254,6 +1274,9 @@ static void usbnet_bh (unsigned long param)
12541274
}
12551275
}
12561276

1277+
/* restart RX again after disabling due to high error rate */
1278+
clear_bit(EVENT_RX_KILL, &dev->flags);
1279+
12571280
// waiting for all pending urbs to complete?
12581281
if (dev->wait) {
12591282
if ((dev->txq.qlen + dev->rxq.qlen + dev->done.qlen) == 0) {

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
150150
if (ret & 1) { /* Link is up. */
151151
netdev_info(adapter->netdev, "NIC Link is Up %d Mbps\n",
152152
adapter->link_speed);
153-
if (!netif_carrier_ok(adapter->netdev))
154-
netif_carrier_on(adapter->netdev);
153+
netif_carrier_on(adapter->netdev);
155154

156155
if (affectTxQueue) {
157156
for (i = 0; i < adapter->num_tx_queues; i++)
@@ -160,8 +159,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
160159
}
161160
} else {
162161
netdev_info(adapter->netdev, "NIC Link is Down\n");
163-
if (netif_carrier_ok(adapter->netdev))
164-
netif_carrier_off(adapter->netdev);
162+
netif_carrier_off(adapter->netdev);
165163

166164
if (affectTxQueue) {
167165
for (i = 0; i < adapter->num_tx_queues; i++)
@@ -3060,6 +3058,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
30603058
netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
30613059
netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues);
30623060

3061+
netif_carrier_off(netdev);
30633062
err = register_netdev(netdev);
30643063

30653064
if (err) {

0 commit comments

Comments
 (0)