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:
"I know this is a bit more than you want to see, and I've told the
wireless folks under no uncertain terms that they must severely scale
back the extent of the fixes they are submitting this late in the
game.

Anyways:

1) vmxnet3's netpoll doesn't perform the equivalent of an ISR, which
is the correct implementation, like it should. Instead it does
something like a NAPI poll operation. This leads to crashes.

From Neil Horman and Arnd Bergmann.

2) Segmentation of SKBs requires proper socket orphaning of the
fragments, otherwise we might access stale state released by the
release callbacks.

This is a 5 patch fix, but the initial patches are giving
variables and such significantly clearer names such that the
actual fix itself at the end looks trivial.

From Michael S. Tsirkin.

3) TCP control block release can deadlock if invoked from a timer on
an already "owned" socket. Fix from Eric Dumazet.

4) In the bridge multicast code, we must validate that the
destination address of general queries is the link local all-nodes
multicast address. From Linus Lüssing.

5) The x86 BPF JIT support for negative offsets puts the parameter
for the helper function call in the wrong register. Fix from
Alexei Starovoitov.

6) The descriptor type used for RTL_GIGA_MAC_VER_17 chips in the
r8169 driver is incorrect. Fix from Hayes Wang.

7) The xen-netback driver tests skb_shinfo(skb)->gso_type bits to see
if a packet is a GSO frame, but that's not the correct test. It
should use skb_is_gso(skb) instead. Fix from Wei Liu.

8) Negative msg->msg_namelen values should generate an error, from
Matthew Leach.

9) at86rf230 can deadlock because it takes the same lock from it's
ISR and it's hard_start_xmit method, without disabling interrupts
in the latter. Fix from Alexander Aring.

10) The FEC driver's restart doesn't perform operations in the correct
order, so promiscuous settings can get lost. Fix from Stefan
Wahren.

11) Fix SKB leak in SCTP cookie handling, from Daniel Borkmann.

12) Reference count and memory leak fixes in TIPC from Ying Xue and
Erik Hugne.

13) Forced eviction in inet_frag_evictor() must strictly make sure all
frags are deleted, otherwise module unload (f.e. 6lowpan) can
crash. Fix from Florian Westphal.

14) Remove assumptions in AF_UNIX's use of csum_partial() (which it
uses as a hash function), which breaks on PowerPC. From Anton
Blanchard.

The main gist of the issue is that csum_partial() is defined only
as a value that, once folded (f.e. via csum_fold()) produces a
correct 16-bit checksum. It is legitimate, therefore, for
csum_partial() to produce two different 32-bit values over the
same data if their respective alignments are different.

15) Fix endiannes bug in MAC address handling of ibmveth driver, also
from Anton Blanchard.

16) Error checks for ipv6 exthdrs offload registration are reversed,
from Anton Nayshtut.

17) Externally triggered ipv6 addrconf routes should count against the
garbage collection threshold. Fix from Sabrina Dubroca.

18) The PCI shutdown handler added to the bnx2 driver can wedge the
chip if it was not brought up earlier already, which in particular
causes the firmware to shut down the PHY. Fix from Michael Chan.

19) Adjust the sanity WARN_ON_ONCE() in qdisc_list_add() because as
currently coded it can and does trigger in legitimate situations.
From Eric Dumazet.

20) BNA driver fails to build on ARM because of a too large udelay()
call, fix from Ben Hutchings.

21) Fair-Queue qdisc holds locks during GFP_KERNEL allocations, fix
from Eric Dumazet.

22) The vlan passthrough ops added in the previous release causes a
regression in source MAC address setting of outgoing headers in
some circumstances. Fix from Peter Boström"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (70 commits)
ipv6: Avoid unnecessary temporary addresses being generated
eth: fec: Fix lost promiscuous mode after reconnecting cable
bonding: set correct vlan id for alb xmit path
at86rf230: fix lockdep splats
net/mlx4_en: Deregister multicast vxlan steering rules when going down
vmxnet3: fix building without CONFIG_PCI_MSI
MAINTAINERS: add networking selftests to NETWORKING
net: socket: error on a negative msg_namelen
MAINTAINERS: Add tools/net to NETWORKING [GENERAL]
packet: doc: Spelling s/than/that/
net/mlx4_core: Load the IB driver when the device supports IBoE
net/mlx4_en: Handle vxlan steering rules for mac address changes
net/mlx4_core: Fix wrong dump of the vxlan offloads device capability
xen-netback: use skb_is_gso in xenvif_start_xmit
r8169: fix the incorrect tx descriptor version
tools/net/Makefile: Define PACKAGE to fix build problems
x86: bpf_jit: support negative offsets
bridge: multicast: enable snooping on general queries only
bridge: multicast: add sanity check for general query destination
tcp: tcp_release_cb() should release socket ownership
...

+515 -549
+1 -1
Documentation/networking/packet_mmap.txt
··· 453 453 enabled previously with setsockopt() and 454 454 the PACKET_COPY_THRESH option. 455 455 456 - The number of frames than can be buffered to 456 + The number of frames that can be buffered to 457 457 be read with recvfrom is limited like a normal socket. 458 458 See the SO_RCVBUF option in the socket (7) man page. 459 459
+30 -18
Documentation/networking/timestamping.txt
··· 21 21 22 22 SO_TIMESTAMPING: 23 23 24 - Instructs the socket layer which kind of information is wanted. The 25 - parameter is an integer with some of the following bits set. Setting 26 - other bits is an error and doesn't change the current state. 24 + Instructs the socket layer which kind of information should be collected 25 + and/or reported. The parameter is an integer with some of the following 26 + bits set. Setting other bits is an error and doesn't change the current 27 + state. 27 28 28 - SOF_TIMESTAMPING_TX_HARDWARE: try to obtain send time stamp in hardware 29 - SOF_TIMESTAMPING_TX_SOFTWARE: if SOF_TIMESTAMPING_TX_HARDWARE is off or 30 - fails, then do it in software 31 - SOF_TIMESTAMPING_RX_HARDWARE: return the original, unmodified time stamp 32 - as generated by the hardware 33 - SOF_TIMESTAMPING_RX_SOFTWARE: if SOF_TIMESTAMPING_RX_HARDWARE is off or 34 - fails, then do it in software 35 - SOF_TIMESTAMPING_RAW_HARDWARE: return original raw hardware time stamp 36 - SOF_TIMESTAMPING_SYS_HARDWARE: return hardware time stamp transformed to 37 - the system time base 38 - SOF_TIMESTAMPING_SOFTWARE: return system time stamp generated in 39 - software 29 + Four of the bits are requests to the stack to try to generate 30 + timestamps. Any combination of them is valid. 40 31 41 - SOF_TIMESTAMPING_TX/RX determine how time stamps are generated. 42 - SOF_TIMESTAMPING_RAW/SYS determine how they are reported in the 43 - following control message: 32 + SOF_TIMESTAMPING_TX_HARDWARE: try to obtain send time stamps in hardware 33 + SOF_TIMESTAMPING_TX_SOFTWARE: try to obtain send time stamps in software 34 + SOF_TIMESTAMPING_RX_HARDWARE: try to obtain receive time stamps in hardware 35 + SOF_TIMESTAMPING_RX_SOFTWARE: try to obtain receive time stamps in software 36 + 37 + The other three bits control which timestamps will be reported in a 38 + generated control message. If none of these bits are set or if none of 39 + the set bits correspond to data that is available, then the control 40 + message will not be generated: 41 + 42 + SOF_TIMESTAMPING_SOFTWARE: report systime if available 43 + SOF_TIMESTAMPING_SYS_HARDWARE: report hwtimetrans if available 44 + SOF_TIMESTAMPING_RAW_HARDWARE: report hwtimeraw if available 45 + 46 + It is worth noting that timestamps may be collected for reasons other 47 + than being requested by a particular socket with 48 + SOF_TIMESTAMPING_[TR]X_(HARD|SOFT)WARE. For example, most drivers that 49 + can generate hardware receive timestamps ignore 50 + SOF_TIMESTAMPING_RX_HARDWARE. It is still a good idea to set that flag 51 + in case future drivers pay attention. 52 + 53 + If timestamps are reported, they will appear in a control message with 54 + cmsg_level==SOL_SOCKET, cmsg_type==SO_TIMESTAMPING, and a payload like 55 + this: 44 56 45 57 struct scm_timestamping { 46 58 struct timespec systime;
+2
MAINTAINERS
··· 6003 6003 F: include/uapi/linux/in.h 6004 6004 F: include/uapi/linux/net.h 6005 6005 F: include/uapi/linux/netdevice.h 6006 + F: tools/net/ 6007 + F: tools/testing/selftests/net/ 6006 6008 6007 6009 NETWORKING [IPv4/IPv6] 6008 6010 M: "David S. Miller" <davem@davemloft.net>
+1 -1
arch/x86/net/bpf_jit.S
··· 140 140 push %r9; \ 141 141 push SKBDATA; \ 142 142 /* rsi already has offset */ \ 143 - mov $SIZE,%ecx; /* size */ \ 143 + mov $SIZE,%edx; /* size */ \ 144 144 call bpf_internal_load_pointer_neg_helper; \ 145 145 test %rax,%rax; \ 146 146 pop SKBDATA; \
+1 -1
drivers/net/bonding/bond_alb.c
··· 730 730 client_info->ntt = 0; 731 731 } 732 732 733 - if (!vlan_get_tag(skb, &client_info->vlan_id)) 733 + if (vlan_get_tag(skb, &client_info->vlan_id)) 734 734 client_info->vlan_id = 0; 735 735 736 736 if (!client_info->assigned) {
+1
drivers/net/bonding/bond_options.c
··· 121 121 static struct bond_opt_value bond_lp_interval_tbl[] = { 122 122 { "minval", 1, BOND_VALFLAG_MIN | BOND_VALFLAG_DEFAULT}, 123 123 { "maxval", INT_MAX, BOND_VALFLAG_MAX}, 124 + { NULL, -1, 0}, 124 125 }; 125 126 126 127 static struct bond_option bond_opts[] = {
+33 -4
drivers/net/ethernet/broadcom/bnx2.c
··· 2507 2507 2508 2508 bp->fw_wr_seq++; 2509 2509 msg_data |= bp->fw_wr_seq; 2510 + bp->fw_last_msg = msg_data; 2510 2511 2511 2512 bnx2_shmem_wr(bp, BNX2_DRV_MB, msg_data); 2512 2513 ··· 4001 4000 wol_msg = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL; 4002 4001 } 4003 4002 4004 - if (!(bp->flags & BNX2_FLAG_NO_WOL)) 4005 - bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT3 | wol_msg, 1, 0); 4003 + if (!(bp->flags & BNX2_FLAG_NO_WOL)) { 4004 + u32 val; 4005 + 4006 + wol_msg |= BNX2_DRV_MSG_DATA_WAIT3; 4007 + if (bp->fw_last_msg || BNX2_CHIP(bp) != BNX2_CHIP_5709) { 4008 + bnx2_fw_sync(bp, wol_msg, 1, 0); 4009 + return; 4010 + } 4011 + /* Tell firmware not to power down the PHY yet, otherwise 4012 + * the chip will take a long time to respond to MMIO reads. 4013 + */ 4014 + val = bnx2_shmem_rd(bp, BNX2_PORT_FEATURE); 4015 + bnx2_shmem_wr(bp, BNX2_PORT_FEATURE, 4016 + val | BNX2_PORT_FEATURE_ASF_ENABLED); 4017 + bnx2_fw_sync(bp, wol_msg, 1, 0); 4018 + bnx2_shmem_wr(bp, BNX2_PORT_FEATURE, val); 4019 + } 4006 4020 4007 4021 } 4008 4022 ··· 4049 4033 4050 4034 if (bp->wol) 4051 4035 pci_set_power_state(bp->pdev, PCI_D3hot); 4052 - } else { 4053 - pci_set_power_state(bp->pdev, PCI_D3hot); 4036 + break; 4037 + 4054 4038 } 4039 + if (!bp->fw_last_msg && BNX2_CHIP(bp) == BNX2_CHIP_5709) { 4040 + u32 val; 4041 + 4042 + /* Tell firmware not to power down the PHY yet, 4043 + * otherwise the other port may not respond to 4044 + * MMIO reads. 4045 + */ 4046 + val = bnx2_shmem_rd(bp, BNX2_BC_STATE_CONDITION); 4047 + val &= ~BNX2_CONDITION_PM_STATE_MASK; 4048 + val |= BNX2_CONDITION_PM_STATE_UNPREP; 4049 + bnx2_shmem_wr(bp, BNX2_BC_STATE_CONDITION, val); 4050 + } 4051 + pci_set_power_state(bp->pdev, PCI_D3hot); 4055 4052 4056 4053 /* No more memory access after this point until 4057 4054 * device is brought back to D0.
+5
drivers/net/ethernet/broadcom/bnx2.h
··· 6900 6900 6901 6901 u16 fw_wr_seq; 6902 6902 u16 fw_drv_pulse_wr_seq; 6903 + u32 fw_last_msg; 6903 6904 6904 6905 int rx_max_ring; 6905 6906 int rx_ring_size; ··· 7407 7406 #define BNX2_CONDITION_MFW_RUN_NCSI 0x00006000 7408 7407 #define BNX2_CONDITION_MFW_RUN_NONE 0x0000e000 7409 7408 #define BNX2_CONDITION_MFW_RUN_MASK 0x0000e000 7409 + #define BNX2_CONDITION_PM_STATE_MASK 0x00030000 7410 + #define BNX2_CONDITION_PM_STATE_FULL 0x00030000 7411 + #define BNX2_CONDITION_PM_STATE_PREP 0x00020000 7412 + #define BNX2_CONDITION_PM_STATE_UNPREP 0x00010000 7410 7413 7411 7414 #define BNX2_BC_STATE_DEBUG_CMD 0x1dc 7412 7415 #define BNX2_BC_STATE_BC_DBG_CMD_SIGNATURE 0x42440000
+1 -1
drivers/net/ethernet/brocade/bna/bfa_ioc.c
··· 1704 1704 while (!bfa_raw_sem_get(bar)) { 1705 1705 if (--n <= 0) 1706 1706 return BFA_STATUS_BADFLASH; 1707 - udelay(10000); 1707 + mdelay(10); 1708 1708 } 1709 1709 return BFA_STATUS_OK; 1710 1710 }
+13 -3
drivers/net/ethernet/cadence/macb.c
··· 632 632 "Unable to allocate sk_buff\n"); 633 633 break; 634 634 } 635 - bp->rx_skbuff[entry] = skb; 636 635 637 636 /* now fill corresponding descriptor entry */ 638 637 paddr = dma_map_single(&bp->pdev->dev, skb->data, 639 638 bp->rx_buffer_size, DMA_FROM_DEVICE); 639 + if (dma_mapping_error(&bp->pdev->dev, paddr)) { 640 + dev_kfree_skb(skb); 641 + break; 642 + } 643 + 644 + bp->rx_skbuff[entry] = skb; 640 645 641 646 if (entry == RX_RING_SIZE - 1) 642 647 paddr |= MACB_BIT(RX_WRAP); ··· 730 725 skb_put(skb, len); 731 726 addr = MACB_BF(RX_WADDR, MACB_BFEXT(RX_WADDR, addr)); 732 727 dma_unmap_single(&bp->pdev->dev, addr, 733 - len, DMA_FROM_DEVICE); 728 + bp->rx_buffer_size, DMA_FROM_DEVICE); 734 729 735 730 skb->protocol = eth_type_trans(skb, bp->dev); 736 731 skb_checksum_none_assert(skb); ··· 1041 1036 } 1042 1037 1043 1038 entry = macb_tx_ring_wrap(bp->tx_head); 1044 - bp->tx_head++; 1045 1039 netdev_vdbg(bp->dev, "Allocated ring entry %u\n", entry); 1046 1040 mapping = dma_map_single(&bp->pdev->dev, skb->data, 1047 1041 len, DMA_TO_DEVICE); 1042 + if (dma_mapping_error(&bp->pdev->dev, mapping)) { 1043 + kfree_skb(skb); 1044 + goto unlock; 1045 + } 1048 1046 1047 + bp->tx_head++; 1049 1048 tx_skb = &bp->tx_skb[entry]; 1050 1049 tx_skb->skb = skb; 1051 1050 tx_skb->mapping = mapping; ··· 1075 1066 if (CIRC_SPACE(bp->tx_head, bp->tx_tail, TX_RING_SIZE) < 1) 1076 1067 netif_stop_queue(dev); 1077 1068 1069 + unlock: 1078 1070 spin_unlock_irqrestore(&bp->lock, flags); 1079 1071 1080 1072 return NETDEV_TX_OK;
+7 -7
drivers/net/ethernet/freescale/fec_main.c
··· 528 528 /* Clear any outstanding interrupt. */ 529 529 writel(0xffc00000, fep->hwp + FEC_IEVENT); 530 530 531 - /* Setup multicast filter. */ 532 - set_multicast_list(ndev); 533 - #ifndef CONFIG_M5272 534 - writel(0, fep->hwp + FEC_HASH_TABLE_HIGH); 535 - writel(0, fep->hwp + FEC_HASH_TABLE_LOW); 536 - #endif 537 - 538 531 /* Set maximum receive buffer size. */ 539 532 writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE); 540 533 ··· 647 654 #endif /* !defined(CONFIG_M5272) */ 648 655 649 656 writel(rcntl, fep->hwp + FEC_R_CNTRL); 657 + 658 + /* Setup multicast filter. */ 659 + set_multicast_list(ndev); 660 + #ifndef CONFIG_M5272 661 + writel(0, fep->hwp + FEC_HASH_TABLE_HIGH); 662 + writel(0, fep->hwp + FEC_HASH_TABLE_LOW); 663 + #endif 650 664 651 665 if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) { 652 666 /* enable ENET endian swap */
+16 -9
drivers/net/ethernet/ibm/ibmveth.c
··· 522 522 return rc; 523 523 } 524 524 525 + static u64 ibmveth_encode_mac_addr(u8 *mac) 526 + { 527 + int i; 528 + u64 encoded = 0; 529 + 530 + for (i = 0; i < ETH_ALEN; i++) 531 + encoded = (encoded << 8) | mac[i]; 532 + 533 + return encoded; 534 + } 535 + 525 536 static int ibmveth_open(struct net_device *netdev) 526 537 { 527 538 struct ibmveth_adapter *adapter = netdev_priv(netdev); 528 - u64 mac_address = 0; 539 + u64 mac_address; 529 540 int rxq_entries = 1; 530 541 unsigned long lpar_rc; 531 542 int rc; ··· 590 579 adapter->rx_queue.num_slots = rxq_entries; 591 580 adapter->rx_queue.toggle = 1; 592 581 593 - memcpy(&mac_address, netdev->dev_addr, netdev->addr_len); 594 - mac_address = mac_address >> 16; 582 + mac_address = ibmveth_encode_mac_addr(netdev->dev_addr); 595 583 596 584 rxq_desc.fields.flags_len = IBMVETH_BUF_VALID | 597 585 adapter->rx_queue.queue_len; ··· 1193 1183 /* add the addresses to the filter table */ 1194 1184 netdev_for_each_mc_addr(ha, netdev) { 1195 1185 /* add the multicast address to the filter table */ 1196 - unsigned long mcast_addr = 0; 1197 - memcpy(((char *)&mcast_addr)+2, ha->addr, ETH_ALEN); 1186 + u64 mcast_addr; 1187 + mcast_addr = ibmveth_encode_mac_addr(ha->addr); 1198 1188 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, 1199 1189 IbmVethMcastAddFilter, 1200 1190 mcast_addr); ··· 1382 1372 1383 1373 netif_napi_add(netdev, &adapter->napi, ibmveth_poll, 16); 1384 1374 1385 - adapter->mac_addr = 0; 1386 - memcpy(&adapter->mac_addr, mac_addr_p, ETH_ALEN); 1387 - 1388 1375 netdev->irq = dev->irq; 1389 1376 netdev->netdev_ops = &ibmveth_netdev_ops; 1390 1377 netdev->ethtool_ops = &netdev_ethtool_ops; ··· 1390 1383 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1391 1384 netdev->features |= netdev->hw_features; 1392 1385 1393 - memcpy(netdev->dev_addr, &adapter->mac_addr, netdev->addr_len); 1386 + memcpy(netdev->dev_addr, mac_addr_p, ETH_ALEN); 1394 1387 1395 1388 for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) { 1396 1389 struct kobject *kobj = &adapter->rx_buff_pool[i].kobj;
-1
drivers/net/ethernet/ibm/ibmveth.h
··· 138 138 struct napi_struct napi; 139 139 struct net_device_stats stats; 140 140 unsigned int mcastFilterSize; 141 - unsigned long mac_addr; 142 141 void * buffer_list_addr; 143 142 void * filter_list_addr; 144 143 dma_addr_t buffer_list_dma;
+10
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 742 742 err = mlx4_en_uc_steer_add(priv, new_mac, 743 743 &qpn, 744 744 &entry->reg_id); 745 + if (err) 746 + return err; 747 + if (priv->tunnel_reg_id) { 748 + mlx4_flow_detach(priv->mdev->dev, priv->tunnel_reg_id); 749 + priv->tunnel_reg_id = 0; 750 + } 751 + err = mlx4_en_tunnel_steer_add(priv, new_mac, qpn, 752 + &priv->tunnel_reg_id); 745 753 return err; 746 754 } 747 755 } ··· 1800 1792 mc_list[5] = priv->port; 1801 1793 mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp, 1802 1794 mc_list, MLX4_PROT_ETH, mclist->reg_id); 1795 + if (mclist->tunnel_reg_id) 1796 + mlx4_flow_detach(mdev->dev, mclist->tunnel_reg_id); 1803 1797 } 1804 1798 mlx4_en_clear_list(dev); 1805 1799 list_for_each_entry_safe(mclist, tmp, &priv->curr_list, list) {
+6 -5
drivers/net/ethernet/mellanox/mlx4/fw.c
··· 129 129 [0] = "RSS support", 130 130 [1] = "RSS Toeplitz Hash Function support", 131 131 [2] = "RSS XOR Hash Function support", 132 - [3] = "Device manage flow steering support", 132 + [3] = "Device managed flow steering support", 133 133 [4] = "Automatic MAC reassignment support", 134 134 [5] = "Time stamping support", 135 135 [6] = "VST (control vlan insertion/stripping) support", 136 136 [7] = "FSM (MAC anti-spoofing) support", 137 137 [8] = "Dynamic QP updates support", 138 - [9] = "TCP/IP offloads/flow-steering for VXLAN support" 138 + [9] = "Device managed flow steering IPoIB support", 139 + [10] = "TCP/IP offloads/flow-steering for VXLAN support" 139 140 }; 140 141 int i; 141 142 ··· 860 859 MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_CQ_TS_SUPPORT_OFFSET); 861 860 862 861 /* For guests, disable vxlan tunneling */ 863 - MLX4_GET(field, outbox, QUERY_DEV_CAP_VXLAN); 862 + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_VXLAN); 864 863 field &= 0xf7; 865 864 MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_VXLAN); 866 865 ··· 870 869 MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_BF_OFFSET); 871 870 872 871 /* For guests, disable mw type 2 */ 873 - MLX4_GET(bmme_flags, outbox, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); 872 + MLX4_GET(bmme_flags, outbox->buf, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); 874 873 bmme_flags &= ~MLX4_BMME_FLAG_TYPE_2_WIN; 875 874 MLX4_PUT(outbox->buf, bmme_flags, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); 876 875 ··· 884 883 } 885 884 886 885 /* turn off ipoib managed steering for guests */ 887 - MLX4_GET(field, outbox, QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET); 886 + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET); 888 887 field &= ~0x80; 889 888 MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET); 890 889
+13 -1
drivers/net/ethernet/mellanox/mlx4/main.c
··· 150 150 struct pci_dev *pdev; 151 151 }; 152 152 153 + static atomic_t pf_loading = ATOMIC_INIT(0); 154 + 153 155 int mlx4_check_port_params(struct mlx4_dev *dev, 154 156 enum mlx4_port_type *port_type) 155 157 { ··· 751 749 has_eth_port = true; 752 750 } 753 751 754 - if (has_ib_port) 752 + if (has_ib_port || (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) 755 753 request_module_nowait(IB_DRV_NAME); 756 754 if (has_eth_port) 757 755 request_module_nowait(EN_DRV_NAME); ··· 1408 1406 int ret_from_reset = 0; 1409 1407 u32 slave_read; 1410 1408 u32 cmd_channel_ver; 1409 + 1410 + if (atomic_read(&pf_loading)) { 1411 + mlx4_warn(dev, "PF is not ready. Deferring probe\n"); 1412 + return -EPROBE_DEFER; 1413 + } 1411 1414 1412 1415 mutex_lock(&priv->cmd.slave_cmd_mutex); 1413 1416 priv->cmd.max_cmds = 1; ··· 2326 2319 2327 2320 if (num_vfs) { 2328 2321 mlx4_warn(dev, "Enabling SR-IOV with %d VFs\n", num_vfs); 2322 + 2323 + atomic_inc(&pf_loading); 2329 2324 err = pci_enable_sriov(pdev, num_vfs); 2325 + atomic_dec(&pf_loading); 2326 + 2330 2327 if (err) { 2331 2328 mlx4_err(dev, "Failed to enable SR-IOV, continuing without SR-IOV (err = %d).\n", 2332 2329 err); ··· 2695 2684 .name = DRV_NAME, 2696 2685 .id_table = mlx4_pci_table, 2697 2686 .probe = mlx4_init_one, 2687 + .shutdown = mlx4_remove_one, 2698 2688 .remove = mlx4_remove_one, 2699 2689 .err_handler = &mlx4_err_handler, 2700 2690 };
+1 -1
drivers/net/ethernet/realtek/r8169.c
··· 209 209 [RTL_GIGA_MAC_VER_16] = 210 210 _R("RTL8101e", RTL_TD_0, NULL, JUMBO_1K, true), 211 211 [RTL_GIGA_MAC_VER_17] = 212 - _R("RTL8168b/8111b", RTL_TD_1, NULL, JUMBO_4K, false), 212 + _R("RTL8168b/8111b", RTL_TD_0, NULL, JUMBO_4K, false), 213 213 [RTL_GIGA_MAC_VER_18] = 214 214 _R("RTL8168cp/8111cp", RTL_TD_1, NULL, JUMBO_6K, false), 215 215 [RTL_GIGA_MAC_VER_19] =
+1 -1
drivers/net/ethernet/stmicro/stmmac/chain_mode.c
··· 151 151 sizeof(struct dma_desc))); 152 152 } 153 153 154 - const struct stmmac_chain_mode_ops chain_mode_ops = { 154 + const struct stmmac_mode_ops chain_mode_ops = { 155 155 .init = stmmac_init_dma_chain, 156 156 .is_jumbo_frm = stmmac_is_jumbo_frm, 157 157 .jumbo_frm = stmmac_jumbo_frm,
+6 -14
drivers/net/ethernet/stmicro/stmmac/common.h
··· 419 419 unsigned int data; /* MII Data */ 420 420 }; 421 421 422 - struct stmmac_ring_mode_ops { 423 - unsigned int (*is_jumbo_frm) (int len, int ehn_desc); 424 - unsigned int (*jumbo_frm) (void *priv, struct sk_buff *skb, int csum); 425 - void (*refill_desc3) (void *priv, struct dma_desc *p); 426 - void (*init_desc3) (struct dma_desc *p); 427 - void (*clean_desc3) (void *priv, struct dma_desc *p); 428 - int (*set_16kib_bfsize) (int mtu); 429 - }; 430 - 431 - struct stmmac_chain_mode_ops { 422 + struct stmmac_mode_ops { 432 423 void (*init) (void *des, dma_addr_t phy_addr, unsigned int size, 433 424 unsigned int extend_desc); 434 425 unsigned int (*is_jumbo_frm) (int len, int ehn_desc); 435 426 unsigned int (*jumbo_frm) (void *priv, struct sk_buff *skb, int csum); 427 + int (*set_16kib_bfsize)(int mtu); 428 + void (*init_desc3)(struct dma_desc *p); 436 429 void (*refill_desc3) (void *priv, struct dma_desc *p); 437 430 void (*clean_desc3) (void *priv, struct dma_desc *p); 438 431 }; ··· 434 441 const struct stmmac_ops *mac; 435 442 const struct stmmac_desc_ops *desc; 436 443 const struct stmmac_dma_ops *dma; 437 - const struct stmmac_ring_mode_ops *ring; 438 - const struct stmmac_chain_mode_ops *chain; 444 + const struct stmmac_mode_ops *mode; 439 445 const struct stmmac_hwtimestamp *ptp; 440 446 struct mii_regs mii; /* MII register Addresses */ 441 447 struct mac_link link; ··· 452 460 void stmmac_set_mac(void __iomem *ioaddr, bool enable); 453 461 454 462 void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr); 455 - extern const struct stmmac_ring_mode_ops ring_mode_ops; 456 - extern const struct stmmac_chain_mode_ops chain_mode_ops; 463 + extern const struct stmmac_mode_ops ring_mode_ops; 464 + extern const struct stmmac_mode_ops chain_mode_ops; 457 465 458 466 #endif /* __COMMON_H__ */
+4 -5
drivers/net/ethernet/stmicro/stmmac/ring_mode.c
··· 100 100 { 101 101 struct stmmac_priv *priv = (struct stmmac_priv *)priv_ptr; 102 102 103 - if (unlikely(priv->plat->has_gmac)) 104 - /* Fill DES3 in case of RING mode */ 105 - if (priv->dma_buf_sz >= BUF_SIZE_8KiB) 106 - p->des3 = p->des2 + BUF_SIZE_8KiB; 103 + /* Fill DES3 in case of RING mode */ 104 + if (priv->dma_buf_sz >= BUF_SIZE_8KiB) 105 + p->des3 = p->des2 + BUF_SIZE_8KiB; 107 106 } 108 107 109 108 /* In ring mode we need to fill the desc3 because it is used as buffer */ ··· 125 126 return ret; 126 127 } 127 128 128 - const struct stmmac_ring_mode_ops ring_mode_ops = { 129 + const struct stmmac_mode_ops ring_mode_ops = { 129 130 .is_jumbo_frm = stmmac_is_jumbo_frm, 130 131 .jumbo_frm = stmmac_jumbo_frm, 131 132 .refill_desc3 = stmmac_refill_desc3,
+49 -44
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 92 92 module_param(tc, int, S_IRUGO | S_IWUSR); 93 93 MODULE_PARM_DESC(tc, "DMA threshold control value"); 94 94 95 - #define DMA_BUFFER_SIZE BUF_SIZE_4KiB 96 - static int buf_sz = DMA_BUFFER_SIZE; 95 + #define DEFAULT_BUFSIZE 1536 96 + static int buf_sz = DEFAULT_BUFSIZE; 97 97 module_param(buf_sz, int, S_IRUGO | S_IWUSR); 98 98 MODULE_PARM_DESC(buf_sz, "DMA buffer size"); 99 99 ··· 136 136 dma_rxsize = DMA_RX_SIZE; 137 137 if (unlikely(dma_txsize < 0)) 138 138 dma_txsize = DMA_TX_SIZE; 139 - if (unlikely((buf_sz < DMA_BUFFER_SIZE) || (buf_sz > BUF_SIZE_16KiB))) 140 - buf_sz = DMA_BUFFER_SIZE; 139 + if (unlikely((buf_sz < DEFAULT_BUFSIZE) || (buf_sz > BUF_SIZE_16KiB))) 140 + buf_sz = DEFAULT_BUFSIZE; 141 141 if (unlikely(flow_ctrl > 1)) 142 142 flow_ctrl = FLOW_AUTO; 143 143 else if (likely(flow_ctrl < 0)) ··· 286 286 287 287 /* MAC core supports the EEE feature. */ 288 288 if (priv->dma_cap.eee) { 289 - /* Check if the PHY supports EEE */ 290 - if (phy_init_eee(priv->phydev, 1)) 291 - goto out; 289 + int tx_lpi_timer = priv->tx_lpi_timer; 292 290 291 + /* Check if the PHY supports EEE */ 292 + if (phy_init_eee(priv->phydev, 1)) { 293 + /* To manage at run-time if the EEE cannot be supported 294 + * anymore (for example because the lp caps have been 295 + * changed). 296 + * In that case the driver disable own timers. 297 + */ 298 + if (priv->eee_active) { 299 + pr_debug("stmmac: disable EEE\n"); 300 + del_timer_sync(&priv->eee_ctrl_timer); 301 + priv->hw->mac->set_eee_timer(priv->ioaddr, 0, 302 + tx_lpi_timer); 303 + } 304 + priv->eee_active = 0; 305 + goto out; 306 + } 307 + /* Activate the EEE and start timers */ 293 308 if (!priv->eee_active) { 294 309 priv->eee_active = 1; 295 310 init_timer(&priv->eee_ctrl_timer); ··· 315 300 316 301 priv->hw->mac->set_eee_timer(priv->ioaddr, 317 302 STMMAC_DEFAULT_LIT_LS, 318 - priv->tx_lpi_timer); 303 + tx_lpi_timer); 319 304 } else 320 305 /* Set HW EEE according to the speed */ 321 306 priv->hw->mac->set_eee_pls(priv->ioaddr, 322 307 priv->phydev->link); 323 308 324 - pr_info("stmmac: Energy-Efficient Ethernet initialized\n"); 309 + pr_debug("stmmac: Energy-Efficient Ethernet initialized\n"); 325 310 326 311 ret = true; 327 312 } ··· 901 886 ret = BUF_SIZE_8KiB; 902 887 else if (mtu >= BUF_SIZE_2KiB) 903 888 ret = BUF_SIZE_4KiB; 904 - else if (mtu >= DMA_BUFFER_SIZE) 889 + else if (mtu > DEFAULT_BUFSIZE) 905 890 ret = BUF_SIZE_2KiB; 906 891 else 907 - ret = DMA_BUFFER_SIZE; 892 + ret = DEFAULT_BUFSIZE; 908 893 909 894 return ret; 910 895 } ··· 966 951 967 952 p->des2 = priv->rx_skbuff_dma[i]; 968 953 969 - if ((priv->mode == STMMAC_RING_MODE) && 954 + if ((priv->hw->mode->init_desc3) && 970 955 (priv->dma_buf_sz == BUF_SIZE_16KiB)) 971 - priv->hw->ring->init_desc3(p); 956 + priv->hw->mode->init_desc3(p); 972 957 973 958 return 0; 974 959 } ··· 999 984 unsigned int bfsize = 0; 1000 985 int ret = -ENOMEM; 1001 986 1002 - /* Set the max buffer size according to the DESC mode 1003 - * and the MTU. Note that RING mode allows 16KiB bsize. 1004 - */ 1005 - if (priv->mode == STMMAC_RING_MODE) 1006 - bfsize = priv->hw->ring->set_16kib_bfsize(dev->mtu); 987 + if (priv->hw->mode->set_16kib_bfsize) 988 + bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu); 1007 989 1008 990 if (bfsize < BUF_SIZE_16KiB) 1009 991 bfsize = stmmac_set_bfsize(dev->mtu, priv->dma_buf_sz); ··· 1041 1029 /* Setup the chained descriptor addresses */ 1042 1030 if (priv->mode == STMMAC_CHAIN_MODE) { 1043 1031 if (priv->extend_desc) { 1044 - priv->hw->chain->init(priv->dma_erx, priv->dma_rx_phy, 1045 - rxsize, 1); 1046 - priv->hw->chain->init(priv->dma_etx, priv->dma_tx_phy, 1047 - txsize, 1); 1032 + priv->hw->mode->init(priv->dma_erx, priv->dma_rx_phy, 1033 + rxsize, 1); 1034 + priv->hw->mode->init(priv->dma_etx, priv->dma_tx_phy, 1035 + txsize, 1); 1048 1036 } else { 1049 - priv->hw->chain->init(priv->dma_rx, priv->dma_rx_phy, 1050 - rxsize, 0); 1051 - priv->hw->chain->init(priv->dma_tx, priv->dma_tx_phy, 1052 - txsize, 0); 1037 + priv->hw->mode->init(priv->dma_rx, priv->dma_rx_phy, 1038 + rxsize, 0); 1039 + priv->hw->mode->init(priv->dma_tx, priv->dma_tx_phy, 1040 + txsize, 0); 1053 1041 } 1054 1042 } 1055 1043 ··· 1300 1288 DMA_TO_DEVICE); 1301 1289 priv->tx_skbuff_dma[entry] = 0; 1302 1290 } 1303 - priv->hw->ring->clean_desc3(priv, p); 1291 + priv->hw->mode->clean_desc3(priv, p); 1304 1292 1305 1293 if (likely(skb != NULL)) { 1306 1294 dev_kfree_skb(skb); ··· 1856 1844 int nfrags = skb_shinfo(skb)->nr_frags; 1857 1845 struct dma_desc *desc, *first; 1858 1846 unsigned int nopaged_len = skb_headlen(skb); 1847 + unsigned int enh_desc = priv->plat->enh_desc; 1859 1848 1860 1849 if (unlikely(stmmac_tx_avail(priv) < nfrags + 1)) { 1861 1850 if (!netif_queue_stopped(dev)) { ··· 1884 1871 first = desc; 1885 1872 1886 1873 /* To program the descriptors according to the size of the frame */ 1887 - if (priv->mode == STMMAC_RING_MODE) { 1888 - is_jumbo = priv->hw->ring->is_jumbo_frm(skb->len, 1889 - priv->plat->enh_desc); 1890 - if (unlikely(is_jumbo)) 1891 - entry = priv->hw->ring->jumbo_frm(priv, skb, 1892 - csum_insertion); 1893 - } else { 1894 - is_jumbo = priv->hw->chain->is_jumbo_frm(skb->len, 1895 - priv->plat->enh_desc); 1896 - if (unlikely(is_jumbo)) 1897 - entry = priv->hw->chain->jumbo_frm(priv, skb, 1898 - csum_insertion); 1899 - } 1874 + if (enh_desc) 1875 + is_jumbo = priv->hw->mode->is_jumbo_frm(skb->len, enh_desc); 1876 + 1900 1877 if (likely(!is_jumbo)) { 1901 1878 desc->des2 = dma_map_single(priv->device, skb->data, 1902 1879 nopaged_len, DMA_TO_DEVICE); 1903 1880 priv->tx_skbuff_dma[entry] = desc->des2; 1904 1881 priv->hw->desc->prepare_tx_desc(desc, 1, nopaged_len, 1905 1882 csum_insertion, priv->mode); 1906 - } else 1883 + } else { 1907 1884 desc = first; 1885 + entry = priv->hw->mode->jumbo_frm(priv, skb, csum_insertion); 1886 + } 1908 1887 1909 1888 for (i = 0; i < nfrags; i++) { 1910 1889 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; ··· 2034 2029 2035 2030 p->des2 = priv->rx_skbuff_dma[entry]; 2036 2031 2037 - priv->hw->ring->refill_desc3(priv, p); 2032 + priv->hw->mode->refill_desc3(priv, p); 2038 2033 2039 2034 if (netif_msg_rx_status(priv)) 2040 2035 pr_debug("\trefill entry #%d\n", entry); ··· 2638 2633 2639 2634 /* To use the chained or ring mode */ 2640 2635 if (chain_mode) { 2641 - priv->hw->chain = &chain_mode_ops; 2636 + priv->hw->mode = &chain_mode_ops; 2642 2637 pr_info(" Chain mode enabled\n"); 2643 2638 priv->mode = STMMAC_CHAIN_MODE; 2644 2639 } else { 2645 - priv->hw->ring = &ring_mode_ops; 2640 + priv->hw->mode = &ring_mode_ops; 2646 2641 pr_info(" Ring mode enabled\n"); 2647 2642 priv->mode = STMMAC_RING_MODE; 2648 2643 }
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 36 36 #ifdef CONFIG_DWMAC_STI 37 37 { .compatible = "st,stih415-dwmac", .data = &sti_gmac_data}, 38 38 { .compatible = "st,stih416-dwmac", .data = &sti_gmac_data}, 39 - { .compatible = "st,stih127-dwmac", .data = &sti_gmac_data}, 39 + { .compatible = "st,stid127-dwmac", .data = &sti_gmac_data}, 40 40 #endif 41 41 /* SoC specific glue layers should come before generic bindings */ 42 42 { .compatible = "st,spear600-gmac"},
+4
drivers/net/hyperv/netvsc_drv.c
··· 442 442 if (!net) 443 443 return -ENOMEM; 444 444 445 + netif_carrier_off(net); 446 + 445 447 net_device_ctx = netdev_priv(net); 446 448 net_device_ctx->device_ctx = dev; 447 449 hv_set_drvdata(dev, net); ··· 475 473 pr_err("Unable to register netdev.\n"); 476 474 rndis_filter_device_remove(dev); 477 475 free_netdev(net); 476 + } else { 477 + schedule_delayed_work(&net_device_ctx->dwork, 0); 478 478 } 479 479 480 480 return ret;
+20 -1
drivers/net/hyperv/rndis_filter.c
··· 243 243 return ret; 244 244 } 245 245 246 + static void rndis_set_link_state(struct rndis_device *rdev, 247 + struct rndis_request *request) 248 + { 249 + u32 link_status; 250 + struct rndis_query_complete *query_complete; 251 + 252 + query_complete = &request->response_msg.msg.query_complete; 253 + 254 + if (query_complete->status == RNDIS_STATUS_SUCCESS && 255 + query_complete->info_buflen == sizeof(u32)) { 256 + memcpy(&link_status, (void *)((unsigned long)query_complete + 257 + query_complete->info_buf_offset), sizeof(u32)); 258 + rdev->link_state = link_status != 0; 259 + } 260 + } 261 + 246 262 static void rndis_filter_receive_response(struct rndis_device *dev, 247 263 struct rndis_message *resp) 248 264 { ··· 288 272 sizeof(struct rndis_message) + RNDIS_EXT_LEN) { 289 273 memcpy(&request->response_msg, resp, 290 274 resp->msg_len); 275 + if (request->request_msg.ndis_msg_type == 276 + RNDIS_MSG_QUERY && request->request_msg.msg. 277 + query_req.oid == RNDIS_OID_GEN_MEDIA_CONNECT_STATUS) 278 + rndis_set_link_state(dev, request); 291 279 } else { 292 280 netdev_err(ndev, 293 281 "rndis response buffer overflow " ··· 640 620 ret = rndis_filter_query_device(dev, 641 621 RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, 642 622 &link_status, &size); 643 - dev->link_state = (link_status != 0) ? true : false; 644 623 645 624 return ret; 646 625 }
+6 -5
drivers/net/ieee802154/at86rf230.c
··· 546 546 int rc; 547 547 unsigned long flags; 548 548 549 - spin_lock(&lp->lock); 549 + spin_lock_irqsave(&lp->lock, flags); 550 550 if (lp->irq_busy) { 551 - spin_unlock(&lp->lock); 551 + spin_unlock_irqrestore(&lp->lock, flags); 552 552 return -EBUSY; 553 553 } 554 - spin_unlock(&lp->lock); 554 + spin_unlock_irqrestore(&lp->lock, flags); 555 555 556 556 might_sleep(); 557 557 ··· 725 725 static irqreturn_t at86rf230_isr(int irq, void *data) 726 726 { 727 727 struct at86rf230_local *lp = data; 728 + unsigned long flags; 728 729 729 - spin_lock(&lp->lock); 730 + spin_lock_irqsave(&lp->lock, flags); 730 731 lp->irq_busy = 1; 731 - spin_unlock(&lp->lock); 732 + spin_unlock_irqrestore(&lp->lock, flags); 732 733 733 734 schedule_work(&lp->irqwork); 734 735
+6 -5
drivers/net/phy/phy.c
··· 164 164 * of that setting. Returns the index of the last setting if 165 165 * none of the others match. 166 166 */ 167 - static inline int phy_find_setting(int speed, int duplex) 167 + static inline unsigned int phy_find_setting(int speed, int duplex) 168 168 { 169 - int idx = 0; 169 + unsigned int idx = 0; 170 170 171 171 while (idx < ARRAY_SIZE(settings) && 172 172 (settings[idx].speed != speed || settings[idx].duplex != duplex)) ··· 185 185 * the mask in features. Returns the index of the last setting 186 186 * if nothing else matches. 187 187 */ 188 - static inline int phy_find_valid(int idx, u32 features) 188 + static inline unsigned int phy_find_valid(unsigned int idx, u32 features) 189 189 { 190 190 while (idx < MAX_NUM_SETTINGS && !(settings[idx].setting & features)) 191 191 idx++; ··· 204 204 static void phy_sanitize_settings(struct phy_device *phydev) 205 205 { 206 206 u32 features = phydev->supported; 207 - int idx; 207 + unsigned int idx; 208 208 209 209 /* Sanitize settings based on PHY capabilities */ 210 210 if ((features & SUPPORTED_Autoneg) == 0) ··· 954 954 (phydev->interface == PHY_INTERFACE_MODE_RGMII))) { 955 955 int eee_lp, eee_cap, eee_adv; 956 956 u32 lp, cap, adv; 957 - int idx, status; 957 + int status; 958 + unsigned int idx; 958 959 959 960 /* Read phy status to properly get the right settings */ 960 961 status = phy_read_status(phydev);
+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 r815x.o 14 + obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.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_SR9700) += sr9700.o
+7
drivers/net/usb/cdc_ether.c
··· 652 652 .driver_info = 0, 653 653 }, 654 654 655 + /* Samsung USB Ethernet Adapters */ 656 + { 657 + USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM, 658 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 659 + .driver_info = 0, 660 + }, 661 + 655 662 /* WHITELIST!!! 656 663 * 657 664 * CDC Ether uses two interfaces, not necessarily consecutive.
+9 -6
drivers/net/usb/r8152.c
··· 449 449 #define MCU_TYPE_PLA 0x0100 450 450 #define MCU_TYPE_USB 0x0000 451 451 452 - #define REALTEK_USB_DEVICE(vend, prod) \ 453 - USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC) 454 - 455 452 struct rx_desc { 456 453 __le32 opts1; 457 454 #define RX_LEN_MASK 0x7fff ··· 2736 2739 struct net_device *netdev; 2737 2740 int ret; 2738 2741 2742 + if (udev->actconfig->desc.bConfigurationValue != 1) { 2743 + usb_driver_set_configuration(udev, 1); 2744 + return -ENODEV; 2745 + } 2746 + 2747 + usb_reset_device(udev); 2739 2748 netdev = alloc_etherdev(sizeof(struct r8152)); 2740 2749 if (!netdev) { 2741 2750 dev_err(&intf->dev, "Out of memory\n"); ··· 2822 2819 2823 2820 /* table of devices that work with this driver */ 2824 2821 static struct usb_device_id rtl8152_table[] = { 2825 - {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, 2826 - {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, 2827 - {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, 2822 + {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, 2823 + {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, 2824 + {USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, 2828 2825 {} 2829 2826 }; 2830 2827
-248
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 ret; 28 - u8 shift = index & 2; 29 - __le32 *tmp; 30 - 31 - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); 32 - if (!tmp) 33 - return -ENOMEM; 34 - 35 - index &= ~3; 36 - 37 - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 38 - RTL815x_REQ_GET_REGS, RTL815x_REQT_READ, 39 - index, MCU_TYPE_PLA, tmp, sizeof(*tmp), 500); 40 - if (ret < 0) 41 - goto out2; 42 - 43 - ret = __le32_to_cpu(*tmp); 44 - ret >>= (shift * 8); 45 - ret &= 0xffff; 46 - 47 - out2: 48 - kfree(tmp); 49 - return ret; 50 - } 51 - 52 - static int pla_write_word(struct usb_device *udev, u16 index, u32 data) 53 - { 54 - __le32 *tmp; 55 - u32 mask = 0xffff; 56 - u16 byen = BYTE_EN_WORD; 57 - u8 shift = index & 2; 58 - int ret; 59 - 60 - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); 61 - if (!tmp) 62 - return -ENOMEM; 63 - 64 - data &= mask; 65 - 66 - if (shift) { 67 - byen <<= shift; 68 - mask <<= (shift * 8); 69 - data <<= (shift * 8); 70 - index &= ~3; 71 - } 72 - 73 - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 74 - RTL815x_REQ_GET_REGS, RTL815x_REQT_READ, 75 - index, MCU_TYPE_PLA, tmp, sizeof(*tmp), 500); 76 - if (ret < 0) 77 - goto out3; 78 - 79 - data |= __le32_to_cpu(*tmp) & ~mask; 80 - *tmp = __cpu_to_le32(data); 81 - 82 - ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 83 - RTL815x_REQ_SET_REGS, RTL815x_REQT_WRITE, 84 - index, MCU_TYPE_PLA | byen, tmp, sizeof(*tmp), 85 - 500); 86 - 87 - out3: 88 - kfree(tmp); 89 - return ret; 90 - } 91 - 92 - static int ocp_reg_read(struct usbnet *dev, u16 addr) 93 - { 94 - u16 ocp_base, ocp_index; 95 - int ret; 96 - 97 - ocp_base = addr & 0xf000; 98 - ret = pla_write_word(dev->udev, OCP_BASE, ocp_base); 99 - if (ret < 0) 100 - goto out; 101 - 102 - ocp_index = (addr & 0x0fff) | 0xb000; 103 - ret = pla_read_word(dev->udev, ocp_index); 104 - 105 - out: 106 - return ret; 107 - } 108 - 109 - static int ocp_reg_write(struct usbnet *dev, u16 addr, u16 data) 110 - { 111 - u16 ocp_base, ocp_index; 112 - int ret; 113 - 114 - ocp_base = addr & 0xf000; 115 - ret = pla_write_word(dev->udev, OCP_BASE, ocp_base); 116 - if (ret < 0) 117 - goto out1; 118 - 119 - ocp_index = (addr & 0x0fff) | 0xb000; 120 - ret = pla_write_word(dev->udev, ocp_index, data); 121 - 122 - out1: 123 - return ret; 124 - } 125 - 126 - static int r815x_mdio_read(struct net_device *netdev, int phy_id, int reg) 127 - { 128 - struct usbnet *dev = netdev_priv(netdev); 129 - int ret; 130 - 131 - if (phy_id != R815x_PHY_ID) 132 - return -EINVAL; 133 - 134 - if (usb_autopm_get_interface(dev->intf) < 0) 135 - return -ENODEV; 136 - 137 - ret = ocp_reg_read(dev, BASE_MII + reg * 2); 138 - 139 - usb_autopm_put_interface(dev->intf); 140 - return ret; 141 - } 142 - 143 - static 144 - void r815x_mdio_write(struct net_device *netdev, int phy_id, int reg, int val) 145 - { 146 - struct usbnet *dev = netdev_priv(netdev); 147 - 148 - if (phy_id != R815x_PHY_ID) 149 - return; 150 - 151 - if (usb_autopm_get_interface(dev->intf) < 0) 152 - return; 153 - 154 - ocp_reg_write(dev, BASE_MII + reg * 2, val); 155 - 156 - usb_autopm_put_interface(dev->intf); 157 - } 158 - 159 - static int r8153_bind(struct usbnet *dev, struct usb_interface *intf) 160 - { 161 - int status; 162 - 163 - status = usbnet_cdc_bind(dev, intf); 164 - if (status < 0) 165 - return status; 166 - 167 - dev->mii.dev = dev->net; 168 - dev->mii.mdio_read = r815x_mdio_read; 169 - dev->mii.mdio_write = r815x_mdio_write; 170 - dev->mii.phy_id_mask = 0x3f; 171 - dev->mii.reg_num_mask = 0x1f; 172 - dev->mii.phy_id = R815x_PHY_ID; 173 - dev->mii.supports_gmii = 1; 174 - 175 - return status; 176 - } 177 - 178 - static int r8152_bind(struct usbnet *dev, struct usb_interface *intf) 179 - { 180 - int status; 181 - 182 - status = usbnet_cdc_bind(dev, intf); 183 - if (status < 0) 184 - return status; 185 - 186 - dev->mii.dev = dev->net; 187 - dev->mii.mdio_read = r815x_mdio_read; 188 - dev->mii.mdio_write = r815x_mdio_write; 189 - dev->mii.phy_id_mask = 0x3f; 190 - dev->mii.reg_num_mask = 0x1f; 191 - dev->mii.phy_id = R815x_PHY_ID; 192 - dev->mii.supports_gmii = 0; 193 - 194 - return status; 195 - } 196 - 197 - static const struct driver_info r8152_info = { 198 - .description = "RTL8152 ECM Device", 199 - .flags = FLAG_ETHER | FLAG_POINTTOPOINT, 200 - .bind = r8152_bind, 201 - .unbind = usbnet_cdc_unbind, 202 - .status = usbnet_cdc_status, 203 - .manage_power = usbnet_manage_power, 204 - }; 205 - 206 - static const struct driver_info r8153_info = { 207 - .description = "RTL8153 ECM Device", 208 - .flags = FLAG_ETHER | FLAG_POINTTOPOINT, 209 - .bind = r8153_bind, 210 - .unbind = usbnet_cdc_unbind, 211 - .status = usbnet_cdc_status, 212 - .manage_power = usbnet_manage_power, 213 - }; 214 - 215 - static const struct usb_device_id products[] = { 216 - { 217 - USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, 218 - USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 219 - .driver_info = (unsigned long) &r8152_info, 220 - }, 221 - 222 - { 223 - USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, 224 - USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 225 - .driver_info = (unsigned long) &r8153_info, 226 - }, 227 - 228 - { }, /* END */ 229 - }; 230 - MODULE_DEVICE_TABLE(usb, products); 231 - 232 - static struct usb_driver r815x_driver = { 233 - .name = "r815x", 234 - .id_table = products, 235 - .probe = usbnet_probe, 236 - .disconnect = usbnet_disconnect, 237 - .suspend = usbnet_suspend, 238 - .resume = usbnet_resume, 239 - .reset_resume = usbnet_resume, 240 - .supports_autosuspend = 1, 241 - .disable_hub_initiated_lpm = 1, 242 - }; 243 - 244 - module_usb_driver(r815x_driver); 245 - 246 - MODULE_AUTHOR("Hayes Wang"); 247 - MODULE_DESCRIPTION("Realtek USB ECM device"); 248 - MODULE_LICENSE("GPL");
+14 -5
drivers/net/vmxnet3/vmxnet3_drv.c
··· 1762 1762 { 1763 1763 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1764 1764 1765 - if (adapter->intr.mask_mode == VMXNET3_IMM_ACTIVE) 1766 - vmxnet3_disable_all_intrs(adapter); 1767 - 1768 - vmxnet3_do_poll(adapter, adapter->rx_queue[0].rx_ring[0].size); 1769 - vmxnet3_enable_all_intrs(adapter); 1765 + switch (adapter->intr.type) { 1766 + #ifdef CONFIG_PCI_MSI 1767 + case VMXNET3_IT_MSIX: { 1768 + int i; 1769 + for (i = 0; i < adapter->num_rx_queues; i++) 1770 + vmxnet3_msix_rx(0, &adapter->rx_queue[i]); 1771 + break; 1772 + } 1773 + #endif 1774 + case VMXNET3_IT_MSI: 1775 + default: 1776 + vmxnet3_intr(0, adapter->netdev); 1777 + break; 1778 + } 1770 1779 1771 1780 } 1772 1781 #endif /* CONFIG_NET_POLL_CONTROLLER */
+5 -2
drivers/net/wireless/iwlwifi/mvm/bt-coex.c
··· 872 872 873 873 lockdep_assert_held(&mvm->mutex); 874 874 875 - /* Rssi update while not associated ?! */ 876 - if (WARN_ON_ONCE(mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT)) 875 + /* 876 + * Rssi update while not associated - can happen since the statistics 877 + * are handled asynchronously 878 + */ 879 + if (mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT) 877 880 return; 878 881 879 882 /* No BT - reports should be disabled */
+2 -3
drivers/net/wireless/iwlwifi/pcie/drv.c
··· 359 359 /* 7265 Series */ 360 360 {IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)}, 361 361 {IWL_PCI_DEVICE(0x095A, 0x5110, iwl7265_2ac_cfg)}, 362 - {IWL_PCI_DEVICE(0x095A, 0x5112, iwl7265_2ac_cfg)}, 363 362 {IWL_PCI_DEVICE(0x095A, 0x5100, iwl7265_2ac_cfg)}, 364 - {IWL_PCI_DEVICE(0x095A, 0x510A, iwl7265_2ac_cfg)}, 365 363 {IWL_PCI_DEVICE(0x095B, 0x5310, iwl7265_2ac_cfg)}, 366 - {IWL_PCI_DEVICE(0x095B, 0x5302, iwl7265_2ac_cfg)}, 364 + {IWL_PCI_DEVICE(0x095B, 0x5302, iwl7265_n_cfg)}, 367 365 {IWL_PCI_DEVICE(0x095B, 0x5210, iwl7265_2ac_cfg)}, 368 366 {IWL_PCI_DEVICE(0x095A, 0x5012, iwl7265_2ac_cfg)}, 367 + {IWL_PCI_DEVICE(0x095A, 0x5412, iwl7265_2ac_cfg)}, 369 368 {IWL_PCI_DEVICE(0x095A, 0x5410, iwl7265_2ac_cfg)}, 370 369 {IWL_PCI_DEVICE(0x095A, 0x5400, iwl7265_2ac_cfg)}, 371 370 {IWL_PCI_DEVICE(0x095A, 0x1010, iwl7265_2ac_cfg)},
+1 -2
drivers/net/wireless/mwifiex/11ac.c
··· 189 189 vht_cap->header.len = 190 190 cpu_to_le16(sizeof(struct ieee80211_vht_cap)); 191 191 memcpy((u8 *)vht_cap + sizeof(struct mwifiex_ie_types_header), 192 - (u8 *)bss_desc->bcn_vht_cap + 193 - sizeof(struct ieee_types_header), 192 + (u8 *)bss_desc->bcn_vht_cap, 194 193 le16_to_cpu(vht_cap->header.len)); 195 194 196 195 mwifiex_fill_vht_cap_tlv(priv, vht_cap, bss_desc->bss_band);
+1 -2
drivers/net/wireless/mwifiex/11n.c
··· 308 308 ht_cap->header.len = 309 309 cpu_to_le16(sizeof(struct ieee80211_ht_cap)); 310 310 memcpy((u8 *) ht_cap + sizeof(struct mwifiex_ie_types_header), 311 - (u8 *) bss_desc->bcn_ht_cap + 312 - sizeof(struct ieee_types_header), 311 + (u8 *)bss_desc->bcn_ht_cap, 313 312 le16_to_cpu(ht_cap->header.len)); 314 313 315 314 mwifiex_fill_cap_info(priv, radio_type, ht_cap);
+4 -4
drivers/net/wireless/mwifiex/scan.c
··· 2101 2101 curr_bss->ht_info_offset); 2102 2102 2103 2103 if (curr_bss->bcn_vht_cap) 2104 - curr_bss->bcn_ht_cap = (void *)(curr_bss->beacon_buf + 2105 - curr_bss->vht_cap_offset); 2104 + curr_bss->bcn_vht_cap = (void *)(curr_bss->beacon_buf + 2105 + curr_bss->vht_cap_offset); 2106 2106 2107 2107 if (curr_bss->bcn_vht_oper) 2108 - curr_bss->bcn_ht_oper = (void *)(curr_bss->beacon_buf + 2109 - curr_bss->vht_info_offset); 2108 + curr_bss->bcn_vht_oper = (void *)(curr_bss->beacon_buf + 2109 + curr_bss->vht_info_offset); 2110 2110 2111 2111 if (curr_bss->bcn_bss_co_2040) 2112 2112 curr_bss->bcn_bss_co_2040 =
+1 -1
drivers/net/wireless/ti/wl1251/rx.c
··· 180 180 wl1251_mem_read(wl, rx_packet_ring_addr, rx_buffer, length); 181 181 182 182 /* The actual length doesn't include the target's alignment */ 183 - skb->len = desc->length - PLCP_HEADER_LENGTH; 183 + skb_trim(skb, desc->length - PLCP_HEADER_LENGTH); 184 184 185 185 fc = (u16 *)skb->data; 186 186
+1 -2
drivers/net/xen-netback/interface.c
··· 132 132 /* If the skb is GSO then we'll also need an extra slot for the 133 133 * metadata. 134 134 */ 135 - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4 || 136 - skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) 135 + if (skb_is_gso(skb)) 137 136 min_slots_needed++; 138 137 139 138 /* If the skb can't possibly fit in the remaining slots
+18 -21
drivers/net/xen-netback/netback.c
··· 240 240 struct gnttab_copy *copy_gop; 241 241 struct xenvif_rx_meta *meta; 242 242 unsigned long bytes; 243 - int gso_type; 243 + int gso_type = XEN_NETIF_GSO_TYPE_NONE; 244 244 245 245 /* Data must not cross a page boundary. */ 246 246 BUG_ON(size + offset > PAGE_SIZE<<compound_order(page)); ··· 299 299 } 300 300 301 301 /* Leave a gap for the GSO descriptor. */ 302 - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) 303 - gso_type = XEN_NETIF_GSO_TYPE_TCPV4; 304 - else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) 305 - gso_type = XEN_NETIF_GSO_TYPE_TCPV6; 306 - else 307 - gso_type = XEN_NETIF_GSO_TYPE_NONE; 302 + if (skb_is_gso(skb)) { 303 + if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) 304 + gso_type = XEN_NETIF_GSO_TYPE_TCPV4; 305 + else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) 306 + gso_type = XEN_NETIF_GSO_TYPE_TCPV6; 307 + } 308 308 309 309 if (*head && ((1 << gso_type) & vif->gso_mask)) 310 310 vif->rx.req_cons++; ··· 338 338 int head = 1; 339 339 int old_meta_prod; 340 340 int gso_type; 341 - int gso_size; 342 341 343 342 old_meta_prod = npo->meta_prod; 344 343 345 - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) { 346 - gso_type = XEN_NETIF_GSO_TYPE_TCPV4; 347 - gso_size = skb_shinfo(skb)->gso_size; 348 - } else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) { 349 - gso_type = XEN_NETIF_GSO_TYPE_TCPV6; 350 - gso_size = skb_shinfo(skb)->gso_size; 351 - } else { 352 - gso_type = XEN_NETIF_GSO_TYPE_NONE; 353 - gso_size = 0; 344 + gso_type = XEN_NETIF_GSO_TYPE_NONE; 345 + if (skb_is_gso(skb)) { 346 + if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) 347 + gso_type = XEN_NETIF_GSO_TYPE_TCPV4; 348 + else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) 349 + gso_type = XEN_NETIF_GSO_TYPE_TCPV6; 354 350 } 355 351 356 352 /* Set up a GSO prefix descriptor, if necessary */ ··· 354 358 req = RING_GET_REQUEST(&vif->rx, vif->rx.req_cons++); 355 359 meta = npo->meta + npo->meta_prod++; 356 360 meta->gso_type = gso_type; 357 - meta->gso_size = gso_size; 361 + meta->gso_size = skb_shinfo(skb)->gso_size; 358 362 meta->size = 0; 359 363 meta->id = req->id; 360 364 } ··· 364 368 365 369 if ((1 << gso_type) & vif->gso_mask) { 366 370 meta->gso_type = gso_type; 367 - meta->gso_size = gso_size; 371 + meta->gso_size = skb_shinfo(skb)->gso_size; 368 372 } else { 369 373 meta->gso_type = XEN_NETIF_GSO_TYPE_NONE; 370 374 meta->gso_size = 0; ··· 496 500 size = skb_frag_size(&skb_shinfo(skb)->frags[i]); 497 501 max_slots_needed += DIV_ROUND_UP(size, PAGE_SIZE); 498 502 } 499 - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4 || 500 - skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) 503 + if (skb_is_gso(skb) && 504 + (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4 || 505 + skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)) 501 506 max_slots_needed++; 502 507 503 508 /* If the skb may not fit then bail out now */
+5 -1
include/net/sock.h
··· 1488 1488 */ 1489 1489 #define sock_owned_by_user(sk) ((sk)->sk_lock.owned) 1490 1490 1491 + static inline void sock_release_ownership(struct sock *sk) 1492 + { 1493 + sk->sk_lock.owned = 0; 1494 + } 1495 + 1491 1496 /* 1492 1497 * Macro so as to not evaluate some arguments when 1493 1498 * lockdep is not enabled. ··· 2191 2186 { 2192 2187 #define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL) | \ 2193 2188 (1UL << SOCK_RCVTSTAMP) | \ 2194 - (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE) | \ 2195 2189 (1UL << SOCK_TIMESTAMPING_SOFTWARE) | \ 2196 2190 (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \ 2197 2191 (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE))
+3
net/8021q/vlan_dev.c
··· 538 538 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); 539 539 struct net_device *real_dev = vlan->real_dev; 540 540 541 + if (saddr == NULL) 542 + saddr = dev->dev_addr; 543 + 541 544 return dev_hard_header(skb, real_dev, type, daddr, saddr, len); 542 545 } 543 546
+30 -3
net/bridge/br_multicast.c
··· 1127 1127 struct net_bridge_port *port, 1128 1128 struct bridge_mcast_querier *querier, 1129 1129 int saddr, 1130 + bool is_general_query, 1130 1131 unsigned long max_delay) 1131 1132 { 1132 - if (saddr) 1133 + if (saddr && is_general_query) 1133 1134 br_multicast_update_querier_timer(br, querier, max_delay); 1134 1135 else if (timer_pending(&querier->timer)) 1135 1136 return; ··· 1182 1181 IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE) : 1; 1183 1182 } 1184 1183 1184 + /* RFC2236+RFC3376 (IGMPv2+IGMPv3) require the multicast link layer 1185 + * all-systems destination addresses (224.0.0.1) for general queries 1186 + */ 1187 + if (!group && iph->daddr != htonl(INADDR_ALLHOSTS_GROUP)) { 1188 + err = -EINVAL; 1189 + goto out; 1190 + } 1191 + 1185 1192 br_multicast_query_received(br, port, &br->ip4_querier, !!iph->saddr, 1186 - max_delay); 1193 + !group, max_delay); 1187 1194 1188 1195 if (!group) 1189 1196 goto out; ··· 1237 1228 unsigned long max_delay; 1238 1229 unsigned long now = jiffies; 1239 1230 const struct in6_addr *group = NULL; 1231 + bool is_general_query; 1240 1232 int err = 0; 1241 1233 1242 1234 spin_lock(&br->multicast_lock); 1243 1235 if (!netif_running(br->dev) || 1244 1236 (port && port->state == BR_STATE_DISABLED)) 1245 1237 goto out; 1238 + 1239 + /* RFC2710+RFC3810 (MLDv1+MLDv2) require link-local source addresses */ 1240 + if (!(ipv6_addr_type(&ip6h->saddr) & IPV6_ADDR_LINKLOCAL)) { 1241 + err = -EINVAL; 1242 + goto out; 1243 + } 1246 1244 1247 1245 if (skb->len == sizeof(*mld)) { 1248 1246 if (!pskb_may_pull(skb, sizeof(*mld))) { ··· 1272 1256 max_delay = max(msecs_to_jiffies(mldv2_mrc(mld2q)), 1UL); 1273 1257 } 1274 1258 1259 + is_general_query = group && ipv6_addr_any(group); 1260 + 1261 + /* RFC2710+RFC3810 (MLDv1+MLDv2) require the multicast link layer 1262 + * all-nodes destination address (ff02::1) for general queries 1263 + */ 1264 + if (is_general_query && !ipv6_addr_is_ll_all_nodes(&ip6h->daddr)) { 1265 + err = -EINVAL; 1266 + goto out; 1267 + } 1268 + 1275 1269 br_multicast_query_received(br, port, &br->ip6_querier, 1276 - !ipv6_addr_any(&ip6h->saddr), max_delay); 1270 + !ipv6_addr_any(&ip6h->saddr), 1271 + is_general_query, max_delay); 1277 1272 1278 1273 if (!group) 1279 1274 goto out;
+54 -46
net/core/skbuff.c
··· 2838 2838 2839 2839 /** 2840 2840 * skb_segment - Perform protocol segmentation on skb. 2841 - * @skb: buffer to segment 2841 + * @head_skb: buffer to segment 2842 2842 * @features: features for the output path (see dev->features) 2843 2843 * 2844 2844 * This function performs segmentation on the given skb. It returns 2845 2845 * a pointer to the first in a list of new skbs for the segments. 2846 2846 * In case of error it returns ERR_PTR(err). 2847 2847 */ 2848 - struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features) 2848 + struct sk_buff *skb_segment(struct sk_buff *head_skb, 2849 + netdev_features_t features) 2849 2850 { 2850 2851 struct sk_buff *segs = NULL; 2851 2852 struct sk_buff *tail = NULL; 2852 - struct sk_buff *fskb = skb_shinfo(skb)->frag_list; 2853 - skb_frag_t *skb_frag = skb_shinfo(skb)->frags; 2854 - unsigned int mss = skb_shinfo(skb)->gso_size; 2855 - unsigned int doffset = skb->data - skb_mac_header(skb); 2853 + struct sk_buff *list_skb = skb_shinfo(head_skb)->frag_list; 2854 + skb_frag_t *frag = skb_shinfo(head_skb)->frags; 2855 + unsigned int mss = skb_shinfo(head_skb)->gso_size; 2856 + unsigned int doffset = head_skb->data - skb_mac_header(head_skb); 2857 + struct sk_buff *frag_skb = head_skb; 2856 2858 unsigned int offset = doffset; 2857 - unsigned int tnl_hlen = skb_tnl_header_len(skb); 2859 + unsigned int tnl_hlen = skb_tnl_header_len(head_skb); 2858 2860 unsigned int headroom; 2859 2861 unsigned int len; 2860 2862 __be16 proto; 2861 2863 bool csum; 2862 2864 int sg = !!(features & NETIF_F_SG); 2863 - int nfrags = skb_shinfo(skb)->nr_frags; 2865 + int nfrags = skb_shinfo(head_skb)->nr_frags; 2864 2866 int err = -ENOMEM; 2865 2867 int i = 0; 2866 2868 int pos; 2867 2869 2868 - proto = skb_network_protocol(skb); 2870 + proto = skb_network_protocol(head_skb); 2869 2871 if (unlikely(!proto)) 2870 2872 return ERR_PTR(-EINVAL); 2871 2873 2872 2874 csum = !!can_checksum_protocol(features, proto); 2873 - __skb_push(skb, doffset); 2874 - headroom = skb_headroom(skb); 2875 - pos = skb_headlen(skb); 2875 + __skb_push(head_skb, doffset); 2876 + headroom = skb_headroom(head_skb); 2877 + pos = skb_headlen(head_skb); 2876 2878 2877 2879 do { 2878 2880 struct sk_buff *nskb; 2879 - skb_frag_t *frag; 2881 + skb_frag_t *nskb_frag; 2880 2882 int hsize; 2881 2883 int size; 2882 2884 2883 - len = skb->len - offset; 2885 + len = head_skb->len - offset; 2884 2886 if (len > mss) 2885 2887 len = mss; 2886 2888 2887 - hsize = skb_headlen(skb) - offset; 2889 + hsize = skb_headlen(head_skb) - offset; 2888 2890 if (hsize < 0) 2889 2891 hsize = 0; 2890 2892 if (hsize > len || !sg) 2891 2893 hsize = len; 2892 2894 2893 - if (!hsize && i >= nfrags && skb_headlen(fskb) && 2894 - (skb_headlen(fskb) == len || sg)) { 2895 - BUG_ON(skb_headlen(fskb) > len); 2895 + if (!hsize && i >= nfrags && skb_headlen(list_skb) && 2896 + (skb_headlen(list_skb) == len || sg)) { 2897 + BUG_ON(skb_headlen(list_skb) > len); 2896 2898 2897 2899 i = 0; 2898 - nfrags = skb_shinfo(fskb)->nr_frags; 2899 - skb_frag = skb_shinfo(fskb)->frags; 2900 - pos += skb_headlen(fskb); 2900 + nfrags = skb_shinfo(list_skb)->nr_frags; 2901 + frag = skb_shinfo(list_skb)->frags; 2902 + frag_skb = list_skb; 2903 + pos += skb_headlen(list_skb); 2901 2904 2902 2905 while (pos < offset + len) { 2903 2906 BUG_ON(i >= nfrags); 2904 2907 2905 - size = skb_frag_size(skb_frag); 2908 + size = skb_frag_size(frag); 2906 2909 if (pos + size > offset + len) 2907 2910 break; 2908 2911 2909 2912 i++; 2910 2913 pos += size; 2911 - skb_frag++; 2914 + frag++; 2912 2915 } 2913 2916 2914 - nskb = skb_clone(fskb, GFP_ATOMIC); 2915 - fskb = fskb->next; 2917 + nskb = skb_clone(list_skb, GFP_ATOMIC); 2918 + list_skb = list_skb->next; 2916 2919 2917 2920 if (unlikely(!nskb)) 2918 2921 goto err; ··· 2936 2933 __skb_push(nskb, doffset); 2937 2934 } else { 2938 2935 nskb = __alloc_skb(hsize + doffset + headroom, 2939 - GFP_ATOMIC, skb_alloc_rx_flag(skb), 2936 + GFP_ATOMIC, skb_alloc_rx_flag(head_skb), 2940 2937 NUMA_NO_NODE); 2941 2938 2942 2939 if (unlikely(!nskb)) ··· 2952 2949 segs = nskb; 2953 2950 tail = nskb; 2954 2951 2955 - __copy_skb_header(nskb, skb); 2956 - nskb->mac_len = skb->mac_len; 2952 + __copy_skb_header(nskb, head_skb); 2953 + nskb->mac_len = head_skb->mac_len; 2957 2954 2958 2955 skb_headers_offset_update(nskb, skb_headroom(nskb) - headroom); 2959 2956 2960 - skb_copy_from_linear_data_offset(skb, -tnl_hlen, 2957 + skb_copy_from_linear_data_offset(head_skb, -tnl_hlen, 2961 2958 nskb->data - tnl_hlen, 2962 2959 doffset + tnl_hlen); 2963 2960 ··· 2966 2963 2967 2964 if (!sg) { 2968 2965 nskb->ip_summed = CHECKSUM_NONE; 2969 - nskb->csum = skb_copy_and_csum_bits(skb, offset, 2966 + nskb->csum = skb_copy_and_csum_bits(head_skb, offset, 2970 2967 skb_put(nskb, len), 2971 2968 len, 0); 2972 2969 continue; 2973 2970 } 2974 2971 2975 - frag = skb_shinfo(nskb)->frags; 2972 + nskb_frag = skb_shinfo(nskb)->frags; 2976 2973 2977 - skb_copy_from_linear_data_offset(skb, offset, 2974 + skb_copy_from_linear_data_offset(head_skb, offset, 2978 2975 skb_put(nskb, hsize), hsize); 2979 2976 2980 - skb_shinfo(nskb)->tx_flags = skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG; 2977 + skb_shinfo(nskb)->tx_flags = skb_shinfo(head_skb)->tx_flags & 2978 + SKBTX_SHARED_FRAG; 2981 2979 2982 2980 while (pos < offset + len) { 2983 2981 if (i >= nfrags) { 2984 - BUG_ON(skb_headlen(fskb)); 2982 + BUG_ON(skb_headlen(list_skb)); 2985 2983 2986 2984 i = 0; 2987 - nfrags = skb_shinfo(fskb)->nr_frags; 2988 - skb_frag = skb_shinfo(fskb)->frags; 2985 + nfrags = skb_shinfo(list_skb)->nr_frags; 2986 + frag = skb_shinfo(list_skb)->frags; 2987 + frag_skb = list_skb; 2989 2988 2990 2989 BUG_ON(!nfrags); 2991 2990 2992 - fskb = fskb->next; 2991 + list_skb = list_skb->next; 2993 2992 } 2994 2993 2995 2994 if (unlikely(skb_shinfo(nskb)->nr_frags >= ··· 3002 2997 goto err; 3003 2998 } 3004 2999 3005 - *frag = *skb_frag; 3006 - __skb_frag_ref(frag); 3007 - size = skb_frag_size(frag); 3000 + if (unlikely(skb_orphan_frags(frag_skb, GFP_ATOMIC))) 3001 + goto err; 3002 + 3003 + *nskb_frag = *frag; 3004 + __skb_frag_ref(nskb_frag); 3005 + size = skb_frag_size(nskb_frag); 3008 3006 3009 3007 if (pos < offset) { 3010 - frag->page_offset += offset - pos; 3011 - skb_frag_size_sub(frag, offset - pos); 3008 + nskb_frag->page_offset += offset - pos; 3009 + skb_frag_size_sub(nskb_frag, offset - pos); 3012 3010 } 3013 3011 3014 3012 skb_shinfo(nskb)->nr_frags++; 3015 3013 3016 3014 if (pos + size <= offset + len) { 3017 3015 i++; 3018 - skb_frag++; 3016 + frag++; 3019 3017 pos += size; 3020 3018 } else { 3021 - skb_frag_size_sub(frag, pos + size - (offset + len)); 3019 + skb_frag_size_sub(nskb_frag, pos + size - (offset + len)); 3022 3020 goto skip_fraglist; 3023 3021 } 3024 3022 3025 - frag++; 3023 + nskb_frag++; 3026 3024 } 3027 3025 3028 3026 skip_fraglist: ··· 3039 3031 nskb->len - doffset, 0); 3040 3032 nskb->ip_summed = CHECKSUM_NONE; 3041 3033 } 3042 - } while ((offset += len) < skb->len); 3034 + } while ((offset += len) < head_skb->len); 3043 3035 3044 3036 return segs; 3045 3037
+4 -1
net/core/sock.c
··· 2357 2357 if (sk->sk_backlog.tail) 2358 2358 __release_sock(sk); 2359 2359 2360 + /* Warning : release_cb() might need to release sk ownership, 2361 + * ie call sock_release_ownership(sk) before us. 2362 + */ 2360 2363 if (sk->sk_prot->release_cb) 2361 2364 sk->sk_prot->release_cb(sk); 2362 2365 2363 - sk->sk_lock.owned = 0; 2366 + sock_release_ownership(sk); 2364 2367 if (waitqueue_active(&sk->sk_lock.wq)) 2365 2368 wake_up(&sk->sk_lock.wq); 2366 2369 spin_unlock_bh(&sk->sk_lock.slock);
+3 -2
net/ipv4/inet_fragment.c
··· 208 208 } 209 209 210 210 work = frag_mem_limit(nf) - nf->low_thresh; 211 - while (work > 0) { 211 + while (work > 0 || force) { 212 212 spin_lock(&nf->lru_lock); 213 213 214 214 if (list_empty(&nf->lru_list)) { ··· 278 278 279 279 atomic_inc(&qp->refcnt); 280 280 hlist_add_head(&qp->list, &hb->chain); 281 + inet_frag_lru_add(nf, qp); 281 282 spin_unlock(&hb->chain_lock); 282 283 read_unlock(&f->lock); 283 - inet_frag_lru_add(nf, qp); 284 + 284 285 return qp; 285 286 } 286 287
+11
net/ipv4/tcp_output.c
··· 767 767 if (flags & (1UL << TCP_TSQ_DEFERRED)) 768 768 tcp_tsq_handler(sk); 769 769 770 + /* Here begins the tricky part : 771 + * We are called from release_sock() with : 772 + * 1) BH disabled 773 + * 2) sk_lock.slock spinlock held 774 + * 3) socket owned by us (sk->sk_lock.owned == 1) 775 + * 776 + * But following code is meant to be called from BH handlers, 777 + * so we should keep BH disabled, but early release socket ownership 778 + */ 779 + sock_release_ownership(sk); 780 + 770 781 if (flags & (1UL << TCP_WRITE_TIMER_DEFERRED)) { 771 782 tcp_write_timer_handler(sk); 772 783 __sock_put(sk);
+4 -1
net/ipv6/addrconf.c
··· 1103 1103 * Lifetime is greater than REGEN_ADVANCE time units. In particular, 1104 1104 * an implementation must not create a temporary address with a zero 1105 1105 * Preferred Lifetime. 1106 + * Use age calculation as in addrconf_verify to avoid unnecessary 1107 + * temporary addresses being generated. 1106 1108 */ 1107 - if (tmp_prefered_lft <= regen_advance) { 1109 + age = (now - tmp_tstamp + ADDRCONF_TIMER_FUZZ_MINUS) / HZ; 1110 + if (tmp_prefered_lft <= regen_advance + age) { 1108 1111 in6_ifa_put(ifp); 1109 1112 in6_dev_put(idev); 1110 1113 ret = -1;
+2 -2
net/ipv6/exthdrs_offload.c
··· 25 25 int ret; 26 26 27 27 ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING); 28 - if (!ret) 28 + if (ret) 29 29 goto out; 30 30 31 31 ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS); 32 - if (!ret) 32 + if (ret) 33 33 goto out_rt; 34 34 35 35 out:
+1 -1
net/ipv6/route.c
··· 1513 1513 if (!table) 1514 1514 goto out; 1515 1515 1516 - rt = ip6_dst_alloc(net, NULL, DST_NOCOUNT, table); 1516 + rt = ip6_dst_alloc(net, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT, table); 1517 1517 1518 1518 if (!rt) { 1519 1519 err = -ENOMEM;
+2 -2
net/l2tp/l2tp_core.c
··· 112 112 spinlock_t l2tp_session_hlist_lock; 113 113 }; 114 114 115 - static void l2tp_session_set_header_len(struct l2tp_session *session, int version); 116 115 static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel); 117 116 118 117 static inline struct l2tp_tunnel *l2tp_tunnel(struct sock *sk) ··· 1862 1863 /* We come here whenever a session's send_seq, cookie_len or 1863 1864 * l2specific_len parameters are set. 1864 1865 */ 1865 - static void l2tp_session_set_header_len(struct l2tp_session *session, int version) 1866 + void l2tp_session_set_header_len(struct l2tp_session *session, int version) 1866 1867 { 1867 1868 if (version == L2TP_HDR_VER_2) { 1868 1869 session->hdr_len = 6; ··· 1875 1876 } 1876 1877 1877 1878 } 1879 + EXPORT_SYMBOL_GPL(l2tp_session_set_header_len); 1878 1880 1879 1881 struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_tunnel *tunnel, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg) 1880 1882 {
+1
net/l2tp/l2tp_core.h
··· 263 263 int length, int (*payload_hook)(struct sk_buff *skb)); 264 264 int l2tp_session_queue_purge(struct l2tp_session *session); 265 265 int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb); 266 + void l2tp_session_set_header_len(struct l2tp_session *session, int version); 266 267 267 268 int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, 268 269 int hdr_len);
+3 -1
net/l2tp/l2tp_netlink.c
··· 578 578 if (info->attrs[L2TP_ATTR_RECV_SEQ]) 579 579 session->recv_seq = nla_get_u8(info->attrs[L2TP_ATTR_RECV_SEQ]); 580 580 581 - if (info->attrs[L2TP_ATTR_SEND_SEQ]) 581 + if (info->attrs[L2TP_ATTR_SEND_SEQ]) { 582 582 session->send_seq = nla_get_u8(info->attrs[L2TP_ATTR_SEND_SEQ]); 583 + l2tp_session_set_header_len(session, session->tunnel->version); 584 + } 583 585 584 586 if (info->attrs[L2TP_ATTR_LNS_MODE]) 585 587 session->lns_mode = nla_get_u8(info->attrs[L2TP_ATTR_LNS_MODE]);
+8 -5
net/l2tp/l2tp_ppp.c
··· 254 254 po = pppox_sk(sk); 255 255 ppp_input(&po->chan, skb); 256 256 } else { 257 - l2tp_info(session, PPPOL2TP_MSG_DATA, "%s: socket not bound\n", 258 - session->name); 257 + l2tp_dbg(session, PPPOL2TP_MSG_DATA, 258 + "%s: recv %d byte data frame, passing to L2TP socket\n", 259 + session->name, data_len); 259 260 260 - /* Not bound. Nothing we can do, so discard. */ 261 - atomic_long_inc(&session->stats.rx_errors); 262 - kfree_skb(skb); 261 + if (sock_queue_rcv_skb(sk, skb) < 0) { 262 + atomic_long_inc(&session->stats.rx_errors); 263 + kfree_skb(skb); 264 + } 263 265 } 264 266 265 267 return; ··· 1314 1312 po->chan.hdrlen = val ? PPPOL2TP_L2TP_HDR_SIZE_SEQ : 1315 1313 PPPOL2TP_L2TP_HDR_SIZE_NOSEQ; 1316 1314 } 1315 + l2tp_session_set_header_len(session, session->tunnel->version); 1317 1316 l2tp_info(session, PPPOL2TP_MSG_CONTROL, 1318 1317 "%s: set send_seq=%d\n", 1319 1318 session->name, session->send_seq);
+6
net/mac80211/chan.c
··· 100 100 } 101 101 max_bw = max(max_bw, width); 102 102 } 103 + 104 + /* use the configured bandwidth in case of monitor interface */ 105 + sdata = rcu_dereference(local->monitor_sdata); 106 + if (sdata && rcu_access_pointer(sdata->vif.chanctx_conf) == conf) 107 + max_bw = max(max_bw, conf->def.width); 108 + 103 109 rcu_read_unlock(); 104 110 105 111 return max_bw;
+1
net/mac80211/mesh_ps.c
··· 36 36 sdata->vif.addr); 37 37 nullfunc->frame_control = fc; 38 38 nullfunc->duration_id = 0; 39 + nullfunc->seq_ctrl = 0; 39 40 /* no address resolution for this frame -> set addr 1 immediately */ 40 41 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); 41 42 memset(skb_put(skb, 2), 0, 2); /* append QoS control field */
+1
net/mac80211/sta_info.c
··· 1206 1206 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); 1207 1207 memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN); 1208 1208 memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN); 1209 + nullfunc->seq_ctrl = 0; 1209 1210 1210 1211 skb->priority = tid; 1211 1212 skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]);
+4 -3
net/sched/sch_api.c
··· 273 273 274 274 void qdisc_list_add(struct Qdisc *q) 275 275 { 276 - struct Qdisc *root = qdisc_dev(q)->qdisc; 276 + if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) { 277 + struct Qdisc *root = qdisc_dev(q)->qdisc; 277 278 278 - WARN_ON_ONCE(root == &noop_qdisc); 279 - if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) 279 + WARN_ON_ONCE(root == &noop_qdisc); 280 280 list_add_tail(&q->list, &root->list); 281 + } 281 282 } 282 283 EXPORT_SYMBOL(qdisc_list_add); 283 284
+15 -6
net/sched/sch_fq.c
··· 601 601 { 602 602 struct fq_sched_data *q = qdisc_priv(sch); 603 603 struct rb_root *array; 604 + void *old_fq_root; 604 605 u32 idx; 605 606 606 607 if (q->fq_root && log == q->fq_trees_log) ··· 616 615 for (idx = 0; idx < (1U << log); idx++) 617 616 array[idx] = RB_ROOT; 618 617 619 - if (q->fq_root) { 620 - fq_rehash(q, q->fq_root, q->fq_trees_log, array, log); 621 - fq_free(q->fq_root); 622 - } 618 + sch_tree_lock(sch); 619 + 620 + old_fq_root = q->fq_root; 621 + if (old_fq_root) 622 + fq_rehash(q, old_fq_root, q->fq_trees_log, array, log); 623 + 623 624 q->fq_root = array; 624 625 q->fq_trees_log = log; 626 + 627 + sch_tree_unlock(sch); 628 + 629 + fq_free(old_fq_root); 625 630 626 631 return 0; 627 632 } ··· 704 697 q->flow_refill_delay = usecs_to_jiffies(usecs_delay); 705 698 } 706 699 707 - if (!err) 700 + if (!err) { 701 + sch_tree_unlock(sch); 708 702 err = fq_resize(sch, fq_log); 709 - 703 + sch_tree_lock(sch); 704 + } 710 705 while (sch->q.qlen > sch->limit) { 711 706 struct sk_buff *skb = fq_dequeue(sch); 712 707
+2 -2
net/sctp/sm_make_chunk.c
··· 1421 1421 BUG_ON(!list_empty(&chunk->list)); 1422 1422 list_del_init(&chunk->transmitted_list); 1423 1423 1424 - /* Free the chunk skb data and the SCTP_chunk stub itself. */ 1425 - dev_kfree_skb(chunk->skb); 1424 + consume_skb(chunk->skb); 1425 + consume_skb(chunk->auth_chunk); 1426 1426 1427 1427 SCTP_DBG_OBJCNT_DEC(chunk); 1428 1428 kmem_cache_free(sctp_chunk_cachep, chunk);
-5
net/sctp/sm_statefuns.c
··· 760 760 761 761 /* Make sure that we and the peer are AUTH capable */ 762 762 if (!net->sctp.auth_enable || !new_asoc->peer.auth_capable) { 763 - kfree_skb(chunk->auth_chunk); 764 763 sctp_association_free(new_asoc); 765 764 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); 766 765 } ··· 774 775 auth.transport = chunk->transport; 775 776 776 777 ret = sctp_sf_authenticate(net, ep, new_asoc, type, &auth); 777 - 778 - /* We can now safely free the auth_chunk clone */ 779 - kfree_skb(chunk->auth_chunk); 780 - 781 778 if (ret != SCTP_IERROR_NO_ERROR) { 782 779 sctp_association_free(new_asoc); 783 780 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
+4
net/socket.c
··· 1986 1986 { 1987 1987 if (copy_from_user(kmsg, umsg, sizeof(struct msghdr))) 1988 1988 return -EFAULT; 1989 + 1990 + if (kmsg->msg_namelen < 0) 1991 + return -EINVAL; 1992 + 1989 1993 if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) 1990 1994 kmsg->msg_namelen = sizeof(struct sockaddr_storage); 1991 1995 return 0;
+2 -7
net/tipc/config.c
··· 376 376 struct tipc_cfg_msg_hdr *req_hdr; 377 377 struct tipc_cfg_msg_hdr *rep_hdr; 378 378 struct sk_buff *rep_buf; 379 - int ret; 380 379 381 380 /* Validate configuration message header (ignore invalid message) */ 382 381 req_hdr = (struct tipc_cfg_msg_hdr *)buf; ··· 397 398 memcpy(rep_hdr, req_hdr, sizeof(*rep_hdr)); 398 399 rep_hdr->tcm_len = htonl(rep_buf->len); 399 400 rep_hdr->tcm_flags &= htons(~TCM_F_REQUEST); 400 - 401 - ret = tipc_conn_sendmsg(&cfgsrv, conid, addr, rep_buf->data, 402 - rep_buf->len); 403 - if (ret < 0) 404 - pr_err("Sending cfg reply message failed, no memory\n"); 405 - 401 + tipc_conn_sendmsg(&cfgsrv, conid, addr, rep_buf->data, 402 + rep_buf->len); 406 403 kfree_skb(rep_buf); 407 404 } 408 405 }
-1
net/tipc/handler.c
··· 58 58 59 59 spin_lock_bh(&qitem_lock); 60 60 if (!handler_enabled) { 61 - pr_err("Signal request ignored by handler\n"); 62 61 spin_unlock_bh(&qitem_lock); 63 62 return -ENOPROTOOPT; 64 63 }
+34 -3
net/tipc/name_table.c
··· 941 941 return 0; 942 942 } 943 943 944 + /** 945 + * tipc_purge_publications - remove all publications for a given type 946 + * 947 + * tipc_nametbl_lock must be held when calling this function 948 + */ 949 + static void tipc_purge_publications(struct name_seq *seq) 950 + { 951 + struct publication *publ, *safe; 952 + struct sub_seq *sseq; 953 + struct name_info *info; 954 + 955 + if (!seq->sseqs) { 956 + nameseq_delete_empty(seq); 957 + return; 958 + } 959 + sseq = seq->sseqs; 960 + info = sseq->info; 961 + list_for_each_entry_safe(publ, safe, &info->zone_list, zone_list) { 962 + tipc_nametbl_remove_publ(publ->type, publ->lower, publ->node, 963 + publ->ref, publ->key); 964 + } 965 + } 966 + 944 967 void tipc_nametbl_stop(void) 945 968 { 946 969 u32 i; 970 + struct name_seq *seq; 971 + struct hlist_head *seq_head; 972 + struct hlist_node *safe; 947 973 948 - /* Verify name table is empty, then release it */ 974 + /* Verify name table is empty and purge any lingering 975 + * publications, then release the name table 976 + */ 949 977 write_lock_bh(&tipc_nametbl_lock); 950 978 for (i = 0; i < TIPC_NAMETBL_SIZE; i++) { 951 979 if (hlist_empty(&table.types[i])) 952 980 continue; 953 - pr_err("nametbl_stop(): orphaned hash chain detected\n"); 954 - break; 981 + seq_head = &table.types[i]; 982 + hlist_for_each_entry_safe(seq, safe, seq_head, ns_list) { 983 + tipc_purge_publications(seq); 984 + } 985 + continue; 955 986 } 956 987 kfree(table.types); 957 988 table.types = NULL;
+7 -7
net/tipc/server.c
··· 87 87 static void tipc_conn_kref_release(struct kref *kref) 88 88 { 89 89 struct tipc_conn *con = container_of(kref, struct tipc_conn, kref); 90 - struct tipc_server *s = con->server; 91 90 92 91 if (con->sock) { 93 92 tipc_sock_release_local(con->sock); ··· 94 95 } 95 96 96 97 tipc_clean_outqueues(con); 97 - 98 - if (con->conid) 99 - s->tipc_conn_shutdown(con->conid, con->usr_data); 100 - 101 98 kfree(con); 102 99 } 103 100 ··· 176 181 struct tipc_server *s = con->server; 177 182 178 183 if (test_and_clear_bit(CF_CONNECTED, &con->flags)) { 184 + if (con->conid) 185 + s->tipc_conn_shutdown(con->conid, con->usr_data); 186 + 179 187 spin_lock_bh(&s->idr_lock); 180 188 idr_remove(&s->conn_idr, con->conid); 181 189 s->idr_in_use--; ··· 427 429 list_add_tail(&e->list, &con->outqueue); 428 430 spin_unlock_bh(&con->outqueue_lock); 429 431 430 - if (test_bit(CF_CONNECTED, &con->flags)) 432 + if (test_bit(CF_CONNECTED, &con->flags)) { 431 433 if (!queue_work(s->send_wq, &con->swork)) 432 434 conn_put(con); 433 - 435 + } else { 436 + conn_put(con); 437 + } 434 438 return 0; 435 439 } 436 440
+2 -2
net/tipc/socket.c
··· 997 997 998 998 for (;;) { 999 999 prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); 1000 - if (skb_queue_empty(&sk->sk_receive_queue)) { 1000 + if (timeo && skb_queue_empty(&sk->sk_receive_queue)) { 1001 1001 if (sock->state == SS_DISCONNECTING) { 1002 1002 err = -ENOTCONN; 1003 1003 break; ··· 1623 1623 for (;;) { 1624 1624 prepare_to_wait_exclusive(sk_sleep(sk), &wait, 1625 1625 TASK_INTERRUPTIBLE); 1626 - if (skb_queue_empty(&sk->sk_receive_queue)) { 1626 + if (timeo && skb_queue_empty(&sk->sk_receive_queue)) { 1627 1627 release_sock(sk); 1628 1628 timeo = schedule_timeout(timeo); 1629 1629 lock_sock(sk);
+2 -17
net/tipc/subscr.c
··· 96 96 { 97 97 struct tipc_subscriber *subscriber = sub->subscriber; 98 98 struct kvec msg_sect; 99 - int ret; 100 99 101 100 msg_sect.iov_base = (void *)&sub->evt; 102 101 msg_sect.iov_len = sizeof(struct tipc_event); 103 - 104 102 sub->evt.event = htohl(event, sub->swap); 105 103 sub->evt.found_lower = htohl(found_lower, sub->swap); 106 104 sub->evt.found_upper = htohl(found_upper, sub->swap); 107 105 sub->evt.port.ref = htohl(port_ref, sub->swap); 108 106 sub->evt.port.node = htohl(node, sub->swap); 109 - ret = tipc_conn_sendmsg(&topsrv, subscriber->conid, NULL, 110 - msg_sect.iov_base, msg_sect.iov_len); 111 - if (ret < 0) 112 - pr_err("Sending subscription event failed, no memory\n"); 107 + tipc_conn_sendmsg(&topsrv, subscriber->conid, NULL, msg_sect.iov_base, 108 + msg_sect.iov_len); 113 109 } 114 110 115 111 /** ··· 148 152 149 153 /* The spin lock per subscriber is used to protect its members */ 150 154 spin_lock_bh(&subscriber->lock); 151 - 152 - /* Validate if the connection related to the subscriber is 153 - * closed (in case subscriber is terminating) 154 - */ 155 - if (subscriber->conid == 0) { 156 - spin_unlock_bh(&subscriber->lock); 157 - return; 158 - } 159 155 160 156 /* Validate timeout (in case subscription is being cancelled) */ 161 157 if (sub->timeout == TIPC_WAIT_FOREVER) { ··· 202 214 struct tipc_subscription *sub_temp; 203 215 204 216 spin_lock_bh(&subscriber->lock); 205 - 206 - /* Invalidate subscriber reference */ 207 - subscriber->conid = 0; 208 217 209 218 /* Destroy any existing subscriptions for subscriber */ 210 219 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
+1 -2
net/unix/af_unix.c
··· 163 163 164 164 static inline unsigned int unix_hash_fold(__wsum n) 165 165 { 166 - unsigned int hash = (__force unsigned int)n; 166 + unsigned int hash = (__force unsigned int)csum_fold(n); 167 167 168 - hash ^= hash>>16; 169 168 hash ^= hash>>8; 170 169 return hash&(UNIX_HASH_SIZE-1); 171 170 }
-2
net/wireless/core.c
··· 788 788 default: 789 789 break; 790 790 } 791 - 792 - wdev->beacon_interval = 0; 793 791 } 794 792 795 793 static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
+1 -1
tools/net/Makefile
··· 12 12 13 13 all : bpf_jit_disasm bpf_dbg bpf_asm 14 14 15 - bpf_jit_disasm : CFLAGS = -Wall -O2 15 + bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm' 16 16 bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl 17 17 bpf_jit_disasm : bpf_jit_disasm.o 18 18