Skip to content

Commit be9c6d9

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Just a bunch of small fixes and tidy ups: 1) Finish the "busy_poll" renames, from Eliezer Tamir. 2) Fix RCU stalls in IFB driver, from Ding Tianhong. 3) Linearize buffers properly in tun/macvtap zerocopy code. 4) Don't crash on rmmod in vxlan, from Pravin B Shelar. 5) Spinlock used before init in alx driver, from Maarten Lankhorst. 6) A sparse warning fix in bnx2x broke TSO checksums, fix from Dmitry Kravkov. 7) Dummy and ifb driver load failure paths can oops, fixes from Tan Xiaojun and Ding Tianhong. 8) Correct MTU calculations in IP tunnels, from Alexander Duyck. 9) Account all TCP retransmits in SNMP stats properly, from Yuchung Cheng. 10) atl1e and via-rhine do not handle DMA mapping failures properly, from Neil Horman. 11) Various equal-cost multipath route fixes in ipv6 from Hannes Frederic Sowa" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (36 commits) ipv6: only static routes qualify for equal cost multipathing via-rhine: fix dma mapping errors atl1e: fix dma mapping warnings tcp: account all retransmit failures usb/net/r815x: fix cast to restricted __le32 usb/net/r8152: fix integer overflow in expression net: access page->private by using page_private net: strict_strtoul is obsolete, use kstrtoul instead drivers/net/ieee802154: don't use devm_pinctrl_get_select_default() in probe drivers/net/ethernet/cadence: don't use devm_pinctrl_get_select_default() in probe drivers/net/can/c_can: don't use devm_pinctrl_get_select_default() in probe net/usb: add relative mii functions for r815x net/tipc: use %*phC to dump small buffers in hex form qlcnic: Adding Maintainers. gre: Fix MTU sizing check for gretap tunnels pkt_sched: sch_qfq: remove forward declaration of qfq_update_agg_ts pkt_sched: sch_qfq: improve efficiency of make_eligible gso: Update tunnel segmentation to support Tx checksum offload inet: fix spacing in assignment ifb: fix oops when loading the ifb failed ...
2 parents 03ce3ca + 307f2fb commit be9c6d9

File tree

65 files changed

+607
-241
lines changed

Some content is hidden

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

65 files changed

+607
-241
lines changed

Documentation/sysctl/net.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,27 @@ The maximum number of packets that kernel can handle on a NAPI interrupt,
5050
it's a Per-CPU variable.
5151
Default: 64
5252

53-
low_latency_read
53+
busy_read
5454
----------------
5555
Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL)
5656
Approximate time in us to busy loop waiting for packets on the device queue.
57-
This sets the default value of the SO_LL socket option.
58-
Can be set or overridden per socket by setting socket option SO_LL, which is
59-
the preferred method of enabling.
60-
If you need to enable the feature globally via sysctl, a value of 50 is recommended.
57+
This sets the default value of the SO_BUSY_POLL socket option.
58+
Can be set or overridden per socket by setting socket option SO_BUSY_POLL,
59+
which is the preferred method of enabling. If you need to enable the feature
60+
globally via sysctl, a value of 50 is recommended.
6161
Will increase power usage.
6262
Default: 0 (off)
6363

64-
low_latency_poll
64+
busy_poll
6565
----------------
6666
Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL)
6767
Approximate time in us to busy loop waiting for events.
6868
Recommended value depends on the number of sockets you poll on.
6969
For several sockets 50, for several hundreds 100.
7070
For more than that you probably want to use epoll.
71-
Note that only sockets with SO_LL set will be busy polled, so you want to either
72-
selectively set SO_LL on those sockets or set sysctl.net.low_latency_read globally.
71+
Note that only sockets with SO_BUSY_POLL set will be busy polled,
72+
so you want to either selectively set SO_BUSY_POLL on those sockets or set
73+
sysctl.net.busy_read globally.
7374
Will increase power usage.
7475
Default: 0 (off)
7576

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6681,10 +6681,12 @@ F: Documentation/networking/LICENSE.qla3xxx
66816681
F: drivers/net/ethernet/qlogic/qla3xxx.*
66826682

66836683
QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
6684+
M: Himanshu Madhani <[email protected]>
66846685
M: Rajesh Borundia <[email protected]>
66856686
M: Shahed Shaikh <[email protected]>
66866687
M: Jitendra Kalsaria <[email protected]>
66876688
M: Sony Chacko <[email protected]>
6689+
M: Sucheta Chakraborty <[email protected]>
66886690
66896691
66906692
S: Supported

arch/alpha/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181

8282
#define SO_SELECT_ERR_QUEUE 45
8383

84-
#define SO_LL 46
84+
#define SO_BUSY_POLL 46
8585

8686
#endif /* _UAPI_ASM_SOCKET_H */

arch/avr32/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@
7474

7575
#define SO_SELECT_ERR_QUEUE 45
7676

77-
#define SO_LL 46
77+
#define SO_BUSY_POLL 46
7878

7979
#endif /* __ASM_AVR32_SOCKET_H */

arch/cris/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
#define SO_SELECT_ERR_QUEUE 45
7878

79-
#define SO_LL 46
79+
#define SO_BUSY_POLL 46
8080

8181
#endif /* _ASM_SOCKET_H */
8282

arch/frv/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
#define SO_SELECT_ERR_QUEUE 45
7676

77-
#define SO_LL 46
77+
#define SO_BUSY_POLL 46
7878

7979
#endif /* _ASM_SOCKET_H */
8080

arch/h8300/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@
7474

7575
#define SO_SELECT_ERR_QUEUE 45
7676

77-
#define SO_LL 46
77+
#define SO_BUSY_POLL 46
7878

7979
#endif /* _ASM_SOCKET_H */

arch/ia64/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@
8383

8484
#define SO_SELECT_ERR_QUEUE 45
8585

86-
#define SO_LL 46
86+
#define SO_BUSY_POLL 46
8787

8888
#endif /* _ASM_IA64_SOCKET_H */

arch/m32r/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@
7474

7575
#define SO_SELECT_ERR_QUEUE 45
7676

77-
#define SO_LL 46
77+
#define SO_BUSY_POLL 46
7878

7979
#endif /* _ASM_M32R_SOCKET_H */

arch/mips/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@
9292

9393
#define SO_SELECT_ERR_QUEUE 45
9494

95-
#define SO_LL 46
95+
#define SO_BUSY_POLL 46
9696

9797
#endif /* _UAPI_ASM_SOCKET_H */

arch/mn10300/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@
7474

7575
#define SO_SELECT_ERR_QUEUE 45
7676

77-
#define SO_LL 46
77+
#define SO_BUSY_POLL 46
7878

7979
#endif /* _ASM_SOCKET_H */

arch/parisc/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
#define SO_SELECT_ERR_QUEUE 0x4026
7575

76-
#define SO_LL 0x4027
76+
#define SO_BUSY_POLL 0x4027
7777

7878
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
7979
* have to define SOCK_NONBLOCK to a different value here.

arch/powerpc/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181

8282
#define SO_SELECT_ERR_QUEUE 45
8383

84-
#define SO_LL 46
84+
#define SO_BUSY_POLL 46
8585

8686
#endif /* _ASM_POWERPC_SOCKET_H */

arch/s390/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@
8080

8181
#define SO_SELECT_ERR_QUEUE 45
8282

83-
#define SO_LL 46
83+
#define SO_BUSY_POLL 46
8484

8585
#endif /* _ASM_SOCKET_H */

arch/sparc/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
#define SO_SELECT_ERR_QUEUE 0x0029
7272

73-
#define SO_LL 0x0030
73+
#define SO_BUSY_POLL 0x0030
7474

7575
/* Security levels - as per NRL IPv6 - don't actually do anything */
7676
#define SO_SECURITY_AUTHENTICATION 0x5001

arch/xtensa/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@
8585

8686
#define SO_SELECT_ERR_QUEUE 45
8787

88-
#define SO_LL 46
88+
#define SO_BUSY_POLL 46
8989

9090
#endif /* _XTENSA_SOCKET_H */

drivers/net/can/c_can/c_can_platform.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <linux/clk.h>
3333
#include <linux/of.h>
3434
#include <linux/of_device.h>
35-
#include <linux/pinctrl/consumer.h>
3635

3736
#include <linux/can/dev.h>
3837

@@ -114,7 +113,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
114113
struct c_can_priv *priv;
115114
const struct of_device_id *match;
116115
const struct platform_device_id *id;
117-
struct pinctrl *pinctrl;
118116
struct resource *mem, *res;
119117
int irq;
120118
struct clk *clk;
@@ -131,11 +129,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
131129
id = platform_get_device_id(pdev);
132130
}
133131

134-
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
135-
if (IS_ERR(pinctrl))
136-
dev_warn(&pdev->dev,
137-
"failed to configure pins from driver\n");
138-
139132
/* get the appropriate clk */
140133
clk = clk_get(&pdev->dev, NULL);
141134
if (IS_ERR(clk)) {

drivers/net/dummy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,17 @@ static int __init dummy_init_module(void)
185185

186186
rtnl_lock();
187187
err = __rtnl_link_register(&dummy_link_ops);
188+
if (err < 0)
189+
goto out;
188190

189191
for (i = 0; i < numdummies && !err; i++) {
190192
err = dummy_init_one();
191193
cond_resched();
192194
}
193195
if (err < 0)
194196
__rtnl_link_unregister(&dummy_link_ops);
197+
198+
out:
195199
rtnl_unlock();
196200

197201
return err;

drivers/net/ethernet/atheros/alx/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,8 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
12451245

12461246
SET_NETDEV_DEV(netdev, &pdev->dev);
12471247
alx = netdev_priv(netdev);
1248+
spin_lock_init(&alx->hw.mdio_lock);
1249+
spin_lock_init(&alx->irq_lock);
12481250
alx->dev = netdev;
12491251
alx->hw.pdev = pdev;
12501252
alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP |
@@ -1327,9 +1329,6 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
13271329

13281330
INIT_WORK(&alx->link_check_wk, alx_link_check);
13291331
INIT_WORK(&alx->reset_wk, alx_reset);
1330-
spin_lock_init(&alx->hw.mdio_lock);
1331-
spin_lock_init(&alx->irq_lock);
1332-
13331332
netif_carrier_off(netdev);
13341333

13351334
err = register_netdev(netdev);

drivers/net/ethernet/atheros/atl1e/atl1e_main.c

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,8 +1665,8 @@ static int atl1e_tso_csum(struct atl1e_adapter *adapter,
16651665
return 0;
16661666
}
16671667

1668-
static void atl1e_tx_map(struct atl1e_adapter *adapter,
1669-
struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
1668+
static int atl1e_tx_map(struct atl1e_adapter *adapter,
1669+
struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
16701670
{
16711671
struct atl1e_tpd_desc *use_tpd = NULL;
16721672
struct atl1e_tx_buffer *tx_buffer = NULL;
@@ -1677,6 +1677,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
16771677
u16 nr_frags;
16781678
u16 f;
16791679
int segment;
1680+
int ring_start = adapter->tx_ring.next_to_use;
16801681

16811682
nr_frags = skb_shinfo(skb)->nr_frags;
16821683
segment = (tpd->word3 >> TPD_SEGMENT_EN_SHIFT) & TPD_SEGMENT_EN_MASK;
@@ -1689,6 +1690,9 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
16891690
tx_buffer->length = map_len;
16901691
tx_buffer->dma = pci_map_single(adapter->pdev,
16911692
skb->data, hdr_len, PCI_DMA_TODEVICE);
1693+
if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma))
1694+
return -ENOSPC;
1695+
16921696
ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
16931697
mapped_len += map_len;
16941698
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
@@ -1715,6 +1719,13 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
17151719
tx_buffer->dma =
17161720
pci_map_single(adapter->pdev, skb->data + mapped_len,
17171721
map_len, PCI_DMA_TODEVICE);
1722+
1723+
if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
1724+
/* Reset the tx rings next pointer */
1725+
adapter->tx_ring.next_to_use = ring_start;
1726+
return -ENOSPC;
1727+
}
1728+
17181729
ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
17191730
mapped_len += map_len;
17201731
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
@@ -1750,6 +1761,13 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
17501761
(i * MAX_TX_BUF_LEN),
17511762
tx_buffer->length,
17521763
DMA_TO_DEVICE);
1764+
1765+
if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
1766+
/* Reset the ring next to use pointer */
1767+
adapter->tx_ring.next_to_use = ring_start;
1768+
return -ENOSPC;
1769+
}
1770+
17531771
ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE);
17541772
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
17551773
use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) |
@@ -1767,6 +1785,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
17671785
/* The last buffer info contain the skb address,
17681786
so it will be free after unmap */
17691787
tx_buffer->skb = skb;
1788+
return 0;
17701789
}
17711790

17721791
static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count,
@@ -1834,10 +1853,13 @@ static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb,
18341853
return NETDEV_TX_OK;
18351854
}
18361855

1837-
atl1e_tx_map(adapter, skb, tpd);
1856+
if (atl1e_tx_map(adapter, skb, tpd))
1857+
goto out;
1858+
18381859
atl1e_tx_queue(adapter, tpd_req, tpd);
18391860

18401861
netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
1862+
out:
18411863
spin_unlock_irqrestore(&adapter->tx_lock, flags);
18421864
return NETDEV_TX_OK;
18431865
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <net/tcp.h>
2525
#include <net/ipv6.h>
2626
#include <net/ip6_checksum.h>
27-
#include <net/ll_poll.h>
27+
#include <net/busy_poll.h>
2828
#include <linux/prefetch.h>
2929
#include "bnx2x_cmn.h"
3030
#include "bnx2x_init.h"
@@ -990,7 +990,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
990990
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
991991
le16_to_cpu(cqe_fp->vlan_tag));
992992

993-
skb_mark_ll(skb, &fp->napi);
993+
skb_mark_napi_id(skb, &fp->napi);
994994

995995
if (bnx2x_fp_ll_polling(fp))
996996
netif_receive_skb(skb);
@@ -3543,9 +3543,9 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
35433543
/* outer IP header info */
35443544
if (xmit_type & XMIT_CSUM_V4) {
35453545
struct iphdr *iph = ip_hdr(skb);
3546-
u16 csum = (__force u16)(~iph->check) -
3547-
(__force u16)iph->tot_len -
3548-
(__force u16)iph->frag_off;
3546+
u32 csum = (__force u32)(~iph->check) -
3547+
(__force u32)iph->tot_len -
3548+
(__force u32)iph->frag_off;
35493549

35503550
pbd2->fw_ip_csum_wo_len_flags_frag =
35513551
bswab16(csum_fold((__force __wsum)csum));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12027,7 +12027,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
1202712027
#endif
1202812028

1202912029
#ifdef CONFIG_NET_LL_RX_POLL
12030-
.ndo_ll_poll = bnx2x_low_latency_recv,
12030+
.ndo_busy_poll = bnx2x_low_latency_recv,
1203112031
#endif
1203212032
};
1203312033

drivers/net/ethernet/cadence/at91_ether.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/of.h>
3030
#include <linux/of_device.h>
3131
#include <linux/of_net.h>
32-
#include <linux/pinctrl/consumer.h>
3332

3433
#include "macb.h"
3534

@@ -309,7 +308,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
309308
struct resource *regs;
310309
struct net_device *dev;
311310
struct phy_device *phydev;
312-
struct pinctrl *pinctrl;
313311
struct macb *lp;
314312
int res;
315313
u32 reg;
@@ -319,15 +317,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
319317
if (!regs)
320318
return -ENOENT;
321319

322-
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
323-
if (IS_ERR(pinctrl)) {
324-
res = PTR_ERR(pinctrl);
325-
if (res == -EPROBE_DEFER)
326-
return res;
327-
328-
dev_warn(&pdev->dev, "No pinctrl provided\n");
329-
}
330-
331320
dev = alloc_etherdev(sizeof(struct macb));
332321
if (!dev)
333322
return -ENOMEM;

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#include <linux/dca.h>
5353
#endif
5454

55-
#include <net/ll_poll.h>
55+
#include <net/busy_poll.h>
5656

5757
#ifdef CONFIG_NET_LL_RX_POLL
5858
#define LL_EXTENDED_STATS

0 commit comments

Comments
 (0)