Skip to content

Commit ef7f8ce

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Frag and UDP handling fixes in i40e driver, from Amritha Nambiar and Alexander Duyck. 2) Undo unintentional UAPI change in netfilter conntrack, from Florian Westphal. 3) Revert a change to how error codes are returned from dev_get_valid_name(), it broke some apps. 4) Cannot cache routes for ipv6 tunnels in the tunnel is ipv4/ipv6 dual-stack. From Eli Cooper. 5) Fix missed PMTU updates in geneve, from Xin Long. 6) Cure double free in macvlan, from Gao Feng. 7) Fix heap out-of-bounds write in rds_message_alloc_sgs(), from Mohamed Ghannam. 8) FEC bug fixes from FUgang Duan (mis-accounting of dev_id, missed deferral of probe when the regulator is not ready yet). 9) Missing DMA mapping error checks in 3c59x, from Neil Horman. 10) Turn off Broadcom tags for some b53 switches, from Florian Fainelli. 11) Fix OOPS when get_target_net() is passed an SKB whose NETLINK_CB() isn't initialized. From Andrei Vagin. 12) Fix crashes in fib6_add(), from Wei Wang. 13) PMTU bug fixes in SCTP from Marcelo Ricardo Leitner. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (56 commits) sh_eth: fix TXALCR1 offsets mdio-sun4i: Fix a memory leak phylink: mark expected switch fall-throughs in phylink_mii_ioctl sctp: fix the handling of ICMP Frag Needed for too small MTUs sctp: do not retransmit upon FragNeeded if PMTU discovery is disabled xen-netfront: enable device after manual module load bnxt_en: Fix the 'Invalid VF' id check in bnxt_vf_ndo_prep routine. bnxt_en: Fix population of flow_type in bnxt_hwrm_cfa_flow_alloc() sh_eth: fix SH7757 GEther initialization net: fec: free/restore resource in related probe error pathes uapi/if_ether.h: prevent redefinition of struct ethhdr ipv6: fix general protection fault in fib6_add() RDS: null pointer dereference in rds_atomic_free_op sh_eth: fix TSU resource handling net: stmmac: enable EEE in MII, GMII or RGMII only rtnetlink: give a user socket to get_target_net() MAINTAINERS: Update my email address. can: ems_usb: improve error reporting for error warning and error passive can: flex_can: Correct the checking for frame length in flexcan_start_xmit() can: gs_usb: fix return value of the "set_bittiming" callback ...
2 parents 44596f8 + 50f3d74 commit ef7f8ce

Some content is hidden

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

53 files changed

+474
-220
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10134,7 +10134,7 @@ F: drivers/irqchip/irq-ompic.c
1013410134
F: drivers/irqchip/irq-or1k-*
1013510135

1013610136
OPENVSWITCH
10137-
M: Pravin Shelar <pshelar@nicira.com>
10137+
M: Pravin B Shelar <pshelar@ovn.org>
1013810138
1013910139
1014010140
W: http://openvswitch.org

drivers/net/can/flexcan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
526526
data = be32_to_cpup((__be32 *)&cf->data[0]);
527527
flexcan_write(data, &priv->tx_mb->data[0]);
528528
}
529-
if (cf->can_dlc > 3) {
529+
if (cf->can_dlc > 4) {
530530
data = be32_to_cpup((__be32 *)&cf->data[4]);
531531
flexcan_write(data, &priv->tx_mb->data[1]);
532532
}

drivers/net/can/usb/ems_usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
395395

396396
if (dev->can.state == CAN_STATE_ERROR_WARNING ||
397397
dev->can.state == CAN_STATE_ERROR_PASSIVE) {
398+
cf->can_id |= CAN_ERR_CRTL;
398399
cf->data[1] = (txerr > rxerr) ?
399400
CAN_ERR_CRTL_TX_PASSIVE : CAN_ERR_CRTL_RX_PASSIVE;
400401
}

drivers/net/can/usb/gs_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev)
449449
dev_err(netdev->dev.parent, "Couldn't set bittimings (err=%d)",
450450
rc);
451451

452-
return rc;
452+
return (rc > 0) ? 0 : rc;
453453
}
454454

455455
static void gs_usb_xmit_callback(struct urb *urb)

drivers/net/can/vxcan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,
194194
tbp = peer_tb;
195195
}
196196

197-
if (tbp[IFLA_IFNAME]) {
197+
if (ifmp && tbp[IFLA_IFNAME]) {
198198
nla_strlcpy(ifname, tbp[IFLA_IFNAME], IFNAMSIZ);
199199
name_assign_type = NET_NAME_USER;
200200
} else {

drivers/net/dsa/b53/b53_common.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,10 +1500,13 @@ static enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds,
15001500
{
15011501
struct b53_device *dev = ds->priv;
15021502

1503-
/* Older models support a different tag format that we do not
1504-
* support in net/dsa/tag_brcm.c yet.
1503+
/* Older models (5325, 5365) support a different tag format that we do
1504+
* not support in net/dsa/tag_brcm.c yet. 539x and 531x5 require managed
1505+
* mode to be turned on which means we need to specifically manage ARL
1506+
* misses on multicast addresses (TBD).
15051507
*/
1506-
if (is5325(dev) || is5365(dev) || !b53_can_enable_brcm_tags(ds, port))
1508+
if (is5325(dev) || is5365(dev) || is539x(dev) || is531x5(dev) ||
1509+
!b53_can_enable_brcm_tags(ds, port))
15071510
return DSA_TAG_PROTO_NONE;
15081511

15091512
/* Broadcom BCM58xx chips have a flow accelerator on Port 8

drivers/net/ethernet/3com/3c59x.c

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ struct vortex_private {
602602
struct sk_buff* rx_skbuff[RX_RING_SIZE];
603603
struct sk_buff* tx_skbuff[TX_RING_SIZE];
604604
unsigned int cur_rx, cur_tx; /* The next free ring entry */
605-
unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */
605+
unsigned int dirty_tx; /* The ring entries to be free()ed. */
606606
struct vortex_extra_stats xstats; /* NIC-specific extra stats */
607607
struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */
608608
dma_addr_t tx_skb_dma; /* Allocated DMA address for bus master ctrl DMA. */
@@ -618,7 +618,6 @@ struct vortex_private {
618618

619619
/* The remainder are related to chip state, mostly media selection. */
620620
struct timer_list timer; /* Media selection timer. */
621-
struct timer_list rx_oom_timer; /* Rx skb allocation retry timer */
622621
int options; /* User-settable misc. driver options. */
623622
unsigned int media_override:4, /* Passed-in media type. */
624623
default_media:4, /* Read from the EEPROM/Wn3_Config. */
@@ -760,7 +759,6 @@ static void mdio_sync(struct vortex_private *vp, int bits);
760759
static int mdio_read(struct net_device *dev, int phy_id, int location);
761760
static void mdio_write(struct net_device *vp, int phy_id, int location, int value);
762761
static void vortex_timer(struct timer_list *t);
763-
static void rx_oom_timer(struct timer_list *t);
764762
static netdev_tx_t vortex_start_xmit(struct sk_buff *skb,
765763
struct net_device *dev);
766764
static netdev_tx_t boomerang_start_xmit(struct sk_buff *skb,
@@ -1601,7 +1599,6 @@ vortex_up(struct net_device *dev)
16011599

16021600
timer_setup(&vp->timer, vortex_timer, 0);
16031601
mod_timer(&vp->timer, RUN_AT(media_tbl[dev->if_port].wait));
1604-
timer_setup(&vp->rx_oom_timer, rx_oom_timer, 0);
16051602

16061603
if (vortex_debug > 1)
16071604
pr_debug("%s: Initial media type %s.\n",
@@ -1676,7 +1673,7 @@ vortex_up(struct net_device *dev)
16761673
window_write16(vp, 0x0040, 4, Wn4_NetDiag);
16771674

16781675
if (vp->full_bus_master_rx) { /* Boomerang bus master. */
1679-
vp->cur_rx = vp->dirty_rx = 0;
1676+
vp->cur_rx = 0;
16801677
/* Initialize the RxEarly register as recommended. */
16811678
iowrite16(SetRxThreshold + (1536>>2), ioaddr + EL3_CMD);
16821679
iowrite32(0x0020, ioaddr + PktStatus);
@@ -1729,6 +1726,7 @@ vortex_open(struct net_device *dev)
17291726
struct vortex_private *vp = netdev_priv(dev);
17301727
int i;
17311728
int retval;
1729+
dma_addr_t dma;
17321730

17331731
/* Use the now-standard shared IRQ implementation. */
17341732
if ((retval = request_irq(dev->irq, vp->full_bus_master_rx ?
@@ -1753,7 +1751,11 @@ vortex_open(struct net_device *dev)
17531751
break; /* Bad news! */
17541752

17551753
skb_reserve(skb, NET_IP_ALIGN); /* Align IP on 16 byte boundaries */
1756-
vp->rx_ring[i].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));
1754+
dma = pci_map_single(VORTEX_PCI(vp), skb->data,
1755+
PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
1756+
if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma))
1757+
break;
1758+
vp->rx_ring[i].addr = cpu_to_le32(dma);
17571759
}
17581760
if (i != RX_RING_SIZE) {
17591761
pr_emerg("%s: no memory for rx ring\n", dev->name);
@@ -2067,6 +2069,12 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
20672069
int len = (skb->len + 3) & ~3;
20682070
vp->tx_skb_dma = pci_map_single(VORTEX_PCI(vp), skb->data, len,
20692071
PCI_DMA_TODEVICE);
2072+
if (dma_mapping_error(&VORTEX_PCI(vp)->dev, vp->tx_skb_dma)) {
2073+
dev_kfree_skb_any(skb);
2074+
dev->stats.tx_dropped++;
2075+
return NETDEV_TX_OK;
2076+
}
2077+
20702078
spin_lock_irq(&vp->window_lock);
20712079
window_set(vp, 7);
20722080
iowrite32(vp->tx_skb_dma, ioaddr + Wn7_MasterAddr);
@@ -2593,7 +2601,7 @@ boomerang_rx(struct net_device *dev)
25932601
int entry = vp->cur_rx % RX_RING_SIZE;
25942602
void __iomem *ioaddr = vp->ioaddr;
25952603
int rx_status;
2596-
int rx_work_limit = vp->dirty_rx + RX_RING_SIZE - vp->cur_rx;
2604+
int rx_work_limit = RX_RING_SIZE;
25972605

25982606
if (vortex_debug > 5)
25992607
pr_debug("boomerang_rx(): status %4.4x\n", ioread16(ioaddr+EL3_STATUS));
@@ -2614,7 +2622,8 @@ boomerang_rx(struct net_device *dev)
26142622
} else {
26152623
/* The packet length: up to 4.5K!. */
26162624
int pkt_len = rx_status & 0x1fff;
2617-
struct sk_buff *skb;
2625+
struct sk_buff *skb, *newskb;
2626+
dma_addr_t newdma;
26182627
dma_addr_t dma = le32_to_cpu(vp->rx_ring[entry].addr);
26192628

26202629
if (vortex_debug > 4)
@@ -2633,9 +2642,27 @@ boomerang_rx(struct net_device *dev)
26332642
pci_dma_sync_single_for_device(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
26342643
vp->rx_copy++;
26352644
} else {
2645+
/* Pre-allocate the replacement skb. If it or its
2646+
* mapping fails then recycle the buffer thats already
2647+
* in place
2648+
*/
2649+
newskb = netdev_alloc_skb_ip_align(dev, PKT_BUF_SZ);
2650+
if (!newskb) {
2651+
dev->stats.rx_dropped++;
2652+
goto clear_complete;
2653+
}
2654+
newdma = pci_map_single(VORTEX_PCI(vp), newskb->data,
2655+
PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
2656+
if (dma_mapping_error(&VORTEX_PCI(vp)->dev, newdma)) {
2657+
dev->stats.rx_dropped++;
2658+
consume_skb(newskb);
2659+
goto clear_complete;
2660+
}
2661+
26362662
/* Pass up the skbuff already on the Rx ring. */
26372663
skb = vp->rx_skbuff[entry];
2638-
vp->rx_skbuff[entry] = NULL;
2664+
vp->rx_skbuff[entry] = newskb;
2665+
vp->rx_ring[entry].addr = cpu_to_le32(newdma);
26392666
skb_put(skb, pkt_len);
26402667
pci_unmap_single(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
26412668
vp->rx_nocopy++;
@@ -2653,55 +2680,15 @@ boomerang_rx(struct net_device *dev)
26532680
netif_rx(skb);
26542681
dev->stats.rx_packets++;
26552682
}
2656-
entry = (++vp->cur_rx) % RX_RING_SIZE;
2657-
}
2658-
/* Refill the Rx ring buffers. */
2659-
for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) {
2660-
struct sk_buff *skb;
2661-
entry = vp->dirty_rx % RX_RING_SIZE;
2662-
if (vp->rx_skbuff[entry] == NULL) {
2663-
skb = netdev_alloc_skb_ip_align(dev, PKT_BUF_SZ);
2664-
if (skb == NULL) {
2665-
static unsigned long last_jif;
2666-
if (time_after(jiffies, last_jif + 10 * HZ)) {
2667-
pr_warn("%s: memory shortage\n",
2668-
dev->name);
2669-
last_jif = jiffies;
2670-
}
2671-
if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE)
2672-
mod_timer(&vp->rx_oom_timer, RUN_AT(HZ * 1));
2673-
break; /* Bad news! */
2674-
}
26752683

2676-
vp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));
2677-
vp->rx_skbuff[entry] = skb;
2678-
}
2684+
clear_complete:
26792685
vp->rx_ring[entry].status = 0; /* Clear complete bit. */
26802686
iowrite16(UpUnstall, ioaddr + EL3_CMD);
2687+
entry = (++vp->cur_rx) % RX_RING_SIZE;
26812688
}
26822689
return 0;
26832690
}
26842691

2685-
/*
2686-
* If we've hit a total OOM refilling the Rx ring we poll once a second
2687-
* for some memory. Otherwise there is no way to restart the rx process.
2688-
*/
2689-
static void
2690-
rx_oom_timer(struct timer_list *t)
2691-
{
2692-
struct vortex_private *vp = from_timer(vp, t, rx_oom_timer);
2693-
struct net_device *dev = vp->mii.dev;
2694-
2695-
spin_lock_irq(&vp->lock);
2696-
if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE) /* This test is redundant, but makes me feel good */
2697-
boomerang_rx(dev);
2698-
if (vortex_debug > 1) {
2699-
pr_debug("%s: rx_oom_timer %s\n", dev->name,
2700-
((vp->cur_rx - vp->dirty_rx) != RX_RING_SIZE) ? "succeeded" : "retrying");
2701-
}
2702-
spin_unlock_irq(&vp->lock);
2703-
}
2704-
27052692
static void
27062693
vortex_down(struct net_device *dev, int final_down)
27072694
{
@@ -2711,7 +2698,6 @@ vortex_down(struct net_device *dev, int final_down)
27112698
netdev_reset_queue(dev);
27122699
netif_stop_queue(dev);
27132700

2714-
del_timer_sync(&vp->rx_oom_timer);
27152701
del_timer_sync(&vp->timer);
27162702

27172703
/* Turn off statistics ASAP. We update dev->stats below. */

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ static struct workqueue_struct *ena_wq;
7575
MODULE_DEVICE_TABLE(pci, ena_pci_tbl);
7676

7777
static int ena_rss_init_default(struct ena_adapter *adapter);
78+
static void check_for_admin_com_state(struct ena_adapter *adapter);
79+
static void ena_destroy_device(struct ena_adapter *adapter);
80+
static int ena_restore_device(struct ena_adapter *adapter);
7881

7982
static void ena_tx_timeout(struct net_device *dev)
8083
{
@@ -1565,7 +1568,7 @@ static int ena_rss_configure(struct ena_adapter *adapter)
15651568

15661569
static int ena_up_complete(struct ena_adapter *adapter)
15671570
{
1568-
int rc, i;
1571+
int rc;
15691572

15701573
rc = ena_rss_configure(adapter);
15711574
if (rc)
@@ -1584,17 +1587,6 @@ static int ena_up_complete(struct ena_adapter *adapter)
15841587

15851588
ena_napi_enable_all(adapter);
15861589

1587-
/* Enable completion queues interrupt */
1588-
for (i = 0; i < adapter->num_queues; i++)
1589-
ena_unmask_interrupt(&adapter->tx_ring[i],
1590-
&adapter->rx_ring[i]);
1591-
1592-
/* schedule napi in case we had pending packets
1593-
* from the last time we disable napi
1594-
*/
1595-
for (i = 0; i < adapter->num_queues; i++)
1596-
napi_schedule(&adapter->ena_napi[i].napi);
1597-
15981590
return 0;
15991591
}
16001592

@@ -1731,7 +1723,7 @@ static int ena_create_all_io_rx_queues(struct ena_adapter *adapter)
17311723

17321724
static int ena_up(struct ena_adapter *adapter)
17331725
{
1734-
int rc;
1726+
int rc, i;
17351727

17361728
netdev_dbg(adapter->netdev, "%s\n", __func__);
17371729

@@ -1774,6 +1766,17 @@ static int ena_up(struct ena_adapter *adapter)
17741766

17751767
set_bit(ENA_FLAG_DEV_UP, &adapter->flags);
17761768

1769+
/* Enable completion queues interrupt */
1770+
for (i = 0; i < adapter->num_queues; i++)
1771+
ena_unmask_interrupt(&adapter->tx_ring[i],
1772+
&adapter->rx_ring[i]);
1773+
1774+
/* schedule napi in case we had pending packets
1775+
* from the last time we disable napi
1776+
*/
1777+
for (i = 0; i < adapter->num_queues; i++)
1778+
napi_schedule(&adapter->ena_napi[i].napi);
1779+
17771780
return rc;
17781781

17791782
err_up:
@@ -1884,6 +1887,17 @@ static int ena_close(struct net_device *netdev)
18841887
if (test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
18851888
ena_down(adapter);
18861889

1890+
/* Check for device status and issue reset if needed*/
1891+
check_for_admin_com_state(adapter);
1892+
if (unlikely(test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags))) {
1893+
netif_err(adapter, ifdown, adapter->netdev,
1894+
"Destroy failure, restarting device\n");
1895+
ena_dump_stats_to_dmesg(adapter);
1896+
/* rtnl lock already obtained in dev_ioctl() layer */
1897+
ena_destroy_device(adapter);
1898+
ena_restore_device(adapter);
1899+
}
1900+
18871901
return 0;
18881902
}
18891903

@@ -2544,11 +2558,12 @@ static void ena_destroy_device(struct ena_adapter *adapter)
25442558

25452559
ena_com_set_admin_running_state(ena_dev, false);
25462560

2547-
ena_close(netdev);
2561+
if (test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
2562+
ena_down(adapter);
25482563

25492564
/* Before releasing the ENA resources, a device reset is required.
25502565
* (to prevent the device from accessing them).
2551-
* In case the reset flag is set and the device is up, ena_close
2566+
* In case the reset flag is set and the device is up, ena_down()
25522567
* already perform the reset, so it can be skipped.
25532568
*/
25542569
if (!(test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags) && dev_up))

drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int bnxt_vf_ndo_prep(struct bnxt *bp, int vf_id)
7070
netdev_err(bp->dev, "vf ndo called though sriov is disabled\n");
7171
return -EINVAL;
7272
}
73-
if (vf_id >= bp->pf.max_vfs) {
73+
if (vf_id >= bp->pf.active_vfs) {
7474
netdev_err(bp->dev, "Invalid VF id %d\n", vf_id);
7575
return -EINVAL;
7676
}

drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static int bnxt_hwrm_cfa_flow_alloc(struct bnxt *bp, struct bnxt_tc_flow *flow,
421421
}
422422

423423
/* If all IP and L4 fields are wildcarded then this is an L2 flow */
424-
if (is_wildcard(&l3_mask, sizeof(l3_mask)) &&
424+
if (is_wildcard(l3_mask, sizeof(*l3_mask)) &&
425425
is_wildcard(&flow->l4_mask, sizeof(flow->l4_mask))) {
426426
flow_flags |= CFA_FLOW_ALLOC_REQ_FLAGS_FLOWTYPE_L2;
427427
} else {

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ struct adapter_params {
344344

345345
unsigned int sf_size; /* serial flash size in bytes */
346346
unsigned int sf_nsec; /* # of flash sectors */
347-
unsigned int sf_fw_start; /* start of FW image in flash */
348347

349348
unsigned int fw_vers; /* firmware version */
350349
unsigned int bs_vers; /* bootstrap version */

0 commit comments

Comments
 (0)