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:
"It's been a while since my last pull request so quite a few fixes have
piled up."

Indeed.

1) Fix nf_{log,queue} compilation with PROC_FS disabled, from Pablo
Neira Ayuso.

2) Fix data corruption on some tg3 chips with TSO enabled, from Michael
Chan.

3) Fix double insertion of VLAN tags in be2net driver, from Sarveshwar
Bandi.

4) Don't have TCP's MD5 support pass > PAGE_SIZE page offsets in
scatter-gather entries into the crypto layer, the crypto layer can't
handle that. From Eric Dumazet.

5) Fix lockdep splat in 802.1Q MRP code, also from Eric Dumazet.

6) Fix OOPS in netfilter log module when called from conntrack, from
Hans Schillstrom.

7) FEC driver needs to use netif_tx_{lock,unlock}_bh() rather than the
non-BH disabling variants. From Fabio Estevam.

8) TCP GSO can generate out-of-order packets, fix from Eric Dumazet.

9) vxlan driver doesn't update 'used' field of fdb entries when it
should, from Sridhar Samudrala.

10) ipv6 should use kzalloc() to allocate inet6 socket cork options,
otherwise we can OOPS in ip6_cork_release(). From Eric Dumazet.

11) Fix races in bonding set mode, from Nikolay Aleksandrov.

12) Fix checksum generation regression added by "r8169: fix 8168evl
frame padding.", from Francois Romieu.

13) ip_gre can look at stale SKB data pointer, fix from Eric Dumazet.

14) Fix checksum handling when GSO is enabled in bnx2x driver with
certain chips, from Yuval Mintz.

15) Fix double free in batman-adv, from Martin Hundebøll.

16) Fix device startup synchronization with firmware in tg3 driver, from
Nithin Sujit.

17) perf networking dropmonitor doesn't work at all due to mixed up
trace parameter ordering, from Ben Hutchings.

18) Fix proportional rate reduction handling in tcp_ack(), from Nandita
Dukkipati.

19) IPSEC layer doesn't return an error when a valid state is detected,
causing an OOPS. Fix from Timo Teräs.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (85 commits)
be2net: bug fix on returning an invalid nic descriptor
tcp: xps: fix reordering issues
net: Revert unused variable changes.
xfrm: properly handle invalid states as an error
virtio_net: enable napi for all possible queues during open
tcp: bug fix in proportional rate reduction.
net: ethernet: sun: drop unused variable
net: ethernet: korina: drop unused variable
net: ethernet: apple: drop unused variable
qmi_wwan: Added support for Cinterion's PLxx WWAN Interface
perf: net_dropmonitor: Remove progress indicator
perf: net_dropmonitor: Use bisection in symbol lookup
perf: net_dropmonitor: Do not assume ordering of dictionaries
perf: net_dropmonitor: Fix symbol-relative addresses
perf: net_dropmonitor: Fix trace parameter order
net: fec: use a more proper compatible string for MVF type device
qlcnic: Fix updating netdev->features
qlcnic: remove netdev->trans_start updates within the driver
qlcnic: Return proper error codes from probe failure paths
tg3: Update version to 3.132
...

+937 -461
+5 -5
MAINTAINERS
··· 5524 5524 F: Documentation/networking/vxge.txt 5525 5525 F: drivers/net/ethernet/neterion/ 5526 5526 5527 - NETFILTER/IPTABLES/IPCHAINS 5528 - P: Harald Welte 5529 - P: Jozsef Kadlecsik 5527 + NETFILTER/IPTABLES 5530 5528 M: Pablo Neira Ayuso <pablo@netfilter.org> 5531 5529 M: Patrick McHardy <kaber@trash.net> 5530 + M: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> 5532 5531 L: netfilter-devel@vger.kernel.org 5533 5532 L: netfilter@vger.kernel.org 5534 5533 L: coreteam@netfilter.org 5535 5534 W: http://www.netfilter.org/ 5536 5535 W: http://www.iptables.org/ 5537 - T: git git://1984.lsi.us.es/nf 5538 - T: git git://1984.lsi.us.es/nf-next 5536 + Q: http://patchwork.ozlabs.org/project/netfilter-devel/list/ 5537 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git 5538 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git 5539 5539 S: Supported 5540 5540 F: include/linux/netfilter* 5541 5541 F: include/linux/netfilter/
+2
drivers/bcma/scan.c
··· 84 84 { BCMA_CORE_I2S, "I2S" }, 85 85 { BCMA_CORE_SDR_DDR1_MEM_CTL, "SDR/DDR1 Memory Controller" }, 86 86 { BCMA_CORE_SHIM, "SHIM" }, 87 + { BCMA_CORE_PCIE2, "PCIe Gen2" }, 88 + { BCMA_CORE_ARM_CR4, "ARM CR4" }, 87 89 { BCMA_CORE_DEFAULT, "Default" }, 88 90 }; 89 91
+3 -3
drivers/isdn/capi/kcapi.c
··· 93 93 94 94 static inline struct capi_ctr *get_capi_ctr_by_nr(u16 contr) 95 95 { 96 - if (contr - 1 >= CAPI_MAXCONTR) 96 + if (contr < 1 || contr - 1 >= CAPI_MAXCONTR) 97 97 return NULL; 98 98 99 99 return capi_controller[contr - 1]; ··· 103 103 { 104 104 lockdep_assert_held(&capi_controller_lock); 105 105 106 - if (applid - 1 >= CAPI_MAXAPPL) 106 + if (applid < 1 || applid - 1 >= CAPI_MAXAPPL) 107 107 return NULL; 108 108 109 109 return capi_applications[applid - 1]; ··· 111 111 112 112 static inline struct capi20_appl *get_capi_appl_by_nr(u16 applid) 113 113 { 114 - if (applid - 1 >= CAPI_MAXAPPL) 114 + if (applid < 1 || applid - 1 >= CAPI_MAXAPPL) 115 115 return NULL; 116 116 117 117 return rcu_dereference(capi_applications[applid - 1]);
+17 -4
drivers/net/bonding/bond_3ad.c
··· 2360 2360 } 2361 2361 2362 2362 /** 2363 - * bond_3ad_get_active_agg_info - get information of the active aggregator 2363 + * __bond_3ad_get_active_agg_info - get information of the active aggregator 2364 2364 * @bond: bonding struct to work on 2365 2365 * @ad_info: ad_info struct to fill with the bond's info 2366 2366 * 2367 2367 * Returns: 0 on success 2368 2368 * < 0 on error 2369 2369 */ 2370 - int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) 2370 + int __bond_3ad_get_active_agg_info(struct bonding *bond, 2371 + struct ad_info *ad_info) 2371 2372 { 2372 2373 struct aggregator *aggregator = NULL; 2373 2374 struct port *port; ··· 2392 2391 return -1; 2393 2392 } 2394 2393 2394 + /* Wrapper used to hold bond->lock so no slave manipulation can occur */ 2395 + int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) 2396 + { 2397 + int ret; 2398 + 2399 + read_lock(&bond->lock); 2400 + ret = __bond_3ad_get_active_agg_info(bond, ad_info); 2401 + read_unlock(&bond->lock); 2402 + 2403 + return ret; 2404 + } 2405 + 2395 2406 int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) 2396 2407 { 2397 2408 struct slave *slave, *start_at; ··· 2415 2402 struct ad_info ad_info; 2416 2403 int res = 1; 2417 2404 2418 - if (bond_3ad_get_active_agg_info(bond, &ad_info)) { 2419 - pr_debug("%s: Error: bond_3ad_get_active_agg_info failed\n", 2405 + if (__bond_3ad_get_active_agg_info(bond, &ad_info)) { 2406 + pr_debug("%s: Error: __bond_3ad_get_active_agg_info failed\n", 2420 2407 dev->name); 2421 2408 goto out; 2422 2409 }
+2
drivers/net/bonding/bond_3ad.h
··· 273 273 void bond_3ad_adapter_duplex_changed(struct slave *slave); 274 274 void bond_3ad_handle_link_change(struct slave *slave, char link); 275 275 int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 276 + int __bond_3ad_get_active_agg_info(struct bonding *bond, 277 + struct ad_info *ad_info); 276 278 int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 277 279 int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, 278 280 struct slave *slave);
+12 -14
drivers/net/bonding/bond_main.c
··· 1362 1362 slave->dev->features, 1363 1363 mask); 1364 1364 } 1365 + features = netdev_add_tso_features(features, mask); 1365 1366 1366 1367 out: 1367 1368 read_unlock(&bond->lock); ··· 2556 2555 { 2557 2556 struct sk_buff *skb; 2558 2557 2559 - pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op, 2560 - slave_dev->name, dest_ip, src_ip, vlan_id); 2558 + pr_debug("arp %d on slave %s: dst %pI4 src %pI4 vid %d\n", arp_op, 2559 + slave_dev->name, &dest_ip, &src_ip, vlan_id); 2561 2560 2562 2561 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, 2563 2562 NULL, slave_dev->dev_addr, NULL); ··· 2589 2588 __be32 addr; 2590 2589 if (!targets[i]) 2591 2590 break; 2592 - pr_debug("basa: target %x\n", targets[i]); 2591 + pr_debug("basa: target %pI4\n", &targets[i]); 2593 2592 if (!bond_vlan_used(bond)) { 2594 2593 pr_debug("basa: empty vlan: arp_send\n"); 2595 2594 addr = bond_confirm_addr(bond->dev, targets[i], 0); ··· 4471 4470 4472 4471 static int bond_check_params(struct bond_params *params) 4473 4472 { 4474 - int arp_validate_value, fail_over_mac_value, primary_reselect_value; 4473 + int arp_validate_value, fail_over_mac_value, primary_reselect_value, i; 4475 4474 4476 4475 /* 4477 4476 * Convert string parameters. ··· 4651 4650 arp_interval = BOND_LINK_ARP_INTERV; 4652 4651 } 4653 4652 4654 - for (arp_ip_count = 0; 4655 - (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[arp_ip_count]; 4656 - arp_ip_count++) { 4653 + for (arp_ip_count = 0, i = 0; 4654 + (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[i]; i++) { 4657 4655 /* not complete check, but should be good enough to 4658 4656 catch mistakes */ 4659 - __be32 ip = in_aton(arp_ip_target[arp_ip_count]); 4660 - if (!isdigit(arp_ip_target[arp_ip_count][0]) || 4661 - ip == 0 || ip == htonl(INADDR_BROADCAST)) { 4657 + __be32 ip = in_aton(arp_ip_target[i]); 4658 + if (!isdigit(arp_ip_target[i][0]) || ip == 0 || 4659 + ip == htonl(INADDR_BROADCAST)) { 4662 4660 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", 4663 - arp_ip_target[arp_ip_count]); 4661 + arp_ip_target[i]); 4664 4662 arp_interval = 0; 4665 4663 } else { 4666 - arp_target[arp_ip_count] = ip; 4664 + arp_target[arp_ip_count++] = ip; 4667 4665 } 4668 4666 } 4669 4667 ··· 4696 4696 if (miimon) { 4697 4697 pr_info("MII link monitoring set to %d ms\n", miimon); 4698 4698 } else if (arp_interval) { 4699 - int i; 4700 - 4701 4699 pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):", 4702 4700 arp_interval, 4703 4701 arp_validate_tbl[arp_validate_value].modename,
+1 -1
drivers/net/bonding/bond_procfs.c
··· 130 130 seq_printf(seq, "Aggregator selection policy (ad_select): %s\n", 131 131 ad_select_tbl[bond->params.ad_select].modename); 132 132 133 - if (bond_3ad_get_active_agg_info(bond, &ad_info)) { 133 + if (__bond_3ad_get_active_agg_info(bond, &ad_info)) { 134 134 seq_printf(seq, "bond %s has no active aggregator\n", 135 135 bond->dev->name); 136 136 } else {
+8 -5
drivers/net/bonding/bond_sysfs.c
··· 316 316 int new_value, ret = count; 317 317 struct bonding *bond = to_bond(d); 318 318 319 + if (!rtnl_trylock()) 320 + return restart_syscall(); 321 + 319 322 if (bond->dev->flags & IFF_UP) { 320 323 pr_err("unable to update mode of %s because interface is up.\n", 321 324 bond->dev->name); ··· 355 352 bond->dev->name, bond_mode_tbl[new_value].modename, 356 353 new_value); 357 354 out: 355 + rtnl_unlock(); 358 356 return ret; 359 357 } 360 358 static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, ··· 1319 1315 } 1320 1316 static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL); 1321 1317 1322 - 1323 1318 /* 1324 1319 * Show current 802.3ad aggregator ID. 1325 1320 */ ··· 1332 1329 if (bond->params.mode == BOND_MODE_8023AD) { 1333 1330 struct ad_info ad_info; 1334 1331 count = sprintf(buf, "%d\n", 1335 - (bond_3ad_get_active_agg_info(bond, &ad_info)) 1332 + bond_3ad_get_active_agg_info(bond, &ad_info) 1336 1333 ? 0 : ad_info.aggregator_id); 1337 1334 } 1338 1335 ··· 1354 1351 if (bond->params.mode == BOND_MODE_8023AD) { 1355 1352 struct ad_info ad_info; 1356 1353 count = sprintf(buf, "%d\n", 1357 - (bond_3ad_get_active_agg_info(bond, &ad_info)) 1354 + bond_3ad_get_active_agg_info(bond, &ad_info) 1358 1355 ? 0 : ad_info.ports); 1359 1356 } 1360 1357 ··· 1376 1373 if (bond->params.mode == BOND_MODE_8023AD) { 1377 1374 struct ad_info ad_info; 1378 1375 count = sprintf(buf, "%d\n", 1379 - (bond_3ad_get_active_agg_info(bond, &ad_info)) 1376 + bond_3ad_get_active_agg_info(bond, &ad_info) 1380 1377 ? 0 : ad_info.actor_key); 1381 1378 } 1382 1379 ··· 1398 1395 if (bond->params.mode == BOND_MODE_8023AD) { 1399 1396 struct ad_info ad_info; 1400 1397 count = sprintf(buf, "%d\n", 1401 - (bond_3ad_get_active_agg_info(bond, &ad_info)) 1398 + bond_3ad_get_active_agg_info(bond, &ad_info) 1402 1399 ? 0 : ad_info.partner_key); 1403 1400 } 1404 1401
+7 -2
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 3313 3313 */ 3314 3314 static void bnx2x_set_pbd_gso(struct sk_buff *skb, 3315 3315 struct eth_tx_parse_bd_e1x *pbd, 3316 + struct eth_tx_start_bd *tx_start_bd, 3316 3317 u32 xmit_type) 3317 3318 { 3318 3319 pbd->lso_mss = cpu_to_le16(skb_shinfo(skb)->gso_size); ··· 3327 3326 ip_hdr(skb)->daddr, 3328 3327 0, IPPROTO_TCP, 0)); 3329 3328 3330 - } else 3329 + /* GSO on 57710/57711 needs FW to calculate IP checksum */ 3330 + tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_IP_CSUM; 3331 + } else { 3331 3332 pbd->tcp_pseudo_csum = 3332 3333 bswab16(~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, 3333 3334 &ipv6_hdr(skb)->daddr, 3334 3335 0, IPPROTO_TCP, 0)); 3336 + } 3335 3337 3336 3338 pbd->global_data |= 3337 3339 cpu_to_le16(ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN); ··· 3818 3814 bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, 3819 3815 xmit_type); 3820 3816 else 3821 - bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); 3817 + bnx2x_set_pbd_gso(skb, pbd_e1x, tx_start_bd, 3818 + xmit_type); 3822 3819 } 3823 3820 3824 3821 /* Set the PBD's parsing_data field if not zero
+49 -12
drivers/net/ethernet/broadcom/tg3.c
··· 94 94 95 95 #define DRV_MODULE_NAME "tg3" 96 96 #define TG3_MAJ_NUM 3 97 - #define TG3_MIN_NUM 131 97 + #define TG3_MIN_NUM 132 98 98 #define DRV_MODULE_VERSION \ 99 99 __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM) 100 - #define DRV_MODULE_RELDATE "April 09, 2013" 100 + #define DRV_MODULE_RELDATE "May 21, 2013" 101 101 102 102 #define RESET_KIND_SHUTDOWN 0 103 103 #define RESET_KIND_INIT 1 ··· 2957 2957 return 0; 2958 2958 } 2959 2959 2960 + static bool tg3_phy_power_bug(struct tg3 *tp) 2961 + { 2962 + switch (tg3_asic_rev(tp)) { 2963 + case ASIC_REV_5700: 2964 + case ASIC_REV_5704: 2965 + return true; 2966 + case ASIC_REV_5780: 2967 + if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) 2968 + return true; 2969 + return false; 2970 + case ASIC_REV_5717: 2971 + if (!tp->pci_fn) 2972 + return true; 2973 + return false; 2974 + case ASIC_REV_5719: 2975 + case ASIC_REV_5720: 2976 + if ((tp->phy_flags & TG3_PHYFLG_PHY_SERDES) && 2977 + !tp->pci_fn) 2978 + return true; 2979 + return false; 2980 + } 2981 + 2982 + return false; 2983 + } 2984 + 2960 2985 static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power) 2961 2986 { 2962 2987 u32 val; ··· 3041 3016 /* The PHY should not be powered down on some chips because 3042 3017 * of bugs. 3043 3018 */ 3044 - if (tg3_asic_rev(tp) == ASIC_REV_5700 || 3045 - tg3_asic_rev(tp) == ASIC_REV_5704 || 3046 - (tg3_asic_rev(tp) == ASIC_REV_5780 && 3047 - (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) || 3048 - (tg3_asic_rev(tp) == ASIC_REV_5717 && 3049 - !tp->pci_fn)) 3019 + if (tg3_phy_power_bug(tp)) 3050 3020 return; 3051 3021 3052 3022 if (tg3_chip_rev(tp) == CHIPREV_5784_AX || ··· 7448 7428 return (base > 0xffffdcc0) && (base + len + 8 < base); 7449 7429 } 7450 7430 7431 + /* Test for TSO DMA buffers that cross into regions which are within MSS bytes 7432 + * of any 4GB boundaries: 4G, 8G, etc 7433 + */ 7434 + static inline int tg3_4g_tso_overflow_test(struct tg3 *tp, dma_addr_t mapping, 7435 + u32 len, u32 mss) 7436 + { 7437 + if (tg3_asic_rev(tp) == ASIC_REV_5762 && mss) { 7438 + u32 base = (u32) mapping & 0xffffffff; 7439 + 7440 + return ((base + len + (mss & 0x3fff)) < base); 7441 + } 7442 + return 0; 7443 + } 7444 + 7451 7445 /* Test for DMA addresses > 40-bit */ 7452 7446 static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, 7453 7447 int len) ··· 7496 7462 hwbug = true; 7497 7463 7498 7464 if (tg3_4g_overflow_test(map, len)) 7465 + hwbug = true; 7466 + 7467 + if (tg3_4g_tso_overflow_test(tp, map, len, mss)) 7499 7468 hwbug = true; 7500 7469 7501 7470 if (tg3_40bit_overflow_test(tp, map, len)) ··· 8911 8874 tg3_halt_cpu(tp, RX_CPU_BASE); 8912 8875 } 8913 8876 8877 + err = tg3_poll_fw(tp); 8878 + if (err) 8879 + return err; 8880 + 8914 8881 tw32(GRC_MODE, tp->grc_mode); 8915 8882 8916 8883 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A0) { ··· 8944 8903 udelay(40); 8945 8904 8946 8905 tg3_ape_unlock(tp, TG3_APE_LOCK_GRC); 8947 - 8948 - err = tg3_poll_fw(tp); 8949 - if (err) 8950 - return err; 8951 8906 8952 8907 tg3_mdio_start(tp); 8953 8908
+16 -2
drivers/net/ethernet/cadence/macb.c
··· 485 485 status = macb_readl(bp, TSR); 486 486 macb_writel(bp, TSR, status); 487 487 488 - macb_writel(bp, ISR, MACB_BIT(TCOMP)); 488 + if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE) 489 + macb_writel(bp, ISR, MACB_BIT(TCOMP)); 489 490 490 491 netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n", 491 492 (unsigned long)status); ··· 739 738 * now. 740 739 */ 741 740 macb_writel(bp, IDR, MACB_RX_INT_FLAGS); 742 - macb_writel(bp, ISR, MACB_BIT(RCOMP)); 741 + if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE) 742 + macb_writel(bp, ISR, MACB_BIT(RCOMP)); 743 743 744 744 if (napi_schedule_prep(&bp->napi)) { 745 745 netdev_vdbg(bp->dev, "scheduling RX softirq\n"); ··· 1064 1062 } 1065 1063 } 1066 1064 1065 + /* 1066 + * Configure peripheral capacities according to integration options used 1067 + */ 1068 + static void macb_configure_caps(struct macb *bp) 1069 + { 1070 + if (macb_is_gem(bp)) { 1071 + if (GEM_BF(IRQCOR, gem_readl(bp, DCFG1)) == 0) 1072 + bp->caps |= MACB_CAPS_ISR_CLEAR_ON_WRITE; 1073 + } 1074 + } 1075 + 1067 1076 static void macb_init_hw(struct macb *bp) 1068 1077 { 1069 1078 u32 config; ··· 1097 1084 bp->duplex = DUPLEX_HALF; 1098 1085 1099 1086 macb_configure_dma(bp); 1087 + macb_configure_caps(bp); 1100 1088 1101 1089 /* Initialize TX and RX buffers */ 1102 1090 macb_writel(bp, RBQP, bp->rx_ring_dma);
+7
drivers/net/ethernet/cadence/macb.h
··· 300 300 #define MACB_REV_SIZE 16 301 301 302 302 /* Bitfields in DCFG1. */ 303 + #define GEM_IRQCOR_OFFSET 23 304 + #define GEM_IRQCOR_SIZE 1 303 305 #define GEM_DBWDEF_OFFSET 25 304 306 #define GEM_DBWDEF_SIZE 3 305 307 ··· 324 322 #define MACB_MAN_WRITE 1 325 323 #define MACB_MAN_READ 2 326 324 #define MACB_MAN_CODE 2 325 + 326 + /* Capability mask bits */ 327 + #define MACB_CAPS_ISR_CLEAR_ON_WRITE 0x1 327 328 328 329 /* Bit manipulation macros */ 329 330 #define MACB_BIT(name) \ ··· 578 573 unsigned int link; 579 574 unsigned int speed; 580 575 unsigned int duplex; 576 + 577 + u32 caps; 581 578 582 579 phy_interface_t phy_interface; 583 580
+4 -9
drivers/net/ethernet/emulex/benet/be_cmds.c
··· 2976 2976 for (i = 0; i < desc_count; i++) { 2977 2977 desc->desc_len = desc->desc_len ? : RESOURCE_DESC_SIZE; 2978 2978 if (((void *)desc + desc->desc_len) > 2979 - (void *)(buf + max_buf_size)) { 2980 - desc = NULL; 2981 - break; 2982 - } 2979 + (void *)(buf + max_buf_size)) 2980 + return NULL; 2983 2981 2984 2982 if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_V0 || 2985 2983 desc->desc_type == NIC_RESOURCE_DESC_TYPE_V1) 2986 - break; 2984 + return desc; 2987 2985 2988 2986 desc = (void *)desc + desc->desc_len; 2989 2987 } 2990 2988 2991 - if (!desc || i == MAX_RESOURCE_DESC) 2992 - return NULL; 2993 - 2994 - return desc; 2989 + return NULL; 2995 2990 } 2996 2991 2997 2992 /* Uses Mbox */
+5 -13
drivers/net/ethernet/emulex/benet/be_main.c
··· 780 780 if (unlikely(!skb)) 781 781 return skb; 782 782 783 - if (vlan_tx_tag_present(skb)) { 783 + if (vlan_tx_tag_present(skb)) 784 784 vlan_tag = be_get_tx_vlan_tag(adapter, skb); 785 - skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); 786 - if (skb) 787 - skb->vlan_tci = 0; 788 - } 789 - 790 - if (qnq_async_evt_rcvd(adapter) && adapter->pvid) { 791 - if (!vlan_tag) 792 - vlan_tag = adapter->pvid; 793 - if (skip_hw_vlan) 794 - *skip_hw_vlan = true; 795 - } 785 + else if (qnq_async_evt_rcvd(adapter) && adapter->pvid) 786 + vlan_tag = adapter->pvid; 796 787 797 788 if (vlan_tag) { 798 789 skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); 799 790 if (unlikely(!skb)) 800 791 return skb; 801 - 802 792 skb->vlan_tci = 0; 793 + if (skip_hw_vlan) 794 + *skip_hw_vlan = true; 803 795 } 804 796 805 797 /* Insert the outer VLAN, if any */
+7 -7
drivers/net/ethernet/freescale/fec_main.c
··· 109 109 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 110 110 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM, 111 111 }, { 112 - .name = "mvf-fec", 112 + .name = "mvf600-fec", 113 113 .driver_data = FEC_QUIRK_ENET_MAC, 114 114 }, { 115 115 /* sentinel */ ··· 122 122 IMX27_FEC, /* runs on i.mx27/35/51 */ 123 123 IMX28_FEC, 124 124 IMX6Q_FEC, 125 - MVF_FEC, 125 + MVF600_FEC, 126 126 }; 127 127 128 128 static const struct of_device_id fec_dt_ids[] = { ··· 130 130 { .compatible = "fsl,imx27-fec", .data = &fec_devtype[IMX27_FEC], }, 131 131 { .compatible = "fsl,imx28-fec", .data = &fec_devtype[IMX28_FEC], }, 132 132 { .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], }, 133 - { .compatible = "fsl,mvf-fec", .data = &fec_devtype[MVF_FEC], }, 133 + { .compatible = "fsl,mvf600-fec", .data = &fec_devtype[MVF600_FEC], }, 134 134 { /* sentinel */ } 135 135 }; 136 136 MODULE_DEVICE_TABLE(of, fec_dt_ids); ··· 451 451 netif_device_detach(ndev); 452 452 napi_disable(&fep->napi); 453 453 netif_stop_queue(ndev); 454 - netif_tx_lock(ndev); 454 + netif_tx_lock_bh(ndev); 455 455 } 456 456 457 457 /* Whack a reset. We should wait for this. */ ··· 616 616 writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); 617 617 618 618 if (netif_running(ndev)) { 619 - netif_device_attach(ndev); 620 - napi_enable(&fep->napi); 619 + netif_tx_unlock_bh(ndev); 621 620 netif_wake_queue(ndev); 622 - netif_tx_unlock(ndev); 621 + napi_enable(&fep->napi); 622 + netif_device_attach(ndev); 623 623 } 624 624 } 625 625
+1
drivers/net/ethernet/freescale/gianfar_ptp.c
··· 524 524 return 0; 525 525 526 526 no_clock: 527 + iounmap(etsects->regs); 527 528 no_ioremap: 528 529 release_resource(etsects->rsrc); 529 530 no_resource:
+43 -43
drivers/net/ethernet/icplus/ipg.h
··· 195 195 /* TFD data structure masks. */ 196 196 197 197 /* TFDList, TFC */ 198 - #define IPG_TFC_RSVD_MASK 0x0000FFFF9FFFFFFF 199 - #define IPG_TFC_FRAMEID 0x000000000000FFFF 200 - #define IPG_TFC_WORDALIGN 0x0000000000030000 201 - #define IPG_TFC_WORDALIGNTODWORD 0x0000000000000000 202 - #define IPG_TFC_WORDALIGNTOWORD 0x0000000000020000 203 - #define IPG_TFC_WORDALIGNDISABLED 0x0000000000030000 204 - #define IPG_TFC_TCPCHECKSUMENABLE 0x0000000000040000 205 - #define IPG_TFC_UDPCHECKSUMENABLE 0x0000000000080000 206 - #define IPG_TFC_IPCHECKSUMENABLE 0x0000000000100000 207 - #define IPG_TFC_FCSAPPENDDISABLE 0x0000000000200000 208 - #define IPG_TFC_TXINDICATE 0x0000000000400000 209 - #define IPG_TFC_TXDMAINDICATE 0x0000000000800000 210 - #define IPG_TFC_FRAGCOUNT 0x000000000F000000 211 - #define IPG_TFC_VLANTAGINSERT 0x0000000010000000 212 - #define IPG_TFC_TFDDONE 0x0000000080000000 213 - #define IPG_TFC_VID 0x00000FFF00000000 214 - #define IPG_TFC_CFI 0x0000100000000000 215 - #define IPG_TFC_USERPRIORITY 0x0000E00000000000 198 + #define IPG_TFC_RSVD_MASK 0x0000FFFF9FFFFFFFULL 199 + #define IPG_TFC_FRAMEID 0x000000000000FFFFULL 200 + #define IPG_TFC_WORDALIGN 0x0000000000030000ULL 201 + #define IPG_TFC_WORDALIGNTODWORD 0x0000000000000000ULL 202 + #define IPG_TFC_WORDALIGNTOWORD 0x0000000000020000ULL 203 + #define IPG_TFC_WORDALIGNDISABLED 0x0000000000030000ULL 204 + #define IPG_TFC_TCPCHECKSUMENABLE 0x0000000000040000ULL 205 + #define IPG_TFC_UDPCHECKSUMENABLE 0x0000000000080000ULL 206 + #define IPG_TFC_IPCHECKSUMENABLE 0x0000000000100000ULL 207 + #define IPG_TFC_FCSAPPENDDISABLE 0x0000000000200000ULL 208 + #define IPG_TFC_TXINDICATE 0x0000000000400000ULL 209 + #define IPG_TFC_TXDMAINDICATE 0x0000000000800000ULL 210 + #define IPG_TFC_FRAGCOUNT 0x000000000F000000ULL 211 + #define IPG_TFC_VLANTAGINSERT 0x0000000010000000ULL 212 + #define IPG_TFC_TFDDONE 0x0000000080000000ULL 213 + #define IPG_TFC_VID 0x00000FFF00000000ULL 214 + #define IPG_TFC_CFI 0x0000100000000000ULL 215 + #define IPG_TFC_USERPRIORITY 0x0000E00000000000ULL 216 216 217 217 /* TFDList, FragInfo */ 218 - #define IPG_TFI_RSVD_MASK 0xFFFF00FFFFFFFFFF 219 - #define IPG_TFI_FRAGADDR 0x000000FFFFFFFFFF 220 - #define IPG_TFI_FRAGLEN 0xFFFF000000000000LL 218 + #define IPG_TFI_RSVD_MASK 0xFFFF00FFFFFFFFFFULL 219 + #define IPG_TFI_FRAGADDR 0x000000FFFFFFFFFFULL 220 + #define IPG_TFI_FRAGLEN 0xFFFF000000000000ULL 221 221 222 222 /* RFD data structure masks. */ 223 223 224 224 /* RFDList, RFS */ 225 - #define IPG_RFS_RSVD_MASK 0x0000FFFFFFFFFFFF 226 - #define IPG_RFS_RXFRAMELEN 0x000000000000FFFF 227 - #define IPG_RFS_RXFIFOOVERRUN 0x0000000000010000 228 - #define IPG_RFS_RXRUNTFRAME 0x0000000000020000 229 - #define IPG_RFS_RXALIGNMENTERROR 0x0000000000040000 230 - #define IPG_RFS_RXFCSERROR 0x0000000000080000 231 - #define IPG_RFS_RXOVERSIZEDFRAME 0x0000000000100000 232 - #define IPG_RFS_RXLENGTHERROR 0x0000000000200000 233 - #define IPG_RFS_VLANDETECTED 0x0000000000400000 234 - #define IPG_RFS_TCPDETECTED 0x0000000000800000 235 - #define IPG_RFS_TCPERROR 0x0000000001000000 236 - #define IPG_RFS_UDPDETECTED 0x0000000002000000 237 - #define IPG_RFS_UDPERROR 0x0000000004000000 238 - #define IPG_RFS_IPDETECTED 0x0000000008000000 239 - #define IPG_RFS_IPERROR 0x0000000010000000 240 - #define IPG_RFS_FRAMESTART 0x0000000020000000 241 - #define IPG_RFS_FRAMEEND 0x0000000040000000 242 - #define IPG_RFS_RFDDONE 0x0000000080000000 243 - #define IPG_RFS_TCI 0x0000FFFF00000000 225 + #define IPG_RFS_RSVD_MASK 0x0000FFFFFFFFFFFFULL 226 + #define IPG_RFS_RXFRAMELEN 0x000000000000FFFFULL 227 + #define IPG_RFS_RXFIFOOVERRUN 0x0000000000010000ULL 228 + #define IPG_RFS_RXRUNTFRAME 0x0000000000020000ULL 229 + #define IPG_RFS_RXALIGNMENTERROR 0x0000000000040000ULL 230 + #define IPG_RFS_RXFCSERROR 0x0000000000080000ULL 231 + #define IPG_RFS_RXOVERSIZEDFRAME 0x0000000000100000ULL 232 + #define IPG_RFS_RXLENGTHERROR 0x0000000000200000ULL 233 + #define IPG_RFS_VLANDETECTED 0x0000000000400000ULL 234 + #define IPG_RFS_TCPDETECTED 0x0000000000800000ULL 235 + #define IPG_RFS_TCPERROR 0x0000000001000000ULL 236 + #define IPG_RFS_UDPDETECTED 0x0000000002000000ULL 237 + #define IPG_RFS_UDPERROR 0x0000000004000000ULL 238 + #define IPG_RFS_IPDETECTED 0x0000000008000000ULL 239 + #define IPG_RFS_IPERROR 0x0000000010000000ULL 240 + #define IPG_RFS_FRAMESTART 0x0000000020000000ULL 241 + #define IPG_RFS_FRAMEEND 0x0000000040000000ULL 242 + #define IPG_RFS_RFDDONE 0x0000000080000000ULL 243 + #define IPG_RFS_TCI 0x0000FFFF00000000ULL 244 244 245 245 /* RFDList, FragInfo */ 246 - #define IPG_RFI_RSVD_MASK 0xFFFF00FFFFFFFFFF 247 - #define IPG_RFI_FRAGADDR 0x000000FFFFFFFFFF 248 - #define IPG_RFI_FRAGLEN 0xFFFF000000000000LL 246 + #define IPG_RFI_RSVD_MASK 0xFFFF00FFFFFFFFFFULL 247 + #define IPG_RFI_FRAGADDR 0x000000FFFFFFFFFFULL 248 + #define IPG_RFI_FRAGLEN 0xFFFF000000000000ULL 249 249 250 250 /* I/O Register masks. */ 251 251
+3 -3
drivers/net/ethernet/marvell/mv643xx_eth.c
··· 867 867 struct netdev_queue *nq = netdev_get_tx_queue(mp->dev, txq->index); 868 868 int reclaimed; 869 869 870 - __netif_tx_lock(nq, smp_processor_id()); 870 + __netif_tx_lock_bh(nq); 871 871 872 872 reclaimed = 0; 873 873 while (reclaimed < budget && txq->tx_desc_count > 0) { ··· 913 913 dev_kfree_skb(skb); 914 914 } 915 915 916 - __netif_tx_unlock(nq); 916 + __netif_tx_unlock_bh(nq); 917 917 918 918 if (reclaimed < budget) 919 919 mp->work_tx &= ~(1 << txq->index); ··· 2745 2745 2746 2746 INIT_WORK(&mp->tx_timeout_task, tx_timeout_task); 2747 2747 2748 - netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, 128); 2748 + netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, NAPI_POLL_WEIGHT); 2749 2749 2750 2750 init_timer(&mp->rx_oom); 2751 2751 mp->rx_oom.data = (unsigned long)mp;
+6
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
··· 907 907 #define QLCNIC_FW_HANG 0x4000 908 908 #define QLCNIC_FW_LRO_MSS_CAP 0x8000 909 909 #define QLCNIC_TX_INTR_SHARED 0x10000 910 + #define QLCNIC_APP_CHANGED_FLAGS 0x20000 910 911 #define QLCNIC_IS_MSI_FAMILY(adapter) \ 911 912 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) 913 + #define QLCNIC_IS_TSO_CAPABLE(adapter) \ 914 + ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO) 912 915 913 916 #define QLCNIC_DEF_NUM_STS_DESC_RINGS 4 914 917 #define QLCNIC_MSIX_TBL_SPACE 8192 ··· 1037 1034 spinlock_t rx_mac_learn_lock; 1038 1035 u32 file_prd_off; /*File fw product offset*/ 1039 1036 u32 fw_version; 1037 + u32 offload_flags; 1040 1038 const struct firmware *fw; 1041 1039 }; 1042 1040 ··· 1546 1542 int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter); 1547 1543 int qlcnic_read_mac_addr(struct qlcnic_adapter *); 1548 1544 int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int); 1545 + void qlcnic_set_netdev_features(struct qlcnic_adapter *, 1546 + struct qlcnic_esw_func_cfg *); 1549 1547 void qlcnic_sriov_vf_schedule_multi(struct net_device *); 1550 1548 void qlcnic_vf_add_mc_list(struct net_device *, u16); 1551 1549
-2
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
··· 382 382 clear_bit(__QLCNIC_RESETTING, &adapter->state); 383 383 dev_err(&adapter->pdev->dev, "%s:\n", __func__); 384 384 385 - adapter->netdev->trans_start = jiffies; 386 - 387 385 return 0; 388 386 } 389 387
+45 -4
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
··· 973 973 return rc; 974 974 } 975 975 976 + static netdev_features_t qlcnic_process_flags(struct qlcnic_adapter *adapter, 977 + netdev_features_t features) 978 + { 979 + u32 offload_flags = adapter->offload_flags; 980 + 981 + if (offload_flags & BIT_0) { 982 + features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM | 983 + NETIF_F_IPV6_CSUM; 984 + adapter->rx_csum = 1; 985 + if (QLCNIC_IS_TSO_CAPABLE(adapter)) { 986 + if (!(offload_flags & BIT_1)) 987 + features &= ~NETIF_F_TSO; 988 + else 989 + features |= NETIF_F_TSO; 990 + 991 + if (!(offload_flags & BIT_2)) 992 + features &= ~NETIF_F_TSO6; 993 + else 994 + features |= NETIF_F_TSO6; 995 + } 996 + } else { 997 + features &= ~(NETIF_F_RXCSUM | 998 + NETIF_F_IP_CSUM | 999 + NETIF_F_IPV6_CSUM); 1000 + 1001 + if (QLCNIC_IS_TSO_CAPABLE(adapter)) 1002 + features &= ~(NETIF_F_TSO | NETIF_F_TSO6); 1003 + adapter->rx_csum = 0; 1004 + } 1005 + 1006 + return features; 1007 + } 976 1008 977 1009 netdev_features_t qlcnic_fix_features(struct net_device *netdev, 978 1010 netdev_features_t features) 979 1011 { 980 1012 struct qlcnic_adapter *adapter = netdev_priv(netdev); 1013 + netdev_features_t changed; 981 1014 982 - if ((adapter->flags & QLCNIC_ESWITCH_ENABLED) && 983 - qlcnic_82xx_check(adapter)) { 984 - netdev_features_t changed = features ^ netdev->features; 985 - features ^= changed & (NETIF_F_ALL_CSUM | NETIF_F_RXCSUM); 1015 + if (qlcnic_82xx_check(adapter) && 1016 + (adapter->flags & QLCNIC_ESWITCH_ENABLED)) { 1017 + if (adapter->flags & QLCNIC_APP_CHANGED_FLAGS) { 1018 + features = qlcnic_process_flags(adapter, features); 1019 + } else { 1020 + changed = features ^ netdev->features; 1021 + features ^= changed & (NETIF_F_RXCSUM | 1022 + NETIF_F_IP_CSUM | 1023 + NETIF_F_IPV6_CSUM | 1024 + NETIF_F_TSO | 1025 + NETIF_F_TSO6); 1026 + } 986 1027 } 987 1028 988 1029 if (!(features & NETIF_F_RXCSUM))
+16 -49
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
··· 84 84 static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter); 85 85 static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); 86 86 static int qlcnicvf_start_firmware(struct qlcnic_adapter *); 87 - static void qlcnic_set_netdev_features(struct qlcnic_adapter *, 88 - struct qlcnic_esw_func_cfg *); 89 87 static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16); 90 88 static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16); 91 - 92 - #define QLCNIC_IS_TSO_CAPABLE(adapter) \ 93 - ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO) 94 89 95 90 static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter) 96 91 { ··· 1069 1074 1070 1075 if (!esw_cfg->promisc_mode) 1071 1076 adapter->flags |= QLCNIC_PROMISC_DISABLED; 1072 - 1073 - qlcnic_set_netdev_features(adapter, esw_cfg); 1074 1077 } 1075 1078 1076 1079 int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter) ··· 1083 1090 return -EIO; 1084 1091 qlcnic_set_vlan_config(adapter, &esw_cfg); 1085 1092 qlcnic_set_eswitch_port_features(adapter, &esw_cfg); 1093 + qlcnic_set_netdev_features(adapter, &esw_cfg); 1086 1094 1087 1095 return 0; 1088 1096 } 1089 1097 1090 - static void 1091 - qlcnic_set_netdev_features(struct qlcnic_adapter *adapter, 1092 - struct qlcnic_esw_func_cfg *esw_cfg) 1098 + void qlcnic_set_netdev_features(struct qlcnic_adapter *adapter, 1099 + struct qlcnic_esw_func_cfg *esw_cfg) 1093 1100 { 1094 1101 struct net_device *netdev = adapter->netdev; 1095 - unsigned long features, vlan_features; 1096 1102 1097 1103 if (qlcnic_83xx_check(adapter)) 1098 1104 return; 1099 1105 1100 - features = (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | 1101 - NETIF_F_IPV6_CSUM | NETIF_F_GRO); 1102 - vlan_features = (NETIF_F_SG | NETIF_F_IP_CSUM | 1103 - NETIF_F_IPV6_CSUM); 1104 - 1105 - if (QLCNIC_IS_TSO_CAPABLE(adapter)) { 1106 - features |= (NETIF_F_TSO | NETIF_F_TSO6); 1107 - vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6); 1108 - } 1109 - 1110 - if (netdev->features & NETIF_F_LRO) 1111 - features |= NETIF_F_LRO; 1112 - 1113 - if (esw_cfg->offload_flags & BIT_0) { 1114 - netdev->features |= features; 1115 - adapter->rx_csum = 1; 1116 - if (!(esw_cfg->offload_flags & BIT_1)) { 1117 - netdev->features &= ~NETIF_F_TSO; 1118 - features &= ~NETIF_F_TSO; 1119 - } 1120 - if (!(esw_cfg->offload_flags & BIT_2)) { 1121 - netdev->features &= ~NETIF_F_TSO6; 1122 - features &= ~NETIF_F_TSO6; 1123 - } 1124 - } else { 1125 - netdev->features &= ~features; 1126 - features &= ~features; 1127 - adapter->rx_csum = 0; 1128 - } 1129 - 1130 - netdev->vlan_features = (features & vlan_features); 1106 + adapter->offload_flags = esw_cfg->offload_flags; 1107 + adapter->flags |= QLCNIC_APP_CHANGED_FLAGS; 1108 + netdev_update_features(netdev); 1109 + adapter->flags &= ~QLCNIC_APP_CHANGED_FLAGS; 1131 1110 } 1132 1111 1133 1112 static int ··· 1981 2016 pci_enable_pcie_error_reporting(pdev); 1982 2017 1983 2018 ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL); 1984 - if (!ahw) 2019 + if (!ahw) { 2020 + err = -ENOMEM; 1985 2021 goto err_out_free_res; 2022 + } 1986 2023 1987 2024 switch (ent->device) { 1988 2025 case PCI_DEVICE_ID_QLOGIC_QLE824X: ··· 2020 2053 2021 2054 adapter->qlcnic_wq = create_singlethread_workqueue("qlcnic"); 2022 2055 if (adapter->qlcnic_wq == NULL) { 2056 + err = -ENOMEM; 2023 2057 dev_err(&pdev->dev, "Failed to create workqueue\n"); 2024 2058 goto err_out_free_netdev; 2025 2059 } ··· 2101 2133 goto err_out_disable_msi; 2102 2134 } 2103 2135 2136 + err = qlcnic_get_act_pci_func(adapter); 2137 + if (err) 2138 + goto err_out_disable_mbx_intr; 2139 + 2104 2140 err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac); 2105 2141 if (err) 2106 2142 goto err_out_disable_mbx_intr; ··· 2133 2161 adapter->netdev->name); 2134 2162 break; 2135 2163 } 2136 - 2137 - if (qlcnic_get_act_pci_func(adapter)) 2138 - goto err_out_disable_mbx_intr; 2139 2164 2140 2165 if (adapter->drv_mac_learn) 2141 2166 qlcnic_alloc_lb_filters_mem(adapter); ··· 3118 3149 if (adapter->need_fw_reset) 3119 3150 goto detach; 3120 3151 3121 - if (adapter->ahw->reset_context && qlcnic_auto_fw_reset) { 3152 + if (adapter->ahw->reset_context && qlcnic_auto_fw_reset) 3122 3153 qlcnic_reset_hw_context(adapter); 3123 - adapter->netdev->trans_start = jiffies; 3124 - } 3125 3154 3126 3155 return 0; 3127 3156 }
-1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
··· 1734 1734 1735 1735 if (!qlcnic_sriov_vf_reinit_driver(adapter)) { 1736 1736 qlcnic_sriov_vf_attach(adapter); 1737 - adapter->netdev->trans_start = jiffies; 1738 1737 adapter->tx_timeo_cnt = 0; 1739 1738 adapter->reset_ctx_cnt = 0; 1740 1739 adapter->fw_fail_cnt = 0;
+3
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
··· 544 544 switch (esw_cfg[i].op_mode) { 545 545 case QLCNIC_PORT_DEFAULTS: 546 546 qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]); 547 + rtnl_lock(); 548 + qlcnic_set_netdev_features(adapter, &esw_cfg[i]); 549 + rtnl_unlock(); 547 550 break; 548 551 case QLCNIC_ADD_VLAN: 549 552 qlcnic_set_vlan_config(adapter, &esw_cfg[i]);
+1
drivers/net/ethernet/realtek/8139cp.c
··· 1136 1136 cp->dev->stats.tx_dropped++; 1137 1137 } 1138 1138 } 1139 + netdev_reset_queue(cp->dev); 1139 1140 1140 1141 memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE); 1141 1142 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
+27 -14
drivers/net/ethernet/realtek/r8169.c
··· 5856 5856 return -EIO; 5857 5857 } 5858 5858 5859 - static inline void rtl8169_tso_csum(struct rtl8169_private *tp, 5859 + static bool rtl_skb_pad(struct sk_buff *skb) 5860 + { 5861 + if (skb_padto(skb, ETH_ZLEN)) 5862 + return false; 5863 + skb_put(skb, ETH_ZLEN - skb->len); 5864 + return true; 5865 + } 5866 + 5867 + static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp, struct sk_buff *skb) 5868 + { 5869 + return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34; 5870 + } 5871 + 5872 + static inline bool rtl8169_tso_csum(struct rtl8169_private *tp, 5860 5873 struct sk_buff *skb, u32 *opts) 5861 5874 { 5862 5875 const struct rtl_tx_desc_info *info = tx_desc_info + tp->txd_version; ··· 5882 5869 } else if (skb->ip_summed == CHECKSUM_PARTIAL) { 5883 5870 const struct iphdr *ip = ip_hdr(skb); 5884 5871 5872 + if (unlikely(rtl_test_hw_pad_bug(tp, skb))) 5873 + return skb_checksum_help(skb) == 0 && rtl_skb_pad(skb); 5874 + 5885 5875 if (ip->protocol == IPPROTO_TCP) 5886 5876 opts[offset] |= info->checksum.tcp; 5887 5877 else if (ip->protocol == IPPROTO_UDP) 5888 5878 opts[offset] |= info->checksum.udp; 5889 5879 else 5890 5880 WARN_ON_ONCE(1); 5881 + } else { 5882 + if (unlikely(rtl_test_hw_pad_bug(tp, skb))) 5883 + return rtl_skb_pad(skb); 5891 5884 } 5885 + return true; 5892 5886 } 5893 5887 5894 5888 static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, ··· 5916 5896 goto err_stop_0; 5917 5897 } 5918 5898 5919 - /* 8168evl does not automatically pad to minimum length. */ 5920 - if (unlikely(tp->mac_version == RTL_GIGA_MAC_VER_34 && 5921 - skb->len < ETH_ZLEN)) { 5922 - if (skb_padto(skb, ETH_ZLEN)) 5923 - goto err_update_stats; 5924 - skb_put(skb, ETH_ZLEN - skb->len); 5925 - } 5926 - 5927 5899 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) 5928 5900 goto err_stop_0; 5901 + 5902 + opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb)); 5903 + opts[0] = DescOwn; 5904 + 5905 + if (!rtl8169_tso_csum(tp, skb, opts)) 5906 + goto err_update_stats; 5929 5907 5930 5908 len = skb_headlen(skb); 5931 5909 mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE); ··· 5935 5917 5936 5918 tp->tx_skb[entry].len = len; 5937 5919 txd->addr = cpu_to_le64(mapping); 5938 - 5939 - opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb)); 5940 - opts[0] = DescOwn; 5941 - 5942 - rtl8169_tso_csum(tp, skb, opts); 5943 5920 5944 5921 frags = rtl8169_xmit_frags(tp, skb, opts); 5945 5922 if (frags < 0)
+5 -3
drivers/net/ethernet/sfc/efx.c
··· 638 638 EFX_MAX_FRAME_LEN(efx->net_dev->mtu) + 639 639 efx->type->rx_buffer_padding); 640 640 rx_buf_len = (sizeof(struct efx_rx_page_state) + 641 - EFX_PAGE_IP_ALIGN + efx->rx_dma_len); 641 + NET_IP_ALIGN + efx->rx_dma_len); 642 642 if (rx_buf_len <= PAGE_SIZE) { 643 643 efx->rx_scatter = false; 644 644 efx->rx_buffer_order = 0; 645 645 } else if (efx->type->can_rx_scatter) { 646 + BUILD_BUG_ON(EFX_RX_USR_BUF_SIZE % L1_CACHE_BYTES); 646 647 BUILD_BUG_ON(sizeof(struct efx_rx_page_state) + 647 - EFX_PAGE_IP_ALIGN + EFX_RX_USR_BUF_SIZE > 648 - PAGE_SIZE / 2); 648 + 2 * ALIGN(NET_IP_ALIGN + EFX_RX_USR_BUF_SIZE, 649 + EFX_RX_BUF_ALIGNMENT) > 650 + PAGE_SIZE); 649 651 efx->rx_scatter = true; 650 652 efx->rx_dma_len = EFX_RX_USR_BUF_SIZE; 651 653 efx->rx_buffer_order = 0;
+15 -16
drivers/net/ethernet/sfc/net_driver.h
··· 72 72 /* Maximum possible MTU the driver supports */ 73 73 #define EFX_MAX_MTU (9 * 1024) 74 74 75 - /* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page. */ 76 - #define EFX_RX_USR_BUF_SIZE 1824 75 + /* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page, 76 + * and should be a multiple of the cache line size. 77 + */ 78 + #define EFX_RX_USR_BUF_SIZE (2048 - 256) 79 + 80 + /* If possible, we should ensure cache line alignment at start and end 81 + * of every buffer. Otherwise, we just need to ensure 4-byte 82 + * alignment of the network header. 83 + */ 84 + #if NET_IP_ALIGN == 0 85 + #define EFX_RX_BUF_ALIGNMENT L1_CACHE_BYTES 86 + #else 87 + #define EFX_RX_BUF_ALIGNMENT 4 88 + #endif 77 89 78 90 /* Forward declare Precision Time Protocol (PTP) support structure. */ 79 91 struct efx_ptp_data; ··· 480 468 }; 481 469 482 470 /* 483 - * Alignment of page-allocated RX buffers 484 - * 485 - * Controls the number of bytes inserted at the start of an RX buffer. 486 - * This is the equivalent of NET_IP_ALIGN [which controls the alignment 487 - * of the skb->head for hardware DMA]. 488 - */ 489 - #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 490 - #define EFX_PAGE_IP_ALIGN 0 491 - #else 492 - #define EFX_PAGE_IP_ALIGN NET_IP_ALIGN 493 - #endif 494 - 495 - /* 496 471 * Alignment of the skb->head which wraps a page-allocated RX buffer 497 472 * 498 473 * The skb allocated to wrap an rx_buffer can have this alignment. Since 499 474 * the data is memcpy'd from the rx_buf, it does not need to be equal to 500 - * EFX_PAGE_IP_ALIGN. 475 + * NET_IP_ALIGN. 501 476 */ 502 477 #define EFX_PAGE_SKB_ALIGN 2 503 478
+4 -4
drivers/net/ethernet/sfc/rx.c
··· 93 93 94 94 void efx_rx_config_page_split(struct efx_nic *efx) 95 95 { 96 - efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + EFX_PAGE_IP_ALIGN, 97 - L1_CACHE_BYTES); 96 + efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + NET_IP_ALIGN, 97 + EFX_RX_BUF_ALIGNMENT); 98 98 efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 : 99 99 ((PAGE_SIZE - sizeof(struct efx_rx_page_state)) / 100 100 efx->rx_page_buf_step); ··· 188 188 do { 189 189 index = rx_queue->added_count & rx_queue->ptr_mask; 190 190 rx_buf = efx_rx_buffer(rx_queue, index); 191 - rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN; 191 + rx_buf->dma_addr = dma_addr + NET_IP_ALIGN; 192 192 rx_buf->page = page; 193 - rx_buf->page_offset = page_offset + EFX_PAGE_IP_ALIGN; 193 + rx_buf->page_offset = page_offset + NET_IP_ALIGN; 194 194 rx_buf->len = efx->rx_dma_len; 195 195 rx_buf->flags = 0; 196 196 ++rx_queue->added_count;
+1
drivers/net/usb/qmi_wwan.c
··· 582 582 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ 583 583 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ 584 584 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ 585 + {QMI_FIXED_INTF(0x1e2d, 0x12d1, 4)}, /* Cinterion PLxx */ 585 586 586 587 /* 4. Gobi 1000 devices */ 587 588 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
+46 -54
drivers/net/usb/rtl8150.c
··· 130 130 struct usb_device *udev; 131 131 struct tasklet_struct tl; 132 132 struct net_device *netdev; 133 - struct urb *rx_urb, *tx_urb, *intr_urb, *ctrl_urb; 133 + struct urb *rx_urb, *tx_urb, *intr_urb; 134 134 struct sk_buff *tx_skb, *rx_skb; 135 135 struct sk_buff *rx_skb_pool[RX_SKB_POOL_SIZE]; 136 136 spinlock_t rx_pool_lock; 137 137 struct usb_ctrlrequest dr; 138 138 int intr_interval; 139 - __le16 rx_creg; 140 139 u8 *intr_buff; 141 140 u8 phy; 142 141 }; 143 142 144 143 typedef struct rtl8150 rtl8150_t; 144 + 145 + struct async_req { 146 + struct usb_ctrlrequest dr; 147 + u16 rx_creg; 148 + }; 145 149 146 150 static const char driver_name [] = "rtl8150"; 147 151 ··· 168 164 indx, 0, data, size, 500); 169 165 } 170 166 171 - static void ctrl_callback(struct urb *urb) 167 + static void async_set_reg_cb(struct urb *urb) 172 168 { 173 - rtl8150_t *dev; 169 + struct async_req *req = (struct async_req *)urb->context; 174 170 int status = urb->status; 175 171 176 - switch (status) { 177 - case 0: 178 - break; 179 - case -EINPROGRESS: 180 - break; 181 - case -ENOENT: 182 - break; 183 - default: 184 - if (printk_ratelimit()) 185 - dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status); 186 - } 187 - dev = urb->context; 188 - clear_bit(RX_REG_SET, &dev->flags); 172 + if (status < 0) 173 + dev_dbg(&urb->dev->dev, "%s failed with %d", __func__, status); 174 + kfree(req); 175 + usb_free_urb(urb); 189 176 } 190 177 191 - static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size) 178 + static int async_set_registers(rtl8150_t *dev, u16 indx, u16 size, u16 reg) 192 179 { 193 - int ret; 180 + int res = -ENOMEM; 181 + struct urb *async_urb; 182 + struct async_req *req; 194 183 195 - if (test_bit(RX_REG_SET, &dev->flags)) 196 - return -EAGAIN; 197 - 198 - dev->dr.bRequestType = RTL8150_REQT_WRITE; 199 - dev->dr.bRequest = RTL8150_REQ_SET_REGS; 200 - dev->dr.wValue = cpu_to_le16(indx); 201 - dev->dr.wIndex = 0; 202 - dev->dr.wLength = cpu_to_le16(size); 203 - dev->ctrl_urb->transfer_buffer_length = size; 204 - usb_fill_control_urb(dev->ctrl_urb, dev->udev, 205 - usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr, 206 - &dev->rx_creg, size, ctrl_callback, dev); 207 - if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) { 208 - if (ret == -ENODEV) 184 + req = kmalloc(sizeof(struct async_req), GFP_ATOMIC); 185 + if (req == NULL) 186 + return res; 187 + async_urb = usb_alloc_urb(0, GFP_ATOMIC); 188 + if (async_urb == NULL) { 189 + kfree(req); 190 + return res; 191 + } 192 + req->rx_creg = cpu_to_le16(reg); 193 + req->dr.bRequestType = RTL8150_REQT_WRITE; 194 + req->dr.bRequest = RTL8150_REQ_SET_REGS; 195 + req->dr.wIndex = 0; 196 + req->dr.wValue = cpu_to_le16(indx); 197 + req->dr.wLength = cpu_to_le16(size); 198 + usb_fill_control_urb(async_urb, dev->udev, 199 + usb_sndctrlpipe(dev->udev, 0), (void *)&req->dr, 200 + &req->rx_creg, size, async_set_reg_cb, req); 201 + res = usb_submit_urb(async_urb, GFP_ATOMIC); 202 + if (res) { 203 + if (res == -ENODEV) 209 204 netif_device_detach(dev->netdev); 210 - dev_err(&dev->udev->dev, 211 - "control request submission failed: %d\n", ret); 212 - } else 213 - set_bit(RX_REG_SET, &dev->flags); 214 - 215 - return ret; 205 + dev_err(&dev->udev->dev, "%s failed with %d\n", __func__, res); 206 + } 207 + return res; 216 208 } 217 209 218 210 static int read_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 * reg) ··· 330 330 usb_free_urb(dev->tx_urb); 331 331 return 0; 332 332 } 333 - dev->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL); 334 - if (!dev->ctrl_urb) { 335 - usb_free_urb(dev->rx_urb); 336 - usb_free_urb(dev->tx_urb); 337 - usb_free_urb(dev->intr_urb); 338 - return 0; 339 - } 340 333 341 334 return 1; 342 335 } ··· 339 346 usb_free_urb(dev->rx_urb); 340 347 usb_free_urb(dev->tx_urb); 341 348 usb_free_urb(dev->intr_urb); 342 - usb_free_urb(dev->ctrl_urb); 343 349 } 344 350 345 351 static void unlink_all_urbs(rtl8150_t * dev) ··· 346 354 usb_kill_urb(dev->rx_urb); 347 355 usb_kill_urb(dev->tx_urb); 348 356 usb_kill_urb(dev->intr_urb); 349 - usb_kill_urb(dev->ctrl_urb); 350 357 } 351 358 352 359 static inline struct sk_buff *pull_skb(rtl8150_t *dev) ··· 620 629 } 621 630 /* RCR bit7=1 attach Rx info at the end; =0 HW CRC (which is broken) */ 622 631 rcr = 0x9e; 623 - dev->rx_creg = cpu_to_le16(rcr); 624 632 tcr = 0xd8; 625 633 cr = 0x0c; 626 634 if (!(rcr & 0x80)) ··· 652 662 static void rtl8150_set_multicast(struct net_device *netdev) 653 663 { 654 664 rtl8150_t *dev = netdev_priv(netdev); 665 + u16 rx_creg = 0x9e; 666 + 655 667 netif_stop_queue(netdev); 656 668 if (netdev->flags & IFF_PROMISC) { 657 - dev->rx_creg |= cpu_to_le16(0x0001); 669 + rx_creg |= 0x0001; 658 670 dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name); 659 671 } else if (!netdev_mc_empty(netdev) || 660 672 (netdev->flags & IFF_ALLMULTI)) { 661 - dev->rx_creg &= cpu_to_le16(0xfffe); 662 - dev->rx_creg |= cpu_to_le16(0x0002); 673 + rx_creg &= 0xfffe; 674 + rx_creg |= 0x0002; 663 675 dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name); 664 676 } else { 665 677 /* ~RX_MULTICAST, ~RX_PROMISCUOUS */ 666 - dev->rx_creg &= cpu_to_le16(0x00fc); 678 + rx_creg &= 0x00fc; 667 679 } 668 - async_set_registers(dev, RCR, 2); 680 + async_set_registers(dev, RCR, sizeof(rx_creg), rx_creg); 669 681 netif_wake_queue(netdev); 670 682 } 671 683
+5 -4
drivers/net/virtio_net.c
··· 636 636 struct virtnet_info *vi = netdev_priv(dev); 637 637 int i; 638 638 639 - for (i = 0; i < vi->curr_queue_pairs; i++) { 640 - /* Make sure we have some buffers: if oom use wq. */ 641 - if (!try_fill_recv(&vi->rq[i], GFP_KERNEL)) 642 - schedule_delayed_work(&vi->refill, 0); 639 + for (i = 0; i < vi->max_queue_pairs; i++) { 640 + if (i < vi->curr_queue_pairs) 641 + /* Make sure we have some buffers: if oom use wq. */ 642 + if (!try_fill_recv(&vi->rq[i], GFP_KERNEL)) 643 + schedule_delayed_work(&vi->refill, 0); 643 644 virtnet_napi_enable(&vi->rq[i]); 644 645 } 645 646
+14 -3
drivers/net/vxlan.c
··· 301 301 } 302 302 303 303 /* Look up Ethernet address in forwarding table */ 304 - static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan, 304 + static struct vxlan_fdb *__vxlan_find_mac(struct vxlan_dev *vxlan, 305 305 const u8 *mac) 306 306 307 307 { ··· 314 314 } 315 315 316 316 return NULL; 317 + } 318 + 319 + static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan, 320 + const u8 *mac) 321 + { 322 + struct vxlan_fdb *f; 323 + 324 + f = __vxlan_find_mac(vxlan, mac); 325 + if (f) 326 + f->used = jiffies; 327 + 328 + return f; 317 329 } 318 330 319 331 /* Add/update destinations for multicast */ ··· 365 353 struct vxlan_fdb *f; 366 354 int notify = 0; 367 355 368 - f = vxlan_find_mac(vxlan, mac); 356 + f = __vxlan_find_mac(vxlan, mac); 369 357 if (f) { 370 358 if (flags & NLM_F_EXCL) { 371 359 netdev_dbg(vxlan->dev, ··· 575 563 576 564 f = vxlan_find_mac(vxlan, src_mac); 577 565 if (likely(f)) { 578 - f->used = jiffies; 579 566 if (likely(f->remote.remote_ip == src_ip)) 580 567 return; 581 568
+1 -1
drivers/net/wireless/ath/ath9k/ar9003_calib.c
··· 965 965 { 966 966 int i; 967 967 968 - if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah)) 968 + if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah) && !AR_SREV_9485(ah)) 969 969 return; 970 970 971 971 for (i = 0; i < AR9300_MAX_CHAINS; i++) {
+1 -1
drivers/net/wireless/ath/ath9k/ar9485_initvals.h
··· 1020 1020 {0x0000a284, 0x00000000, 0x00000000, 0x000002a0, 0x000002a0}, 1021 1021 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1022 1022 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1023 - {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, 1023 + {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18}, 1024 1024 {0x0000a2d0, 0x00071981, 0x00071981, 0x00071982, 0x00071982}, 1025 1025 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, 1026 1026 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+3 -1
drivers/net/wireless/ath/ath9k/ath9k.h
··· 254 254 int sched; 255 255 int paused; 256 256 u8 state; 257 + bool stop_cb; 257 258 }; 258 259 259 260 struct ath_node { ··· 352 351 void ath_tx_edma_tasklet(struct ath_softc *sc); 353 352 int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, 354 353 u16 tid, u16 *ssn); 355 - void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 354 + bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid, 355 + bool flush); 356 356 void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 357 357 358 358 void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
+8
drivers/net/wireless/ath/ath9k/debug.c
··· 2008 2008 WARN_ON(i != ATH9K_SSTATS_LEN); 2009 2009 } 2010 2010 2011 + void ath9k_deinit_debug(struct ath_softc *sc) 2012 + { 2013 + if (config_enabled(CONFIG_ATH9K_DEBUGFS) && sc->rfs_chan_spec_scan) { 2014 + relay_close(sc->rfs_chan_spec_scan); 2015 + sc->rfs_chan_spec_scan = NULL; 2016 + } 2017 + } 2018 + 2011 2019 int ath9k_init_debug(struct ath_hw *ah) 2012 2020 { 2013 2021 struct ath_common *common = ath9k_hw_common(ah);
+5
drivers/net/wireless/ath/ath9k/debug.h
··· 304 304 }; 305 305 306 306 int ath9k_init_debug(struct ath_hw *ah); 307 + void ath9k_deinit_debug(struct ath_softc *sc); 307 308 308 309 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); 309 310 void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, ··· 338 337 static inline int ath9k_init_debug(struct ath_hw *ah) 339 338 { 340 339 return 0; 340 + } 341 + 342 + static inline void ath9k_deinit_debug(struct ath_softc *sc) 343 + { 341 344 } 342 345 343 346 static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
+4 -6
drivers/net/wireless/ath/ath9k/init.c
··· 906 906 if (!ath_is_world_regd(reg)) { 907 907 error = regulatory_hint(hw->wiphy, reg->alpha2); 908 908 if (error) 909 - goto unregister; 909 + goto debug_cleanup; 910 910 } 911 911 912 912 ath_init_leds(sc); ··· 914 914 915 915 return 0; 916 916 917 + debug_cleanup: 918 + ath9k_deinit_debug(sc); 917 919 unregister: 918 920 ieee80211_unregister_hw(hw); 919 921 rx_cleanup: ··· 944 942 sc->dfs_detector->exit(sc->dfs_detector); 945 943 946 944 ath9k_eeprom_release(sc); 947 - 948 - if (config_enabled(CONFIG_ATH9K_DEBUGFS) && sc->rfs_chan_spec_scan) { 949 - relay_close(sc->rfs_chan_spec_scan); 950 - sc->rfs_chan_spec_scan = NULL; 951 - } 952 945 } 953 946 954 947 void ath9k_deinit_device(struct ath_softc *sc) ··· 957 960 958 961 ath9k_ps_restore(sc); 959 962 963 + ath9k_deinit_debug(sc); 960 964 ieee80211_unregister_hw(hw); 961 965 ath_rx_cleanup(sc); 962 966 ath9k_deinit_softc(sc);
+5 -3
drivers/net/wireless/ath/ath9k/main.c
··· 1687 1687 u16 tid, u16 *ssn, u8 buf_size) 1688 1688 { 1689 1689 struct ath_softc *sc = hw->priv; 1690 + bool flush = false; 1690 1691 int ret = 0; 1691 1692 1692 1693 local_bh_disable(); ··· 1704 1703 ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1705 1704 ath9k_ps_restore(sc); 1706 1705 break; 1707 - case IEEE80211_AMPDU_TX_STOP_CONT: 1708 1706 case IEEE80211_AMPDU_TX_STOP_FLUSH: 1709 1707 case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: 1708 + flush = true; 1709 + case IEEE80211_AMPDU_TX_STOP_CONT: 1710 1710 ath9k_ps_wakeup(sc); 1711 - ath_tx_aggr_stop(sc, sta, tid); 1712 - ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1711 + if (ath_tx_aggr_stop(sc, sta, tid, flush)) 1712 + ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1713 1713 ath9k_ps_restore(sc); 1714 1714 break; 1715 1715 case IEEE80211_AMPDU_TX_OPERATIONAL:
+48 -26
drivers/net/wireless/ath/ath9k/xmit.c
··· 164 164 ARRAY_SIZE(bf->rates)); 165 165 } 166 166 167 - static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 167 + static void ath_tx_clear_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 168 + { 169 + tid->state &= ~AGGR_ADDBA_COMPLETE; 170 + tid->state &= ~AGGR_CLEANUP; 171 + if (!tid->stop_cb) 172 + return; 173 + 174 + ieee80211_start_tx_ba_cb_irqsafe(tid->an->vif, tid->an->sta->addr, 175 + tid->tidno); 176 + tid->stop_cb = false; 177 + } 178 + 179 + static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid, 180 + bool flush_packets) 168 181 { 169 182 struct ath_txq *txq = tid->ac->txq; 170 183 struct sk_buff *skb; ··· 194 181 while ((skb = __skb_dequeue(&tid->buf_q))) { 195 182 fi = get_frame_info(skb); 196 183 bf = fi->bf; 184 + if (!bf && !flush_packets) 185 + bf = ath_tx_setup_buffer(sc, txq, tid, skb); 197 186 198 187 if (!bf) { 199 - bf = ath_tx_setup_buffer(sc, txq, tid, skb); 200 - if (!bf) { 201 - ieee80211_free_txskb(sc->hw, skb); 202 - continue; 203 - } 188 + ieee80211_free_txskb(sc->hw, skb); 189 + continue; 204 190 } 205 191 206 - if (fi->retries) { 192 + if (fi->retries || flush_packets) { 207 193 list_add_tail(&bf->list, &bf_head); 208 194 ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 209 195 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); ··· 213 201 } 214 202 } 215 203 216 - if (tid->baw_head == tid->baw_tail) { 217 - tid->state &= ~AGGR_ADDBA_COMPLETE; 218 - tid->state &= ~AGGR_CLEANUP; 219 - } 204 + if (tid->baw_head == tid->baw_tail) 205 + ath_tx_clear_tid(sc, tid); 220 206 221 - if (sendbar) { 207 + if (sendbar && !flush_packets) { 222 208 ath_txq_unlock(sc, txq); 223 209 ath_send_bar(tid, tid->seq_start); 224 210 ath_txq_lock(sc, txq); ··· 287 277 288 278 list_add_tail(&bf->list, &bf_head); 289 279 290 - if (fi->retries) 291 - ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 292 - 280 + ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 293 281 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); 294 282 } 295 283 ··· 610 602 } 611 603 612 604 if (tid->state & AGGR_CLEANUP) 613 - ath_tx_flush_tid(sc, tid); 605 + ath_tx_flush_tid(sc, tid, false); 614 606 615 607 rcu_read_unlock(); 616 608 ··· 628 620 struct ath_tx_status *ts, struct ath_buf *bf, 629 621 struct list_head *bf_head) 630 622 { 623 + struct ieee80211_tx_info *info; 631 624 bool txok, flush; 632 625 633 626 txok = !(ts->ts_status & ATH9K_TXERR_MASK); ··· 640 631 txq->axq_ampdu_depth--; 641 632 642 633 if (!bf_isampdu(bf)) { 643 - if (!flush) 634 + if (!flush) { 635 + info = IEEE80211_SKB_CB(bf->bf_mpdu); 636 + memcpy(info->control.rates, bf->rates, 637 + sizeof(info->control.rates)); 644 638 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); 639 + } 645 640 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); 646 641 } else 647 642 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok); ··· 689 676 690 677 skb = bf->bf_mpdu; 691 678 tx_info = IEEE80211_SKB_CB(skb); 692 - rates = tx_info->control.rates; 679 + rates = bf->rates; 693 680 694 681 /* 695 682 * Find the lowest frame length among the rate series that will have a ··· 1269 1256 return 0; 1270 1257 } 1271 1258 1272 - void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) 1259 + bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid, 1260 + bool flush) 1273 1261 { 1274 1262 struct ath_node *an = (struct ath_node *)sta->drv_priv; 1275 1263 struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); 1276 1264 struct ath_txq *txq = txtid->ac->txq; 1265 + bool ret = !flush; 1266 + 1267 + if (flush) 1268 + txtid->stop_cb = false; 1277 1269 1278 1270 if (txtid->state & AGGR_CLEANUP) 1279 - return; 1271 + return false; 1280 1272 1281 1273 if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { 1282 1274 txtid->state &= ~AGGR_ADDBA_PROGRESS; 1283 - return; 1275 + return ret; 1284 1276 } 1285 1277 1286 1278 ath_txq_lock(sc, txq); ··· 1297 1279 * TID can only be reused after all in-progress subframes have been 1298 1280 * completed. 1299 1281 */ 1300 - if (txtid->baw_head != txtid->baw_tail) 1282 + if (txtid->baw_head != txtid->baw_tail) { 1301 1283 txtid->state |= AGGR_CLEANUP; 1302 - else 1284 + ret = false; 1285 + txtid->stop_cb = !flush; 1286 + } else { 1303 1287 txtid->state &= ~AGGR_ADDBA_COMPLETE; 1288 + } 1304 1289 1305 - ath_tx_flush_tid(sc, txtid); 1290 + ath_tx_flush_tid(sc, txtid, flush); 1306 1291 ath_txq_unlock_complete(sc, txq); 1292 + return ret; 1307 1293 } 1308 1294 1309 1295 void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, ··· 2437 2415 tid->ac = &an->ac[acno]; 2438 2416 tid->state &= ~AGGR_ADDBA_COMPLETE; 2439 2417 tid->state &= ~AGGR_ADDBA_PROGRESS; 2418 + tid->stop_cb = false; 2440 2419 } 2441 2420 2442 2421 for (acno = 0, ac = &an->ac[acno]; ··· 2474 2451 } 2475 2452 2476 2453 ath_tid_drain(sc, txq, tid); 2477 - tid->state &= ~AGGR_ADDBA_COMPLETE; 2478 - tid->state &= ~AGGR_CLEANUP; 2454 + ath_tx_clear_tid(sc, tid); 2479 2455 2480 2456 ath_txq_unlock(sc, txq); 2481 2457 }
+6 -1
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 4140 4140 .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 4141 4141 BIT(NL80211_IFTYPE_P2P_GO) 4142 4142 }, 4143 + { 4144 + .max = 1, 4145 + .types = BIT(NL80211_IFTYPE_P2P_DEVICE) 4146 + } 4143 4147 }; 4144 4148 static const struct ieee80211_iface_combination brcmf_iface_combos[] = { 4145 4149 { ··· 4201 4197 BIT(NL80211_IFTYPE_ADHOC) | 4202 4198 BIT(NL80211_IFTYPE_AP) | 4203 4199 BIT(NL80211_IFTYPE_P2P_CLIENT) | 4204 - BIT(NL80211_IFTYPE_P2P_GO); 4200 + BIT(NL80211_IFTYPE_P2P_GO) | 4201 + BIT(NL80211_IFTYPE_P2P_DEVICE); 4205 4202 wiphy->iface_combinations = brcmf_iface_combos; 4206 4203 wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); 4207 4204 wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
+1 -1
drivers/net/wireless/iwlegacy/common.c
··· 1423 1423 } 1424 1424 EXPORT_SYMBOL(il_setup_rx_scan_handlers); 1425 1425 1426 - inline u16 1426 + u16 1427 1427 il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band, 1428 1428 u8 n_probes) 1429 1429 {
+27
drivers/net/wireless/iwlwifi/mvm/fw-api.h
··· 173 173 REPLY_DEBUG_CMD = 0xf0, 174 174 DEBUG_LOG_MSG = 0xf7, 175 175 176 + MCAST_FILTER_CMD = 0xd0, 177 + 176 178 /* D3 commands/notifications */ 177 179 D3_CONFIG_CMD = 0xd3, 178 180 PROT_OFFLOAD_CONFIG_CMD = 0xd4, ··· 949 947 __le16 length; 950 948 u8 data[0]; 951 949 } __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */ 950 + 951 + #define MAX_PORT_ID_NUM 2 952 + 953 + /** 954 + * struct iwl_mcast_filter_cmd - configure multicast filter. 955 + * @filter_own: Set 1 to filter out multicast packets sent by station itself 956 + * @port_id: Multicast MAC addresses array specifier. This is a strange way 957 + * to identify network interface adopted in host-device IF. 958 + * It is used by FW as index in array of addresses. This array has 959 + * MAX_PORT_ID_NUM members. 960 + * @count: Number of MAC addresses in the array 961 + * @pass_all: Set 1 to pass all multicast packets. 962 + * @bssid: current association BSSID. 963 + * @addr_list: Place holder for array of MAC addresses. 964 + * IMPORTANT: add padding if necessary to ensure DWORD alignment. 965 + */ 966 + struct iwl_mcast_filter_cmd { 967 + u8 filter_own; 968 + u8 port_id; 969 + u8 count; 970 + u8 pass_all; 971 + u8 bssid[6]; 972 + u8 reserved[2]; 973 + u8 addr_list[0]; 974 + } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */ 952 975 953 976 #endif /* __fw_api_h__ */
+8 -4
drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
··· 586 586 */ 587 587 static void iwl_mvm_mac_ctxt_cmd_fill_sta(struct iwl_mvm *mvm, 588 588 struct ieee80211_vif *vif, 589 - struct iwl_mac_data_sta *ctxt_sta) 589 + struct iwl_mac_data_sta *ctxt_sta, 590 + bool force_assoc_off) 590 591 { 591 592 /* We need the dtim_period to set the MAC as associated */ 592 - if (vif->bss_conf.assoc && vif->bss_conf.dtim_period) { 593 + if (vif->bss_conf.assoc && vif->bss_conf.dtim_period && 594 + !force_assoc_off) { 593 595 u32 dtim_offs; 594 596 595 597 /* ··· 661 659 cmd.filter_flags &= ~cpu_to_le32(MAC_FILTER_IN_BEACON); 662 660 663 661 /* Fill the data specific for station mode */ 664 - iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.sta); 662 + iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.sta, 663 + action == FW_CTXT_ACTION_ADD); 665 664 666 665 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); 667 666 } ··· 680 677 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action); 681 678 682 679 /* Fill the data specific for station mode */ 683 - iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.p2p_sta.sta); 680 + iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.p2p_sta.sta, 681 + action == FW_CTXT_ACTION_ADD); 684 682 685 683 cmd.p2p_sta.ctwin = cpu_to_le32(noa->oppps_ctwindow & 686 684 IEEE80211_P2P_OPPPS_CTWINDOW_MASK);
+16 -1
drivers/net/wireless/iwlwifi/mvm/mac80211.c
··· 701 701 *total_flags = 0; 702 702 } 703 703 704 + static int iwl_mvm_configure_mcast_filter(struct iwl_mvm *mvm, 705 + struct ieee80211_vif *vif) 706 + { 707 + struct iwl_mcast_filter_cmd mcast_filter_cmd = { 708 + .pass_all = 1, 709 + }; 710 + 711 + memcpy(mcast_filter_cmd.bssid, vif->bss_conf.bssid, ETH_ALEN); 712 + 713 + return iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_SYNC, 714 + sizeof(mcast_filter_cmd), 715 + &mcast_filter_cmd); 716 + } 717 + 704 718 static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, 705 719 struct ieee80211_vif *vif, 706 720 struct ieee80211_bss_conf *bss_conf, ··· 736 722 return; 737 723 } 738 724 iwl_mvm_bt_coex_vif_assoc(mvm, vif); 725 + iwl_mvm_configure_mcast_filter(mvm, vif); 739 726 } else if (mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { 740 727 /* remove AP station now that the MAC is unassoc */ 741 728 ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id); ··· 946 931 947 932 switch (cmd) { 948 933 case STA_NOTIFY_SLEEP: 949 - if (atomic_read(&mvmsta->pending_frames) > 0) 934 + if (atomic_read(&mvm->pending_frames[mvmsta->sta_id]) > 0) 950 935 ieee80211_sta_block_awake(hw, sta, true); 951 936 /* 952 937 * The fw updates the STA to be asleep. Tx packets on the Tx
+1
drivers/net/wireless/iwlwifi/mvm/mvm.h
··· 292 292 struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT]; 293 293 struct work_struct sta_drained_wk; 294 294 unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; 295 + atomic_t pending_frames[IWL_MVM_STATION_COUNT]; 295 296 296 297 /* configured by mac80211 */ 297 298 u32 rts_threshold;
+1
drivers/net/wireless/iwlwifi/mvm/ops.c
··· 292 292 CMD(BT_COEX_PROT_ENV), 293 293 CMD(BT_PROFILE_NOTIFICATION), 294 294 CMD(BT_CONFIG), 295 + CMD(MCAST_FILTER_CMD), 295 296 }; 296 297 #undef CMD 297 298
+6
drivers/net/wireless/iwlwifi/mvm/scan.c
··· 298 298 else 299 299 cmd->type = cpu_to_le32(SCAN_TYPE_FORCED); 300 300 301 + /* 302 + * TODO: This is a WA due to a bug in the FW AUX framework that does not 303 + * properly handle time events that fail to be scheduled 304 + */ 305 + cmd->type = cpu_to_le32(SCAN_TYPE_FORCED); 306 + 301 307 cmd->repeats = cpu_to_le32(1); 302 308 303 309 /*
+10 -3
drivers/net/wireless/iwlwifi/mvm/sta.c
··· 219 219 mvm_sta->max_agg_bufsize = LINK_QUAL_AGG_FRAME_LIMIT_DEF; 220 220 221 221 /* HW restart, don't assume the memory has been zeroed */ 222 - atomic_set(&mvm_sta->pending_frames, 0); 222 + atomic_set(&mvm->pending_frames[sta_id], 0); 223 223 mvm_sta->tid_disable_agg = 0; 224 224 mvm_sta->tfd_queue_msk = 0; 225 225 for (i = 0; i < IEEE80211_NUM_ACS; i++) ··· 407 407 } 408 408 409 409 /* 410 + * Make sure that the tx response code sees the station as -EBUSY and 411 + * calls the drain worker. 412 + */ 413 + spin_lock_bh(&mvm_sta->lock); 414 + /* 410 415 * There are frames pending on the AC queues for this station. 411 416 * We need to wait until all the frames are drained... 412 417 */ 413 - if (atomic_read(&mvm_sta->pending_frames)) { 414 - ret = iwl_mvm_drain_sta(mvm, mvm_sta, true); 418 + if (atomic_read(&mvm->pending_frames[mvm_sta->sta_id])) { 415 419 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], 416 420 ERR_PTR(-EBUSY)); 421 + spin_unlock_bh(&mvm_sta->lock); 422 + ret = iwl_mvm_drain_sta(mvm, mvm_sta, true); 417 423 } else { 424 + spin_unlock_bh(&mvm_sta->lock); 418 425 ret = iwl_mvm_rm_sta_common(mvm, mvm_sta->sta_id); 419 426 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], NULL); 420 427 }
-2
drivers/net/wireless/iwlwifi/mvm/sta.h
··· 274 274 * @bt_reduced_txpower: is reduced tx power enabled for this station 275 275 * @lock: lock to protect the whole struct. Since %tid_data is access from Tx 276 276 * and from Tx response flow, it needs a spinlock. 277 - * @pending_frames: number of frames for this STA on the shared Tx queues. 278 277 * @tid_data: per tid data. Look at %iwl_mvm_tid_data. 279 278 * 280 279 * When mac80211 creates a station it reserves some space (hw->sta_data_size) ··· 289 290 u8 max_agg_bufsize; 290 291 bool bt_reduced_txpower; 291 292 spinlock_t lock; 292 - atomic_t pending_frames; 293 293 struct iwl_mvm_tid_data tid_data[IWL_MAX_TID_COUNT]; 294 294 struct iwl_lq_sta lq_sta; 295 295 struct ieee80211_vif *vif;
+36 -12
drivers/net/wireless/iwlwifi/mvm/tx.c
··· 416 416 417 417 spin_unlock(&mvmsta->lock); 418 418 419 - if (mvmsta->vif->type == NL80211_IFTYPE_AP && 420 - txq_id < IWL_MVM_FIRST_AGG_QUEUE) 421 - atomic_inc(&mvmsta->pending_frames); 419 + if (txq_id < IWL_MVM_FIRST_AGG_QUEUE) 420 + atomic_inc(&mvm->pending_frames[mvmsta->sta_id]); 422 421 423 422 return 0; 424 423 ··· 679 680 /* 680 681 * If the txq is not an AMPDU queue, there is no chance we freed 681 682 * several skbs. Check that out... 682 - * If there are no pending frames for this STA, notify mac80211 that 683 - * this station can go to sleep in its STA table. 684 683 */ 685 - if (txq_id < IWL_MVM_FIRST_AGG_QUEUE && mvmsta && 686 - !WARN_ON(skb_freed > 1) && 687 - mvmsta->vif->type == NL80211_IFTYPE_AP && 688 - atomic_sub_and_test(skb_freed, &mvmsta->pending_frames)) { 689 - ieee80211_sta_block_awake(mvm->hw, sta, false); 690 - set_bit(sta_id, mvm->sta_drained); 691 - schedule_work(&mvm->sta_drained_wk); 684 + if (txq_id < IWL_MVM_FIRST_AGG_QUEUE && !WARN_ON(skb_freed > 1) && 685 + atomic_sub_and_test(skb_freed, &mvm->pending_frames[sta_id])) { 686 + if (mvmsta) { 687 + /* 688 + * If there are no pending frames for this STA, notify 689 + * mac80211 that this station can go to sleep in its 690 + * STA table. 691 + */ 692 + if (mvmsta->vif->type == NL80211_IFTYPE_AP) 693 + ieee80211_sta_block_awake(mvm->hw, sta, false); 694 + /* 695 + * We might very well have taken mvmsta pointer while 696 + * the station was being removed. The remove flow might 697 + * have seen a pending_frame (because we didn't take 698 + * the lock) even if now the queues are drained. So make 699 + * really sure now that this the station is not being 700 + * removed. If it is, run the drain worker to remove it. 701 + */ 702 + spin_lock_bh(&mvmsta->lock); 703 + sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); 704 + if (IS_ERR_OR_NULL(sta)) { 705 + /* 706 + * Station disappeared in the meantime: 707 + * so we are draining. 708 + */ 709 + set_bit(sta_id, mvm->sta_drained); 710 + schedule_work(&mvm->sta_drained_wk); 711 + } 712 + spin_unlock_bh(&mvmsta->lock); 713 + } else if (!mvmsta) { 714 + /* Tx response without STA, so we are draining */ 715 + set_bit(sta_id, mvm->sta_drained); 716 + schedule_work(&mvm->sta_drained_wk); 717 + } 692 718 } 693 719 694 720 rcu_read_unlock();
+9 -9
drivers/net/wireless/mac80211_hwsim.c
··· 1723 1723 class_destroy(hwsim_class); 1724 1724 } 1725 1725 1726 - 1727 - static struct device_driver mac80211_hwsim_driver = { 1728 - .name = "mac80211_hwsim", 1729 - .bus = &platform_bus_type, 1730 - .owner = THIS_MODULE, 1726 + static struct platform_driver mac80211_hwsim_driver = { 1727 + .driver = { 1728 + .name = "mac80211_hwsim", 1729 + .owner = THIS_MODULE, 1730 + }, 1731 1731 }; 1732 1732 1733 1733 static const struct net_device_ops hwsim_netdev_ops = { ··· 2219 2219 spin_lock_init(&hwsim_radio_lock); 2220 2220 INIT_LIST_HEAD(&hwsim_radios); 2221 2221 2222 - err = driver_register(&mac80211_hwsim_driver); 2222 + err = platform_driver_register(&mac80211_hwsim_driver); 2223 2223 if (err) 2224 2224 return err; 2225 2225 ··· 2254 2254 err = -ENOMEM; 2255 2255 goto failed_drvdata; 2256 2256 } 2257 - data->dev->driver = &mac80211_hwsim_driver; 2257 + data->dev->driver = &mac80211_hwsim_driver.driver; 2258 2258 err = device_bind_driver(data->dev); 2259 2259 if (err != 0) { 2260 2260 printk(KERN_DEBUG ··· 2564 2564 failed: 2565 2565 mac80211_hwsim_free(); 2566 2566 failed_unregister_driver: 2567 - driver_unregister(&mac80211_hwsim_driver); 2567 + platform_driver_unregister(&mac80211_hwsim_driver); 2568 2568 return err; 2569 2569 } 2570 2570 module_init(init_mac80211_hwsim); ··· 2577 2577 2578 2578 mac80211_hwsim_free(); 2579 2579 unregister_netdev(hwsim_mon); 2580 - driver_unregister(&mac80211_hwsim_driver); 2580 + platform_driver_unregister(&mac80211_hwsim_driver); 2581 2581 } 2582 2582 module_exit(exit_mac80211_hwsim);
+2 -2
drivers/net/wireless/rtlwifi/rtl8188ee/trx.h
··· 550 550 rxmcs == DESC92C_RATE11M) 551 551 552 552 struct phy_rx_agc_info_t { 553 - #if __LITTLE_ENDIAN 553 + #ifdef __LITTLE_ENDIAN 554 554 u8 gain:7, trsw:1; 555 555 #else 556 556 u8 trsw:1, gain:7; ··· 574 574 u8 stream_target_csi[2]; 575 575 u8 sig_evm; 576 576 u8 rsvd_3; 577 - #if __LITTLE_ENDIAN 577 + #ifdef __LITTLE_ENDIAN 578 578 u8 antsel_rx_keep_2:1; /*ex_intf_flg:1;*/ 579 579 u8 sgi_en:1; 580 580 u8 rxsc:2;
+1
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
··· 349 349 {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/ 350 350 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ 351 351 {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ 352 + {RTL_USB_DEVICE(0x0846, 0xf001, rtl92cu_hal_cfg)}, /*On Netwrks N300MA*/ 352 353 {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ 353 354 {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/ 354 355 {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
+4 -1
include/linux/bcma/bcma.h
··· 134 134 #define BCMA_CORE_I2S 0x834 135 135 #define BCMA_CORE_SDR_DDR1_MEM_CTL 0x835 /* SDR/DDR1 memory controller core */ 136 136 #define BCMA_CORE_SHIM 0x837 /* SHIM component in ubus/6362 */ 137 - #define BCMA_CORE_ARM_CR4 0x83e 137 + #define BCMA_CORE_PHY_AC 0x83B 138 + #define BCMA_CORE_PCIE2 0x83C /* PCI Express Gen2 */ 139 + #define BCMA_CORE_USB30_DEV 0x83D 140 + #define BCMA_CORE_ARM_CR4 0x83E 138 141 #define BCMA_CORE_DEFAULT 0xFFF 139 142 140 143 #define BCMA_MAX_NR_CORES 16
+5
include/linux/brcmphy.h
··· 1 + #ifndef _LINUX_BRCMPHY_H 2 + #define _LINUX_BRCMPHY_H 3 + 1 4 #define PHY_ID_BCM50610 0x0143bd60 2 5 #define PHY_ID_BCM50610M 0x0143bd70 3 6 #define PHY_ID_BCM5241 0x0143bc30 ··· 32 29 #define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 33 30 #define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 34 31 #define PHY_BCM_FLAGS_VALID 0x80000000 32 + 33 + #endif /* _LINUX_BRCMPHY_H */
+11
include/linux/netdevice.h
··· 2733 2733 } 2734 2734 netdev_features_t netdev_increment_features(netdev_features_t all, 2735 2735 netdev_features_t one, netdev_features_t mask); 2736 + 2737 + /* Allow TSO being used on stacked device : 2738 + * Performing the GSO segmentation before last device 2739 + * is a performance improvement. 2740 + */ 2741 + static inline netdev_features_t netdev_add_tso_features(netdev_features_t features, 2742 + netdev_features_t mask) 2743 + { 2744 + return netdev_increment_features(features, NETIF_F_ALL_TSO, mask); 2745 + } 2746 + 2736 2747 int __netdev_update_features(struct net_device *dev); 2737 2748 void netdev_update_features(struct net_device *dev); 2738 2749 void netdev_change_features(struct net_device *dev);
+8 -4
include/net/mac80211.h
··· 3043 3043 * This function may not be called in IRQ context. Calls to this function 3044 3044 * for a single hardware must be synchronized against each other. Calls to 3045 3045 * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be 3046 - * mixed for a single hardware. 3046 + * mixed for a single hardware. Must not run concurrently with 3047 + * ieee80211_tx_status() or ieee80211_tx_status_ni(). 3047 3048 * 3048 3049 * In process context use instead ieee80211_rx_ni(). 3049 3050 * ··· 3060 3059 * (internally defers to a tasklet.) 3061 3060 * 3062 3061 * Calls to this function, ieee80211_rx() or ieee80211_rx_ni() may not 3063 - * be mixed for a single hardware. 3062 + * be mixed for a single hardware.Must not run concurrently with 3063 + * ieee80211_tx_status() or ieee80211_tx_status_ni(). 3064 3064 * 3065 3065 * @hw: the hardware this frame came in on 3066 3066 * @skb: the buffer to receive, owned by mac80211 after this call ··· 3075 3073 * (internally disables bottom halves). 3076 3074 * 3077 3075 * Calls to this function, ieee80211_rx() and ieee80211_rx_irqsafe() may 3078 - * not be mixed for a single hardware. 3076 + * not be mixed for a single hardware. Must not run concurrently with 3077 + * ieee80211_tx_status() or ieee80211_tx_status_ni(). 3079 3078 * 3080 3079 * @hw: the hardware this frame came in on 3081 3080 * @skb: the buffer to receive, owned by mac80211 after this call ··· 3199 3196 * This function may not be called in IRQ context. Calls to this function 3200 3197 * for a single hardware must be synchronized against each other. Calls 3201 3198 * to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe() 3202 - * may not be mixed for a single hardware. 3199 + * may not be mixed for a single hardware. Must not run concurrently with 3200 + * ieee80211_rx() or ieee80211_rx_ni(). 3203 3201 * 3204 3202 * @hw: the hardware the frame was transmitted by 3205 3203 * @skb: the frame that was transmitted, owned by mac80211 after this call
+2 -1
include/net/netfilter/nf_log.h
··· 30 30 } u; 31 31 }; 32 32 33 - typedef void nf_logfn(u_int8_t pf, 33 + typedef void nf_logfn(struct net *net, 34 + u_int8_t pf, 34 35 unsigned int hooknum, 35 36 const struct sk_buff *skb, 36 37 const struct net_device *in,
+2 -2
net/802/mrp.c
··· 871 871 */ 872 872 del_timer_sync(&app->join_timer); 873 873 874 - spin_lock(&app->lock); 874 + spin_lock_bh(&app->lock); 875 875 mrp_mad_event(app, MRP_EVENT_TX); 876 876 mrp_pdu_queue(app); 877 - spin_unlock(&app->lock); 877 + spin_unlock_bh(&app->lock); 878 878 879 879 mrp_queue_xmit(app); 880 880
+1
net/batman-adv/main.c
··· 181 181 batadv_originator_free(bat_priv); 182 182 183 183 free_percpu(bat_priv->bat_counters); 184 + bat_priv->bat_counters = NULL; 184 185 185 186 atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE); 186 187 }
+16
net/batman-adv/originator.c
··· 156 156 kfree(orig_node); 157 157 } 158 158 159 + /** 160 + * batadv_orig_node_free_ref - decrement the orig node refcounter and possibly 161 + * schedule an rcu callback for freeing it 162 + * @orig_node: the orig node to free 163 + */ 159 164 void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node) 160 165 { 161 166 if (atomic_dec_and_test(&orig_node->refcount)) 162 167 call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu); 168 + } 169 + 170 + /** 171 + * batadv_orig_node_free_ref_now - decrement the orig node refcounter and 172 + * possibly free it (without rcu callback) 173 + * @orig_node: the orig node to free 174 + */ 175 + void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node) 176 + { 177 + if (atomic_dec_and_test(&orig_node->refcount)) 178 + batadv_orig_node_free_rcu(&orig_node->rcu); 163 179 } 164 180 165 181 void batadv_originator_free(struct batadv_priv *bat_priv)
+1
net/batman-adv/originator.h
··· 26 26 void batadv_originator_free(struct batadv_priv *bat_priv); 27 27 void batadv_purge_orig_ref(struct batadv_priv *bat_priv); 28 28 void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node); 29 + void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node); 29 30 struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv, 30 31 const uint8_t *addr); 31 32 struct batadv_neigh_node *
+1
net/batman-adv/soft-interface.c
··· 505 505 batadv_debugfs_del_meshif(dev); 506 506 free_bat_counters: 507 507 free_percpu(bat_priv->bat_counters); 508 + bat_priv->bat_counters = NULL; 508 509 509 510 return ret; 510 511 }
+6 -1
net/batman-adv/translation-table.c
··· 144 144 struct batadv_tt_orig_list_entry *orig_entry; 145 145 146 146 orig_entry = container_of(rcu, struct batadv_tt_orig_list_entry, rcu); 147 - batadv_orig_node_free_ref(orig_entry->orig_node); 147 + 148 + /* We are in an rcu callback here, therefore we cannot use 149 + * batadv_orig_node_free_ref() and its call_rcu(): 150 + * An rcu_barrier() wouldn't wait for that to finish 151 + */ 152 + batadv_orig_node_free_ref_now(orig_entry->orig_node); 148 153 kfree(orig_entry); 149 154 } 150 155
+5 -6
net/bridge/netfilter/ebt_log.c
··· 72 72 } 73 73 74 74 static void 75 - ebt_log_packet(u_int8_t pf, unsigned int hooknum, 76 - const struct sk_buff *skb, const struct net_device *in, 77 - const struct net_device *out, const struct nf_loginfo *loginfo, 78 - const char *prefix) 75 + ebt_log_packet(struct net *net, u_int8_t pf, unsigned int hooknum, 76 + const struct sk_buff *skb, const struct net_device *in, 77 + const struct net_device *out, const struct nf_loginfo *loginfo, 78 + const char *prefix) 79 79 { 80 80 unsigned int bitmask; 81 - struct net *net = dev_net(in ? in : out); 82 81 83 82 /* FIXME: Disabled from containers until syslog ns is supported */ 84 83 if (!net_eq(net, &init_net)) ··· 190 191 nf_log_packet(net, NFPROTO_BRIDGE, par->hooknum, skb, 191 192 par->in, par->out, &li, "%s", info->prefix); 192 193 else 193 - ebt_log_packet(NFPROTO_BRIDGE, par->hooknum, skb, par->in, 194 + ebt_log_packet(net, NFPROTO_BRIDGE, par->hooknum, skb, par->in, 194 195 par->out, &li, info->prefix); 195 196 return EBT_CONTINUE; 196 197 }
+11 -7
net/bridge/netfilter/ebt_ulog.c
··· 131 131 return skb; 132 132 } 133 133 134 - static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb, 135 - const struct net_device *in, const struct net_device *out, 136 - const struct ebt_ulog_info *uloginfo, const char *prefix) 134 + static void ebt_ulog_packet(struct net *net, unsigned int hooknr, 135 + const struct sk_buff *skb, 136 + const struct net_device *in, 137 + const struct net_device *out, 138 + const struct ebt_ulog_info *uloginfo, 139 + const char *prefix) 137 140 { 138 141 ebt_ulog_packet_msg_t *pm; 139 142 size_t size, copy_len; 140 143 struct nlmsghdr *nlh; 141 - struct net *net = dev_net(in ? in : out); 142 144 struct ebt_ulog_net *ebt = ebt_ulog_pernet(net); 143 145 unsigned int group = uloginfo->nlgroup; 144 146 ebt_ulog_buff_t *ub = &ebt->ulog_buffers[group]; ··· 235 233 } 236 234 237 235 /* this function is registered with the netfilter core */ 238 - static void ebt_log_packet(u_int8_t pf, unsigned int hooknum, 236 + static void ebt_log_packet(struct net *net, u_int8_t pf, unsigned int hooknum, 239 237 const struct sk_buff *skb, const struct net_device *in, 240 238 const struct net_device *out, const struct nf_loginfo *li, 241 239 const char *prefix) ··· 254 252 strlcpy(loginfo.prefix, prefix, sizeof(loginfo.prefix)); 255 253 } 256 254 257 - ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix); 255 + ebt_ulog_packet(net, hooknum, skb, in, out, &loginfo, prefix); 258 256 } 259 257 260 258 static unsigned int 261 259 ebt_ulog_tg(struct sk_buff *skb, const struct xt_action_param *par) 262 260 { 263 - ebt_ulog_packet(par->hooknum, skb, par->in, par->out, 261 + struct net *net = dev_net(par->in ? par->in : par->out); 262 + 263 + ebt_ulog_packet(net, par->hooknum, skb, par->in, par->out, 264 264 par->targinfo, NULL); 265 265 return EBT_CONTINUE; 266 266 }
+2 -1
net/ipv4/ip_gre.c
··· 235 235 */ 236 236 struct net *net = dev_net(skb->dev); 237 237 struct ip_tunnel_net *itn; 238 - const struct iphdr *iph = (const struct iphdr *)skb->data; 238 + const struct iphdr *iph; 239 239 const int type = icmp_hdr(skb)->type; 240 240 const int code = icmp_hdr(skb)->code; 241 241 struct ip_tunnel *t; ··· 281 281 else 282 282 itn = net_generic(net, ipgre_net_id); 283 283 284 + iph = (const struct iphdr *)skb->data; 284 285 t = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi.flags, 285 286 iph->daddr, iph->saddr, tpi.key); 286 287
+8 -5
net/ipv4/netfilter/ipt_ULOG.c
··· 162 162 return skb; 163 163 } 164 164 165 - static void ipt_ulog_packet(unsigned int hooknum, 165 + static void ipt_ulog_packet(struct net *net, 166 + unsigned int hooknum, 166 167 const struct sk_buff *skb, 167 168 const struct net_device *in, 168 169 const struct net_device *out, ··· 175 174 size_t size, copy_len; 176 175 struct nlmsghdr *nlh; 177 176 struct timeval tv; 178 - struct net *net = dev_net(in ? in : out); 179 177 struct ulog_net *ulog = ulog_pernet(net); 180 178 181 179 /* ffs == find first bit set, necessary because userspace ··· 291 291 static unsigned int 292 292 ulog_tg(struct sk_buff *skb, const struct xt_action_param *par) 293 293 { 294 - ipt_ulog_packet(par->hooknum, skb, par->in, par->out, 294 + struct net *net = dev_net(par->in ? par->in : par->out); 295 + 296 + ipt_ulog_packet(net, par->hooknum, skb, par->in, par->out, 295 297 par->targinfo, NULL); 296 298 return XT_CONTINUE; 297 299 } 298 300 299 - static void ipt_logfn(u_int8_t pf, 301 + static void ipt_logfn(struct net *net, 302 + u_int8_t pf, 300 303 unsigned int hooknum, 301 304 const struct sk_buff *skb, 302 305 const struct net_device *in, ··· 321 318 strlcpy(loginfo.prefix, prefix, sizeof(loginfo.prefix)); 322 319 } 323 320 324 - ipt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix); 321 + ipt_ulog_packet(net, hooknum, skb, in, out, &loginfo, prefix); 325 322 } 326 323 327 324 static int ulog_tg_check(const struct xt_tgchk_param *par)
+26 -3
net/ipv4/tcp.c
··· 2887 2887 unsigned int mss; 2888 2888 struct sk_buff *gso_skb = skb; 2889 2889 __sum16 newcheck; 2890 + bool ooo_okay, copy_destructor; 2890 2891 2891 2892 if (!pskb_may_pull(skb, sizeof(*th))) 2892 2893 goto out; ··· 2928 2927 goto out; 2929 2928 } 2930 2929 2930 + copy_destructor = gso_skb->destructor == tcp_wfree; 2931 + ooo_okay = gso_skb->ooo_okay; 2932 + /* All segments but the first should have ooo_okay cleared */ 2933 + skb->ooo_okay = 0; 2934 + 2931 2935 segs = skb_segment(skb, features); 2932 2936 if (IS_ERR(segs)) 2933 2937 goto out; 2938 + 2939 + /* Only first segment might have ooo_okay set */ 2940 + segs->ooo_okay = ooo_okay; 2934 2941 2935 2942 delta = htonl(oldlen + (thlen + mss)); 2936 2943 ··· 2959 2950 thlen, skb->csum)); 2960 2951 2961 2952 seq += mss; 2953 + if (copy_destructor) { 2954 + skb->destructor = gso_skb->destructor; 2955 + skb->sk = gso_skb->sk; 2956 + /* {tcp|sock}_wfree() use exact truesize accounting : 2957 + * sum(skb->truesize) MUST be exactly be gso_skb->truesize 2958 + * So we account mss bytes of 'true size' for each segment. 2959 + * The last segment will contain the remaining. 2960 + */ 2961 + skb->truesize = mss; 2962 + gso_skb->truesize -= mss; 2963 + } 2962 2964 skb = skb->next; 2963 2965 th = tcp_hdr(skb); 2964 2966 ··· 2982 2962 * is freed at TX completion, and not right now when gso_skb 2983 2963 * is freed by GSO engine 2984 2964 */ 2985 - if (gso_skb->destructor == tcp_wfree) { 2965 + if (copy_destructor) { 2986 2966 swap(gso_skb->sk, skb->sk); 2987 2967 swap(gso_skb->destructor, skb->destructor); 2988 2968 swap(gso_skb->truesize, skb->truesize); ··· 3289 3269 3290 3270 for (i = 0; i < shi->nr_frags; ++i) { 3291 3271 const struct skb_frag_struct *f = &shi->frags[i]; 3292 - struct page *page = skb_frag_page(f); 3293 - sg_set_page(&sg, page, skb_frag_size(f), f->page_offset); 3272 + unsigned int offset = f->page_offset; 3273 + struct page *page = skb_frag_page(f) + (offset >> PAGE_SHIFT); 3274 + 3275 + sg_set_page(&sg, page, skb_frag_size(f), 3276 + offset_in_page(offset)); 3294 3277 if (crypto_hash_update(desc, &sg, skb_frag_size(f))) 3295 3278 return 1; 3296 3279 }
+13 -10
net/ipv4/tcp_input.c
··· 2743 2743 * tcp_xmit_retransmit_queue(). 2744 2744 */ 2745 2745 static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, 2746 - int prior_sacked, bool is_dupack, 2747 - int flag) 2746 + int prior_sacked, int prior_packets, 2747 + bool is_dupack, int flag) 2748 2748 { 2749 2749 struct inet_connection_sock *icsk = inet_csk(sk); 2750 2750 struct tcp_sock *tp = tcp_sk(sk); ··· 2804 2804 tcp_add_reno_sack(sk); 2805 2805 } else 2806 2806 do_lost = tcp_try_undo_partial(sk, pkts_acked); 2807 - newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked; 2807 + newly_acked_sacked = prior_packets - tp->packets_out + 2808 + tp->sacked_out - prior_sacked; 2808 2809 break; 2809 2810 case TCP_CA_Loss: 2810 2811 tcp_process_loss(sk, flag, is_dupack); ··· 2819 2818 if (is_dupack) 2820 2819 tcp_add_reno_sack(sk); 2821 2820 } 2822 - newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked; 2821 + newly_acked_sacked = prior_packets - tp->packets_out + 2822 + tp->sacked_out - prior_sacked; 2823 2823 2824 2824 if (icsk->icsk_ca_state <= TCP_CA_Disorder) 2825 2825 tcp_try_undo_dsack(sk); ··· 3332 3330 bool is_dupack = false; 3333 3331 u32 prior_in_flight; 3334 3332 u32 prior_fackets; 3335 - int prior_packets; 3333 + int prior_packets = tp->packets_out; 3336 3334 int prior_sacked = tp->sacked_out; 3337 3335 int pkts_acked = 0; 3336 + int previous_packets_out = 0; 3338 3337 3339 3338 /* If the ack is older than previous acks 3340 3339 * then we can probably ignore it. ··· 3406 3403 sk->sk_err_soft = 0; 3407 3404 icsk->icsk_probes_out = 0; 3408 3405 tp->rcv_tstamp = tcp_time_stamp; 3409 - prior_packets = tp->packets_out; 3410 3406 if (!prior_packets) 3411 3407 goto no_queue; 3412 3408 3413 3409 /* See if we can take anything off of the retransmit queue. */ 3410 + previous_packets_out = tp->packets_out; 3414 3411 flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); 3415 3412 3416 - pkts_acked = prior_packets - tp->packets_out; 3413 + pkts_acked = previous_packets_out - tp->packets_out; 3417 3414 3418 3415 if (tcp_ack_is_dubious(sk, flag)) { 3419 3416 /* Advance CWND, if state allows this. */ ··· 3421 3418 tcp_cong_avoid(sk, ack, prior_in_flight); 3422 3419 is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP)); 3423 3420 tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, 3424 - is_dupack, flag); 3421 + prior_packets, is_dupack, flag); 3425 3422 } else { 3426 3423 if (flag & FLAG_DATA_ACKED) 3427 3424 tcp_cong_avoid(sk, ack, prior_in_flight); ··· 3444 3441 /* If data was DSACKed, see if we can undo a cwnd reduction. */ 3445 3442 if (flag & FLAG_DSACKING_ACK) 3446 3443 tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, 3447 - is_dupack, flag); 3444 + prior_packets, is_dupack, flag); 3448 3445 /* If this ack opens up a zero window, clear backoff. It was 3449 3446 * being used to time the probes, and is probably far higher than 3450 3447 * it needs to be for normal retransmission. ··· 3467 3464 if (TCP_SKB_CB(skb)->sacked) { 3468 3465 flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una); 3469 3466 tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, 3470 - is_dupack, flag); 3467 + prior_packets, is_dupack, flag); 3471 3468 } 3472 3469 3473 3470 SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
+6 -4
net/ipv4/tcp_output.c
··· 874 874 &md5); 875 875 tcp_header_size = tcp_options_size + sizeof(struct tcphdr); 876 876 877 - if (tcp_packets_in_flight(tp) == 0) { 877 + if (tcp_packets_in_flight(tp) == 0) 878 878 tcp_ca_event(sk, CA_EVENT_TX_START); 879 - skb->ooo_okay = 1; 880 - } else 881 - skb->ooo_okay = 0; 879 + 880 + /* if no packet is in qdisc/device queue, then allow XPS to select 881 + * another queue. 882 + */ 883 + skb->ooo_okay = sk_wmem_alloc_get(sk) == 0; 882 884 883 885 skb_push(skb, tcp_header_size); 884 886 skb_reset_transport_header(skb);
+1 -1
net/ipv6/ip6_output.c
··· 1147 1147 if (WARN_ON(np->cork.opt)) 1148 1148 return -EINVAL; 1149 1149 1150 - np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation); 1150 + np->cork.opt = kzalloc(opt->tot_len, sk->sk_allocation); 1151 1151 if (unlikely(np->cork.opt == NULL)) 1152 1152 return -ENOBUFS; 1153 1153
+1 -1
net/irda/irlap_frame.c
··· 544 544 /* 545 545 * We now have some discovery info to deliver! 546 546 */ 547 - discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC); 547 + discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC); 548 548 if (!discovery) { 549 549 IRDA_WARNING("%s: unable to malloc!\n", __func__); 550 550 return;
+1
net/mac80211/ieee80211_i.h
··· 1267 1267 void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata); 1268 1268 void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata, 1269 1269 __le16 fc, bool acked); 1270 + void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); 1270 1271 1271 1272 /* IBSS code */ 1272 1273 void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
+51 -10
net/mac80211/mlme.c
··· 1015 1015 1016 1016 static void 1017 1017 ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, 1018 - u64 timestamp, struct ieee802_11_elems *elems) 1018 + u64 timestamp, struct ieee802_11_elems *elems, 1019 + bool beacon) 1019 1020 { 1020 1021 struct ieee80211_local *local = sdata->local; 1021 1022 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; ··· 1033 1032 struct cfg80211_chan_def new_vht_chandef = {}; 1034 1033 const struct ieee80211_sec_chan_offs_ie *sec_chan_offs; 1035 1034 const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie; 1035 + const struct ieee80211_ht_operation *ht_oper; 1036 1036 int secondary_channel_offset = -1; 1037 1037 1038 1038 ASSERT_MGD_MTX(ifmgd); ··· 1050 1048 1051 1049 sec_chan_offs = elems->sec_chan_offs; 1052 1050 wide_bw_chansw_ie = elems->wide_bw_chansw_ie; 1051 + ht_oper = elems->ht_operation; 1053 1052 1054 1053 if (ifmgd->flags & (IEEE80211_STA_DISABLE_HT | 1055 1054 IEEE80211_STA_DISABLE_40MHZ)) { 1056 1055 sec_chan_offs = NULL; 1057 1056 wide_bw_chansw_ie = NULL; 1057 + /* only used for bandwidth here */ 1058 + ht_oper = NULL; 1058 1059 } 1059 1060 1060 1061 if (ifmgd->flags & IEEE80211_STA_DISABLE_VHT) ··· 1099 1094 return; 1100 1095 } 1101 1096 1102 - if (sec_chan_offs) { 1097 + if (!beacon && sec_chan_offs) { 1103 1098 secondary_channel_offset = sec_chan_offs->sec_chan_offs; 1099 + } else if (beacon && ht_oper) { 1100 + secondary_channel_offset = 1101 + ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET; 1104 1102 } else if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) { 1105 - /* if HT is enabled and the IE not present, it's still HT */ 1103 + /* 1104 + * If it's not a beacon, HT is enabled and the IE not present, 1105 + * it's 20 MHz, 802.11-2012 8.5.2.6: 1106 + * This element [the Secondary Channel Offset Element] is 1107 + * present when switching to a 40 MHz channel. It may be 1108 + * present when switching to a 20 MHz channel (in which 1109 + * case the secondary channel offset is set to SCN). 1110 + */ 1106 1111 secondary_channel_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE; 1107 1112 } 1108 1113 ··· 2811 2796 mutex_unlock(&local->iflist_mtx); 2812 2797 } 2813 2798 2814 - ieee80211_sta_process_chanswitch(sdata, rx_status->mactime, elems); 2799 + ieee80211_sta_process_chanswitch(sdata, rx_status->mactime, 2800 + elems, true); 2815 2801 2816 2802 } 2817 2803 ··· 3226 3210 3227 3211 ieee80211_sta_process_chanswitch(sdata, 3228 3212 rx_status->mactime, 3229 - &elems); 3213 + &elems, false); 3230 3214 } else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) { 3231 3215 ies_len = skb->len - 3232 3216 offsetof(struct ieee80211_mgmt, ··· 3248 3232 3249 3233 ieee80211_sta_process_chanswitch(sdata, 3250 3234 rx_status->mactime, 3251 - &elems); 3235 + &elems, false); 3252 3236 } 3253 3237 break; 3254 3238 } ··· 3638 3622 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 3639 3623 } 3640 3624 } 3625 + 3626 + #ifdef CONFIG_PM 3627 + void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) 3628 + { 3629 + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3630 + 3631 + mutex_lock(&ifmgd->mtx); 3632 + if (!ifmgd->associated) { 3633 + mutex_unlock(&ifmgd->mtx); 3634 + return; 3635 + } 3636 + 3637 + if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) { 3638 + sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; 3639 + mlme_dbg(sdata, "driver requested disconnect after resume\n"); 3640 + ieee80211_sta_connection_lost(sdata, 3641 + ifmgd->associated->bssid, 3642 + WLAN_REASON_UNSPECIFIED, 3643 + true); 3644 + mutex_unlock(&ifmgd->mtx); 3645 + return; 3646 + } 3647 + mutex_unlock(&ifmgd->mtx); 3648 + } 3649 + #endif 3641 3650 3642 3651 /* interface setup */ 3643 3652 void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) ··· 4370 4329 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 4371 4330 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; 4372 4331 bool tx = !req->local_state_change; 4373 - bool sent_frame = false; 4332 + bool report_frame = false; 4374 4333 4375 4334 mutex_lock(&ifmgd->mtx); 4376 4335 ··· 4387 4346 ieee80211_destroy_auth_data(sdata, false); 4388 4347 mutex_unlock(&ifmgd->mtx); 4389 4348 4390 - sent_frame = tx; 4349 + report_frame = true; 4391 4350 goto out; 4392 4351 } 4393 4352 ··· 4395 4354 ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { 4396 4355 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 4397 4356 req->reason_code, tx, frame_buf); 4398 - sent_frame = tx; 4357 + report_frame = true; 4399 4358 } 4400 4359 mutex_unlock(&ifmgd->mtx); 4401 4360 4402 4361 out: 4403 - if (sent_frame) 4362 + if (report_frame) 4404 4363 __cfg80211_send_deauth(sdata->dev, frame_buf, 4405 4364 IEEE80211_DEAUTH_FRAME_LEN); 4406 4365
+8 -1
net/mac80211/rate.c
··· 688 688 struct ieee80211_sta *pubsta, 689 689 struct ieee80211_sta_rates *rates) 690 690 { 691 - struct ieee80211_sta_rates *old = rcu_dereference(pubsta->rates); 691 + struct ieee80211_sta_rates *old; 692 692 693 + /* 694 + * mac80211 guarantees that this function will not be called 695 + * concurrently, so the following RCU access is safe, even without 696 + * extra locking. This can not be checked easily, so we just set 697 + * the condition to true. 698 + */ 699 + old = rcu_dereference_protected(pubsta->rates, true); 693 700 rcu_assign_pointer(pubsta->rates, rates); 694 701 if (old) 695 702 kfree_rcu(old, rcu_head);
+3
net/mac80211/rx.c
··· 3036 3036 * and location updates. Note that mac80211 3037 3037 * itself never looks at these frames. 3038 3038 */ 3039 + if (!multicast && 3040 + !ether_addr_equal(sdata->vif.addr, hdr->addr1)) 3041 + return 0; 3039 3042 if (ieee80211_is_public_action(hdr, skb->len)) 3040 3043 return 1; 3041 3044 if (!ieee80211_is_beacon(hdr->frame_control))
+2 -2
net/mac80211/tkip.c
··· 208 208 u32 iv32 = get_unaligned_le32(&data[4]); 209 209 u16 iv16 = data[2] | (data[0] << 8); 210 210 211 - spin_lock_bh(&key->u.tkip.txlock); 211 + spin_lock(&key->u.tkip.txlock); 212 212 ieee80211_compute_tkip_p1k(key, iv32); 213 213 tkip_mixing_phase2(tk, ctx, iv16, p2k); 214 - spin_unlock_bh(&key->u.tkip.txlock); 214 + spin_unlock(&key->u.tkip.txlock); 215 215 } 216 216 EXPORT_SYMBOL(ieee80211_get_tkip_p2k); 217 217
+7
net/mac80211/util.c
··· 1740 1740 mb(); 1741 1741 local->resuming = false; 1742 1742 1743 + list_for_each_entry(sdata, &local->interfaces, list) { 1744 + if (!ieee80211_sdata_running(sdata)) 1745 + continue; 1746 + if (sdata->vif.type == NL80211_IFTYPE_STATION) 1747 + ieee80211_sta_restart(sdata); 1748 + } 1749 + 1743 1750 mod_timer(&local->sta_cleanup, jiffies + 1); 1744 1751 #else 1745 1752 WARN_ON(1);
+5 -2
net/netfilter/nf_log.c
··· 148 148 va_start(args, fmt); 149 149 vsnprintf(prefix, sizeof(prefix), fmt, args); 150 150 va_end(args); 151 - logger->logfn(pf, hooknum, skb, in, out, loginfo, prefix); 151 + logger->logfn(net, pf, hooknum, skb, in, out, loginfo, prefix); 152 152 } 153 153 rcu_read_unlock(); 154 154 } ··· 368 368 return 0; 369 369 370 370 out_sysctl: 371 + #ifdef CONFIG_PROC_FS 371 372 /* For init_net: errors will trigger panic, don't unroll on error. */ 372 373 if (!net_eq(net, &init_net)) 373 374 remove_proc_entry("nf_log", net->nf.proc_netfilter); 374 - 375 + #endif 375 376 return ret; 376 377 } 377 378 378 379 static void __net_exit nf_log_net_exit(struct net *net) 379 380 { 380 381 netfilter_log_sysctl_exit(net); 382 + #ifdef CONFIG_PROC_FS 381 383 remove_proc_entry("nf_log", net->nf.proc_netfilter); 384 + #endif 382 385 } 383 386 384 387 static struct pernet_operations nf_log_net_ops = {
+7 -6
net/netfilter/xt_LOG.c
··· 466 466 467 467 468 468 static void 469 - ipt_log_packet(u_int8_t pf, 469 + ipt_log_packet(struct net *net, 470 + u_int8_t pf, 470 471 unsigned int hooknum, 471 472 const struct sk_buff *skb, 472 473 const struct net_device *in, ··· 476 475 const char *prefix) 477 476 { 478 477 struct sbuff *m; 479 - struct net *net = dev_net(in ? in : out); 480 478 481 479 /* FIXME: Disabled from containers until syslog ns is supported */ 482 480 if (!net_eq(net, &init_net)) ··· 797 797 } 798 798 799 799 static void 800 - ip6t_log_packet(u_int8_t pf, 800 + ip6t_log_packet(struct net *net, 801 + u_int8_t pf, 801 802 unsigned int hooknum, 802 803 const struct sk_buff *skb, 803 804 const struct net_device *in, ··· 807 806 const char *prefix) 808 807 { 809 808 struct sbuff *m; 810 - struct net *net = dev_net(in ? in : out); 811 809 812 810 /* FIXME: Disabled from containers until syslog ns is supported */ 813 811 if (!net_eq(net, &init_net)) ··· 833 833 { 834 834 const struct xt_log_info *loginfo = par->targinfo; 835 835 struct nf_loginfo li; 836 + struct net *net = dev_net(par->in ? par->in : par->out); 836 837 837 838 li.type = NF_LOG_TYPE_LOG; 838 839 li.u.log.level = loginfo->level; 839 840 li.u.log.logflags = loginfo->logflags; 840 841 841 842 if (par->family == NFPROTO_IPV4) 842 - ipt_log_packet(NFPROTO_IPV4, par->hooknum, skb, par->in, 843 + ipt_log_packet(net, NFPROTO_IPV4, par->hooknum, skb, par->in, 843 844 par->out, &li, loginfo->prefix); 844 845 #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 845 846 else if (par->family == NFPROTO_IPV6) 846 - ip6t_log_packet(NFPROTO_IPV6, par->hooknum, skb, par->in, 847 + ip6t_log_packet(net, NFPROTO_IPV6, par->hooknum, skb, par->in, 847 848 par->out, &li, loginfo->prefix); 848 849 #endif 849 850 else
+2 -1
net/netfilter/xt_NFLOG.c
··· 26 26 { 27 27 const struct xt_nflog_info *info = par->targinfo; 28 28 struct nf_loginfo li; 29 + struct net *net = dev_net(par->in ? par->in : par->out); 29 30 30 31 li.type = NF_LOG_TYPE_ULOG; 31 32 li.u.ulog.copy_len = info->len; 32 33 li.u.ulog.group = info->group; 33 34 li.u.ulog.qthreshold = info->threshold; 34 35 35 - nfulnl_log_packet(par->family, par->hooknum, skb, par->in, 36 + nfulnl_log_packet(net, par->family, par->hooknum, skb, par->in, 36 37 par->out, &li, info->prefix); 37 38 return XT_CONTINUE; 38 39 }
+14 -3
net/netfilter/xt_TCPOPTSTRIP.c
··· 30 30 31 31 static unsigned int 32 32 tcpoptstrip_mangle_packet(struct sk_buff *skb, 33 - const struct xt_tcpoptstrip_target_info *info, 33 + const struct xt_action_param *par, 34 34 unsigned int tcphoff, unsigned int minlen) 35 35 { 36 + const struct xt_tcpoptstrip_target_info *info = par->targinfo; 36 37 unsigned int optl, i, j; 37 38 struct tcphdr *tcph; 38 39 u_int16_t n, o; 39 40 u_int8_t *opt; 41 + int len; 42 + 43 + /* This is a fragment, no TCP header is available */ 44 + if (par->fragoff != 0) 45 + return XT_CONTINUE; 40 46 41 47 if (!skb_make_writable(skb, skb->len)) 48 + return NF_DROP; 49 + 50 + len = skb->len - tcphoff; 51 + if (len < (int)sizeof(struct tcphdr) || 52 + tcp_hdr(skb)->doff * 4 > len) 42 53 return NF_DROP; 43 54 44 55 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); ··· 87 76 static unsigned int 88 77 tcpoptstrip_tg4(struct sk_buff *skb, const struct xt_action_param *par) 89 78 { 90 - return tcpoptstrip_mangle_packet(skb, par->targinfo, ip_hdrlen(skb), 79 + return tcpoptstrip_mangle_packet(skb, par, ip_hdrlen(skb), 91 80 sizeof(struct iphdr) + sizeof(struct tcphdr)); 92 81 } 93 82 ··· 105 94 if (tcphoff < 0) 106 95 return NF_DROP; 107 96 108 - return tcpoptstrip_mangle_packet(skb, par->targinfo, tcphoff, 97 + return tcpoptstrip_mangle_packet(skb, par, tcphoff, 109 98 sizeof(*ipv6h) + sizeof(struct tcphdr)); 110 99 } 111 100 #endif
+69
net/netlabel/netlabel_domainhash.c
··· 245 245 } 246 246 } 247 247 248 + /** 249 + * netlbl_domhsh_validate - Validate a new domain mapping entry 250 + * @entry: the entry to validate 251 + * 252 + * This function validates the new domain mapping entry to ensure that it is 253 + * a valid entry. Returns zero on success, negative values on failure. 254 + * 255 + */ 256 + static int netlbl_domhsh_validate(const struct netlbl_dom_map *entry) 257 + { 258 + struct netlbl_af4list *iter4; 259 + struct netlbl_domaddr4_map *map4; 260 + #if IS_ENABLED(CONFIG_IPV6) 261 + struct netlbl_af6list *iter6; 262 + struct netlbl_domaddr6_map *map6; 263 + #endif /* IPv6 */ 264 + 265 + if (entry == NULL) 266 + return -EINVAL; 267 + 268 + switch (entry->type) { 269 + case NETLBL_NLTYPE_UNLABELED: 270 + if (entry->type_def.cipsov4 != NULL || 271 + entry->type_def.addrsel != NULL) 272 + return -EINVAL; 273 + break; 274 + case NETLBL_NLTYPE_CIPSOV4: 275 + if (entry->type_def.cipsov4 == NULL) 276 + return -EINVAL; 277 + break; 278 + case NETLBL_NLTYPE_ADDRSELECT: 279 + netlbl_af4list_foreach(iter4, &entry->type_def.addrsel->list4) { 280 + map4 = netlbl_domhsh_addr4_entry(iter4); 281 + switch (map4->type) { 282 + case NETLBL_NLTYPE_UNLABELED: 283 + if (map4->type_def.cipsov4 != NULL) 284 + return -EINVAL; 285 + break; 286 + case NETLBL_NLTYPE_CIPSOV4: 287 + if (map4->type_def.cipsov4 == NULL) 288 + return -EINVAL; 289 + break; 290 + default: 291 + return -EINVAL; 292 + } 293 + } 294 + #if IS_ENABLED(CONFIG_IPV6) 295 + netlbl_af6list_foreach(iter6, &entry->type_def.addrsel->list6) { 296 + map6 = netlbl_domhsh_addr6_entry(iter6); 297 + switch (map6->type) { 298 + case NETLBL_NLTYPE_UNLABELED: 299 + break; 300 + default: 301 + return -EINVAL; 302 + } 303 + } 304 + #endif /* IPv6 */ 305 + break; 306 + default: 307 + return -EINVAL; 308 + } 309 + 310 + return 0; 311 + } 312 + 248 313 /* 249 314 * Domain Hash Table Functions 250 315 */ ··· 375 310 struct netlbl_af6list *iter6; 376 311 struct netlbl_af6list *tmp6; 377 312 #endif /* IPv6 */ 313 + 314 + ret_val = netlbl_domhsh_validate(entry); 315 + if (ret_val != 0) 316 + return ret_val; 378 317 379 318 /* XXX - we can remove this RCU read lock as the spinlock protects the 380 319 * entire function, but before we do we need to fixup the
+10 -7
net/wireless/core.c
··· 638 638 * cfg80211_mutex lock 639 639 */ 640 640 res = rfkill_register(rdev->rfkill); 641 - if (res) 642 - goto out_rm_dev; 641 + if (res) { 642 + device_del(&rdev->wiphy.dev); 643 + 644 + mutex_lock(&cfg80211_mutex); 645 + debugfs_remove_recursive(rdev->wiphy.debugfsdir); 646 + list_del_rcu(&rdev->list); 647 + wiphy_regulatory_deregister(wiphy); 648 + mutex_unlock(&cfg80211_mutex); 649 + return res; 650 + } 643 651 644 652 rtnl_lock(); 645 653 rdev->wiphy.registered = true; 646 654 rtnl_unlock(); 647 655 return 0; 648 - 649 - out_rm_dev: 650 - device_del(&rdev->wiphy.dev); 651 - return res; 652 656 } 653 657 EXPORT_SYMBOL(wiphy_register); 654 658 ··· 870 866 #endif 871 867 __cfg80211_disconnect(rdev, dev, 872 868 WLAN_REASON_DEAUTH_LEAVING, true); 873 - cfg80211_mlme_down(rdev, dev); 874 869 wdev_unlock(wdev); 875 870 break; 876 871 case NL80211_IFTYPE_MESH_POINT:
+4
net/wireless/nl80211.c
··· 7577 7577 &tcp->payload_tok)) 7578 7578 return -ENOBUFS; 7579 7579 7580 + nla_nest_end(msg, nl_tcp); 7581 + 7580 7582 return 0; 7581 7583 } 7582 7584 ··· 9972 9970 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || 9973 9971 (netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, 9974 9972 netdev->ifindex)) || 9973 + nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || 9975 9974 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) || 9976 9975 (sig_dbm && 9977 9976 nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || ··· 10013 10010 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || 10014 10011 (netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, 10015 10012 netdev->ifindex)) || 10013 + nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || 10016 10014 nla_put(msg, NL80211_ATTR_FRAME, len, buf) || 10017 10015 nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie) || 10018 10016 (ack && nla_put_flag(msg, NL80211_ATTR_ACK)))
+2 -1
net/wireless/sme.c
··· 961 961 /* was it connected by userspace SME? */ 962 962 if (!wdev->conn) { 963 963 cfg80211_mlme_down(rdev, dev); 964 - return 0; 964 + goto disconnect; 965 965 } 966 966 967 967 if (wdev->sme_state == CFG80211_SME_CONNECTING && ··· 987 987 return err; 988 988 } 989 989 990 + disconnect: 990 991 if (wdev->sme_state == CFG80211_SME_CONNECTED) 991 992 __cfg80211_disconnected(dev, NULL, 0, 0, false); 992 993 else if (wdev->sme_state == CFG80211_SME_CONNECTING)
+13 -10
net/wireless/trace.h
··· 2441 2441 TP_STRUCT__entry( 2442 2442 WIPHY_ENTRY 2443 2443 WDEV_ENTRY 2444 + __field(bool, non_wireless) 2444 2445 __field(bool, disconnect) 2445 2446 __field(bool, magic_pkt) 2446 2447 __field(bool, gtk_rekey_failure) ··· 2450 2449 __field(bool, rfkill_release) 2451 2450 __field(s32, pattern_idx) 2452 2451 __field(u32, packet_len) 2453 - __dynamic_array(u8, packet, wakeup->packet_present_len) 2452 + __dynamic_array(u8, packet, 2453 + wakeup ? wakeup->packet_present_len : 0) 2454 2454 ), 2455 2455 TP_fast_assign( 2456 2456 WIPHY_ASSIGN; 2457 2457 WDEV_ASSIGN; 2458 - __entry->disconnect = wakeup->disconnect; 2459 - __entry->magic_pkt = wakeup->magic_pkt; 2460 - __entry->gtk_rekey_failure = wakeup->gtk_rekey_failure; 2461 - __entry->eap_identity_req = wakeup->eap_identity_req; 2462 - __entry->four_way_handshake = wakeup->four_way_handshake; 2463 - __entry->rfkill_release = wakeup->rfkill_release; 2464 - __entry->pattern_idx = wakeup->pattern_idx; 2465 - __entry->packet_len = wakeup->packet_len; 2466 - if (wakeup->packet && wakeup->packet_present_len) 2458 + __entry->non_wireless = !wakeup; 2459 + __entry->disconnect = wakeup ? wakeup->disconnect : false; 2460 + __entry->magic_pkt = wakeup ? wakeup->magic_pkt : false; 2461 + __entry->gtk_rekey_failure = wakeup ? wakeup->gtk_rekey_failure : false; 2462 + __entry->eap_identity_req = wakeup ? wakeup->eap_identity_req : false; 2463 + __entry->four_way_handshake = wakeup ? wakeup->four_way_handshake : false; 2464 + __entry->rfkill_release = wakeup ? wakeup->rfkill_release : false; 2465 + __entry->pattern_idx = wakeup ? wakeup->pattern_idx : false; 2466 + __entry->packet_len = wakeup ? wakeup->packet_len : false; 2467 + if (wakeup && wakeup->packet && wakeup->packet_present_len) 2467 2468 memcpy(__get_dynamic_array(packet), wakeup->packet, 2468 2469 wakeup->packet_present_len); 2469 2470 ),
+1
net/xfrm/xfrm_output.c
··· 64 64 65 65 if (unlikely(x->km.state != XFRM_STATE_VALID)) { 66 66 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEINVALID); 67 + err = -EINVAL; 67 68 goto error; 68 69 } 69 70
+21 -18
tools/perf/scripts/python/net_dropmonitor.py
··· 15 15 16 16 def get_kallsyms_table(): 17 17 global kallsyms 18 + 18 19 try: 19 20 f = open("/proc/kallsyms", "r") 20 - linecount = 0 21 - for line in f: 22 - linecount = linecount+1 23 - f.seek(0) 24 21 except: 25 22 return 26 23 27 - 28 - j = 0 29 24 for line in f: 30 25 loc = int(line.split()[0], 16) 31 26 name = line.split()[2] 32 - j = j +1 33 - if ((j % 100) == 0): 34 - print "\r" + str(j) + "/" + str(linecount), 35 - kallsyms.append({ 'loc': loc, 'name' : name}) 36 - 37 - print "\r" + str(j) + "/" + str(linecount) 27 + kallsyms.append((loc, name)) 38 28 kallsyms.sort() 39 - return 40 29 41 30 def get_sym(sloc): 42 31 loc = int(sloc) 43 - for i in kallsyms: 44 - if (i['loc'] >= loc): 45 - return (i['name'], i['loc']-loc) 46 - return (None, 0) 32 + 33 + # Invariant: kallsyms[i][0] <= loc for all 0 <= i <= start 34 + # kallsyms[i][0] > loc for all end <= i < len(kallsyms) 35 + start, end = -1, len(kallsyms) 36 + while end != start + 1: 37 + pivot = (start + end) // 2 38 + if loc < kallsyms[pivot][0]: 39 + end = pivot 40 + else: 41 + start = pivot 42 + 43 + # Now (start == -1 or kallsyms[start][0] <= loc) 44 + # and (start == len(kallsyms) - 1 or loc < kallsyms[start + 1][0]) 45 + if start >= 0: 46 + symloc, name = kallsyms[start] 47 + return (name, loc - symloc) 48 + else: 49 + return (None, 0) 47 50 48 51 def print_drop_table(): 49 52 print "%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT") ··· 67 64 68 65 # called from perf, when it finds a correspoinding event 69 66 def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, 70 - skbaddr, protocol, location): 67 + skbaddr, location, protocol): 71 68 slocation = str(location) 72 69 try: 73 70 drop_log[slocation] = drop_log[slocation] + 1