Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
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
  ...
  • Loading branch information
torvalds committed Jul 14, 2013
2 parents 03ce3ca + 307f2fb commit be9c6d9
Show file tree
Hide file tree
Showing 65 changed files with 607 additions and 241 deletions.
17 changes: 9 additions & 8 deletions Documentation/sysctl/net.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,27 @@ The maximum number of packets that kernel can handle on a NAPI interrupt,
it's a Per-CPU variable.
Default: 64

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

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

Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6681,10 +6681,12 @@ F: Documentation/networking/LICENSE.qla3xxx
F: drivers/net/ethernet/qlogic/qla3xxx.*

QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
M: Himanshu Madhani <[email protected]>
M: Rajesh Borundia <[email protected]>
M: Shahed Shaikh <[email protected]>
M: Jitendra Kalsaria <[email protected]>
M: Sony Chacko <[email protected]>
M: Sucheta Chakraborty <[email protected]>
M: [email protected]
L: [email protected]
S: Supported
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _UAPI_ASM_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/avr32/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* __ASM_AVR32_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/cris/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_SOCKET_H */

Expand Down
2 changes: 1 addition & 1 deletion arch/frv/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_SOCKET_H */

2 changes: 1 addition & 1 deletion arch/h8300/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/ia64/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_IA64_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/m32r/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_M32R_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/mips/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _UAPI_ASM_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/mn10300/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/parisc/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

#define SO_SELECT_ERR_QUEUE 0x4026

#define SO_LL 0x4027
#define SO_BUSY_POLL 0x4027

/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
* have to define SOCK_NONBLOCK to a different value here.
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_POWERPC_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/s390/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _ASM_SOCKET_H */
2 changes: 1 addition & 1 deletion arch/sparc/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

#define SO_SELECT_ERR_QUEUE 0x0029

#define SO_LL 0x0030
#define SO_BUSY_POLL 0x0030

/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 0x5001
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@

#define SO_SELECT_ERR_QUEUE 45

#define SO_LL 46
#define SO_BUSY_POLL 46

#endif /* _XTENSA_SOCKET_H */
7 changes: 0 additions & 7 deletions drivers/net/can/c_can/c_can_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/clk.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>

#include <linux/can/dev.h>

Expand Down Expand Up @@ -114,7 +113,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
struct c_can_priv *priv;
const struct of_device_id *match;
const struct platform_device_id *id;
struct pinctrl *pinctrl;
struct resource *mem, *res;
int irq;
struct clk *clk;
Expand All @@ -131,11 +129,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
id = platform_get_device_id(pdev);
}

pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl))
dev_warn(&pdev->dev,
"failed to configure pins from driver\n");

/* get the appropriate clk */
clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,17 @@ static int __init dummy_init_module(void)

rtnl_lock();
err = __rtnl_link_register(&dummy_link_ops);
if (err < 0)
goto out;

for (i = 0; i < numdummies && !err; i++) {
err = dummy_init_one();
cond_resched();
}
if (err < 0)
__rtnl_link_unregister(&dummy_link_ops);

out:
rtnl_unlock();

return err;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/ethernet/atheros/alx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,8 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

SET_NETDEV_DEV(netdev, &pdev->dev);
alx = netdev_priv(netdev);
spin_lock_init(&alx->hw.mdio_lock);
spin_lock_init(&alx->irq_lock);
alx->dev = netdev;
alx->hw.pdev = pdev;
alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP |
Expand Down Expand Up @@ -1327,9 +1329,6 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

INIT_WORK(&alx->link_check_wk, alx_link_check);
INIT_WORK(&alx->reset_wk, alx_reset);
spin_lock_init(&alx->hw.mdio_lock);
spin_lock_init(&alx->irq_lock);

netif_carrier_off(netdev);

err = register_netdev(netdev);
Expand Down
28 changes: 25 additions & 3 deletions drivers/net/ethernet/atheros/atl1e/atl1e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,8 +1665,8 @@ static int atl1e_tso_csum(struct atl1e_adapter *adapter,
return 0;
}

static void atl1e_tx_map(struct atl1e_adapter *adapter,
struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
static int atl1e_tx_map(struct atl1e_adapter *adapter,
struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
{
struct atl1e_tpd_desc *use_tpd = NULL;
struct atl1e_tx_buffer *tx_buffer = NULL;
Expand All @@ -1677,6 +1677,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
u16 nr_frags;
u16 f;
int segment;
int ring_start = adapter->tx_ring.next_to_use;

nr_frags = skb_shinfo(skb)->nr_frags;
segment = (tpd->word3 >> TPD_SEGMENT_EN_SHIFT) & TPD_SEGMENT_EN_MASK;
Expand All @@ -1689,6 +1690,9 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
tx_buffer->length = map_len;
tx_buffer->dma = pci_map_single(adapter->pdev,
skb->data, hdr_len, PCI_DMA_TODEVICE);
if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma))
return -ENOSPC;

ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
mapped_len += map_len;
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
Expand All @@ -1715,6 +1719,13 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
tx_buffer->dma =
pci_map_single(adapter->pdev, skb->data + mapped_len,
map_len, PCI_DMA_TODEVICE);

if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
/* Reset the tx rings next pointer */
adapter->tx_ring.next_to_use = ring_start;
return -ENOSPC;
}

ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
mapped_len += map_len;
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
Expand Down Expand Up @@ -1750,6 +1761,13 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
(i * MAX_TX_BUF_LEN),
tx_buffer->length,
DMA_TO_DEVICE);

if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
/* Reset the ring next to use pointer */
adapter->tx_ring.next_to_use = ring_start;
return -ENOSPC;
}

ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE);
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) |
Expand All @@ -1767,6 +1785,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
/* The last buffer info contain the skb address,
so it will be free after unmap */
tx_buffer->skb = skb;
return 0;
}

static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count,
Expand Down Expand Up @@ -1834,10 +1853,13 @@ static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb,
return NETDEV_TX_OK;
}

atl1e_tx_map(adapter, skb, tpd);
if (atl1e_tx_map(adapter, skb, tpd))
goto out;

atl1e_tx_queue(adapter, tpd_req, tpd);

netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
out:
spin_unlock_irqrestore(&adapter->tx_lock, flags);
return NETDEV_TX_OK;
}
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <net/tcp.h>
#include <net/ipv6.h>
#include <net/ip6_checksum.h>
#include <net/ll_poll.h>
#include <net/busy_poll.h>
#include <linux/prefetch.h>
#include "bnx2x_cmn.h"
#include "bnx2x_init.h"
Expand Down Expand Up @@ -990,7 +990,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
le16_to_cpu(cqe_fp->vlan_tag));

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

if (bnx2x_fp_ll_polling(fp))
netif_receive_skb(skb);
Expand Down Expand Up @@ -3543,9 +3543,9 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
/* outer IP header info */
if (xmit_type & XMIT_CSUM_V4) {
struct iphdr *iph = ip_hdr(skb);
u16 csum = (__force u16)(~iph->check) -
(__force u16)iph->tot_len -
(__force u16)iph->frag_off;
u32 csum = (__force u32)(~iph->check) -
(__force u32)iph->tot_len -
(__force u32)iph->frag_off;

pbd2->fw_ip_csum_wo_len_flags_frag =
bswab16(csum_fold((__force __wsum)csum));
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12027,7 +12027,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
#endif

#ifdef CONFIG_NET_LL_RX_POLL
.ndo_ll_poll = bnx2x_low_latency_recv,
.ndo_busy_poll = bnx2x_low_latency_recv,
#endif
};

Expand Down
11 changes: 0 additions & 11 deletions drivers/net/ethernet/cadence/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_net.h>
#include <linux/pinctrl/consumer.h>

#include "macb.h"

Expand Down Expand Up @@ -309,7 +308,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
struct resource *regs;
struct net_device *dev;
struct phy_device *phydev;
struct pinctrl *pinctrl;
struct macb *lp;
int res;
u32 reg;
Expand All @@ -319,15 +317,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
if (!regs)
return -ENOENT;

pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
res = PTR_ERR(pinctrl);
if (res == -EPROBE_DEFER)
return res;

dev_warn(&pdev->dev, "No pinctrl provided\n");
}

dev = alloc_etherdev(sizeof(struct macb));
if (!dev)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <linux/dca.h>
#endif

#include <net/ll_poll.h>
#include <net/busy_poll.h>

#ifdef CONFIG_NET_LL_RX_POLL
#define LL_EXTENDED_STATS
Expand Down
Loading

0 comments on commit be9c6d9

Please sign in to comment.