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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) Stale SKB data pointer access across pskb_may_pull() calls in L2TP,
from Haishuang Yan.

2) Fix multicast frame handling in mac80211 AP code, from Felix
Fietkau.

3) mac80211 station hashtable insert errors not handled properly, fix
from Johannes Berg.

4) Fix TX descriptor count limit handling in e1000, from Alexander
Duyck.

5) Revert a buggy netdev refcount fix in netpoll, from Bjorn Helgaas.

6) Must assign rtnl_link_ops of the device before registering it, fix
in ip6_tunnel from Thadeu Lima de Souza Cascardo.

7) Memory leak fix in tc action net exit, from WANG Cong.

8) Add missing AF_KCM entries to name tables, from Dexuan Cui.

9) Fix regression in GRE handling of csums wrt. FOU, from Alexander
Duyck.

10) Fix memory allocation alignment and congestion map corruption in
RDS, from Shamir Rabinovitch.

11) Fix default qdisc regression in tuntap driver, from Jason Wang.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits)
bridge, netem: mark mailing lists as moderated
tuntap: restore default qdisc
mpls: find_outdev: check for err ptr in addition to NULL check
ipv6: Count in extension headers in skb->network_header
RDS: fix congestion map corruption for PAGE_SIZE > 4k
RDS: memory allocated must be align to 8
GRE: Disable segmentation offloads w/ CSUM and we are encapsulated via FOU
net: add the AF_KCM entries to family name tables
MAINTAINERS: intel-wired-lan list is moderated
lib/test_bpf: Add additional BPF_ADD tests
lib/test_bpf: Add test to check for result of 32-bit add that overflows
lib/test_bpf: Add tests for unsigned BPF_JGT
lib/test_bpf: Fix JMP_JSET tests
VSOCK: Detach QP check should filter out non matching QPs.
stmmac: fix adjust link call in case of a switch is attached
af_packet: tone down the Tx-ring unsupported spew.
net_sched: fix a memory leak in tc action
samples/bpf: Enable powerpc support
samples/bpf: Use llc in PATH, rather than a hardcoded value
samples/bpf: Fix build breakage with map_perf_test_user.c
...

+448 -92
+3 -3
MAINTAINERS
··· 4302 4302 4303 4303 ETHERNET BRIDGE 4304 4304 M: Stephen Hemminger <stephen@networkplumber.org> 4305 - L: bridge@lists.linux-foundation.org 4305 + L: bridge@lists.linux-foundation.org (moderated for non-subscribers) 4306 4306 L: netdev@vger.kernel.org 4307 4307 W: http://www.linuxfoundation.org/en/Net:Bridge 4308 4308 S: Maintained ··· 5751 5751 R: Bruce Allan <bruce.w.allan@intel.com> 5752 5752 R: John Ronciak <john.ronciak@intel.com> 5753 5753 R: Mitch Williams <mitch.a.williams@intel.com> 5754 - L: intel-wired-lan@lists.osuosl.org 5754 + L: intel-wired-lan@lists.osuosl.org (moderated for non-subscribers) 5755 5755 W: http://www.intel.com/support/feedback.htm 5756 5756 W: http://e1000.sourceforge.net/ 5757 5757 Q: http://patchwork.ozlabs.org/project/intel-wired-lan/list/ ··· 7576 7576 7577 7577 NETEM NETWORK EMULATOR 7578 7578 M: Stephen Hemminger <stephen@networkplumber.org> 7579 - L: netem@lists.linux-foundation.org 7579 + L: netem@lists.linux-foundation.org (moderated for non-subscribers) 7580 7580 S: Maintained 7581 7581 F: net/sched/sch_netem.c 7582 7582
+1
drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h
··· 166 166 CH_PCI_ID_TABLE_FENTRY(0x5099), /* Custom 2x40G QSFP */ 167 167 CH_PCI_ID_TABLE_FENTRY(0x509a), /* Custom T520-CR */ 168 168 CH_PCI_ID_TABLE_FENTRY(0x509b), /* Custom T540-CR LOM */ 169 + CH_PCI_ID_TABLE_FENTRY(0x509c), /* Custom T520-CR*/ 169 170 170 171 /* T6 adapters: 171 172 */
+19 -2
drivers/net/ethernet/intel/e1000/e1000_main.c
··· 3106 3106 return __e1000_maybe_stop_tx(netdev, size); 3107 3107 } 3108 3108 3109 - #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1) 3109 + #define TXD_USE_COUNT(S, X) (((S) + ((1 << (X)) - 1)) >> (X)) 3110 3110 static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, 3111 3111 struct net_device *netdev) 3112 3112 { ··· 3256 3256 nr_frags, mss); 3257 3257 3258 3258 if (count) { 3259 + /* The descriptors needed is higher than other Intel drivers 3260 + * due to a number of workarounds. The breakdown is below: 3261 + * Data descriptors: MAX_SKB_FRAGS + 1 3262 + * Context Descriptor: 1 3263 + * Keep head from touching tail: 2 3264 + * Workarounds: 3 3265 + */ 3266 + int desc_needed = MAX_SKB_FRAGS + 7; 3267 + 3259 3268 netdev_sent_queue(netdev, skb->len); 3260 3269 skb_tx_timestamp(skb); 3261 3270 3262 3271 e1000_tx_queue(adapter, tx_ring, tx_flags, count); 3272 + 3273 + /* 82544 potentially requires twice as many data descriptors 3274 + * in order to guarantee buffers don't end on evenly-aligned 3275 + * dwords 3276 + */ 3277 + if (adapter->pcix_82544) 3278 + desc_needed += MAX_SKB_FRAGS + 1; 3279 + 3263 3280 /* Make sure there is space in the ring for the next send. */ 3264 - e1000_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 2); 3281 + e1000_maybe_stop_tx(netdev, tx_ring, desc_needed); 3265 3282 3266 3283 if (!skb->xmit_more || 3267 3284 netif_xmit_stopped(netdev_get_tx_queue(netdev, 0))) {
+1
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 8559 8559 I40E_FLAG_OUTER_UDP_CSUM_CAPABLE | 8560 8560 I40E_FLAG_WB_ON_ITR_CAPABLE | 8561 8561 I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE | 8562 + I40E_FLAG_NO_PCI_LINK_CHECK | 8562 8563 I40E_FLAG_100M_SGMII_CAPABLE | 8563 8564 I40E_FLAG_USE_SET_LLDP_MIB | 8564 8565 I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
+10 -12
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 288 288 (priv->pcs == STMMAC_PCS_RTBI)) 289 289 goto out; 290 290 291 - /* Never init EEE in case of a switch is attached */ 292 - if (priv->phydev->is_pseudo_fixed_link) 293 - goto out; 294 - 295 291 /* MAC core supports the EEE feature. */ 296 292 if (priv->dma_cap.eee) { 297 293 int tx_lpi_timer = priv->tx_lpi_timer; ··· 767 771 768 772 spin_unlock_irqrestore(&priv->lock, flags); 769 773 770 - /* At this stage, it could be needed to setup the EEE or adjust some 771 - * MAC related HW registers. 772 - */ 773 - priv->eee_enabled = stmmac_eee_init(priv); 774 + if (phydev->is_pseudo_fixed_link) 775 + /* Stop PHY layer to call the hook to adjust the link in case 776 + * of a switch is attached to the stmmac driver. 777 + */ 778 + phydev->irq = PHY_IGNORE_INTERRUPT; 779 + else 780 + /* At this stage, init the EEE if supported. 781 + * Never called in case of fixed_link. 782 + */ 783 + priv->eee_enabled = stmmac_eee_init(priv); 774 784 } 775 785 776 786 /** ··· 866 864 phy_disconnect(phydev); 867 865 return -ENODEV; 868 866 } 869 - 870 - /* If attached to a switch, there is no reason to poll phy handler */ 871 - if (phydev->is_pseudo_fixed_link) 872 - phydev->irq = PHY_IGNORE_INTERRUPT; 873 867 874 868 pr_debug("stmmac_init_phy: %s: attached to PHY (UID 0x%x)" 875 869 " Link = %d\n", dev->name, phydev->phy_id, phydev->link);
+2 -2
drivers/net/tun.c
··· 1015 1015 /* Zero header length */ 1016 1016 dev->type = ARPHRD_NONE; 1017 1017 dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; 1018 - dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ 1019 1018 break; 1020 1019 1021 1020 case IFF_TAP: ··· 1026 1027 1027 1028 eth_hw_addr_random(dev); 1028 1029 1029 - dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ 1030 1030 break; 1031 1031 } 1032 1032 } ··· 1479 1481 1480 1482 dev->ethtool_ops = &tun_ethtool_ops; 1481 1483 dev->destructor = tun_free_netdev; 1484 + /* We prefer our own queue length */ 1485 + dev->tx_queue_len = TUN_READQ_SIZE; 1482 1486 } 1483 1487 1484 1488 /* Trivial set of netlink ops to allow deleting tun or tap
+4 -1
include/linux/netdevice.h
··· 2120 2120 /* Used in foo-over-udp, set in udp[46]_gro_receive */ 2121 2121 u8 is_ipv6:1; 2122 2122 2123 - /* 7 bit hole */ 2123 + /* Used in GRE, set in fou/gue_gro_receive */ 2124 + u8 is_fou:1; 2125 + 2126 + /* 6 bit hole */ 2124 2127 2125 2128 /* used to support CHECKSUM_COMPLETE for tunneling protocols */ 2126 2129 __wsum csum;
+1
include/net/act_api.h
··· 135 135 static inline void tc_action_net_exit(struct tc_action_net *tn) 136 136 { 137 137 tcf_hashinfo_destroy(tn->ops, tn->hinfo); 138 + kfree(tn->hinfo); 138 139 } 139 140 140 141 int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
+2
include/net/mac80211.h
··· 1001 1001 * flag indicates that the PN was verified for replay protection. 1002 1002 * Note that this flag is also currently only supported when a frame 1003 1003 * is also decrypted (ie. @RX_FLAG_DECRYPTED must be set) 1004 + * @RX_FLAG_DUP_VALIDATED: The driver should set this flag if it did 1005 + * de-duplication by itself. 1004 1006 * @RX_FLAG_FAILED_FCS_CRC: Set this flag if the FCS check failed on 1005 1007 * the frame. 1006 1008 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
+2 -4
include/net/sctp/sctp.h
··· 386 386 { 387 387 struct list_head *result = NULL; 388 388 389 - if (list->next != list) { 389 + if (!list_empty(list)) { 390 390 result = list->next; 391 - list->next = result->next; 392 - list->next->prev = list; 393 - INIT_LIST_HEAD(result); 391 + list_del_init(result); 394 392 } 395 393 return result; 396 394 }
+225 -4
lib/test_bpf.c
··· 2444 2444 { { 0, 4294967295U } }, 2445 2445 }, 2446 2446 { 2447 + "ALU_ADD_X: 2 + 4294967294 = 0", 2448 + .u.insns_int = { 2449 + BPF_LD_IMM64(R0, 2), 2450 + BPF_LD_IMM64(R1, 4294967294U), 2451 + BPF_ALU32_REG(BPF_ADD, R0, R1), 2452 + BPF_JMP_IMM(BPF_JEQ, R0, 0, 2), 2453 + BPF_ALU32_IMM(BPF_MOV, R0, 0), 2454 + BPF_EXIT_INSN(), 2455 + BPF_ALU32_IMM(BPF_MOV, R0, 1), 2456 + BPF_EXIT_INSN(), 2457 + }, 2458 + INTERNAL, 2459 + { }, 2460 + { { 0, 1 } }, 2461 + }, 2462 + { 2447 2463 "ALU64_ADD_X: 1 + 2 = 3", 2448 2464 .u.insns_int = { 2449 2465 BPF_LD_IMM64(R0, 1), ··· 2482 2466 INTERNAL, 2483 2467 { }, 2484 2468 { { 0, 4294967295U } }, 2469 + }, 2470 + { 2471 + "ALU64_ADD_X: 2 + 4294967294 = 4294967296", 2472 + .u.insns_int = { 2473 + BPF_LD_IMM64(R0, 2), 2474 + BPF_LD_IMM64(R1, 4294967294U), 2475 + BPF_LD_IMM64(R2, 4294967296ULL), 2476 + BPF_ALU64_REG(BPF_ADD, R0, R1), 2477 + BPF_JMP_REG(BPF_JEQ, R0, R2, 2), 2478 + BPF_MOV32_IMM(R0, 0), 2479 + BPF_EXIT_INSN(), 2480 + BPF_MOV32_IMM(R0, 1), 2481 + BPF_EXIT_INSN(), 2482 + }, 2483 + INTERNAL, 2484 + { }, 2485 + { { 0, 1 } }, 2485 2486 }, 2486 2487 /* BPF_ALU | BPF_ADD | BPF_K */ 2487 2488 { ··· 2535 2502 { { 0, 4294967295U } }, 2536 2503 }, 2537 2504 { 2505 + "ALU_ADD_K: 4294967294 + 2 = 0", 2506 + .u.insns_int = { 2507 + BPF_LD_IMM64(R0, 4294967294U), 2508 + BPF_ALU32_IMM(BPF_ADD, R0, 2), 2509 + BPF_JMP_IMM(BPF_JEQ, R0, 0, 2), 2510 + BPF_ALU32_IMM(BPF_MOV, R0, 0), 2511 + BPF_EXIT_INSN(), 2512 + BPF_ALU32_IMM(BPF_MOV, R0, 1), 2513 + BPF_EXIT_INSN(), 2514 + }, 2515 + INTERNAL, 2516 + { }, 2517 + { { 0, 1 } }, 2518 + }, 2519 + { 2538 2520 "ALU_ADD_K: 0 + (-1) = 0x00000000ffffffff", 2539 2521 .u.insns_int = { 2540 2522 BPF_LD_IMM64(R2, 0x0), 2541 2523 BPF_LD_IMM64(R3, 0x00000000ffffffff), 2542 2524 BPF_ALU32_IMM(BPF_ADD, R2, 0xffffffff), 2525 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2526 + BPF_MOV32_IMM(R0, 2), 2527 + BPF_EXIT_INSN(), 2528 + BPF_MOV32_IMM(R0, 1), 2529 + BPF_EXIT_INSN(), 2530 + }, 2531 + INTERNAL, 2532 + { }, 2533 + { { 0, 0x1 } }, 2534 + }, 2535 + { 2536 + "ALU_ADD_K: 0 + 0xffff = 0xffff", 2537 + .u.insns_int = { 2538 + BPF_LD_IMM64(R2, 0x0), 2539 + BPF_LD_IMM64(R3, 0xffff), 2540 + BPF_ALU32_IMM(BPF_ADD, R2, 0xffff), 2541 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2542 + BPF_MOV32_IMM(R0, 2), 2543 + BPF_EXIT_INSN(), 2544 + BPF_MOV32_IMM(R0, 1), 2545 + BPF_EXIT_INSN(), 2546 + }, 2547 + INTERNAL, 2548 + { }, 2549 + { { 0, 0x1 } }, 2550 + }, 2551 + { 2552 + "ALU_ADD_K: 0 + 0x7fffffff = 0x7fffffff", 2553 + .u.insns_int = { 2554 + BPF_LD_IMM64(R2, 0x0), 2555 + BPF_LD_IMM64(R3, 0x7fffffff), 2556 + BPF_ALU32_IMM(BPF_ADD, R2, 0x7fffffff), 2557 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2558 + BPF_MOV32_IMM(R0, 2), 2559 + BPF_EXIT_INSN(), 2560 + BPF_MOV32_IMM(R0, 1), 2561 + BPF_EXIT_INSN(), 2562 + }, 2563 + INTERNAL, 2564 + { }, 2565 + { { 0, 0x1 } }, 2566 + }, 2567 + { 2568 + "ALU_ADD_K: 0 + 0x80000000 = 0x80000000", 2569 + .u.insns_int = { 2570 + BPF_LD_IMM64(R2, 0x0), 2571 + BPF_LD_IMM64(R3, 0x80000000), 2572 + BPF_ALU32_IMM(BPF_ADD, R2, 0x80000000), 2573 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2574 + BPF_MOV32_IMM(R0, 2), 2575 + BPF_EXIT_INSN(), 2576 + BPF_MOV32_IMM(R0, 1), 2577 + BPF_EXIT_INSN(), 2578 + }, 2579 + INTERNAL, 2580 + { }, 2581 + { { 0, 0x1 } }, 2582 + }, 2583 + { 2584 + "ALU_ADD_K: 0 + 0x80008000 = 0x80008000", 2585 + .u.insns_int = { 2586 + BPF_LD_IMM64(R2, 0x0), 2587 + BPF_LD_IMM64(R3, 0x80008000), 2588 + BPF_ALU32_IMM(BPF_ADD, R2, 0x80008000), 2543 2589 BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2544 2590 BPF_MOV32_IMM(R0, 2), 2545 2591 BPF_EXIT_INSN(), ··· 2663 2551 { { 0, 2147483647 } }, 2664 2552 }, 2665 2553 { 2554 + "ALU64_ADD_K: 4294967294 + 2 = 4294967296", 2555 + .u.insns_int = { 2556 + BPF_LD_IMM64(R0, 4294967294U), 2557 + BPF_LD_IMM64(R1, 4294967296ULL), 2558 + BPF_ALU64_IMM(BPF_ADD, R0, 2), 2559 + BPF_JMP_REG(BPF_JEQ, R0, R1, 2), 2560 + BPF_ALU32_IMM(BPF_MOV, R0, 0), 2561 + BPF_EXIT_INSN(), 2562 + BPF_ALU32_IMM(BPF_MOV, R0, 1), 2563 + BPF_EXIT_INSN(), 2564 + }, 2565 + INTERNAL, 2566 + { }, 2567 + { { 0, 1 } }, 2568 + }, 2569 + { 2666 2570 "ALU64_ADD_K: 2147483646 + -2147483647 = -1", 2667 2571 .u.insns_int = { 2668 2572 BPF_LD_IMM64(R0, 2147483646), ··· 2711 2583 BPF_LD_IMM64(R2, 0x0), 2712 2584 BPF_LD_IMM64(R3, 0xffffffffffffffffLL), 2713 2585 BPF_ALU64_IMM(BPF_ADD, R2, 0xffffffff), 2586 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2587 + BPF_MOV32_IMM(R0, 2), 2588 + BPF_EXIT_INSN(), 2589 + BPF_MOV32_IMM(R0, 1), 2590 + BPF_EXIT_INSN(), 2591 + }, 2592 + INTERNAL, 2593 + { }, 2594 + { { 0, 0x1 } }, 2595 + }, 2596 + { 2597 + "ALU64_ADD_K: 0 + 0xffff = 0xffff", 2598 + .u.insns_int = { 2599 + BPF_LD_IMM64(R2, 0x0), 2600 + BPF_LD_IMM64(R3, 0xffff), 2601 + BPF_ALU64_IMM(BPF_ADD, R2, 0xffff), 2602 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2603 + BPF_MOV32_IMM(R0, 2), 2604 + BPF_EXIT_INSN(), 2605 + BPF_MOV32_IMM(R0, 1), 2606 + BPF_EXIT_INSN(), 2607 + }, 2608 + INTERNAL, 2609 + { }, 2610 + { { 0, 0x1 } }, 2611 + }, 2612 + { 2613 + "ALU64_ADD_K: 0 + 0x7fffffff = 0x7fffffff", 2614 + .u.insns_int = { 2615 + BPF_LD_IMM64(R2, 0x0), 2616 + BPF_LD_IMM64(R3, 0x7fffffff), 2617 + BPF_ALU64_IMM(BPF_ADD, R2, 0x7fffffff), 2618 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2619 + BPF_MOV32_IMM(R0, 2), 2620 + BPF_EXIT_INSN(), 2621 + BPF_MOV32_IMM(R0, 1), 2622 + BPF_EXIT_INSN(), 2623 + }, 2624 + INTERNAL, 2625 + { }, 2626 + { { 0, 0x1 } }, 2627 + }, 2628 + { 2629 + "ALU64_ADD_K: 0 + 0x80000000 = 0xffffffff80000000", 2630 + .u.insns_int = { 2631 + BPF_LD_IMM64(R2, 0x0), 2632 + BPF_LD_IMM64(R3, 0xffffffff80000000LL), 2633 + BPF_ALU64_IMM(BPF_ADD, R2, 0x80000000), 2634 + BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2635 + BPF_MOV32_IMM(R0, 2), 2636 + BPF_EXIT_INSN(), 2637 + BPF_MOV32_IMM(R0, 1), 2638 + BPF_EXIT_INSN(), 2639 + }, 2640 + INTERNAL, 2641 + { }, 2642 + { { 0, 0x1 } }, 2643 + }, 2644 + { 2645 + "ALU_ADD_K: 0 + 0x80008000 = 0xffffffff80008000", 2646 + .u.insns_int = { 2647 + BPF_LD_IMM64(R2, 0x0), 2648 + BPF_LD_IMM64(R3, 0xffffffff80008000LL), 2649 + BPF_ALU64_IMM(BPF_ADD, R2, 0x80008000), 2714 2650 BPF_JMP_REG(BPF_JEQ, R2, R3, 2), 2715 2651 BPF_MOV32_IMM(R0, 2), 2716 2652 BPF_EXIT_INSN(), ··· 4414 4222 { }, 4415 4223 { { 0, 1 } }, 4416 4224 }, 4225 + { 4226 + "JMP_JGT_K: Unsigned jump: if (-1 > 1) return 1", 4227 + .u.insns_int = { 4228 + BPF_ALU32_IMM(BPF_MOV, R0, 0), 4229 + BPF_LD_IMM64(R1, -1), 4230 + BPF_JMP_IMM(BPF_JGT, R1, 1, 1), 4231 + BPF_EXIT_INSN(), 4232 + BPF_ALU32_IMM(BPF_MOV, R0, 1), 4233 + BPF_EXIT_INSN(), 4234 + }, 4235 + INTERNAL, 4236 + { }, 4237 + { { 0, 1 } }, 4238 + }, 4417 4239 /* BPF_JMP | BPF_JGE | BPF_K */ 4418 4240 { 4419 4241 "JMP_JGE_K: if (3 >= 2) return 1", ··· 4509 4303 .u.insns_int = { 4510 4304 BPF_ALU32_IMM(BPF_MOV, R0, 0), 4511 4305 BPF_LD_IMM64(R1, 3), 4512 - BPF_JMP_IMM(BPF_JNE, R1, 2, 1), 4306 + BPF_JMP_IMM(BPF_JSET, R1, 2, 1), 4513 4307 BPF_EXIT_INSN(), 4514 4308 BPF_ALU32_IMM(BPF_MOV, R0, 1), 4515 4309 BPF_EXIT_INSN(), ··· 4523 4317 .u.insns_int = { 4524 4318 BPF_ALU32_IMM(BPF_MOV, R0, 0), 4525 4319 BPF_LD_IMM64(R1, 3), 4526 - BPF_JMP_IMM(BPF_JNE, R1, 0xffffffff, 1), 4320 + BPF_JMP_IMM(BPF_JSET, R1, 0xffffffff, 1), 4527 4321 BPF_EXIT_INSN(), 4528 4322 BPF_ALU32_IMM(BPF_MOV, R0, 1), 4529 4323 BPF_EXIT_INSN(), ··· 4610 4404 { }, 4611 4405 { { 0, 1 } }, 4612 4406 }, 4407 + { 4408 + "JMP_JGT_X: Unsigned jump: if (-1 > 1) return 1", 4409 + .u.insns_int = { 4410 + BPF_ALU32_IMM(BPF_MOV, R0, 0), 4411 + BPF_LD_IMM64(R1, -1), 4412 + BPF_LD_IMM64(R2, 1), 4413 + BPF_JMP_REG(BPF_JGT, R1, R2, 1), 4414 + BPF_EXIT_INSN(), 4415 + BPF_ALU32_IMM(BPF_MOV, R0, 1), 4416 + BPF_EXIT_INSN(), 4417 + }, 4418 + INTERNAL, 4419 + { }, 4420 + { { 0, 1 } }, 4421 + }, 4613 4422 /* BPF_JMP | BPF_JGE | BPF_X */ 4614 4423 { 4615 4424 "JMP_JGE_X: if (3 >= 2) return 1", ··· 4695 4474 BPF_ALU32_IMM(BPF_MOV, R0, 0), 4696 4475 BPF_LD_IMM64(R1, 3), 4697 4476 BPF_LD_IMM64(R2, 2), 4698 - BPF_JMP_REG(BPF_JNE, R1, R2, 1), 4477 + BPF_JMP_REG(BPF_JSET, R1, R2, 1), 4699 4478 BPF_EXIT_INSN(), 4700 4479 BPF_ALU32_IMM(BPF_MOV, R0, 1), 4701 4480 BPF_EXIT_INSN(), ··· 4710 4489 BPF_ALU32_IMM(BPF_MOV, R0, 0), 4711 4490 BPF_LD_IMM64(R1, 3), 4712 4491 BPF_LD_IMM64(R2, 0xffffffff), 4713 - BPF_JMP_REG(BPF_JNE, R1, R2, 1), 4492 + BPF_JMP_REG(BPF_JSET, R1, R2, 1), 4714 4493 BPF_EXIT_INSN(), 4715 4494 BPF_ALU32_IMM(BPF_MOV, R0, 1), 4716 4495 BPF_EXIT_INSN(),
+1
net/core/dev.c
··· 4439 4439 NAPI_GRO_CB(skb)->flush = 0; 4440 4440 NAPI_GRO_CB(skb)->free = 0; 4441 4441 NAPI_GRO_CB(skb)->encap_mark = 0; 4442 + NAPI_GRO_CB(skb)->is_fou = 0; 4442 4443 NAPI_GRO_CB(skb)->gro_remcsum_start = 0; 4443 4444 4444 4445 /* Setup for GRO checksum validation */
+1 -2
net/core/netpoll.c
··· 603 603 const struct net_device_ops *ops; 604 604 int err; 605 605 606 + np->dev = ndev; 606 607 strlcpy(np->dev_name, ndev->name, IFNAMSIZ); 607 608 INIT_WORK(&np->cleanup_work, netpoll_async_cleanup); 608 609 ··· 670 669 goto unlock; 671 670 } 672 671 dev_hold(ndev); 673 - np->dev = ndev; 674 672 675 673 if (netdev_master_upper_dev_get(ndev)) { 676 674 np_err(np, "%s is a slave device, aborting\n", np->dev_name); ··· 770 770 return 0; 771 771 772 772 put: 773 - np->dev = NULL; 774 773 dev_put(ndev); 775 774 unlock: 776 775 rtnl_unlock();
+6 -3
net/core/sock.c
··· 221 221 "sk_lock-AF_TIPC" , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV" , 222 222 "sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN" , "sk_lock-AF_PHONET" , 223 223 "sk_lock-AF_IEEE802154", "sk_lock-AF_CAIF" , "sk_lock-AF_ALG" , 224 - "sk_lock-AF_NFC" , "sk_lock-AF_VSOCK" , "sk_lock-AF_MAX" 224 + "sk_lock-AF_NFC" , "sk_lock-AF_VSOCK" , "sk_lock-AF_KCM" , 225 + "sk_lock-AF_MAX" 225 226 }; 226 227 static const char *const af_family_slock_key_strings[AF_MAX+1] = { 227 228 "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , ··· 238 237 "slock-AF_TIPC" , "slock-AF_BLUETOOTH", "slock-AF_IUCV" , 239 238 "slock-AF_RXRPC" , "slock-AF_ISDN" , "slock-AF_PHONET" , 240 239 "slock-AF_IEEE802154", "slock-AF_CAIF" , "slock-AF_ALG" , 241 - "slock-AF_NFC" , "slock-AF_VSOCK" ,"slock-AF_MAX" 240 + "slock-AF_NFC" , "slock-AF_VSOCK" ,"slock-AF_KCM" , 241 + "slock-AF_MAX" 242 242 }; 243 243 static const char *const af_family_clock_key_strings[AF_MAX+1] = { 244 244 "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , ··· 255 253 "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" , 256 254 "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" , 257 255 "clock-AF_IEEE802154", "clock-AF_CAIF" , "clock-AF_ALG" , 258 - "clock-AF_NFC" , "clock-AF_VSOCK" , "clock-AF_MAX" 256 + "clock-AF_NFC" , "clock-AF_VSOCK" , "clock-AF_KCM" , 257 + "clock-AF_MAX" 259 258 }; 260 259 261 260 /*
+6
net/ipv4/fou.c
··· 203 203 */ 204 204 NAPI_GRO_CB(skb)->encap_mark = 0; 205 205 206 + /* Flag this frame as already having an outer encap header */ 207 + NAPI_GRO_CB(skb)->is_fou = 1; 208 + 206 209 rcu_read_lock(); 207 210 offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; 208 211 ops = rcu_dereference(offloads[proto]); ··· 370 367 * specific header such as VXLAN or GENEVE. 371 368 */ 372 369 NAPI_GRO_CB(skb)->encap_mark = 0; 370 + 371 + /* Flag this frame as already having an outer encap header */ 372 + NAPI_GRO_CB(skb)->is_fou = 1; 373 373 374 374 rcu_read_lock(); 375 375 offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
+8
net/ipv4/gre_offload.c
··· 150 150 if ((greh->flags & ~(GRE_KEY|GRE_CSUM)) != 0) 151 151 goto out; 152 152 153 + /* We can only support GRE_CSUM if we can track the location of 154 + * the GRE header. In the case of FOU/GUE we cannot because the 155 + * outer UDP header displaces the GRE header leaving us in a state 156 + * of limbo. 157 + */ 158 + if ((greh->flags & GRE_CSUM) && NAPI_GRO_CB(skb)->is_fou) 159 + goto out; 160 + 153 161 type = greh->protocol; 154 162 155 163 rcu_read_lock();
+10 -3
net/ipv4/ip_gre.c
··· 862 862 dev->hw_features |= GRE_FEATURES; 863 863 864 864 if (!(tunnel->parms.o_flags & TUNNEL_SEQ)) { 865 - /* TCP offload with GRE SEQ is not supported. */ 866 - dev->features |= NETIF_F_GSO_SOFTWARE; 867 - dev->hw_features |= NETIF_F_GSO_SOFTWARE; 865 + /* TCP offload with GRE SEQ is not supported, nor 866 + * can we support 2 levels of outer headers requiring 867 + * an update. 868 + */ 869 + if (!(tunnel->parms.o_flags & TUNNEL_CSUM) || 870 + (tunnel->encap.type == TUNNEL_ENCAP_NONE)) { 871 + dev->features |= NETIF_F_GSO_SOFTWARE; 872 + dev->hw_features |= NETIF_F_GSO_SOFTWARE; 873 + } 874 + 868 875 /* Can use a lockless transmit, unless we generate 869 876 * output sequences 870 877 */
+4 -4
net/ipv6/ip6_output.c
··· 1090 1090 int getfrag(void *from, char *to, int offset, int len, 1091 1091 int odd, struct sk_buff *skb), 1092 1092 void *from, int length, int hh_len, int fragheaderlen, 1093 - int transhdrlen, int mtu, unsigned int flags, 1094 - const struct flowi6 *fl6) 1093 + int exthdrlen, int transhdrlen, int mtu, 1094 + unsigned int flags, const struct flowi6 *fl6) 1095 1095 1096 1096 { 1097 1097 struct sk_buff *skb; ··· 1116 1116 skb_put(skb, fragheaderlen + transhdrlen); 1117 1117 1118 1118 /* initialize network header pointer */ 1119 - skb_reset_network_header(skb); 1119 + skb_set_network_header(skb, exthdrlen); 1120 1120 1121 1121 /* initialize protocol header pointer */ 1122 1122 skb->transport_header = skb->network_header + fragheaderlen; ··· 1358 1358 (rt->dst.dev->features & NETIF_F_UFO) && 1359 1359 (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { 1360 1360 err = ip6_ufo_append_data(sk, queue, getfrag, from, length, 1361 - hh_len, fragheaderlen, 1361 + hh_len, fragheaderlen, exthdrlen, 1362 1362 transhdrlen, mtu, flags, fl6); 1363 1363 if (err) 1364 1364 goto error;
+1 -1
net/ipv6/ip6_tunnel.c
··· 252 252 253 253 t = netdev_priv(dev); 254 254 255 + dev->rtnl_link_ops = &ip6_link_ops; 255 256 err = register_netdevice(dev); 256 257 if (err < 0) 257 258 goto out; 258 259 259 260 strcpy(t->parms.name, dev->name); 260 - dev->rtnl_link_ops = &ip6_link_ops; 261 261 262 262 dev_hold(dev); 263 263 ip6_tnl_link(ip6n, t);
+5 -3
net/l2tp/l2tp_ip.c
··· 123 123 struct l2tp_tunnel *tunnel = NULL; 124 124 int length; 125 125 126 - /* Point to L2TP header */ 127 - optr = ptr = skb->data; 128 - 129 126 if (!pskb_may_pull(skb, 4)) 130 127 goto discard; 131 128 129 + /* Point to L2TP header */ 130 + optr = ptr = skb->data; 132 131 session_id = ntohl(*((__be32 *) ptr)); 133 132 ptr += 4; 134 133 ··· 155 156 if (!pskb_may_pull(skb, length)) 156 157 goto discard; 157 158 159 + /* Point to L2TP header */ 160 + optr = ptr = skb->data; 161 + ptr += 4; 158 162 pr_debug("%s: ip recv\n", tunnel->name); 159 163 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length); 160 164 }
+5 -3
net/l2tp/l2tp_ip6.c
··· 136 136 struct l2tp_tunnel *tunnel = NULL; 137 137 int length; 138 138 139 - /* Point to L2TP header */ 140 - optr = ptr = skb->data; 141 - 142 139 if (!pskb_may_pull(skb, 4)) 143 140 goto discard; 144 141 142 + /* Point to L2TP header */ 143 + optr = ptr = skb->data; 145 144 session_id = ntohl(*((__be32 *) ptr)); 146 145 ptr += 4; 147 146 ··· 168 169 if (!pskb_may_pull(skb, length)) 169 170 goto discard; 170 171 172 + /* Point to L2TP header */ 173 + optr = ptr = skb->data; 174 + ptr += 4; 171 175 pr_debug("%s: ip recv\n", tunnel->name); 172 176 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length); 173 177 }
+3 -1
net/mac80211/chan.c
··· 343 343 struct ieee80211_chanctx *ctx, 344 344 const struct cfg80211_chan_def *chandef) 345 345 { 346 - if (cfg80211_chandef_identical(&ctx->conf.def, chandef)) 346 + if (cfg80211_chandef_identical(&ctx->conf.def, chandef)) { 347 + ieee80211_recalc_chanctx_min_def(local, ctx); 347 348 return; 349 + } 348 350 349 351 WARN_ON(!cfg80211_chandef_compatible(&ctx->conf.def, chandef)); 350 352
+4
net/mac80211/ieee80211_i.h
··· 1719 1719 enum ieee80211_sta_rx_bandwidth ieee80211_sta_cap_rx_bw(struct sta_info *sta); 1720 1720 enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta); 1721 1721 void ieee80211_sta_set_rx_nss(struct sta_info *sta); 1722 + enum ieee80211_sta_rx_bandwidth 1723 + ieee80211_chan_width_to_rx_bw(enum nl80211_chan_width width); 1724 + enum nl80211_chan_width ieee80211_sta_cap_chan_bw(struct sta_info *sta); 1725 + void ieee80211_sta_set_rx_nss(struct sta_info *sta); 1722 1726 void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata, 1723 1727 struct ieee80211_mgmt *mgmt); 1724 1728 u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
+1 -1
net/mac80211/mesh_hwmp.c
··· 530 530 const u8 *target_addr, *orig_addr; 531 531 const u8 *da; 532 532 u8 target_flags, ttl, flags; 533 - u32 orig_sn, target_sn, lifetime, target_metric; 533 + u32 orig_sn, target_sn, lifetime, target_metric = 0; 534 534 bool reply = false; 535 535 bool forward = true; 536 536 bool root_is_gate;
+9 -5
net/mac80211/sta_info.c
··· 67 67 68 68 static const struct rhashtable_params sta_rht_params = { 69 69 .nelem_hint = 3, /* start small */ 70 + .insecure_elasticity = true, /* Disable chain-length checks. */ 70 71 .automatic_shrinking = true, 71 72 .head_offset = offsetof(struct sta_info, hash_node), 72 73 .key_offset = offsetof(struct sta_info, addr), ··· 259 258 } 260 259 261 260 /* Caller must hold local->sta_mtx */ 262 - static void sta_info_hash_add(struct ieee80211_local *local, 263 - struct sta_info *sta) 261 + static int sta_info_hash_add(struct ieee80211_local *local, 262 + struct sta_info *sta) 264 263 { 265 - rhashtable_insert_fast(&local->sta_hash, &sta->hash_node, 266 - sta_rht_params); 264 + return rhashtable_insert_fast(&local->sta_hash, &sta->hash_node, 265 + sta_rht_params); 267 266 } 268 267 269 268 static void sta_deliver_ps_frames(struct work_struct *wk) ··· 525 524 set_sta_flag(sta, WLAN_STA_BLOCK_BA); 526 525 527 526 /* make the station visible */ 528 - sta_info_hash_add(local, sta); 527 + err = sta_info_hash_add(local, sta); 528 + if (err) 529 + goto out_drop_sta; 529 530 530 531 list_add_tail_rcu(&sta->list, &local->sta_list); 531 532 ··· 560 557 out_remove: 561 558 sta_info_hash_del(local, sta); 562 559 list_del_rcu(&sta->list); 560 + out_drop_sta: 563 561 local->num_sta--; 564 562 synchronize_net(); 565 563 __cleanup_single_sta(sta);
-1
net/mac80211/sta_info.h
··· 377 377 * @uploaded: set to true when sta is uploaded to the driver 378 378 * @sta: station information we share with the driver 379 379 * @sta_state: duplicates information about station state (for debug) 380 - * @beacon_loss_count: number of times beacon loss has triggered 381 380 * @rcu_head: RCU head used for freeing this station struct 382 381 * @cur_max_bandwidth: maximum bandwidth to use for TX to the station, 383 382 * taken from HT/VHT capabilities or VHT operating mode notification
+35 -8
net/mac80211/tdls.c
··· 4 4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 5 5 * Copyright 2014, Intel Corporation 6 6 * Copyright 2014 Intel Mobile Communications GmbH 7 - * Copyright 2015 Intel Deutschland GmbH 7 + * Copyright 2015 - 2016 Intel Deutschland GmbH 8 8 * 9 9 * This file is GPLv2 as found in COPYING. 10 10 */ ··· 15 15 #include <linux/rtnetlink.h> 16 16 #include "ieee80211_i.h" 17 17 #include "driver-ops.h" 18 + #include "rate.h" 18 19 19 20 /* give usermode some time for retries in setting up the TDLS session */ 20 21 #define TDLS_PEER_SETUP_TIMEOUT (15 * HZ) ··· 303 302 /* IEEE802.11ac-2013 Table E-4 */ 304 303 u16 centers_80mhz[] = { 5210, 5290, 5530, 5610, 5690, 5775 }; 305 304 struct cfg80211_chan_def uc = sta->tdls_chandef; 306 - enum nl80211_chan_width max_width = ieee80211_get_sta_bw(&sta->sta); 305 + enum nl80211_chan_width max_width = ieee80211_sta_cap_chan_bw(sta); 307 306 int i; 308 307 309 308 /* only support upgrading non-narrow channels up to 80Mhz */ ··· 314 313 if (max_width > NL80211_CHAN_WIDTH_80) 315 314 max_width = NL80211_CHAN_WIDTH_80; 316 315 317 - if (uc.width == max_width) 316 + if (uc.width >= max_width) 318 317 return; 319 318 /* 320 319 * Channel usage constrains in the IEEE802.11ac-2013 specification only ··· 325 324 for (i = 0; i < ARRAY_SIZE(centers_80mhz); i++) 326 325 if (abs(uc.chan->center_freq - centers_80mhz[i]) <= 30) { 327 326 uc.center_freq1 = centers_80mhz[i]; 327 + uc.center_freq2 = 0; 328 328 uc.width = NL80211_CHAN_WIDTH_80; 329 329 break; 330 330 } ··· 334 332 return; 335 333 336 334 /* proceed to downgrade the chandef until usable or the same */ 337 - while (uc.width > max_width && 335 + while (uc.width > max_width || 338 336 !cfg80211_reg_can_beacon_relax(sdata->local->hw.wiphy, &uc, 339 337 sdata->wdev.iftype)) 340 338 ieee80211_chandef_downgrade(&uc); ··· 1244 1242 return ret; 1245 1243 } 1246 1244 1247 - static void iee80211_tdls_recalc_chanctx(struct ieee80211_sub_if_data *sdata) 1245 + static void iee80211_tdls_recalc_chanctx(struct ieee80211_sub_if_data *sdata, 1246 + struct sta_info *sta) 1248 1247 { 1249 1248 struct ieee80211_local *local = sdata->local; 1250 1249 struct ieee80211_chanctx_conf *conf; 1251 1250 struct ieee80211_chanctx *ctx; 1251 + enum nl80211_chan_width width; 1252 + struct ieee80211_supported_band *sband; 1252 1253 1253 1254 mutex_lock(&local->chanctx_mtx); 1254 1255 conf = rcu_dereference_protected(sdata->vif.chanctx_conf, 1255 1256 lockdep_is_held(&local->chanctx_mtx)); 1256 1257 if (conf) { 1258 + width = conf->def.width; 1259 + sband = local->hw.wiphy->bands[conf->def.chan->band]; 1257 1260 ctx = container_of(conf, struct ieee80211_chanctx, conf); 1258 1261 ieee80211_recalc_chanctx_chantype(local, ctx); 1262 + 1263 + /* if width changed and a peer is given, update its BW */ 1264 + if (width != conf->def.width && sta && 1265 + test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW)) { 1266 + enum ieee80211_sta_rx_bandwidth bw; 1267 + 1268 + bw = ieee80211_chan_width_to_rx_bw(conf->def.width); 1269 + bw = min(bw, ieee80211_sta_cap_rx_bw(sta)); 1270 + if (bw != sta->sta.bandwidth) { 1271 + sta->sta.bandwidth = bw; 1272 + rate_control_rate_update(local, sband, sta, 1273 + IEEE80211_RC_BW_CHANGED); 1274 + /* 1275 + * if a TDLS peer BW was updated, we need to 1276 + * recalc the chandef width again, to get the 1277 + * correct chanctx min_def 1278 + */ 1279 + ieee80211_recalc_chanctx_chantype(local, ctx); 1280 + } 1281 + } 1282 + 1259 1283 } 1260 1284 mutex_unlock(&local->chanctx_mtx); 1261 1285 } ··· 1378 1350 break; 1379 1351 } 1380 1352 1381 - iee80211_tdls_recalc_chanctx(sdata); 1382 - 1383 1353 mutex_lock(&local->sta_mtx); 1384 1354 sta = sta_info_get(sdata, peer); 1385 1355 if (!sta) { ··· 1386 1360 break; 1387 1361 } 1388 1362 1363 + iee80211_tdls_recalc_chanctx(sdata, sta); 1389 1364 iee80211_tdls_recalc_ht_protection(sdata, sta); 1390 1365 1391 1366 set_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH); ··· 1417 1390 iee80211_tdls_recalc_ht_protection(sdata, NULL); 1418 1391 mutex_unlock(&local->sta_mtx); 1419 1392 1420 - iee80211_tdls_recalc_chanctx(sdata); 1393 + iee80211_tdls_recalc_chanctx(sdata, NULL); 1421 1394 break; 1422 1395 default: 1423 1396 ret = -ENOTSUPP;
+9 -4
net/mac80211/tx.c
··· 1116 1116 reset_agg_timer = true; 1117 1117 } else { 1118 1118 queued = true; 1119 + if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER) { 1120 + clear_sta_flag(tx->sta, WLAN_STA_SP); 1121 + ps_dbg(tx->sta->sdata, 1122 + "STA %pM aid %d: SP frame queued, close the SP w/o telling the peer\n", 1123 + tx->sta->sta.addr, tx->sta->sta.aid); 1124 + } 1119 1125 info->control.vif = &tx->sdata->vif; 1120 1126 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; 1121 - info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS | 1122 - IEEE80211_TX_CTL_NO_PS_BUFFER | 1123 - IEEE80211_TX_STATUS_EOSP; 1127 + info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS; 1124 1128 __skb_queue_tail(&tid_tx->pending, skb); 1125 1129 if (skb_queue_len(&tid_tx->pending) > STA_MAX_TX_BUFFER) 1126 1130 purge_skb = __skb_dequeue(&tid_tx->pending); ··· 1251 1247 struct txq_info *txqi; 1252 1248 u8 ac; 1253 1249 1254 - if (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE) 1250 + if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) || 1251 + (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) 1255 1252 goto tx_normal; 1256 1253 1257 1254 if (!ieee80211_is_data(hdr->frame_control))
+25 -5
net/mac80211/vht.c
··· 319 319 return IEEE80211_STA_RX_BW_80; 320 320 } 321 321 322 - static enum ieee80211_sta_rx_bandwidth 322 + enum nl80211_chan_width ieee80211_sta_cap_chan_bw(struct sta_info *sta) 323 + { 324 + struct ieee80211_sta_vht_cap *vht_cap = &sta->sta.vht_cap; 325 + u32 cap_width; 326 + 327 + if (!vht_cap->vht_supported) { 328 + if (!sta->sta.ht_cap.ht_supported) 329 + return NL80211_CHAN_WIDTH_20_NOHT; 330 + 331 + return sta->sta.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ? 332 + NL80211_CHAN_WIDTH_40 : NL80211_CHAN_WIDTH_20; 333 + } 334 + 335 + cap_width = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK; 336 + 337 + if (cap_width == IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ) 338 + return NL80211_CHAN_WIDTH_160; 339 + else if (cap_width == IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) 340 + return NL80211_CHAN_WIDTH_80P80; 341 + 342 + return NL80211_CHAN_WIDTH_80; 343 + } 344 + 345 + enum ieee80211_sta_rx_bandwidth 323 346 ieee80211_chan_width_to_rx_bw(enum nl80211_chan_width width) 324 347 { 325 348 switch (width) { ··· 370 347 371 348 bw = ieee80211_sta_cap_rx_bw(sta); 372 349 bw = min(bw, sta->cur_max_bandwidth); 373 - 374 - /* do not cap the BW of TDLS WIDER_BW peers by the bss */ 375 - if (!test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW)) 376 - bw = min(bw, ieee80211_chan_width_to_rx_bw(bss_width)); 350 + bw = min(bw, ieee80211_chan_width_to_rx_bw(bss_width)); 377 351 378 352 return bw; 379 353 }
+3
net/mpls/af_mpls.c
··· 543 543 if (!dev) 544 544 return ERR_PTR(-ENODEV); 545 545 546 + if (IS_ERR(dev)) 547 + return dev; 548 + 546 549 /* The caller is holding rtnl anyways, so release the dev reference */ 547 550 dev_put(dev); 548 551
+1 -1
net/packet/af_packet.c
··· 4151 4151 4152 4152 /* Opening a Tx-ring is NOT supported in TPACKET_V3 */ 4153 4153 if (!closing && tx_ring && (po->tp_version > TPACKET_V2)) { 4154 - WARN(1, "Tx-ring is not supported.\n"); 4154 + net_warn_ratelimited("Tx-ring is not supported.\n"); 4155 4155 goto out; 4156 4156 } 4157 4157
+1 -1
net/rds/ib_recv.c
··· 796 796 797 797 addr = kmap_atomic(sg_page(&frag->f_sg)); 798 798 799 - src = addr + frag_off; 799 + src = addr + frag->f_sg.offset + frag_off; 800 800 dst = (void *)map->m_page_addrs[map_page] + map_off; 801 801 for (k = 0; k < to_copy; k += 8) { 802 802 /* Record ports that became uncongested, ie
+2 -2
net/rds/page.c
··· 135 135 if (rem->r_offset != 0) 136 136 rds_stats_inc(s_page_remainder_hit); 137 137 138 - rem->r_offset += bytes; 139 - if (rem->r_offset == PAGE_SIZE) { 138 + rem->r_offset += ALIGN(bytes, 8); 139 + if (rem->r_offset >= PAGE_SIZE) { 140 140 __free_page(rem->r_page); 141 141 rem->r_page = NULL; 142 142 }
+2 -1
net/sctp/output.c
··· 705 705 /* Check whether this chunk and all the rest of pending data will fit 706 706 * or delay in hopes of bundling a full sized packet. 707 707 */ 708 - if (chunk->skb->len + q->out_qlen >= transport->pathmtu - packet->overhead) 708 + if (chunk->skb->len + q->out_qlen > 709 + transport->pathmtu - packet->overhead - sizeof(sctp_data_chunk_t) - 4) 709 710 /* Enough data queued to fill a packet */ 710 711 return SCTP_XMIT_OK; 711 712
+2 -2
net/vmw_vsock/vmci_transport.c
··· 842 842 * qp_handle. 843 843 */ 844 844 if (vmci_handle_is_invalid(e_payload->handle) || 845 - vmci_handle_is_equal(trans->qp_handle, e_payload->handle)) 845 + !vmci_handle_is_equal(trans->qp_handle, e_payload->handle)) 846 846 return; 847 847 848 848 /* We don't ask for delayed CBs when we subscribe to this event (we ··· 2154 2154 2155 2155 MODULE_AUTHOR("VMware, Inc."); 2156 2156 MODULE_DESCRIPTION("VMCI transport for Virtual Sockets"); 2157 - MODULE_VERSION("1.0.2.0-k"); 2157 + MODULE_VERSION("1.0.3.0-k"); 2158 2158 MODULE_LICENSE("GPL v2"); 2159 2159 MODULE_ALIAS("vmware_vsock"); 2160 2160 MODULE_ALIAS_NETPROTO(PF_VSOCK);
+3 -9
samples/bpf/Makefile
··· 76 76 HOSTLOADLIBES_spintest += -lelf 77 77 HOSTLOADLIBES_map_perf_test += -lelf -lrt 78 78 79 - # point this to your LLVM backend with bpf support 80 - LLC=$(srctree)/tools/bpf/llvm/bld/Debug+Asserts/bin/llc 81 - 82 - # asm/sysreg.h inline assmbly used by it is incompatible with llvm. 83 - # But, ehere is not easy way to fix it, so just exclude it since it is 79 + # asm/sysreg.h - inline assembly used by it is incompatible with llvm. 80 + # But, there is no easy way to fix it, so just exclude it since it is 84 81 # useless for BPF samples. 85 82 $(obj)/%.o: $(src)/%.c 86 83 clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ 87 84 -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ 88 - -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ 89 - clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ 90 - -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ 91 - -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=asm -o $@.s 85 + -O2 -emit-llvm -c $< -o -| llc -march=bpf -filetype=obj -o $@
+26
samples/bpf/bpf_helpers.h
··· 82 82 #define PT_REGS_FP(x) ((x)->bp) 83 83 #define PT_REGS_RC(x) ((x)->ax) 84 84 #define PT_REGS_SP(x) ((x)->sp) 85 + #define PT_REGS_IP(x) ((x)->ip) 85 86 86 87 #elif defined(__s390x__) 87 88 ··· 95 94 #define PT_REGS_FP(x) ((x)->gprs[11]) /* Works only with CONFIG_FRAME_POINTER */ 96 95 #define PT_REGS_RC(x) ((x)->gprs[2]) 97 96 #define PT_REGS_SP(x) ((x)->gprs[15]) 97 + #define PT_REGS_IP(x) ((x)->ip) 98 98 99 99 #elif defined(__aarch64__) 100 100 ··· 108 106 #define PT_REGS_FP(x) ((x)->regs[29]) /* Works only with CONFIG_FRAME_POINTER */ 109 107 #define PT_REGS_RC(x) ((x)->regs[0]) 110 108 #define PT_REGS_SP(x) ((x)->sp) 109 + #define PT_REGS_IP(x) ((x)->pc) 110 + 111 + #elif defined(__powerpc__) 112 + 113 + #define PT_REGS_PARM1(x) ((x)->gpr[3]) 114 + #define PT_REGS_PARM2(x) ((x)->gpr[4]) 115 + #define PT_REGS_PARM3(x) ((x)->gpr[5]) 116 + #define PT_REGS_PARM4(x) ((x)->gpr[6]) 117 + #define PT_REGS_PARM5(x) ((x)->gpr[7]) 118 + #define PT_REGS_RC(x) ((x)->gpr[3]) 119 + #define PT_REGS_SP(x) ((x)->sp) 120 + #define PT_REGS_IP(x) ((x)->nip) 111 121 112 122 #endif 123 + 124 + #ifdef __powerpc__ 125 + #define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = (ctx)->link; }) 126 + #define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP 127 + #else 128 + #define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ \ 129 + bpf_probe_read(&(ip), sizeof(ip), (void *)PT_REGS_RET(ctx)); }) 130 + #define BPF_KRETPROBE_READ_RET_IP(ip, ctx) ({ \ 131 + bpf_probe_read(&(ip), sizeof(ip), \ 132 + (void *)(PT_REGS_FP(ctx) + sizeof(ip))); }) 133 + #endif 134 + 113 135 #endif
+1
samples/bpf/map_perf_test_user.c
··· 17 17 #include <linux/bpf.h> 18 18 #include <string.h> 19 19 #include <time.h> 20 + #include <sys/resource.h> 20 21 #include "libbpf.h" 21 22 #include "bpf_load.h" 22 23
+1 -1
samples/bpf/spintest_kern.c
··· 34 34 #define PROG(foo) \ 35 35 int foo(struct pt_regs *ctx) \ 36 36 { \ 37 - long v = ctx->ip, *val; \ 37 + long v = PT_REGS_IP(ctx), *val; \ 38 38 \ 39 39 val = bpf_map_lookup_elem(&my_map, &v); \ 40 40 bpf_map_update_elem(&my_map, &v, &v, BPF_ANY); \
+2 -2
samples/bpf/tracex2_kern.c
··· 27 27 long init_val = 1; 28 28 long *value; 29 29 30 - /* x64/s390x specific: read ip of kfree_skb caller. 30 + /* read ip of kfree_skb caller. 31 31 * non-portable version of __builtin_return_address(0) 32 32 */ 33 - bpf_probe_read(&loc, sizeof(loc), (void *)PT_REGS_RET(ctx)); 33 + BPF_KPROBE_READ_RET_IP(loc, ctx); 34 34 35 35 value = bpf_map_lookup_elem(&my_map, &loc); 36 36 if (value)
+1 -1
samples/bpf/tracex4_kern.c
··· 40 40 long ip = 0; 41 41 42 42 /* get ip address of kmem_cache_alloc_node() caller */ 43 - bpf_probe_read(&ip, sizeof(ip), (void *)(PT_REGS_FP(ctx) + sizeof(ip))); 43 + BPF_KRETPROBE_READ_RET_IP(ip, ctx); 44 44 45 45 struct pair v = { 46 46 .val = bpf_ktime_get_ns(),