1. 27 Mar, 2018 10 commits
    • Ping-Ke Shih's avatar
      rtlwifi: remove redundant statement found by static checker · 757a9eb8
      Ping-Ke Shih authored
      smatch reports "rtl_is_special_data() warn: inconsistent indenting", but
      it is an obvious redundant statement so remove it.
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      757a9eb8
    • Ping-Ke Shih's avatar
      rtlwifi: Add modifier static to functions reported by sparse · 91b9e684
      Ping-Ke Shih authored
      sparse reports some functions were not declared, so add 'static' as
      modifier. Remove an unused function btc8821a1ant_is_wifi_status_changed()
      exposed due to 'static'.
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      91b9e684
    • Amitkumar Karwar's avatar
      rsi: fix kernel panic observed on 64bit machine · 864db4d5
      Amitkumar Karwar authored
      Following kernel panic is observed on 64bit machine while loading
      the driver. It is fixed if we pass dynamically allocated memory to
      SDIO for DMA.
      
      BUG: unable to handle kernel paging request at ffffeb04000172e0
      IP: sg_miter_stop+0x56/0x70
      PGD 0 P4D 0
      Oops: 0000 [#1] SMP PTI
      Modules linked in: rsi_sdio(OE+) rsi_91x(OE) btrsi(OE) rfcomm bluetooth
      ecdh_generic mac80211 mmc_block fuse xt_CHECKSUM iptable_mangle
      drm_kms_helper mmc_core serio_raw drm firewire_ohci tg3
      CPU: 0 PID: 4003 Comm: insmod Tainted: G           OE    4.16.0-rc1+ #27
      Hardware name: Dell Inc. Latitude E5500                  /0DW634, BIOS
      A19 06/13/2013
      RIP: 0010:sg_miter_stop+0x56/0x70
      RSP: 0018:ffff88007d003e78 EFLAGS: 00010002
      RAX: 0000000000000003 RBX: 0000000000000004 RCX: 0000000000000000
      RDX: ffffeb04000172c0 RSI: ffff88002f58002c RDI: ffff88007d003e80
      RBP: 0000000000000004 R08: ffff88007d003e80 R09: 0000000000000008
      R10: 0000000000000003 R11: 0000000000000001 R12: 0000000000000004
      R13: ffff88002f580028 R14: 0000000000000000 R15: 0000000000000004
      FS:  00007f35c29db700(0000) GS:ffff88007d000000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffffeb04000172e0 CR3: 000000007038e000 CR4: 00000000000406f0
      Call Trace:
      <IRQ>
      sg_copy_buffer+0xc6/0xf0
      sdhci_tasklet_finish+0x170/0x260 [sdhci]
      tasklet_action+0xf4/0x100
      __do_softirq+0xef/0x26e
      irq_exit+0xbe/0xd0
      do_IRQ+0x4a/0xc0
      common_interrupt+0xa2/0xa2
      </IRQ>
      Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      864db4d5
    • Amitkumar Karwar's avatar
      rsi: fix error path handling in SDIO probe · 90b12aeb
      Amitkumar Karwar authored
      We miss to release IRQ in certain error path in SDIO probe which
      causes following kernel panic. This patch corrects error path
      handling
      
      BUG: unable to handle kernel NULL pointer dereference at        (null)
      IP:           (null)
      PGD 0 P4D 0
      Oops: 0010 [#1] SMP PTI
      Call Trace:
       <IRQ>
       ? call_timer_fn+0x29/0x120
       ? run_timer_softirq+0x1da/0x420
       ? timer_interrupt+0x11/0x20
       ? __do_softirq+0xef/0x26e
       ? irq_exit+0xbe/0xd0
       ? do_IRQ+0x4a/0xc0
       ? common_interrupt+0xa2/0xa2
       </IRQ>
       ? cpuidle_enter_state+0x118/0x250
       ? do_idle+0x186/0x1e0
       ? cpu_startup_entry+0x6f/0x80
       ? start_kernel+0x47c/0x49c
       ? secondary_startup_64+0xa5/0xb0
      
      Fixes: 50117605 ("rsi: improve RX handling in SDIO interface")
      Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      90b12aeb
    • Colin Ian King's avatar
      rsi: remove redundant duplicate assignment of buffer_size · a31f9314
      Colin Ian King authored
      Variable buffer_size is re-assigned the same value, this duplicated
      assignment is redundant and can be removed.
      
      Cleans up clang warning:
      drivers/net/wireless/rsi/rsi_91x_usb.c:140:4: warning: Value stored
      to 'buffer_size' is never read
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      a31f9314
    • Tobin C. Harding's avatar
      rsi: Remove stack VLA usage · 44f98a93
      Tobin C. Harding authored
      The use of stack Variable Length Arrays needs to be avoided, as they
      can be a vector for stack exhaustion, which can be both a runtime bug
      (kernel Oops) or a security flaw (overwriting memory beyond the
      stack). Also, in general, as code evolves it is easy to lose track of
      how big a VLA can get. Thus, we can end up having runtime failures
      that are hard to debug. As part of the directive[1] to remove all VLAs
      from the kernel, and build with -Wvla.
      
      Currently rsi code uses a VLA based on a function argument to
      `rsi_sdio_load_data_master_write()`.  The function call chain is
      
      Both these functions
      
      	rsi_sdio_reinit_device()
      	rsi_probe()
      
      start the call chain:
      
      	rsi_hal_device_init()
      	rsi_load_fw()
      	auto_fw_upgrade()
      	ping_pong_write()
      	rsi_sdio_load_data_master_write()
      
      [Without familiarity with the code] it appears that none of the 4 locks
      
      	mutex
      	rx_mutex
      	tx_mutex
      	tx_bus_mutex
      
      are held when `rsi_sdio_load_data_master_write()` is called.  It is therefore
      safe to use kmalloc with GFP_KERNEL.
      
      We can avoid using the VLA by using `kmalloc()` and free'ing the memory on all
      exit paths.
      
      Change buffer from 'u8 array' to 'u8 *'.  Call `kmalloc()` to allocate memory for
      the buffer.  Using goto statement to call `kfree()` on all return paths.
      
      It can be expected that this patch will result in a small increase in overhead
      due to the use of `kmalloc()` however this code is only called on initialization
      (and re-initialization) so this overhead should not degrade performance.
      
      [1] https://lkml.org/lkml/2018/3/7/621Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      44f98a93
    • Ganapathi Bhat's avatar
      mwifiex: remove warnings in mwifiex_cmd_append_11n_tlv() · 6c20495b
      Ganapathi Bhat authored
      Fix the following sparse warning in mwifiex_cmd_append_11n_tlv:
      
      drivers/net/wireless/marvell/mwifiex/11n.c:358:65: warning: invalid assignment: &=
      drivers/net/wireless/marvell/mwifiex/11n.c:358:65:    left side has type restricted __le16
      drivers/net/wireless/marvell/mwifiex/11n.c:358:65:    right side has type int
      drivers/net/wireless/marvell/mwifiex/11n.c:360:65: warning: invalid assignment: &=
      drivers/net/wireless/marvell/mwifiex/11n.c:360:65:    left side has type restricted __le16
      drivers/net/wireless/marvell/mwifiex/11n.c:360:65:    right side has type int
      drivers/net/wireless/marvell/mwifiex/11n.c:366:65: warning: invalid assignment: &=
      drivers/net/wireless/marvell/mwifiex/11n.c:366:65:    left side has type restricted __le16
      drivers/net/wireless/marvell/mwifiex/11n.c:366:65:    right side has type int
      drivers/net/wireless/marvell/mwifiex/11n.c:368:65: warning: invalid assignment: &=
      drivers/net/wireless/marvell/mwifiex/11n.c:368:65:    left side has type restricted __le16
      drivers/net/wireless/marvell/mwifiex/11n.c:368:65:    right side has type int
      
      Fixes: 77423fa7 ("mwifiex: fix incorrect ht capability problem")
      Signed-off-by: default avatarGanapathi Bhat <gbhat@marvell.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6c20495b
    • Joe Perches's avatar
      wireless: Use octal not symbolic permissions · 2ef00c53
      Joe Perches authored
      Prefer the direct use of octal for permissions.
      
      Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace
      and some typing.
      
      Miscellanea:
      
      o Whitespace neatening around these conversions.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      2ef00c53
    • Arnd Bergmann's avatar
      Bluetooth: btrsi: rework dependencies · 255dd5b7
      Arnd Bergmann authored
      The linkage between the bluetooth driver and the wireless
      driver is not defined properly, leading to build problems
      such as:
      
      warning: (BT_HCIRSI) selects RSI_COEX which has unmet direct dependencies (NETDEVICES && WLAN && WLAN_VENDOR_RSI && BT_HCIRSI && RSI_91X)
      drivers/net/wireless/rsi/rsi_91x_main.o: In function `rsi_read_pkt':
      (.text+0x205): undefined reference to `rsi_bt_ops'
      
      As the dependency is actually the reverse (RSI_91X uses
      the BT_RSI driver, not the other way round), this changes
      the dependency to match, and enables the bluetooth driver
      from the RSI_COEX symbol.
      
      Fixes: 38aa4da5 ("Bluetooth: btrsi: add new rsi bluetooth driver")
      Acked-by; Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      255dd5b7
    • Kalle Valo's avatar
      Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git · abd5f008
      Kalle Valo authored
      ath.git patches for 4.17. Major changes:
      
      wil6210
      
      * support multiple virtual interfaces
      abd5f008
  2. 26 Mar, 2018 25 commits
    • Ramon Fried's avatar
      wcn36xx: Check DXE IRQ reason · 6767b302
      Ramon Fried authored
      IRQ reason was not cheked for errors.
      Although error handing is not currently supported, it
      will be nice to output an error value to the log if the
      DMA operation failed.
      Signed-off-by: default avatarRamon Fried <rfried@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6767b302
    • Ramon Fried's avatar
      wcn36xx: calculate DXE default channel values · e5d04670
      Ramon Fried authored
      DXE channel defaults used hardcoded magic values.
      Added bit definitions of the control register and
      calculate this values in compilation for clarity.
      Signed-off-by: default avatarRamon Fried <rfried@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      e5d04670
    • Ramon Fried's avatar
      wcn36xx: calculate DXE control registers values · 6ced7958
      Ramon Fried authored
      DXE descriptor control registers used hardcoded magic values.  Added bit
      definitions of the control register and calculate this values in compilation
      for clarity. No functional changes.
      Signed-off-by: default avatarRamon Fried <rfried@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6ced7958
    • Peter Große's avatar
      ath9k: spelling s/premble/preamble/ · 1fb148f5
      Peter Große authored
      Signed-off-by: default avatarPeter Große <pegro@friiks.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      1fb148f5
    • Sebastian Gottschall's avatar
      ath9k: fix crash in spectral scan · 221b6ec6
      Sebastian Gottschall authored
      Fixes crash seen on arm smp systems (gateworks ventana imx6):
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000014
      pgd = 80004000
      [00000014] *pgd=00000000
      Internal error: Oops - BUG: 17 [#1] PREEMPT SMP ARM
      Modules linked in: ip6table_filter nf_conntrack_ipv6 ip6_tables nf_log_ipv6 nf_defrag_ipv6 shortcut_fe ipcomp6 xfrm_ipcomp xfrm6_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_ro xfrm6_mode_beet ip6_tunnel tunnel6 mip6 ah6 esp6 xfrm_algo sit ip_tunnel tunnel4 ipv6 ath10k_pci ath10k_core ath9k ath mac80211 cfg80211 compat ath_pci ath_hal(P) caamalg authencesn authenc caamrng caamhash caam_jr caam cdc_ncm usbnet usbcore sky2 imx2_wdt
      CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: P                4.9.85 #19
      Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
      task: bf064980 task.stack: bf07c000
      PC is at relay_buf_full+0xc/0x30
      LR is at _674+0x740/0xf10 [ath9k]
      pc : [<8018bce0>]    lr : [<7f1aa604>]    psr: 80000013
      sp : bf07dbf0  ip : bf07dc00  fp : bf07dbfc
      r10: 0000003f  r9 : bf130e00  r8 : 809044b0
      r7 : 00000000  r6 : be67a9f0  r5 : 00000000  r4 : 809043e4
      r3 : c0864c24  r2 : 00000000  r1 : 00000004  r0 : 00000000
      Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 4e6a004a  DAC: 00000055
      Process ksoftirqd/0 (pid: 3, stack limit = 0xbf07c210)
      Stack: (0xbf07dbf0 to 0xbf07e000)
      dbe0:                                     bf07dd04 bf07dc00 7f1aa604 8018bce0
      dc00: 00004014 be59e010 bf07dc34 bf07dc18 7f1a7084 7f19c07c be59c010 be6470a0
      dc20: 0000096c be648954 bf07dc6c bf07dc38 7f1c286c bf07dd90 bf07dc5c bf07dc48
      dc40: 8029ea4c 0000003c 00000001 be59c010 00000094 00000000 00000000 00000000
      dc60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      dc80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      dca0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      dcc0: 00000000 00000000 00000000 00000000 00000000 00000000 8010ef24 00000030
      dce0: be94f5e8 be6485a0 bddf0200 be59c010 be6465a0 be6415a0 bf07ddf4 bf07dd08
      dd00: 7f1cf800 7f1aa55c 1fc38c4c 00000000 bf07dd58 cccccccd 66666667 be640bc0
      dd20: bf07dd54 be6415a0 1fc38c4c 00000000 00000000 be59c038 be67a9c0 be59e010
      dd40: be67a9f0 be647170 8090c904 be59c010 00000000 00000001 1fc38e84 00000000
      dd60: be640bc0 bddf0200 00000200 00000010 0000003f 00000002 20000013 be59c010
      dd80: 8092d940 bf7ca2c0 bf07ddb4 bf07dd98 1fc38c4c 2602003f 0100ff1b 80ff1b00
      dda0: 00808080 00000000 00000000 80808080 80808080 80808080 80808080 00008080
      ddc0: 00000000 00000000 7f1b62b8 00000002 be6470ec be6470f0 00000000 bf07de98
      dde0: 8092d940 be6415a0 bf07de94 bf07ddf8 7f1d1ed8 7f1cf1fc 00000000 00000000
      de00: bf7cc4c0 00000400 be6470f0 bf07de18 8015165c be59c010 8090453c 8090453c
      de20: bf07dec4 be6465a0 8014f614 80148884 0000619a 00000001 bf07c000 00000100
      de40: bf07de78 00000001 7f327850 00000002 afb50401 bf064980 bf07de9c bf07de68
      de60: bf064a00 803cc668 bf064a00 be6470b4 be6470b8 80844180 00000000 bf07de98
      de80: 8092d940 bf07c000 bf07dec4 bf07de98 80124d18 7f1d1c44 80124c94 00000000
      dea0: 00000006 80902098 80902080 40000006 00000100 bf07c000 bf07df24 bf07dec8
      dec0: 8012501c 80124ca0 bf7cc4c0 bf064980 be95e1c0 04208040 80902d00 000061c7
      dee0: 0000000a 80600b54 8092d940 808441f8 80902080 bf07dec8 bf03b200 bf07c000
      df00: bf03b200 8090fe54 00000000 00000000 00000000 00000000 bf07df34 bf07df28
      df20: 80125148 80124f28 bf07df5c bf07df38 8013deb4 8012511c 00000000 bf03b240
      df40: bf03b200 8013dc90 00000000 00000000 bf07dfac bf07df60 8013ad40 8013dc9c
      df60: 70448040 00000001 00000000 bf03b200 00000000 00030003 bf07df78 bf07df78
      df80: 00000000 00000000 bf07df88 bf07df88 bf03b240 8013ac48 00000000 00000000
      dfa0: 00000000 bf07dfb0 80107760 8013ac54 00000000 00000000 00000000 00000000
      dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 8c120004 1190ad04
      Backtrace:
      [<8018bcd4>] (relay_buf_full) from [<7f1aa604>] (_674+0x740/0xf10 [ath9k])
      [<7f1aa550>] (_674 [ath9k]) from [<7f1cf800>] (_582+0x14b4/0x3708 [ath9k])
       r10:be6415a0 r9:be6465a0 r8:be59c010 r7:bddf0200 r6:be6485a0 r5:be94f5e8
       r4:00000030
      [<7f1cf1f0>] (_582 [ath9k]) from [<7f1d1ed8>] (_735+0x2a0/0xec4 [ath9k])
       r10:be6415a0 r9:8092d940 r8:bf07de98 r7:00000000 r6:be6470f0 r5:be6470ec
       r4:00000002
      [<7f1d1c38>] (_735 [ath9k]) from [<80124d18>] (tasklet_action+0x84/0xf8)
       r10:bf07c000 r9:8092d940 r8:bf07de98 r7:00000000 r6:80844180 r5:be6470b8
       r4:be6470b4
      [<80124c94>] (tasklet_action) from [<8012501c>] (__do_softirq+0x100/0x1f4)
       r10:bf07c000 r9:00000100 r8:40000006 r7:80902080 r6:80902098 r5:00000006
       r4:00000000 r3:80124c94
      [<80124f1c>] (__do_softirq) from [<80125148>] (run_ksoftirqd+0x38/0x4c)
       r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:8090fe54 r5:bf03b200
       r4:bf07c000
      [<80125110>] (run_ksoftirqd) from [<8013deb4>] (smpboot_thread_fn+0x224/0x260)
      [<8013dc90>] (smpboot_thread_fn) from [<8013ad40>] (kthread+0xf8/0x100)
       r9:00000000 r8:00000000 r7:8013dc90 r6:bf03b200 r5:bf03b240 r4:00000000
      [<8013ac48>] (kthread) from [<80107760>] (ret_from_fork+0x14/0x34)
       r7:00000000 r6:00000000 r5:8013ac48 r4:bf03b240
      Code: e89da800 e1a0c00d e92dd800 e24cb004 (e5901014)
      ---[ end trace dddf11ac9111b272 ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      CPU1: stopping
      CPU: 1 PID: 0 Comm: swapper/1 Tainted: P      D         4.9.85 #19
      Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
      Backtrace:
      [<8010a708>] (dump_backtrace) from [<8010a99c>] (show_stack+0x18/0x1c)
       r7:bf093f58 r6:20000193 r5:809168e8 r4:00000000
      [<8010a984>] (show_stack) from [<802a09c4>] (dump_stack+0x94/0xa8)
      [<802a0930>] (dump_stack) from [<8010d184>] (handle_IPI+0xe8/0x180)
       r7:bf093f58 r6:00000000 r5:00000001 r4:808478c4
      [<8010d09c>] (handle_IPI) from [<801013e8>] (gic_handle_irq+0x78/0x7c)
       r7:f4000100 r6:bf093f58 r5:f400010c r4:8090467c
      [<80101370>] (gic_handle_irq) from [<8010b378>] (__irq_svc+0x58/0x8c)
      Exception stack(0xbf093f58 to 0xbf093fa0)
      3f40:                                                       bf7d62a0 00000000
      3f60: 0010a5f4 80113460 bf092000 809043e4 00000002 80904434 bf092008 412fc09a
      3f80: 00000000 bf093fb4 bf093fb8 bf093fa8 8010804c 80108050 60000013 ffffffff
       r9:bf092000 r8:bf092008 r7:bf093f8c r6:ffffffff r5:60000013 r4:80108050
      [<80108014>] (arch_cpu_idle) from [<80553c2c>] (default_idle_call+0x30/0x34)
      [<80553bfc>] (default_idle_call) from [<80158394>] (cpu_startup_entry+0xc4/0xfc)
      [<801582d0>] (cpu_startup_entry) from [<8010ce40>] (secondary_start_kernel+0x168/0x174)
       r7:8092d2f8 r4:80913568
      [<8010ccd8>] (secondary_start_kernel) from [<10101488>] (0x10101488)
       r5:00000055 r4:4f07806a
      Rebooting in 10 seconds..
      Reboot failed -- System halted
      Signed-off-by: default avatarSebastian Gottschall <s.gottschall@dd-wrt.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      221b6ec6
    • Karthikeyan Periyasamy's avatar
      ath10k: Fix kernel panic while using worker (ath10k_sta_rc_update_wk) · 8b2d93dd
      Karthikeyan Periyasamy authored
      When attempt to run worker (ath10k_sta_rc_update_wk) after the station object
      (ieee80211_sta) delete will trigger the kernel panic.
      
      This problem arise in AP + Mesh configuration, Where the current node AP VAP
      and neighbor node mesh VAP MAC address are same. When the current mesh node
      try to establish the mesh link with neighbor node, driver peer creation for
      the neighbor mesh node fails due to duplication MAC address. Already the AP
      VAP created with same MAC address.
      
      It is caused by the following scenario steps.
      
      Steps:
      1. In above condition, ath10k driver sta_state callback (ath10k_sta_state)
         fails to do the state change for a station from IEEE80211_STA_NOTEXIST
         to IEEE80211_STA_NONE due to peer creation fails. Sta_state callback is
         called from ieee80211_add_station() to handle the new station
         (neighbor mesh node) request from the wpa_supplicant.
      2. Concurrently ath10k receive the sta_rc_update callback notification from
         the mesh_neighbour_update() to handle the beacon frames of the above
         neighbor mesh node. since its atomic callback, ath10k driver queue the
         work (ath10k_sta_rc_update_wk) to handle rc update.
      3. Due to driver sta_state callback fails (step 1), mac80211 free the station
         object.
      4. When the worker (ath10k_sta_rc_update_wk) scheduled to run, it will access
         the station object which is already deleted. so it will trigger kernel
         panic.
      
      Added the peer exist check in sta_rc_update callback before queue the work.
      
      Kernel Panic log:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c0204000
      [00000000] *pgd=00000000
      Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      CPU: 1 PID: 1833 Comm: kworker/u4:2 Not tainted 3.14.77 #1
      task: dcef0000 ti: d72b6000 task.ti: d72b6000
      PC is at pwq_activate_delayed_work+0x10/0x40
      LR is at pwq_activate_delayed_work+0xc/0x40
      pc : [<c023f988>]    lr : [<c023f984>]    psr: 40000193
      sp : d72b7f18  ip : 0000007a  fp : d72b6000
      r10: 00000000  r9 : dd404414  r8 : d8c31998
      r7 : d72b6038  r6 : 00000004  r5 : d4907ec8  r4 : dcee1300
      r3 : ffffffe0  r2 : 00000000  r1 : 00000001  r0 : 00000000
      Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5787d  Table: 595bc06a  DAC: 00000015
      ...
      Process kworker/u4:2 (pid: 1833, stack limit = 0xd72b6238)
      Stack: (0xd72b7f18 to 0xd72b8000)
      7f00:                                                       00000001 dcee1300
      7f20: 00000001 c02410dc d8c31980 dd404400 dd404400 c0242790 d8c31980 00000089
      7f40: 00000000 d93e1340 00000000 d8c31980 c0242568 00000000 00000000 00000000
      7f60: 00000000 c02474dc 00000000 00000000 000000f8 d8c31980 00000000 00000000
      7f80: d72b7f80 d72b7f80 00000000 00000000 d72b7f90 d72b7f90 d72b7fac d93e1340
      7fa0: c0247404 00000000 00000000 c0208d20 00000000 00000000 00000000 00000000
      7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
      [<c023f988>] (pwq_activate_delayed_work) from [<c02410dc>] (pwq_dec_nr_in_flight+0x58/0xc4)
      [<c02410dc>] (pwq_dec_nr_in_flight) from [<c0242790>] (worker_thread+0x228/0x360)
      [<c0242790>] (worker_thread) from [<c02474dc>] (kthread+0xd8/0xec)
      [<c02474dc>] (kthread) from [<c0208d20>] (ret_from_fork+0x14/0x34)
      Code: e92d4038 e1a05000 ebffffbc[69210.619376] SMP: failed to stop secondary CPUs
      Rebooting in 3 seconds..
      Signed-off-by: default avatarKarthikeyan Periyasamy <periyasa@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      8b2d93dd
    • Carl Huang's avatar
      ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait · 9ef0f58e
      Carl Huang authored
      The skb may be freed in tx completion context before
      trace_ath10k_wmi_cmd is called. This can be easily captured when
      KASAN(Kernel Address Sanitizer) is enabled. The fix is to move
      trace_ath10k_wmi_cmd before the send operation. As the ret has no
      meaning in trace_ath10k_wmi_cmd then, so remove this parameter too.
      Signed-off-by: default avatarCarl Huang <cjhuang@codeaurora.org>
      Tested-by: default avatarBrian Norris <briannorris@chromium.org>
      Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9ef0f58e
    • Ramon Fried's avatar
      wcn36xx: reduce verbosity of drivers messages · 6b8a127b
      Ramon Fried authored
      Whenever the WLAN interface is started the FW
      version and caps are printed.
      The caps now will be displayed only in debug mode.
      Firmware version will be displayed only once on first
      startup of the interface.
      
      Change-Id: I4db6ea7f384fe15eebe4c3ddb1d1ccab00094332
      Signed-off-by: default avatarRamon Fried <rfried@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6b8a127b
    • Sriram R's avatar
      ath: fix false radar detection in JP region · ba21ac6c
      Sriram R authored
      This fixes false radar detection (of radar type 7)
      in Japan region by correcting the radar pulse type
      to Chirp as per specification.
      Signed-off-by: default avatarSriram R <srirrama@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ba21ac6c
    • Maharaja Kennadyrajan's avatar
      ath10k: debugfs support to get final TPC stats for 10.4 variants · bc64d052
      Maharaja Kennadyrajan authored
      Export the final Transmit Power Control (TPC) value, which is the
      minimum of control power and existing TPC value to user space via
      a new debugfs file "tpc_stats_final" to help with debugging.
      It works with the new wmi cmd and event introduced in 10.4 firmware
      branch.
      
      WMI command ID: WMI_PDEV_GET_TPC_TABLE_CMDID
      WMI event ID: WMI_PDEV_TPC_TABLE_EVENTID
      
      cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
      
      $ cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
      
      TPC config for channel 5180 mode 10
      
      CTL             =  0x 0 Reg. Domain             = 58
      Antenna Gain    =  0 Reg. Max Antenna Gain      =   0
      Power Limit     = 60 Reg. Max Power             = 60
      Num tx chains   =  2 Num supported rates        = 109
      
      ******************* CDD POWER TABLE ****************
      
      No.  Preamble Rate_code tpc_value1 tpc_value2 tpc_value3
      0    CCK      0x40        0          0
      1    CCK      0x41        0          0
      [...]
      107  HTCUP    0x 0       46          46
      108  HTCUP    0x 0       46          46
      
      ******************* STBC POWER TABLE ****************
      
      No.  Preamble Rate_code tpc_value1 tpc_value2 tpc_value3
      0    CCK      0x40        0          0
      1    CCK      0x41        0          0
      [...]
      107  HTCUP    0x 0        46         46
      108  HTCUP    0x 0        46         46
      
      ***********************************
      TXBF not supported
      **********************************
      
      The existing tpc_stats debugfs file provides the dump
      which is minimum of target power and regulatory domain.
      
      cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
      
      Hardware_used: QCA4019
      Firmware version: firmware-5.bin_10.4-3.0-00209
      Signed-off-by: default avatarMaharaja Kennadyrajan <mkenna@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      bc64d052
    • Vasanthakumar Thiagarajan's avatar
      ath10k: add sta rx packet stats per tid · caee728a
      Vasanthakumar Thiagarajan authored
      Added per tid sta counters for the following
      
      - Total number MSDUs received from firmware
      - Number of MSDUs received with errors like decryption, crc, mic ,etc.
      - Number of MSDUs dropped in the driver
      - A-MPDU/A-MSDU subframe stats
      - Number of MSDUS passed to mac80211
      
      All stats other than A-MPDU stats are only for received data frames.
      A-MPDU stats might have stats for management frames when monitor
      interface is active where management frames are notified both in wmi
      and HTT interfaces.
      
      These per tid stats can be enabled with tid bitmask through a debugfs
      like below
      
       echo <tid_bitmask> > /sys/kernel/debug/ieee80211/phyX/ath10k/sta_tid_stats_mask
      
       tid 16 (tid_bitmask 0x10000) is used for non-qos data/management frames
      
      The stats are read from
      /sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/<sta_mac>/dump_tid_stats
      
      Sample output:
      
       To enable rx stats for tid 0, 5 and 6,
      
       echo 0x00000061 > /sys/kernel/debug/ieee80211/phy0/ath10k/sta_tid_stats_mask
      
      cat /sys/kernel/debug/ieee80211/phy0/netdev\:wlan15/stations/8c\:fd\:f0\:0a\:8e\:df/dump_tid_stats
      
        		Driver Rx pkt stats per tid, ([tid] count)
                      ------------------------------------------
      MSDUs from FW                   [00] 2567        [05] 3178        [06] 1089
      MSDUs unchained                 [00] 0           [05] 0           [06] 0
      MSDUs locally dropped:chained   [00] 0           [05] 0           [06] 0
      MSDUs locally dropped:filtered  [00] 0           [05] 0           [06] 0
      MSDUs queued for mac80211       [00] 2567        [05] 3178        [06] 1089
      MSDUs with error:fcs_err        [00] 0           [05] 0           [06] 2
      MSDUs with error:tkip_err       [00] 0           [05] 0           [06] 0
      MSDUs with error:crypt_err      [00] 0           [05] 0           [06] 0
      MSDUs with error:peer_idx_inval [00] 0           [05] 0           [06] 0
      
      A-MPDU num subframes upto 10    [00] 2567        [05] 3178        [06] 1087
      A-MPDU num subframes 11-20      [00] 0           [05] 0           [06] 0
      A-MPDU num subframes 21-30      [00] 0           [05] 0           [06] 0
      A-MPDU num subframes 31-40      [00] 0           [05] 0           [06] 0
      A-MPDU num subframes 41-50      [00] 0           [05] 0           [06] 0
      A-MPDU num subframes 51-60      [00] 0           [05] 0           [06] 0
      A-MPDU num subframes >60        [00] 0           [05] 0           [06] 0
      
      A-MSDU num subframes 1          [00] 2567        [05] 3178        [06] 1089
      A-MSDU num subframes 2          [00] 0           [05] 0           [06] 0
      A-MSDU num subframes 3          [00] 0           [05] 0           [06] 0
      A-MSDU num subframes 4          [00] 0           [05] 0           [06] 0
      A-MSDU num subframes >4         [00] 0           [05] 0           [06] 0
      Signed-off-by: default avatarVasanthakumar Thiagarajan <vthiagar@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      caee728a
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-next-for-davem-2018-03-24' of... · 996bfed1
      David S. Miller authored
      Merge tag 'wireless-drivers-next-for-davem-2018-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for 4.17
      
      The biggest changes are the bluetooth related patches to the rsi
      driver. It adds a new bluetooth driver which communicates directly
      with the wireless driver and the interface is defined in
      include/net/rsi_91x.h.
      
      Major changes:
      
      wl1251
      
      * read the MAC address from the NVS file
      
      rtlwifi
      
      * enable mac80211 fast-tx support
      
      mt76
      
      * add capability to select tx/rx antennas
      
      mt7601
      
      * let mac80211 validate rx CCMP Packet Number (PN)
      
      rsi
      
      * bluetooth: add new btrsi driver
      
      * btcoex support with the new btrsi driver
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      996bfed1
    • kbuild test robot's avatar
      tipc: tipc_disc_addr_trial_msg() can be static · da18ab32
      kbuild test robot authored
      Fixes: 25b0b9c4 ("tipc: handle collisions of 32-bit node address hash values")
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Acked-by: Jon Maloy jon.maloy@ericsson.com
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da18ab32
    • Dan Carpenter's avatar
      ibmvnic: Potential NULL dereference in clean_one_tx_pool() · 050e85c9
      Dan Carpenter authored
      There is an && vs || typo here, which potentially leads to a NULL
      dereference.
      
      Fixes: e9e1e978 ("ibmvnic: Update TX pool cleaning routine")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      050e85c9
    • Ganesh Goudar's avatar
      cxgb4: support new ISSI flash parts · 0f1417f9
      Ganesh Goudar authored
      Add support for new 32MB and 64MB ISSI (Integrated Silicon
      Solution, Inc.) FLASH parts.
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f1417f9
    • Ganesh Goudar's avatar
      cxgb4: depend on firmware event for link status · b46f7da1
      Ganesh Goudar authored
      Depend on the firmware sending us link status changes,
      rather than assuming that the link goes down upon L1
      configuration.
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b46f7da1
    • Arjun Vynipadath's avatar
      cxgb4: copy vlan_id in ndo_get_vf_config · bd79acee
      Arjun Vynipadath authored
      Copy vlan_id to get it displayed in vf info.
      Signed-off-by: default avatarArjun Vynipadath <arjun@chelsio.com>
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarGanesh Goudhar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd79acee
    • Arjun Vynipadath's avatar
      cxgb4: Setup FW queues before registering netdev · 843bd7db
      Arjun Vynipadath authored
      When NetworkManager is enabled, there are chances that interface up
      is called even before probe completes. This means we have not yet
      allocated the FW sge queues, hence rest of ingress queue allocation
      wont be proper. Fix this by calling setup_fw_sge_queues() before
      register_netdev().
      
      Fixes: 0fbc81b3 ('chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's')
      Signed-off-by: default avatarArjun Vynipadath <arjun@chelsio.com>
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      843bd7db
    • David S. Miller's avatar
      Merge branch 'broadcom-Adaptive-interrupt-coalescing' · 2db95690
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      net: broadcom: Adaptive interrupt coalescing
      
      This patch series adds adaptive interrupt coalescing for the Gigabit Ethernet
      drivers SYSTEMPORT and GENET.
      
      This really helps lower the interrupt count and system load, as measured by
      vmstat for a Gigabit TCP RX session:
      
      SYSTEMPORT:
      
      without:
      
       1  0      0 192188      0  25472    0    0     0     0 122100 38870  1 42 57  0  0
      [ ID] Interval       Transfer     Bandwidth
      [  4]  0.0-10.0 sec  1.03 GBytes   884 Mbits/sec
      
      with:
      
       1  0      0 192288      0  25468    0    0     0     0 58806 44401  0 100  0  0  0
      [  5]  0.0-10.0 sec  1.04 GBytes   888 Mbits/sec
      
      GENET:
      
      without:
      
       1  0      0 1170404      0  25420    0    0     0     0 130785 63402  2 85 12  0  0
      [ ID] Interval       Transfer     Bandwidth
      [  4]  0.0-10.0 sec  1.04 GBytes   888 Mbits/sec
      
      with:
      
       1  0      0 1170560      0  25420    0    0     0     0 50610 48477  0 100  0  0  0
      [  5]  0.0-10.0 sec  1.05 GBytes   899 Mbits/sec
      
      Please look at the implementation and let me know if you see any problems, this
      was largely inspired by bnxt_en.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2db95690
    • Florian Fainelli's avatar
      net: bcmgenet: Add support for adaptive RX coalescing · 9f4ca058
      Florian Fainelli authored
      Unlike the moder modern SYSTEMPORT hardware, we do not have a
      configurable TDMA timeout, which limits us to implement adaptive RX
      interrupt coalescing only. We have each of our RX rings implement a
      bcmgenet_net_dim structure which holds an interrupt counter, number of
      packets, bytes, and a container for a net_dim instance.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f4ca058
    • Florian Fainelli's avatar
      net: systemport: Implement adaptive interrupt coalescing · b6e0e875
      Florian Fainelli authored
      Implement support for adaptive RX and TX interrupt coalescing using
      net_dim. We have each of our TX ring and our single RX ring implement a
      bcm_sysport_net_dim structure which holds an interrupt counter, number
      of packets, bytes, and a container for a net_dim instance.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6e0e875
    • David S. Miller's avatar
      Merge branch 'mv88e6xxx-module-reloading' · 9259f134
      David S. Miller authored
      Andrew Lunn says:
      
      ====================
      Fixes to allow mv88e6xxx module to be reloaded
      
      As reported by Uwe Kleine-König, the interrupt trigger is first
      configured by DT and then reconfigured to edge. This results in a
      failure on EPROBE_DEFER, or if the module is unloaded and reloaded.
      
      A second crash happens on module reload due to a missing call to the
      common IRQ free code when using polled interrupts.
      
      With these fixes in place, it becomes possible to load and unload the
      kernel modules a few times without it crashing.
      
      v2: Fix the ü in Künig a couple of times
      v3: But the ü should be an ö!
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9259f134
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Call the common IRQ free code · 71f74ae4
      Andrew Lunn authored
      When free'ing the polled IRQs, call the common irq free code.
      Otherwise the interrupts are left registered, and when we come to load
      the driver a second time, we get an Opps.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71f74ae4
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Use the DT IRQ trigger mode · 422a9fd6
      Andrew Lunn authored
      By calling request_threaded_irq() with the flag IRQF_TRIGGER_FALLING
      we override the trigger mode provided in device tree. And the
      interrupt is actually active low, which is what all the current device
      tree descriptions use.
      Suggested-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Tested-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      422a9fd6
    • Roman Mashak's avatar
      tc-testing: updated police, mirred, skbedit and skbmod with more tests · 808679e7
      Roman Mashak authored
      Added extra test cases for control actions (reclassify, pipe etc.),
      cookies, max index value and police args sanity check.
      Signed-off-by: default avatarRoman Mashak <mrv@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      808679e7
  3. 25 Mar, 2018 5 commits
    • David S. Miller's avatar
      Merge branch 'hv_netvsc-Fix-improve-RX-path-error-handling' · 9e096868
      David S. Miller authored
      Haiyang Zhang says:
      
      ====================
      hv_netvsc: Fix/improve RX path error handling
      
      Fix the status code returned to the host. Also add range
      check for rx packet offset and length.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e096868
    • Haiyang Zhang's avatar
      hv_netvsc: Add range checking for rx packet offset and length · c5d24bdd
      Haiyang Zhang authored
      This patch adds range checking for rx packet offset and length.
      It may only happen if there is a host side bug.
      Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5d24bdd
    • Haiyang Zhang's avatar
      hv_netvsc: Fix the return status in RX path · 5c71dadb
      Haiyang Zhang authored
      As defined in hyperv_net.h, the NVSP_STAT_SUCCESS is one not zero.
      Some functions returns 0 when it actually means NVSP_STAT_SUCCESS.
      This patch fixes them.
      
      In netvsc_receive(), it puts the last RNDIS packet's receive status
      for all packets in a vmxferpage which may contain multiple RNDIS
      packets.
      This patch puts NVSP_STAT_FAIL in the receive completion if one of
      the packets in a vmxferpage fails.
      Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c71dadb
    • David S. Miller's avatar
      Merge branch 'net-permit-skb_segment-on-head_frag-frag_list-skb' · 74b4bed9
      David S. Miller authored
      Yonghong Song says:
      
      ====================
      net: permit skb_segment on head_frag frag_list skb
      
      One of our in-house projects, bpf-based NAT, hits a kernel BUG_ON at
      function skb_segment(), line 3667. The bpf program attaches to
      clsact ingress, calls bpf_skb_change_proto to change protocol
      from ipv4 to ipv6 or from ipv6 to ipv4, and then calls bpf_redirect
      to send the changed packet out.
       ...
          3665                 while (pos < offset + len) {
          3666                         if (i >= nfrags) {
          3667                                 BUG_ON(skb_headlen(list_skb));
       ...
      
      The triggering input skb has the following properties:
          list_skb = skb->frag_list;
          skb->nfrags != NULL && skb_headlen(list_skb) != 0
      and skb_segment() is not able to handle a frag_list skb
      if its headlen (list_skb->len - list_skb->data_len) is not 0.
      
      Patch #1 provides a simple solution to avoid BUG_ON. If
      list_skb->head_frag is true, its page-backed frag will
      be processed before the list_skb->frags.
      Patch #2 provides a test case in test_bpf module which
      constructs a skb and calls skb_segment() directly. The test
      case is able to trigger the BUG_ON without Patch #1.
      
      The patch has been tested in the following setup:
        ipv6_host <-> nat_server <-> ipv4_host
      where nat_server has a bpf program doing ipv4<->ipv6
      translation and forwarding through clsact hook
      bpf_skb_change_proto.
      
      Changelog:
      v5 -> v6:
        . Added back missed BUG_ON(!nfrags) for zero
          skb_headlen(skb) case, plus a couple of
          cosmetic changes, from Alexander.
      v4 -> v5:
        . Replace local variable head_frag with
          a static inline function skb_head_frag_to_page_desc
          which gets the head_frag on-demand. This makes
          code more readable and also does not increase
          the stack size, from Alexander.
        . Remove the "if(nfrags)" guard for skb_orphan_frags
          and skb_zerocopy_clone as I found that they can
          handle zero-frag skb (with non-zero skb_headlen(skb))
          properly.
        . Properly release segment list from skb_segment()
          in the test, from Eric.
      v3 -> v4:
        . Remove dynamic memory allocation and use rewinding
          for both index and frag to remove one branch in fast path,
          from Alexander.
        . Fix a bunch of issues in test_bpf skb_segment() test,
          including proper way to allocate skb, proper function
          argument for skb_add_rx_frag and not freeint skb, etc.,
          from Eric.
      v2 -> v3:
        . Use starting frag index -1 (instead of 0) to
          special process head_frag before other frags in the skb,
          from Alexander Duyck.
      v1 -> v2:
        . Removed never-hit BUG_ON, spotted by Linyu Yuan.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74b4bed9
    • Yonghong Song's avatar
      net: bpf: add a test for skb_segment in test_bpf module · 76db8087
      Yonghong Song authored
      Without the previous commit,
      "modprobe test_bpf" will have the following errors:
      ...
      [   98.149165] ------------[ cut here ]------------
      [   98.159362] kernel BUG at net/core/skbuff.c:3667!
      [   98.169756] invalid opcode: 0000 [#1] SMP PTI
      [   98.179370] Modules linked in:
      [   98.179371]  test_bpf(+)
      ...
      which triggers the bug the previous commit intends to fix.
      
      The skbs are constructed to mimic what mlx5 may generate.
      The packet size/header may not mimic real cases in production. But
      the processing flow is similar.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76db8087