Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
...

+610 -244
+9 -8
Documentation/sysctl/net.txt
··· 50 50 it's a Per-CPU variable. 51 51 Default: 64 52 52 53 - low_latency_read 53 + busy_read 54 54 ---------------- 55 55 Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL) 56 56 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. 61 61 Will increase power usage. 62 62 Default: 0 (off) 63 63 64 - low_latency_poll 64 + busy_poll 65 65 ---------------- 66 66 Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL) 67 67 Approximate time in us to busy loop waiting for events. 68 68 Recommended value depends on the number of sockets you poll on. 69 69 For several sockets 50, for several hundreds 100. 70 70 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. 73 74 Will increase power usage. 74 75 Default: 0 (off) 75 76
+2
MAINTAINERS
··· 6681 6681 F: drivers/net/ethernet/qlogic/qla3xxx.* 6682 6682 6683 6683 QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER 6684 + M: Himanshu Madhani <himanshu.madhani@qlogic.com> 6684 6685 M: Rajesh Borundia <rajesh.borundia@qlogic.com> 6685 6686 M: Shahed Shaikh <shahed.shaikh@qlogic.com> 6686 6687 M: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> 6687 6688 M: Sony Chacko <sony.chacko@qlogic.com> 6689 + M: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> 6688 6690 M: linux-driver@qlogic.com 6689 6691 L: netdev@vger.kernel.org 6690 6692 S: Supported
+1 -1
arch/alpha/include/uapi/asm/socket.h
··· 81 81 82 82 #define SO_SELECT_ERR_QUEUE 45 83 83 84 - #define SO_LL 46 84 + #define SO_BUSY_POLL 46 85 85 86 86 #endif /* _UAPI_ASM_SOCKET_H */
+1 -1
arch/avr32/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* __ASM_AVR32_SOCKET_H */
+1 -1
arch/cris/include/uapi/asm/socket.h
··· 76 76 77 77 #define SO_SELECT_ERR_QUEUE 45 78 78 79 - #define SO_LL 46 79 + #define SO_BUSY_POLL 46 80 80 81 81 #endif /* _ASM_SOCKET_H */ 82 82
+1 -1
arch/frv/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_SOCKET_H */ 80 80
+1 -1
arch/h8300/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_SOCKET_H */
+1 -1
arch/ia64/include/uapi/asm/socket.h
··· 83 83 84 84 #define SO_SELECT_ERR_QUEUE 45 85 85 86 - #define SO_LL 46 86 + #define SO_BUSY_POLL 46 87 87 88 88 #endif /* _ASM_IA64_SOCKET_H */
+1 -1
arch/m32r/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_M32R_SOCKET_H */
+1 -1
arch/mips/include/uapi/asm/socket.h
··· 92 92 93 93 #define SO_SELECT_ERR_QUEUE 45 94 94 95 - #define SO_LL 46 95 + #define SO_BUSY_POLL 46 96 96 97 97 #endif /* _UAPI_ASM_SOCKET_H */
+1 -1
arch/mn10300/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_SOCKET_H */
+1 -1
arch/parisc/include/uapi/asm/socket.h
··· 73 73 74 74 #define SO_SELECT_ERR_QUEUE 0x4026 75 75 76 - #define SO_LL 0x4027 76 + #define SO_BUSY_POLL 0x4027 77 77 78 78 /* O_NONBLOCK clashes with the bits used for socket types. Therefore we 79 79 * have to define SOCK_NONBLOCK to a different value here.
+1 -1
arch/powerpc/include/uapi/asm/socket.h
··· 81 81 82 82 #define SO_SELECT_ERR_QUEUE 45 83 83 84 - #define SO_LL 46 84 + #define SO_BUSY_POLL 46 85 85 86 86 #endif /* _ASM_POWERPC_SOCKET_H */
+1 -1
arch/s390/include/uapi/asm/socket.h
··· 80 80 81 81 #define SO_SELECT_ERR_QUEUE 45 82 82 83 - #define SO_LL 46 83 + #define SO_BUSY_POLL 46 84 84 85 85 #endif /* _ASM_SOCKET_H */
+1 -1
arch/sparc/include/uapi/asm/socket.h
··· 70 70 71 71 #define SO_SELECT_ERR_QUEUE 0x0029 72 72 73 - #define SO_LL 0x0030 73 + #define SO_BUSY_POLL 0x0030 74 74 75 75 /* Security levels - as per NRL IPv6 - don't actually do anything */ 76 76 #define SO_SECURITY_AUTHENTICATION 0x5001
+1 -1
arch/xtensa/include/uapi/asm/socket.h
··· 85 85 86 86 #define SO_SELECT_ERR_QUEUE 45 87 87 88 - #define SO_LL 46 88 + #define SO_BUSY_POLL 46 89 89 90 90 #endif /* _XTENSA_SOCKET_H */
-7
drivers/net/can/c_can/c_can_platform.c
··· 32 32 #include <linux/clk.h> 33 33 #include <linux/of.h> 34 34 #include <linux/of_device.h> 35 - #include <linux/pinctrl/consumer.h> 36 35 37 36 #include <linux/can/dev.h> 38 37 ··· 113 114 struct c_can_priv *priv; 114 115 const struct of_device_id *match; 115 116 const struct platform_device_id *id; 116 - struct pinctrl *pinctrl; 117 117 struct resource *mem, *res; 118 118 int irq; 119 119 struct clk *clk; ··· 128 130 } else { 129 131 id = platform_get_device_id(pdev); 130 132 } 131 - 132 - pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 133 - if (IS_ERR(pinctrl)) 134 - dev_warn(&pdev->dev, 135 - "failed to configure pins from driver\n"); 136 133 137 134 /* get the appropriate clk */ 138 135 clk = clk_get(&pdev->dev, NULL);
+4
drivers/net/dummy.c
··· 185 185 186 186 rtnl_lock(); 187 187 err = __rtnl_link_register(&dummy_link_ops); 188 + if (err < 0) 189 + goto out; 188 190 189 191 for (i = 0; i < numdummies && !err; i++) { 190 192 err = dummy_init_one(); ··· 194 192 } 195 193 if (err < 0) 196 194 __rtnl_link_unregister(&dummy_link_ops); 195 + 196 + out: 197 197 rtnl_unlock(); 198 198 199 199 return err;
+2 -3
drivers/net/ethernet/atheros/alx/main.c
··· 1245 1245 1246 1246 SET_NETDEV_DEV(netdev, &pdev->dev); 1247 1247 alx = netdev_priv(netdev); 1248 + spin_lock_init(&alx->hw.mdio_lock); 1249 + spin_lock_init(&alx->irq_lock); 1248 1250 alx->dev = netdev; 1249 1251 alx->hw.pdev = pdev; 1250 1252 alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP | ··· 1329 1327 1330 1328 INIT_WORK(&alx->link_check_wk, alx_link_check); 1331 1329 INIT_WORK(&alx->reset_wk, alx_reset); 1332 - spin_lock_init(&alx->hw.mdio_lock); 1333 - spin_lock_init(&alx->irq_lock); 1334 - 1335 1330 netif_carrier_off(netdev); 1336 1331 1337 1332 err = register_netdev(netdev);
+25 -3
drivers/net/ethernet/atheros/atl1e/atl1e_main.c
··· 1665 1665 return 0; 1666 1666 } 1667 1667 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) 1670 1670 { 1671 1671 struct atl1e_tpd_desc *use_tpd = NULL; 1672 1672 struct atl1e_tx_buffer *tx_buffer = NULL; ··· 1677 1677 u16 nr_frags; 1678 1678 u16 f; 1679 1679 int segment; 1680 + int ring_start = adapter->tx_ring.next_to_use; 1680 1681 1681 1682 nr_frags = skb_shinfo(skb)->nr_frags; 1682 1683 segment = (tpd->word3 >> TPD_SEGMENT_EN_SHIFT) & TPD_SEGMENT_EN_MASK; ··· 1690 1689 tx_buffer->length = map_len; 1691 1690 tx_buffer->dma = pci_map_single(adapter->pdev, 1692 1691 skb->data, hdr_len, PCI_DMA_TODEVICE); 1692 + if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) 1693 + return -ENOSPC; 1694 + 1693 1695 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE); 1694 1696 mapped_len += map_len; 1695 1697 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma); ··· 1719 1715 tx_buffer->dma = 1720 1716 pci_map_single(adapter->pdev, skb->data + mapped_len, 1721 1717 map_len, PCI_DMA_TODEVICE); 1718 + 1719 + if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) { 1720 + /* Reset the tx rings next pointer */ 1721 + adapter->tx_ring.next_to_use = ring_start; 1722 + return -ENOSPC; 1723 + } 1724 + 1722 1725 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE); 1723 1726 mapped_len += map_len; 1724 1727 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma); ··· 1761 1750 (i * MAX_TX_BUF_LEN), 1762 1751 tx_buffer->length, 1763 1752 DMA_TO_DEVICE); 1753 + 1754 + if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) { 1755 + /* Reset the ring next to use pointer */ 1756 + adapter->tx_ring.next_to_use = ring_start; 1757 + return -ENOSPC; 1758 + } 1759 + 1764 1760 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE); 1765 1761 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma); 1766 1762 use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) | ··· 1785 1767 /* The last buffer info contain the skb address, 1786 1768 so it will be free after unmap */ 1787 1769 tx_buffer->skb = skb; 1770 + return 0; 1788 1771 } 1789 1772 1790 1773 static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count, ··· 1853 1834 return NETDEV_TX_OK; 1854 1835 } 1855 1836 1856 - atl1e_tx_map(adapter, skb, tpd); 1837 + if (atl1e_tx_map(adapter, skb, tpd)) 1838 + goto out; 1839 + 1857 1840 atl1e_tx_queue(adapter, tpd_req, tpd); 1858 1841 1859 1842 netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */ 1843 + out: 1860 1844 spin_unlock_irqrestore(&adapter->tx_lock, flags); 1861 1845 return NETDEV_TX_OK; 1862 1846 }
+5 -5
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 24 24 #include <net/tcp.h> 25 25 #include <net/ipv6.h> 26 26 #include <net/ip6_checksum.h> 27 - #include <net/ll_poll.h> 27 + #include <net/busy_poll.h> 28 28 #include <linux/prefetch.h> 29 29 #include "bnx2x_cmn.h" 30 30 #include "bnx2x_init.h" ··· 990 990 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), 991 991 le16_to_cpu(cqe_fp->vlan_tag)); 992 992 993 - skb_mark_ll(skb, &fp->napi); 993 + skb_mark_napi_id(skb, &fp->napi); 994 994 995 995 if (bnx2x_fp_ll_polling(fp)) 996 996 netif_receive_skb(skb); ··· 3543 3543 /* outer IP header info */ 3544 3544 if (xmit_type & XMIT_CSUM_V4) { 3545 3545 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; 3549 3549 3550 3550 pbd2->fw_ip_csum_wo_len_flags_frag = 3551 3551 bswab16(csum_fold((__force __wsum)csum));
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 12027 12027 #endif 12028 12028 12029 12029 #ifdef CONFIG_NET_LL_RX_POLL 12030 - .ndo_ll_poll = bnx2x_low_latency_recv, 12030 + .ndo_busy_poll = bnx2x_low_latency_recv, 12031 12031 #endif 12032 12032 }; 12033 12033
-11
drivers/net/ethernet/cadence/at91_ether.c
··· 29 29 #include <linux/of.h> 30 30 #include <linux/of_device.h> 31 31 #include <linux/of_net.h> 32 - #include <linux/pinctrl/consumer.h> 33 32 34 33 #include "macb.h" 35 34 ··· 308 309 struct resource *regs; 309 310 struct net_device *dev; 310 311 struct phy_device *phydev; 311 - struct pinctrl *pinctrl; 312 312 struct macb *lp; 313 313 int res; 314 314 u32 reg; ··· 316 318 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 317 319 if (!regs) 318 320 return -ENOENT; 319 - 320 - pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 321 - if (IS_ERR(pinctrl)) { 322 - res = PTR_ERR(pinctrl); 323 - if (res == -EPROBE_DEFER) 324 - return res; 325 - 326 - dev_warn(&pdev->dev, "No pinctrl provided\n"); 327 - } 328 321 329 322 dev = alloc_etherdev(sizeof(struct macb)); 330 323 if (!dev)
+1 -1
drivers/net/ethernet/intel/ixgbe/ixgbe.h
··· 52 52 #include <linux/dca.h> 53 53 #endif 54 54 55 - #include <net/ll_poll.h> 55 + #include <net/busy_poll.h> 56 56 57 57 #ifdef CONFIG_NET_LL_RX_POLL 58 58 #define LL_EXTENDED_STATS
+2 -2
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 1978 1978 } 1979 1979 1980 1980 #endif /* IXGBE_FCOE */ 1981 - skb_mark_ll(skb, &q_vector->napi); 1981 + skb_mark_napi_id(skb, &q_vector->napi); 1982 1982 ixgbe_rx_skb(q_vector, skb); 1983 1983 1984 1984 /* update budget accounting */ ··· 7228 7228 .ndo_poll_controller = ixgbe_netpoll, 7229 7229 #endif 7230 7230 #ifdef CONFIG_NET_LL_RX_POLL 7231 - .ndo_ll_poll = ixgbe_low_latency_recv, 7231 + .ndo_busy_poll = ixgbe_low_latency_recv, 7232 7232 #endif 7233 7233 #ifdef IXGBE_FCOE 7234 7234 .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get,
+2 -2
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 38 38 #include <linux/slab.h> 39 39 #include <linux/hash.h> 40 40 #include <net/ip.h> 41 - #include <net/ll_poll.h> 41 + #include <net/busy_poll.h> 42 42 43 43 #include <linux/mlx4/driver.h> 44 44 #include <linux/mlx4/device.h> ··· 2141 2141 .ndo_rx_flow_steer = mlx4_en_filter_rfs, 2142 2142 #endif 2143 2143 #ifdef CONFIG_NET_LL_RX_POLL 2144 - .ndo_ll_poll = mlx4_en_low_latency_recv, 2144 + .ndo_busy_poll = mlx4_en_low_latency_recv, 2145 2145 #endif 2146 2146 }; 2147 2147
+2 -2
drivers/net/ethernet/mellanox/mlx4/en_rx.c
··· 31 31 * 32 32 */ 33 33 34 - #include <net/ll_poll.h> 34 + #include <net/busy_poll.h> 35 35 #include <linux/mlx4/cq.h> 36 36 #include <linux/slab.h> 37 37 #include <linux/mlx4/qp.h> ··· 767 767 timestamp); 768 768 } 769 769 770 - skb_mark_ll(skb, &cq->napi); 770 + skb_mark_napi_id(skb, &cq->napi); 771 771 772 772 /* Push it up the stack */ 773 773 netif_receive_skb(skb);
+67
drivers/net/ethernet/realtek/r8169.c
··· 46 46 #define FIRMWARE_8105E_1 "rtl_nic/rtl8105e-1.fw" 47 47 #define FIRMWARE_8402_1 "rtl_nic/rtl8402-1.fw" 48 48 #define FIRMWARE_8411_1 "rtl_nic/rtl8411-1.fw" 49 + #define FIRMWARE_8411_2 "rtl_nic/rtl8411-2.fw" 49 50 #define FIRMWARE_8106E_1 "rtl_nic/rtl8106e-1.fw" 50 51 #define FIRMWARE_8106E_2 "rtl_nic/rtl8106e-2.fw" 51 52 #define FIRMWARE_8168G_2 "rtl_nic/rtl8168g-2.fw" ··· 145 144 RTL_GIGA_MAC_VER_41, 146 145 RTL_GIGA_MAC_VER_42, 147 146 RTL_GIGA_MAC_VER_43, 147 + RTL_GIGA_MAC_VER_44, 148 148 RTL_GIGA_MAC_NONE = 0xff, 149 149 }; 150 150 ··· 278 276 [RTL_GIGA_MAC_VER_43] = 279 277 _R("RTL8106e", RTL_TD_1, FIRMWARE_8106E_2, 280 278 JUMBO_1K, true), 279 + [RTL_GIGA_MAC_VER_44] = 280 + _R("RTL8411", RTL_TD_1, FIRMWARE_8411_2, 281 + JUMBO_9K, false), 281 282 }; 282 283 #undef _R 283 284 ··· 399 394 #define CSIAR_FUNC_CARD 0x00000000 400 395 #define CSIAR_FUNC_SDIO 0x00010000 401 396 #define CSIAR_FUNC_NIC 0x00020000 397 + #define CSIAR_FUNC_NIC2 0x00010000 402 398 PMCH = 0x6f, 403 399 EPHYAR = 0x80, 404 400 #define EPHYAR_FLAG 0x80000000 ··· 832 826 MODULE_FIRMWARE(FIRMWARE_8168F_2); 833 827 MODULE_FIRMWARE(FIRMWARE_8402_1); 834 828 MODULE_FIRMWARE(FIRMWARE_8411_1); 829 + MODULE_FIRMWARE(FIRMWARE_8411_2); 835 830 MODULE_FIRMWARE(FIRMWARE_8106E_1); 836 831 MODULE_FIRMWARE(FIRMWARE_8106E_2); 837 832 MODULE_FIRMWARE(FIRMWARE_8168G_2); ··· 2058 2051 int mac_version; 2059 2052 } mac_info[] = { 2060 2053 /* 8168G family. */ 2054 + { 0x7cf00000, 0x5c800000, RTL_GIGA_MAC_VER_44 }, 2061 2055 { 0x7cf00000, 0x50900000, RTL_GIGA_MAC_VER_42 }, 2062 2056 { 0x7cf00000, 0x4c100000, RTL_GIGA_MAC_VER_41 }, 2063 2057 { 0x7cf00000, 0x4c000000, RTL_GIGA_MAC_VER_40 }, ··· 3659 3651 break; 3660 3652 case RTL_GIGA_MAC_VER_42: 3661 3653 case RTL_GIGA_MAC_VER_43: 3654 + case RTL_GIGA_MAC_VER_44: 3662 3655 rtl8168g_2_hw_phy_config(tp); 3663 3656 break; 3664 3657 ··· 3872 3863 case RTL_GIGA_MAC_VER_41: 3873 3864 case RTL_GIGA_MAC_VER_42: 3874 3865 case RTL_GIGA_MAC_VER_43: 3866 + case RTL_GIGA_MAC_VER_44: 3875 3867 ops->write = r8168g_mdio_write; 3876 3868 ops->read = r8168g_mdio_read; 3877 3869 break; ··· 3926 3916 case RTL_GIGA_MAC_VER_41: 3927 3917 case RTL_GIGA_MAC_VER_42: 3928 3918 case RTL_GIGA_MAC_VER_43: 3919 + case RTL_GIGA_MAC_VER_44: 3929 3920 RTL_W32(RxConfig, RTL_R32(RxConfig) | 3930 3921 AcceptBroadcast | AcceptMulticast | AcceptMyPhys); 3931 3922 break; ··· 4189 4178 case RTL_GIGA_MAC_VER_40: 4190 4179 case RTL_GIGA_MAC_VER_41: 4191 4180 case RTL_GIGA_MAC_VER_42: 4181 + case RTL_GIGA_MAC_VER_44: 4192 4182 ops->down = r8168_pll_power_down; 4193 4183 ops->up = r8168_pll_power_up; 4194 4184 break; ··· 4236 4224 case RTL_GIGA_MAC_VER_41: 4237 4225 case RTL_GIGA_MAC_VER_42: 4238 4226 case RTL_GIGA_MAC_VER_43: 4227 + case RTL_GIGA_MAC_VER_44: 4239 4228 RTL_W32(RxConfig, RX128_INT_EN | RX_DMA_BURST | RX_EARLY_OFF); 4240 4229 break; 4241 4230 default: ··· 4397 4384 case RTL_GIGA_MAC_VER_41: 4398 4385 case RTL_GIGA_MAC_VER_42: 4399 4386 case RTL_GIGA_MAC_VER_43: 4387 + case RTL_GIGA_MAC_VER_44: 4400 4388 default: 4401 4389 ops->disable = NULL; 4402 4390 ops->enable = NULL; ··· 4507 4493 tp->mac_version == RTL_GIGA_MAC_VER_41 || 4508 4494 tp->mac_version == RTL_GIGA_MAC_VER_42 || 4509 4495 tp->mac_version == RTL_GIGA_MAC_VER_43 || 4496 + tp->mac_version == RTL_GIGA_MAC_VER_44 || 4510 4497 tp->mac_version == RTL_GIGA_MAC_VER_38) { 4511 4498 RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq); 4512 4499 rtl_udelay_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666); ··· 4797 4782 RTL_R32(CSIDR) : ~0; 4798 4783 } 4799 4784 4785 + static void r8411_csi_write(struct rtl8169_private *tp, int addr, int value) 4786 + { 4787 + void __iomem *ioaddr = tp->mmio_addr; 4788 + 4789 + RTL_W32(CSIDR, value); 4790 + RTL_W32(CSIAR, CSIAR_WRITE_CMD | (addr & CSIAR_ADDR_MASK) | 4791 + CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT | 4792 + CSIAR_FUNC_NIC2); 4793 + 4794 + rtl_udelay_loop_wait_low(tp, &rtl_csiar_cond, 10, 100); 4795 + } 4796 + 4797 + static u32 r8411_csi_read(struct rtl8169_private *tp, int addr) 4798 + { 4799 + void __iomem *ioaddr = tp->mmio_addr; 4800 + 4801 + RTL_W32(CSIAR, (addr & CSIAR_ADDR_MASK) | CSIAR_FUNC_NIC2 | 4802 + CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT); 4803 + 4804 + return rtl_udelay_loop_wait_high(tp, &rtl_csiar_cond, 10, 100) ? 4805 + RTL_R32(CSIDR) : ~0; 4806 + } 4807 + 4800 4808 static void rtl_init_csi_ops(struct rtl8169_private *tp) 4801 4809 { 4802 4810 struct csi_ops *ops = &tp->csi_ops; ··· 4847 4809 case RTL_GIGA_MAC_VER_38: 4848 4810 ops->write = r8402_csi_write; 4849 4811 ops->read = r8402_csi_read; 4812 + break; 4813 + 4814 + case RTL_GIGA_MAC_VER_44: 4815 + ops->write = r8411_csi_write; 4816 + ops->read = r8411_csi_read; 4850 4817 break; 4851 4818 4852 4819 default: ··· 5298 5255 rtl_ephy_init(tp, e_info_8168g_2, ARRAY_SIZE(e_info_8168g_2)); 5299 5256 } 5300 5257 5258 + static void rtl_hw_start_8411_2(struct rtl8169_private *tp) 5259 + { 5260 + void __iomem *ioaddr = tp->mmio_addr; 5261 + static const struct ephy_info e_info_8411_2[] = { 5262 + { 0x00, 0x0000, 0x0008 }, 5263 + { 0x0c, 0x3df0, 0x0200 }, 5264 + { 0x0f, 0xffff, 0x5200 }, 5265 + { 0x19, 0x0020, 0x0000 }, 5266 + { 0x1e, 0x0000, 0x2000 } 5267 + }; 5268 + 5269 + rtl_hw_start_8168g_1(tp); 5270 + 5271 + /* disable aspm and clock request before access ephy */ 5272 + RTL_W8(Config2, RTL_R8(Config2) & ~ClkReqEn); 5273 + RTL_W8(Config5, RTL_R8(Config5) & ~ASPM_en); 5274 + rtl_ephy_init(tp, e_info_8411_2, ARRAY_SIZE(e_info_8411_2)); 5275 + } 5276 + 5301 5277 static void rtl_hw_start_8168(struct net_device *dev) 5302 5278 { 5303 5279 struct rtl8169_private *tp = netdev_priv(dev); ··· 5421 5359 break; 5422 5360 case RTL_GIGA_MAC_VER_42: 5423 5361 rtl_hw_start_8168g_2(tp); 5362 + break; 5363 + 5364 + case RTL_GIGA_MAC_VER_44: 5365 + rtl_hw_start_8411_2(tp); 5424 5366 break; 5425 5367 5426 5368 default: ··· 6943 6877 case RTL_GIGA_MAC_VER_41: 6944 6878 case RTL_GIGA_MAC_VER_42: 6945 6879 case RTL_GIGA_MAC_VER_43: 6880 + case RTL_GIGA_MAC_VER_44: 6946 6881 rtl_hw_init_8168g(tp); 6947 6882 break; 6948 6883
+1
drivers/net/ethernet/renesas/Kconfig
··· 4 4 5 5 config SH_ETH 6 6 tristate "Renesas SuperH Ethernet support" 7 + depends on HAS_DMA 7 8 select CRC32 8 9 select MII 9 10 select MDIO_BITBANG
+16 -1
drivers/net/ethernet/via/via-rhine.c
··· 1171 1171 rp->rx_skbuff_dma[i] = 1172 1172 pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz, 1173 1173 PCI_DMA_FROMDEVICE); 1174 - 1174 + if (dma_mapping_error(&rp->pdev->dev, rp->rx_skbuff_dma[i])) { 1175 + rp->rx_skbuff_dma[i] = 0; 1176 + dev_kfree_skb(skb); 1177 + break; 1178 + } 1175 1179 rp->rx_ring[i].addr = cpu_to_le32(rp->rx_skbuff_dma[i]); 1176 1180 rp->rx_ring[i].rx_status = cpu_to_le32(DescOwn); 1177 1181 } ··· 1691 1687 rp->tx_skbuff_dma[entry] = 1692 1688 pci_map_single(rp->pdev, skb->data, skb->len, 1693 1689 PCI_DMA_TODEVICE); 1690 + if (dma_mapping_error(&rp->pdev->dev, rp->tx_skbuff_dma[entry])) { 1691 + dev_kfree_skb(skb); 1692 + rp->tx_skbuff_dma[entry] = 0; 1693 + dev->stats.tx_dropped++; 1694 + return NETDEV_TX_OK; 1695 + } 1694 1696 rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_skbuff_dma[entry]); 1695 1697 } 1696 1698 ··· 1971 1961 pci_map_single(rp->pdev, skb->data, 1972 1962 rp->rx_buf_sz, 1973 1963 PCI_DMA_FROMDEVICE); 1964 + if (dma_mapping_error(&rp->pdev->dev, rp->rx_skbuff_dma[entry])) { 1965 + dev_kfree_skb(skb); 1966 + rp->rx_skbuff_dma[entry] = 0; 1967 + break; 1968 + } 1974 1969 rp->rx_ring[entry].addr = cpu_to_le32(rp->rx_skbuff_dma[entry]); 1975 1970 } 1976 1971 rp->rx_ring[entry].rx_status = cpu_to_le32(DescOwn);
-7
drivers/net/ieee802154/mrf24j40.c
··· 22 22 #include <linux/spi/spi.h> 23 23 #include <linux/interrupt.h> 24 24 #include <linux/module.h> 25 - #include <linux/pinctrl/consumer.h> 26 25 #include <net/wpan-phy.h> 27 26 #include <net/mac802154.h> 28 27 #include <net/ieee802154.h> ··· 626 627 int ret = -ENOMEM; 627 628 u8 val; 628 629 struct mrf24j40 *devrec; 629 - struct pinctrl *pinctrl; 630 630 631 631 printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq); 632 632 ··· 635 637 devrec->buf = kzalloc(3, GFP_KERNEL); 636 638 if (!devrec->buf) 637 639 goto err_buf; 638 - 639 - pinctrl = devm_pinctrl_get_select_default(&spi->dev); 640 - if (IS_ERR(pinctrl)) 641 - dev_warn(&spi->dev, 642 - "pinctrl pins are not configured from the driver"); 643 640 644 641 spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */ 645 642 if (spi->max_speed_hz > MAX_SPI_SPEED_HZ)
+7 -1
drivers/net/ifb.c
··· 291 291 292 292 rtnl_lock(); 293 293 err = __rtnl_link_register(&ifb_link_ops); 294 + if (err < 0) 295 + goto out; 294 296 295 - for (i = 0; i < numifbs && !err; i++) 297 + for (i = 0; i < numifbs && !err; i++) { 296 298 err = ifb_init_one(i); 299 + cond_resched(); 300 + } 297 301 if (err) 298 302 __rtnl_link_unregister(&ifb_link_ops); 303 + 304 + out: 299 305 rtnl_unlock(); 300 306 301 307 return err;
+6 -2
drivers/net/macvtap.c
··· 712 712 int vnet_hdr_len = 0; 713 713 int copylen = 0; 714 714 bool zerocopy = false; 715 + size_t linear; 715 716 716 717 if (q->flags & IFF_VNET_HDR) { 717 718 vnet_hdr_len = q->vnet_hdr_sz; ··· 767 766 copylen = vnet_hdr.hdr_len; 768 767 if (!copylen) 769 768 copylen = GOODCOPY_LEN; 770 - } else 769 + linear = copylen; 770 + } else { 771 771 copylen = len; 772 + linear = vnet_hdr.hdr_len; 773 + } 772 774 773 775 skb = macvtap_alloc_skb(&q->sk, NET_IP_ALIGN, copylen, 774 - vnet_hdr.hdr_len, noblock, &err); 776 + linear, noblock, &err); 775 777 if (!skb) 776 778 goto err; 777 779
+1
drivers/net/phy/at803x.c
··· 217 217 218 218 static struct mdio_device_id __maybe_unused atheros_tbl[] = { 219 219 { 0x004dd076, 0xffffffef }, 220 + { 0x004dd074, 0xffffffef }, 220 221 { 0x004dd072, 0xffffffef }, 221 222 { } 222 223 };
+6 -3
drivers/net/tun.c
··· 1042 1042 { 1043 1043 struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) }; 1044 1044 struct sk_buff *skb; 1045 - size_t len = total_len, align = NET_SKB_PAD; 1045 + size_t len = total_len, align = NET_SKB_PAD, linear; 1046 1046 struct virtio_net_hdr gso = { 0 }; 1047 1047 int offset = 0; 1048 1048 int copylen; ··· 1106 1106 copylen = gso.hdr_len; 1107 1107 if (!copylen) 1108 1108 copylen = GOODCOPY_LEN; 1109 - } else 1109 + linear = copylen; 1110 + } else { 1110 1111 copylen = len; 1112 + linear = gso.hdr_len; 1113 + } 1111 1114 1112 - skb = tun_alloc_skb(tfile, align, copylen, gso.hdr_len, noblock); 1115 + skb = tun_alloc_skb(tfile, align, copylen, linear, noblock); 1113 1116 if (IS_ERR(skb)) { 1114 1117 if (PTR_ERR(skb) != -EAGAIN) 1115 1118 tun->dev->stats.rx_dropped++;
+1 -1
drivers/net/usb/Makefile
··· 11 11 obj-$(CONFIG_USB_NET_AX8817X) += asix.o 12 12 asix-y := asix_devices.o asix_common.o ax88172a.o 13 13 obj-$(CONFIG_USB_NET_AX88179_178A) += ax88179_178a.o 14 - obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o 14 + obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o r815x.o 15 15 obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o 16 16 obj-$(CONFIG_USB_NET_DM9601) += dm9601.o 17 17 obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o
+7 -2
drivers/net/usb/cdc_ether.c
··· 646 646 }, 647 647 648 648 /* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */ 649 - #if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE) 650 649 { 651 650 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, 652 651 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 653 652 .driver_info = 0, 654 653 }, 655 - #endif 654 + 655 + /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */ 656 + { 657 + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, 658 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 659 + .driver_info = 0, 660 + }, 656 661 657 662 /* 658 663 * WHITELIST!!!
+2 -1
drivers/net/usb/r8152.c
··· 934 934 struct r8152 *tp = netdev_priv(netdev); 935 935 struct net_device_stats *stats = rtl8152_get_stats(netdev); 936 936 struct tx_desc *tx_desc; 937 - int len, res; 937 + unsigned int len; 938 + int res; 938 939 939 940 netif_stop_queue(netdev); 940 941 len = skb->len;
+234
drivers/net/usb/r815x.c
··· 1 + #include <linux/module.h> 2 + #include <linux/netdevice.h> 3 + #include <linux/mii.h> 4 + #include <linux/usb.h> 5 + #include <linux/usb/cdc.h> 6 + #include <linux/usb/usbnet.h> 7 + 8 + #define RTL815x_REQT_READ 0xc0 9 + #define RTL815x_REQT_WRITE 0x40 10 + #define RTL815x_REQ_GET_REGS 0x05 11 + #define RTL815x_REQ_SET_REGS 0x05 12 + 13 + #define MCU_TYPE_PLA 0x0100 14 + #define OCP_BASE 0xe86c 15 + #define BASE_MII 0xa400 16 + 17 + #define BYTE_EN_DWORD 0xff 18 + #define BYTE_EN_WORD 0x33 19 + #define BYTE_EN_BYTE 0x11 20 + 21 + #define R815x_PHY_ID 32 22 + #define REALTEK_VENDOR_ID 0x0bda 23 + 24 + 25 + static int pla_read_word(struct usb_device *udev, u16 index) 26 + { 27 + int data, ret; 28 + u8 shift = index & 2; 29 + __le32 ocp_data; 30 + 31 + index &= ~3; 32 + 33 + ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 34 + RTL815x_REQ_GET_REGS, RTL815x_REQT_READ, 35 + index, MCU_TYPE_PLA, &ocp_data, sizeof(ocp_data), 36 + 500); 37 + if (ret < 0) 38 + return ret; 39 + 40 + data = __le32_to_cpu(ocp_data); 41 + data >>= (shift * 8); 42 + data &= 0xffff; 43 + 44 + return data; 45 + } 46 + 47 + static int pla_write_word(struct usb_device *udev, u16 index, u32 data) 48 + { 49 + __le32 ocp_data; 50 + u32 mask = 0xffff; 51 + u16 byen = BYTE_EN_WORD; 52 + u8 shift = index & 2; 53 + int ret; 54 + 55 + data &= mask; 56 + 57 + if (shift) { 58 + byen <<= shift; 59 + mask <<= (shift * 8); 60 + data <<= (shift * 8); 61 + index &= ~3; 62 + } 63 + 64 + ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 65 + RTL815x_REQ_GET_REGS, RTL815x_REQT_READ, 66 + index, MCU_TYPE_PLA, &ocp_data, sizeof(ocp_data), 67 + 500); 68 + if (ret < 0) 69 + return ret; 70 + 71 + data |= __le32_to_cpu(ocp_data) & ~mask; 72 + ocp_data = __cpu_to_le32(data); 73 + 74 + ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 75 + RTL815x_REQ_SET_REGS, RTL815x_REQT_WRITE, 76 + index, MCU_TYPE_PLA | byen, &ocp_data, 77 + sizeof(ocp_data), 500); 78 + 79 + return ret; 80 + } 81 + 82 + static int ocp_reg_read(struct usbnet *dev, u16 addr) 83 + { 84 + u16 ocp_base, ocp_index; 85 + int ret; 86 + 87 + ocp_base = addr & 0xf000; 88 + ret = pla_write_word(dev->udev, OCP_BASE, ocp_base); 89 + if (ret < 0) 90 + goto out; 91 + 92 + ocp_index = (addr & 0x0fff) | 0xb000; 93 + ret = pla_read_word(dev->udev, ocp_index); 94 + 95 + out: 96 + return ret; 97 + } 98 + 99 + static int ocp_reg_write(struct usbnet *dev, u16 addr, u16 data) 100 + { 101 + u16 ocp_base, ocp_index; 102 + int ret; 103 + 104 + ocp_base = addr & 0xf000; 105 + ret = pla_write_word(dev->udev, OCP_BASE, ocp_base); 106 + if (ret < 0) 107 + goto out1; 108 + 109 + ocp_index = (addr & 0x0fff) | 0xb000; 110 + ret = pla_write_word(dev->udev, ocp_index, data); 111 + 112 + out1: 113 + return ret; 114 + } 115 + 116 + static int r815x_mdio_read(struct net_device *netdev, int phy_id, int reg) 117 + { 118 + struct usbnet *dev = netdev_priv(netdev); 119 + 120 + if (phy_id != R815x_PHY_ID) 121 + return -EINVAL; 122 + 123 + return ocp_reg_read(dev, BASE_MII + reg * 2); 124 + } 125 + 126 + static 127 + void r815x_mdio_write(struct net_device *netdev, int phy_id, int reg, int val) 128 + { 129 + struct usbnet *dev = netdev_priv(netdev); 130 + 131 + if (phy_id != R815x_PHY_ID) 132 + return; 133 + 134 + ocp_reg_write(dev, BASE_MII + reg * 2, val); 135 + } 136 + 137 + static int r8153_bind(struct usbnet *dev, struct usb_interface *intf) 138 + { 139 + int status; 140 + 141 + status = usbnet_cdc_bind(dev, intf); 142 + if (status < 0) 143 + return status; 144 + 145 + dev->mii.dev = dev->net; 146 + dev->mii.mdio_read = r815x_mdio_read; 147 + dev->mii.mdio_write = r815x_mdio_write; 148 + dev->mii.phy_id_mask = 0x3f; 149 + dev->mii.reg_num_mask = 0x1f; 150 + dev->mii.phy_id = R815x_PHY_ID; 151 + dev->mii.supports_gmii = 1; 152 + 153 + return 0; 154 + } 155 + 156 + static int r8152_bind(struct usbnet *dev, struct usb_interface *intf) 157 + { 158 + int status; 159 + 160 + status = usbnet_cdc_bind(dev, intf); 161 + if (status < 0) 162 + return status; 163 + 164 + dev->mii.dev = dev->net; 165 + dev->mii.mdio_read = r815x_mdio_read; 166 + dev->mii.mdio_write = r815x_mdio_write; 167 + dev->mii.phy_id_mask = 0x3f; 168 + dev->mii.reg_num_mask = 0x1f; 169 + dev->mii.phy_id = R815x_PHY_ID; 170 + dev->mii.supports_gmii = 0; 171 + 172 + return 0; 173 + } 174 + 175 + static const struct driver_info r8152_info = { 176 + .description = "RTL8152 ECM Device", 177 + .flags = FLAG_ETHER | FLAG_POINTTOPOINT, 178 + .bind = r8152_bind, 179 + .unbind = usbnet_cdc_unbind, 180 + .status = usbnet_cdc_status, 181 + .manage_power = usbnet_manage_power, 182 + }; 183 + 184 + static const struct driver_info r8153_info = { 185 + .description = "RTL8153 ECM Device", 186 + .flags = FLAG_ETHER | FLAG_POINTTOPOINT, 187 + .bind = r8153_bind, 188 + .unbind = usbnet_cdc_unbind, 189 + .status = usbnet_cdc_status, 190 + .manage_power = usbnet_manage_power, 191 + }; 192 + 193 + static const struct usb_device_id products[] = { 194 + { 195 + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, 196 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 197 + #if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE) 198 + .driver_info = 0, 199 + #else 200 + .driver_info = (unsigned long) &r8152_info, 201 + #endif 202 + }, 203 + 204 + { 205 + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, 206 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 207 + #if defined(CONFIG_USB_RTL8153) || defined(CONFIG_USB_RTL8153_MODULE) 208 + .driver_info = 0, 209 + #else 210 + .driver_info = (unsigned long) &r8153_info, 211 + #endif 212 + }, 213 + 214 + { }, /* END */ 215 + }; 216 + MODULE_DEVICE_TABLE(usb, products); 217 + 218 + static struct usb_driver r815x_driver = { 219 + .name = "r815x", 220 + .id_table = products, 221 + .probe = usbnet_probe, 222 + .disconnect = usbnet_disconnect, 223 + .suspend = usbnet_suspend, 224 + .resume = usbnet_resume, 225 + .reset_resume = usbnet_resume, 226 + .supports_autosuspend = 1, 227 + .disable_hub_initiated_lpm = 1, 228 + }; 229 + 230 + module_usb_driver(r815x_driver); 231 + 232 + MODULE_AUTHOR("Hayes Wang"); 233 + MODULE_DESCRIPTION("Realtek USB ECM device"); 234 + MODULE_LICENSE("GPL");
+1 -1
drivers/net/vxlan.c
··· 1916 1916 1917 1917 static void __exit vxlan_cleanup_module(void) 1918 1918 { 1919 - unregister_pernet_device(&vxlan_net_ops); 1920 1919 rtnl_link_unregister(&vxlan_link_ops); 1921 1920 destroy_workqueue(vxlan_wq); 1921 + unregister_pernet_device(&vxlan_net_ops); 1922 1922 rcu_barrier(); 1923 1923 } 1924 1924 module_exit(vxlan_cleanup_module);
+1 -1
fs/select.c
··· 28 28 #include <linux/hrtimer.h> 29 29 #include <linux/sched/rt.h> 30 30 #include <linux/freezer.h> 31 - #include <net/ll_poll.h> 31 + #include <net/busy_poll.h> 32 32 33 33 #include <asm/uaccess.h> 34 34
+1 -1
include/linux/netdevice.h
··· 974 974 void (*ndo_netpoll_cleanup)(struct net_device *dev); 975 975 #endif 976 976 #ifdef CONFIG_NET_LL_RX_POLL 977 - int (*ndo_ll_poll)(struct napi_struct *dev); 977 + int (*ndo_busy_poll)(struct napi_struct *dev); 978 978 #endif 979 979 int (*ndo_set_vf_mac)(struct net_device *dev, 980 980 int queue, u8 *mac);
+16 -14
include/net/ll_poll.h include/net/busy_poll.h
··· 1 1 /* 2 - * Low Latency Sockets 2 + * net busy poll support 3 3 * Copyright(c) 2013 Intel Corporation. 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify it ··· 21 21 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 22 22 */ 23 23 24 - #ifndef _LINUX_NET_LL_POLL_H 25 - #define _LINUX_NET_LL_POLL_H 24 + #ifndef _LINUX_NET_BUSY_POLL_H 25 + #define _LINUX_NET_BUSY_POLL_H 26 26 27 27 #include <linux/netdevice.h> 28 28 #include <net/ip.h> ··· 30 30 #ifdef CONFIG_NET_LL_RX_POLL 31 31 32 32 struct napi_struct; 33 - extern unsigned int sysctl_net_ll_read __read_mostly; 34 - extern unsigned int sysctl_net_ll_poll __read_mostly; 33 + extern unsigned int sysctl_net_busy_read __read_mostly; 34 + extern unsigned int sysctl_net_busy_poll __read_mostly; 35 35 36 36 /* return values from ndo_ll_poll */ 37 37 #define LL_FLUSH_FAILED -1 ··· 39 39 40 40 static inline bool net_busy_loop_on(void) 41 41 { 42 - return sysctl_net_ll_poll; 42 + return sysctl_net_busy_poll; 43 43 } 44 44 45 45 /* a wrapper to make debug_smp_processor_id() happy ··· 72 72 /* in poll/select we use the global sysctl_net_ll_poll value */ 73 73 static inline unsigned long busy_loop_end_time(void) 74 74 { 75 - return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_ll_poll); 75 + return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll); 76 76 } 77 77 78 78 static inline bool sk_can_busy_loop(struct sock *sk) ··· 110 110 goto out; 111 111 112 112 ops = napi->dev->netdev_ops; 113 - if (!ops->ndo_ll_poll) 113 + if (!ops->ndo_busy_poll) 114 114 goto out; 115 115 116 116 do { 117 - rc = ops->ndo_ll_poll(napi); 117 + rc = ops->ndo_busy_poll(napi); 118 118 119 119 if (rc == LL_FLUSH_FAILED) 120 120 break; /* permanent failure */ ··· 134 134 } 135 135 136 136 /* used in the NIC receive handler to mark the skb */ 137 - static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi) 137 + static inline void skb_mark_napi_id(struct sk_buff *skb, 138 + struct napi_struct *napi) 138 139 { 139 140 skb->napi_id = napi->napi_id; 140 141 } 141 142 142 143 /* used in the protocol hanlder to propagate the napi_id to the socket */ 143 - static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb) 144 + static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb) 144 145 { 145 146 sk->sk_napi_id = skb->napi_id; 146 147 } ··· 167 166 return false; 168 167 } 169 168 170 - static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi) 169 + static inline void skb_mark_napi_id(struct sk_buff *skb, 170 + struct napi_struct *napi) 171 171 { 172 172 } 173 173 174 - static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb) 174 + static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb) 175 175 { 176 176 } 177 177 ··· 182 180 } 183 181 184 182 #endif /* CONFIG_NET_LL_RX_POLL */ 185 - #endif /* _LINUX_NET_LL_POLL_H */ 183 + #endif /* _LINUX_NET_BUSY_POLL_H */
+1 -1
include/uapi/asm-generic/socket.h
··· 76 76 77 77 #define SO_SELECT_ERR_QUEUE 45 78 78 79 - #define SO_LL 46 79 + #define SO_BUSY_POLL 46 80 80 81 81 #endif /* __ASM_GENERIC_SOCKET_H */
+5 -5
net/9p/trans_common.c
··· 24 24 */ 25 25 void p9_release_pages(struct page **pages, int nr_pages) 26 26 { 27 - int i = 0; 28 - while (pages[i] && nr_pages--) { 29 - put_page(pages[i]); 30 - i++; 31 - } 27 + int i; 28 + 29 + for (i = 0; i < nr_pages; i++) 30 + if (pages[i]) 31 + put_page(pages[i]); 32 32 } 33 33 EXPORT_SYMBOL(p9_release_pages); 34 34
+1 -1
net/core/datagram.c
··· 56 56 #include <net/sock.h> 57 57 #include <net/tcp_states.h> 58 58 #include <trace/events/skb.h> 59 - #include <net/ll_poll.h> 59 + #include <net/busy_poll.h> 60 60 61 61 /* 62 62 * Is a socket 'connection oriented' ?
+6 -8
net/core/dev.c
··· 2481 2481 } 2482 2482 2483 2483 static netdev_features_t harmonize_features(struct sk_buff *skb, 2484 - __be16 protocol, netdev_features_t features) 2484 + netdev_features_t features) 2485 2485 { 2486 2486 if (skb->ip_summed != CHECKSUM_NONE && 2487 - !can_checksum_protocol(features, protocol)) { 2487 + !can_checksum_protocol(features, skb_network_protocol(skb))) { 2488 2488 features &= ~NETIF_F_ALL_CSUM; 2489 2489 } else if (illegal_highdma(skb->dev, skb)) { 2490 2490 features &= ~NETIF_F_SG; ··· 2505 2505 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; 2506 2506 protocol = veh->h_vlan_encapsulated_proto; 2507 2507 } else if (!vlan_tx_tag_present(skb)) { 2508 - return harmonize_features(skb, protocol, features); 2508 + return harmonize_features(skb, features); 2509 2509 } 2510 2510 2511 2511 features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX | 2512 2512 NETIF_F_HW_VLAN_STAG_TX); 2513 2513 2514 - if (protocol != htons(ETH_P_8021Q) && protocol != htons(ETH_P_8021AD)) { 2515 - return harmonize_features(skb, protocol, features); 2516 - } else { 2514 + if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) 2517 2515 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 2518 2516 NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX | 2519 2517 NETIF_F_HW_VLAN_STAG_TX; 2520 - return harmonize_features(skb, protocol, features); 2521 - } 2518 + 2519 + return harmonize_features(skb, features); 2522 2520 } 2523 2521 EXPORT_SYMBOL(netif_skb_features); 2524 2522
+3 -3
net/core/skbuff.c
··· 824 824 page = alloc_page(gfp_mask); 825 825 if (!page) { 826 826 while (head) { 827 - struct page *next = (struct page *)head->private; 827 + struct page *next = (struct page *)page_private(head); 828 828 put_page(head); 829 829 head = next; 830 830 } ··· 834 834 memcpy(page_address(page), 835 835 vaddr + f->page_offset, skb_frag_size(f)); 836 836 kunmap_atomic(vaddr); 837 - page->private = (unsigned long)head; 837 + set_page_private(page, (unsigned long)head); 838 838 head = page; 839 839 } 840 840 ··· 848 848 for (i = num_frags - 1; i >= 0; i--) { 849 849 __skb_fill_page_desc(skb, i, head, 0, 850 850 skb_shinfo(skb)->frags[i].size); 851 - head = (struct page *)head->private; 851 + head = (struct page *)page_private(head); 852 852 } 853 853 854 854 skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
+4 -4
net/core/sock.c
··· 139 139 #include <net/tcp.h> 140 140 #endif 141 141 142 - #include <net/ll_poll.h> 142 + #include <net/busy_poll.h> 143 143 144 144 static DEFINE_MUTEX(proto_list_mutex); 145 145 static LIST_HEAD(proto_list); ··· 901 901 break; 902 902 903 903 #ifdef CONFIG_NET_LL_RX_POLL 904 - case SO_LL: 904 + case SO_BUSY_POLL: 905 905 /* allow unprivileged users to decrease the value */ 906 906 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) 907 907 ret = -EPERM; ··· 1171 1171 break; 1172 1172 1173 1173 #ifdef CONFIG_NET_LL_RX_POLL 1174 - case SO_LL: 1174 + case SO_BUSY_POLL: 1175 1175 v.val = sk->sk_ll_usec; 1176 1176 break; 1177 1177 #endif ··· 2294 2294 2295 2295 #ifdef CONFIG_NET_LL_RX_POLL 2296 2296 sk->sk_napi_id = 0; 2297 - sk->sk_ll_usec = sysctl_net_ll_read; 2297 + sk->sk_ll_usec = sysctl_net_busy_read; 2298 2298 #endif 2299 2299 2300 2300 /*
+5 -5
net/core/sysctl_net_core.c
··· 19 19 #include <net/ip.h> 20 20 #include <net/sock.h> 21 21 #include <net/net_ratelimit.h> 22 - #include <net/ll_poll.h> 22 + #include <net/busy_poll.h> 23 23 24 24 static int one = 1; 25 25 ··· 300 300 #endif /* CONFIG_NET_FLOW_LIMIT */ 301 301 #ifdef CONFIG_NET_LL_RX_POLL 302 302 { 303 - .procname = "low_latency_poll", 304 - .data = &sysctl_net_ll_poll, 303 + .procname = "busy_poll", 304 + .data = &sysctl_net_busy_poll, 305 305 .maxlen = sizeof(unsigned int), 306 306 .mode = 0644, 307 307 .proc_handler = proc_dointvec 308 308 }, 309 309 { 310 - .procname = "low_latency_read", 311 - .data = &sysctl_net_ll_read, 310 + .procname = "busy_read", 311 + .data = &sysctl_net_busy_read, 312 312 .maxlen = sizeof(unsigned int), 313 313 .mode = 0644, 314 314 .proc_handler = proc_dointvec
+1 -1
net/dns_resolver/dns_key.c
··· 118 118 if (opt_vlen <= 0) 119 119 goto bad_option_value; 120 120 121 - ret = strict_strtoul(eq, 10, &derrno); 121 + ret = kstrtoul(eq, 10, &derrno); 122 122 if (ret < 0) 123 123 goto bad_option_value; 124 124
+3
net/ipv4/gre_offload.c
··· 100 100 } 101 101 __skb_push(skb, tnl_hlen - ghl); 102 102 103 + skb_reset_inner_headers(skb); 104 + skb->encapsulation = 1; 105 + 103 106 skb_reset_mac_header(skb); 104 107 skb_set_network_header(skb, mac_len); 105 108 skb->mac_len = mac_len;
+1 -1
net/ipv4/inet_hashtables.c
··· 467 467 lock = inet_ehash_lockp(hashinfo, sk->sk_hash); 468 468 469 469 spin_lock_bh(lock); 470 - done =__sk_nulls_del_node_init_rcu(sk); 470 + done = __sk_nulls_del_node_init_rcu(sk); 471 471 if (done) 472 472 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 473 473 spin_unlock_bh(lock);
+1 -1
net/ipv4/ip_tunnel.c
··· 476 476 struct rtable *rt, __be16 df) 477 477 { 478 478 struct ip_tunnel *tunnel = netdev_priv(dev); 479 - int pkt_size = skb->len - tunnel->hlen; 479 + int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len; 480 480 int mtu; 481 481 482 482 if (df)
+1 -1
net/ipv4/tcp.c
··· 279 279 280 280 #include <asm/uaccess.h> 281 281 #include <asm/ioctls.h> 282 - #include <net/ll_poll.h> 282 + #include <net/busy_poll.h> 283 283 284 284 int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT; 285 285
+2 -2
net/ipv4/tcp_ipv4.c
··· 75 75 #include <net/netdma.h> 76 76 #include <net/secure_seq.h> 77 77 #include <net/tcp_memcontrol.h> 78 - #include <net/ll_poll.h> 78 + #include <net/busy_poll.h> 79 79 80 80 #include <linux/inet.h> 81 81 #include <linux/ipv6.h> ··· 1994 1994 if (sk_filter(sk, skb)) 1995 1995 goto discard_and_relse; 1996 1996 1997 - sk_mark_ll(sk, skb); 1997 + sk_mark_napi_id(sk, skb); 1998 1998 skb->dev = NULL; 1999 1999 2000 2000 bh_lock_sock_nested(sk);
+4 -3
net/ipv4/tcp_output.c
··· 2407 2407 * see tcp_input.c tcp_sacktag_write_queue(). 2408 2408 */ 2409 2409 TCP_SKB_CB(skb)->ack_seq = tp->snd_nxt; 2410 + } else { 2411 + NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL); 2410 2412 } 2411 2413 return err; 2412 2414 } ··· 2530 2528 if (sacked & (TCPCB_SACKED_ACKED|TCPCB_SACKED_RETRANS)) 2531 2529 continue; 2532 2530 2533 - if (tcp_retransmit_skb(sk, skb)) { 2534 - NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL); 2531 + if (tcp_retransmit_skb(sk, skb)) 2535 2532 return; 2536 - } 2533 + 2537 2534 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2538 2535 2539 2536 if (tcp_in_cwnd_reduction(sk))
+5 -3
net/ipv4/udp.c
··· 109 109 #include <trace/events/udp.h> 110 110 #include <linux/static_key.h> 111 111 #include <trace/events/skb.h> 112 - #include <net/ll_poll.h> 112 + #include <net/busy_poll.h> 113 113 #include "udp_impl.h" 114 114 115 115 struct udp_table udp_table __read_mostly; ··· 1713 1713 if (sk != NULL) { 1714 1714 int ret; 1715 1715 1716 - sk_mark_ll(sk, skb); 1716 + sk_mark_napi_id(sk, skb); 1717 1717 ret = udp_queue_rcv_skb(sk, skb); 1718 1718 sock_put(sk); 1719 1719 ··· 2323 2323 struct udphdr *uh; 2324 2324 int udp_offset = outer_hlen - tnl_hlen; 2325 2325 2326 + skb_reset_inner_headers(skb); 2327 + skb->encapsulation = 1; 2328 + 2326 2329 skb->mac_len = mac_len; 2327 2330 2328 2331 skb_push(skb, outer_hlen); ··· 2348 2345 uh->check = CSUM_MANGLED_0; 2349 2346 2350 2347 } 2351 - skb->ip_summed = CHECKSUM_NONE; 2352 2348 skb->protocol = protocol; 2353 2349 } while ((skb = skb->next)); 2354 2350 out:
+11 -4
net/ipv6/ip6_fib.c
··· 632 632 return ln; 633 633 } 634 634 635 + static inline bool rt6_qualify_for_ecmp(struct rt6_info *rt) 636 + { 637 + return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) == 638 + RTF_GATEWAY; 639 + } 640 + 635 641 /* 636 642 * Insert routing information in a node. 637 643 */ ··· 652 646 int add = (!info->nlh || 653 647 (info->nlh->nlmsg_flags & NLM_F_CREATE)); 654 648 int found = 0; 649 + bool rt_can_ecmp = rt6_qualify_for_ecmp(rt); 655 650 656 651 ins = &fn->leaf; 657 652 ··· 698 691 * To avoid long list, we only had siblings if the 699 692 * route have a gateway. 700 693 */ 701 - if (rt->rt6i_flags & RTF_GATEWAY && 702 - !(rt->rt6i_flags & RTF_EXPIRES) && 703 - !(iter->rt6i_flags & RTF_EXPIRES)) 694 + if (rt_can_ecmp && 695 + rt6_qualify_for_ecmp(iter)) 704 696 rt->rt6i_nsiblings++; 705 697 } 706 698 ··· 721 715 /* Find the first route that have the same metric */ 722 716 sibling = fn->leaf; 723 717 while (sibling) { 724 - if (sibling->rt6i_metric == rt->rt6i_metric) { 718 + if (sibling->rt6i_metric == rt->rt6i_metric && 719 + rt6_qualify_for_ecmp(sibling)) { 725 720 list_add_tail(&rt->rt6i_siblings, 726 721 &sibling->rt6i_siblings); 727 722 break;
+49 -29
net/ipv6/route.c
··· 65 65 #include <linux/sysctl.h> 66 66 #endif 67 67 68 + enum rt6_nud_state { 69 + RT6_NUD_FAIL_HARD = -2, 70 + RT6_NUD_FAIL_SOFT = -1, 71 + RT6_NUD_SUCCEED = 1 72 + }; 73 + 68 74 static struct rt6_info *ip6_rt_copy(struct rt6_info *ort, 69 75 const struct in6_addr *dest); 70 76 static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); ··· 537 531 return 0; 538 532 } 539 533 540 - static inline bool rt6_check_neigh(struct rt6_info *rt) 534 + static inline enum rt6_nud_state rt6_check_neigh(struct rt6_info *rt) 541 535 { 542 536 struct neighbour *neigh; 543 - bool ret = false; 537 + enum rt6_nud_state ret = RT6_NUD_FAIL_HARD; 544 538 545 539 if (rt->rt6i_flags & RTF_NONEXTHOP || 546 540 !(rt->rt6i_flags & RTF_GATEWAY)) 547 - return true; 541 + return RT6_NUD_SUCCEED; 548 542 549 543 rcu_read_lock_bh(); 550 544 neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway); 551 545 if (neigh) { 552 546 read_lock(&neigh->lock); 553 547 if (neigh->nud_state & NUD_VALID) 554 - ret = true; 548 + ret = RT6_NUD_SUCCEED; 555 549 #ifdef CONFIG_IPV6_ROUTER_PREF 556 550 else if (!(neigh->nud_state & NUD_FAILED)) 557 - ret = true; 551 + ret = RT6_NUD_SUCCEED; 558 552 #endif 559 553 read_unlock(&neigh->lock); 560 - } else if (IS_ENABLED(CONFIG_IPV6_ROUTER_PREF)) { 561 - ret = true; 554 + } else { 555 + ret = IS_ENABLED(CONFIG_IPV6_ROUTER_PREF) ? 556 + RT6_NUD_SUCCEED : RT6_NUD_FAIL_SOFT; 562 557 } 563 558 rcu_read_unlock_bh(); 564 559 ··· 573 566 574 567 m = rt6_check_dev(rt, oif); 575 568 if (!m && (strict & RT6_LOOKUP_F_IFACE)) 576 - return -1; 569 + return RT6_NUD_FAIL_HARD; 577 570 #ifdef CONFIG_IPV6_ROUTER_PREF 578 571 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; 579 572 #endif 580 - if (!rt6_check_neigh(rt) && (strict & RT6_LOOKUP_F_REACHABLE)) 581 - return -1; 573 + if (strict & RT6_LOOKUP_F_REACHABLE) { 574 + int n = rt6_check_neigh(rt); 575 + if (n < 0) 576 + return n; 577 + } 582 578 return m; 583 579 } 584 580 585 581 static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict, 586 - int *mpri, struct rt6_info *match) 582 + int *mpri, struct rt6_info *match, 583 + bool *do_rr) 587 584 { 588 585 int m; 586 + bool match_do_rr = false; 589 587 590 588 if (rt6_check_expired(rt)) 591 589 goto out; 592 590 593 591 m = rt6_score_route(rt, oif, strict); 594 - if (m < 0) 592 + if (m == RT6_NUD_FAIL_SOFT && !IS_ENABLED(CONFIG_IPV6_ROUTER_PREF)) { 593 + match_do_rr = true; 594 + m = 0; /* lowest valid score */ 595 + } else if (m < 0) { 595 596 goto out; 596 - 597 - if (m > *mpri) { 598 - if (strict & RT6_LOOKUP_F_REACHABLE) 599 - rt6_probe(match); 600 - *mpri = m; 601 - match = rt; 602 - } else if (strict & RT6_LOOKUP_F_REACHABLE) { 603 - rt6_probe(rt); 604 597 } 605 598 599 + if (strict & RT6_LOOKUP_F_REACHABLE) 600 + rt6_probe(rt); 601 + 602 + if (m > *mpri) { 603 + *do_rr = match_do_rr; 604 + *mpri = m; 605 + match = rt; 606 + } 606 607 out: 607 608 return match; 608 609 } 609 610 610 611 static struct rt6_info *find_rr_leaf(struct fib6_node *fn, 611 612 struct rt6_info *rr_head, 612 - u32 metric, int oif, int strict) 613 + u32 metric, int oif, int strict, 614 + bool *do_rr) 613 615 { 614 616 struct rt6_info *rt, *match; 615 617 int mpri = -1; ··· 626 610 match = NULL; 627 611 for (rt = rr_head; rt && rt->rt6i_metric == metric; 628 612 rt = rt->dst.rt6_next) 629 - match = find_match(rt, oif, strict, &mpri, match); 613 + match = find_match(rt, oif, strict, &mpri, match, do_rr); 630 614 for (rt = fn->leaf; rt && rt != rr_head && rt->rt6i_metric == metric; 631 615 rt = rt->dst.rt6_next) 632 - match = find_match(rt, oif, strict, &mpri, match); 616 + match = find_match(rt, oif, strict, &mpri, match, do_rr); 633 617 634 618 return match; 635 619 } ··· 638 622 { 639 623 struct rt6_info *match, *rt0; 640 624 struct net *net; 625 + bool do_rr = false; 641 626 642 627 rt0 = fn->rr_ptr; 643 628 if (!rt0) 644 629 fn->rr_ptr = rt0 = fn->leaf; 645 630 646 - match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict); 631 + match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict, 632 + &do_rr); 647 633 648 - if (!match && 649 - (strict & RT6_LOOKUP_F_REACHABLE)) { 634 + if (do_rr) { 650 635 struct rt6_info *next = rt0->dst.rt6_next; 651 636 652 637 /* no entries matched; do round-robin */ ··· 1097 1080 1098 1081 rt = (struct rt6_info *) skb_dst(skb); 1099 1082 if (rt) { 1100 - if (rt->rt6i_flags & RTF_CACHE) 1101 - rt6_update_expires(rt, 0); 1102 - else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT)) 1083 + if (rt->rt6i_flags & RTF_CACHE) { 1084 + dst_hold(&rt->dst); 1085 + if (ip6_del_rt(rt)) 1086 + dst_free(&rt->dst); 1087 + } else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT)) { 1103 1088 rt->rt6i_node->fn_sernum = -1; 1089 + } 1104 1090 } 1105 1091 } 1106 1092
+2 -2
net/ipv6/tcp_ipv6.c
··· 63 63 #include <net/inet_common.h> 64 64 #include <net/secure_seq.h> 65 65 #include <net/tcp_memcontrol.h> 66 - #include <net/ll_poll.h> 66 + #include <net/busy_poll.h> 67 67 68 68 #include <asm/uaccess.h> 69 69 ··· 1499 1499 if (sk_filter(sk, skb)) 1500 1500 goto discard_and_relse; 1501 1501 1502 - sk_mark_ll(sk, skb); 1502 + sk_mark_napi_id(sk, skb); 1503 1503 skb->dev = NULL; 1504 1504 1505 1505 bh_lock_sock_nested(sk);
+2 -2
net/ipv6/udp.c
··· 46 46 #include <net/ip6_checksum.h> 47 47 #include <net/xfrm.h> 48 48 #include <net/inet6_hashtables.h> 49 - #include <net/ll_poll.h> 49 + #include <net/busy_poll.h> 50 50 51 51 #include <linux/proc_fs.h> 52 52 #include <linux/seq_file.h> ··· 844 844 if (sk != NULL) { 845 845 int ret; 846 846 847 - sk_mark_ll(sk, skb); 847 + sk_mark_napi_id(sk, skb); 848 848 ret = udpv6_queue_rcv_skb(sk, skb); 849 849 sock_put(sk); 850 850
+63 -64
net/sched/sch_qfq.c
··· 821 821 unsigned long old_vslot = q->oldV >> q->min_slot_shift; 822 822 823 823 if (vslot != old_vslot) { 824 - unsigned long mask = (1ULL << fls(vslot ^ old_vslot)) - 1; 824 + unsigned long mask; 825 + int last_flip_pos = fls(vslot ^ old_vslot); 826 + 827 + if (last_flip_pos > 31) /* higher than the number of groups */ 828 + mask = ~0UL; /* make all groups eligible */ 829 + else 830 + mask = (1UL << last_flip_pos) - 1; 831 + 825 832 qfq_move_groups(q, mask, IR, ER); 826 833 qfq_move_groups(q, mask, IB, EB); 827 834 } ··· 1010 1003 agg->F = agg->S + (u64)service_received * agg->inv_w; 1011 1004 } 1012 1005 1013 - static inline void qfq_update_agg_ts(struct qfq_sched *q, 1014 - struct qfq_aggregate *agg, 1015 - enum update_reason reason); 1006 + /* Assign a reasonable start time for a new aggregate in group i. 1007 + * Admissible values for \hat(F) are multiples of \sigma_i 1008 + * no greater than V+\sigma_i . Larger values mean that 1009 + * we had a wraparound so we consider the timestamp to be stale. 1010 + * 1011 + * If F is not stale and F >= V then we set S = F. 1012 + * Otherwise we should assign S = V, but this may violate 1013 + * the ordering in EB (see [2]). So, if we have groups in ER, 1014 + * set S to the F_j of the first group j which would be blocking us. 1015 + * We are guaranteed not to move S backward because 1016 + * otherwise our group i would still be blocked. 1017 + */ 1018 + static void qfq_update_start(struct qfq_sched *q, struct qfq_aggregate *agg) 1019 + { 1020 + unsigned long mask; 1021 + u64 limit, roundedF; 1022 + int slot_shift = agg->grp->slot_shift; 1023 + 1024 + roundedF = qfq_round_down(agg->F, slot_shift); 1025 + limit = qfq_round_down(q->V, slot_shift) + (1ULL << slot_shift); 1026 + 1027 + if (!qfq_gt(agg->F, q->V) || qfq_gt(roundedF, limit)) { 1028 + /* timestamp was stale */ 1029 + mask = mask_from(q->bitmaps[ER], agg->grp->index); 1030 + if (mask) { 1031 + struct qfq_group *next = qfq_ffs(q, mask); 1032 + if (qfq_gt(roundedF, next->F)) { 1033 + if (qfq_gt(limit, next->F)) 1034 + agg->S = next->F; 1035 + else /* preserve timestamp correctness */ 1036 + agg->S = limit; 1037 + return; 1038 + } 1039 + } 1040 + agg->S = q->V; 1041 + } else /* timestamp is not stale */ 1042 + agg->S = agg->F; 1043 + } 1044 + 1045 + /* Update the timestamps of agg before scheduling/rescheduling it for 1046 + * service. In particular, assign to agg->F its maximum possible 1047 + * value, i.e., the virtual finish time with which the aggregate 1048 + * should be labeled if it used all its budget once in service. 1049 + */ 1050 + static inline void 1051 + qfq_update_agg_ts(struct qfq_sched *q, 1052 + struct qfq_aggregate *agg, enum update_reason reason) 1053 + { 1054 + if (reason != requeue) 1055 + qfq_update_start(q, agg); 1056 + else /* just charge agg for the service received */ 1057 + agg->S = agg->F; 1058 + 1059 + agg->F = agg->S + (u64)agg->budgetmax * agg->inv_w; 1060 + } 1016 1061 1017 1062 static void qfq_schedule_agg(struct qfq_sched *q, struct qfq_aggregate *agg); 1018 1063 ··· 1186 1127 1187 1128 return agg; 1188 1129 } 1189 - 1190 - /* 1191 - * Assign a reasonable start time for a new aggregate in group i. 1192 - * Admissible values for \hat(F) are multiples of \sigma_i 1193 - * no greater than V+\sigma_i . Larger values mean that 1194 - * we had a wraparound so we consider the timestamp to be stale. 1195 - * 1196 - * If F is not stale and F >= V then we set S = F. 1197 - * Otherwise we should assign S = V, but this may violate 1198 - * the ordering in EB (see [2]). So, if we have groups in ER, 1199 - * set S to the F_j of the first group j which would be blocking us. 1200 - * We are guaranteed not to move S backward because 1201 - * otherwise our group i would still be blocked. 1202 - */ 1203 - static void qfq_update_start(struct qfq_sched *q, struct qfq_aggregate *agg) 1204 - { 1205 - unsigned long mask; 1206 - u64 limit, roundedF; 1207 - int slot_shift = agg->grp->slot_shift; 1208 - 1209 - roundedF = qfq_round_down(agg->F, slot_shift); 1210 - limit = qfq_round_down(q->V, slot_shift) + (1ULL << slot_shift); 1211 - 1212 - if (!qfq_gt(agg->F, q->V) || qfq_gt(roundedF, limit)) { 1213 - /* timestamp was stale */ 1214 - mask = mask_from(q->bitmaps[ER], agg->grp->index); 1215 - if (mask) { 1216 - struct qfq_group *next = qfq_ffs(q, mask); 1217 - if (qfq_gt(roundedF, next->F)) { 1218 - if (qfq_gt(limit, next->F)) 1219 - agg->S = next->F; 1220 - else /* preserve timestamp correctness */ 1221 - agg->S = limit; 1222 - return; 1223 - } 1224 - } 1225 - agg->S = q->V; 1226 - } else /* timestamp is not stale */ 1227 - agg->S = agg->F; 1228 - } 1229 - 1230 - /* 1231 - * Update the timestamps of agg before scheduling/rescheduling it for 1232 - * service. In particular, assign to agg->F its maximum possible 1233 - * value, i.e., the virtual finish time with which the aggregate 1234 - * should be labeled if it used all its budget once in service. 1235 - */ 1236 - static inline void 1237 - qfq_update_agg_ts(struct qfq_sched *q, 1238 - struct qfq_aggregate *agg, enum update_reason reason) 1239 - { 1240 - if (reason != requeue) 1241 - qfq_update_start(q, agg); 1242 - else /* just charge agg for the service received */ 1243 - agg->S = agg->F; 1244 - 1245 - agg->F = agg->S + (u64)agg->budgetmax * agg->inv_w; 1246 - } 1247 - 1248 - static void qfq_schedule_agg(struct qfq_sched *, struct qfq_aggregate *); 1249 1130 1250 1131 static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) 1251 1132 {
+3 -3
net/socket.c
··· 104 104 #include <linux/route.h> 105 105 #include <linux/sockios.h> 106 106 #include <linux/atalk.h> 107 - #include <net/ll_poll.h> 107 + #include <net/busy_poll.h> 108 108 109 109 #ifdef CONFIG_NET_LL_RX_POLL 110 - unsigned int sysctl_net_ll_read __read_mostly; 111 - unsigned int sysctl_net_ll_poll __read_mostly; 110 + unsigned int sysctl_net_busy_read __read_mostly; 111 + unsigned int sysctl_net_busy_poll __read_mostly; 112 112 #endif 113 113 114 114 static int sock_no_open(struct inode *irrelevant, struct file *dontcare);
+1 -7
net/tipc/ib_media.c
··· 292 292 if (str_size < 60) /* 60 = 19 * strlen("xx:") + strlen("xx\0") */ 293 293 return 1; 294 294 295 - sprintf(str_buf, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:" 296 - "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", 297 - a->value[0], a->value[1], a->value[2], a->value[3], 298 - a->value[4], a->value[5], a->value[6], a->value[7], 299 - a->value[8], a->value[9], a->value[10], a->value[11], 300 - a->value[12], a->value[13], a->value[14], a->value[15], 301 - a->value[16], a->value[17], a->value[18], a->value[19]); 295 + sprintf(str_buf, "%20phC", a->value); 302 296 303 297 return 0; 304 298 }