1. 02 5月, 2020 6 次提交
    • Y
      gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() · 846c68f7
      Yoshiyuki Kurauchi 提交于
      In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI
      flag since it returns multipart message.
      This patch adds a new arg "flags" in gtp_genl_fill_info() so that
      flags can be set by the callers.
      Signed-off-by: NYoshiyuki Kurauchi <ahochauwaaaaa@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      846c68f7
    • J
      cxgb4: Add missing annotation for service_ofldq() · cae9566a
      Jules Irenge 提交于
      Sparse reports a warning at service_ofldq()
      
      warning: context imbalance in service_ofldq() - unexpected unlock
      
      The root cause is the missing annotation at service_ofldq()
      
      Add the missing __must_hold(&q->sendq.lock) annotation
      Signed-off-by: NJules Irenge <jbi.octave@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cae9566a
    • C
      net: Make PTP-specific drivers depend on PTP_1588_CLOCK · b6d49cab
      Clay McClure 提交于
      Commit d1cbfd77 ("ptp_clock: Allow for it to be optional") changed
      all PTP-capable Ethernet drivers from `select PTP_1588_CLOCK` to `imply
      PTP_1588_CLOCK`, "in order to break the hard dependency between the PTP
      clock subsystem and ethernet drivers capable of being clock providers."
      As a result it is possible to build PTP-capable Ethernet drivers without
      the PTP subsystem by deselecting PTP_1588_CLOCK. Drivers are required to
      handle the missing dependency gracefully.
      
      Some PTP-capable Ethernet drivers (e.g., TI_CPSW) factor their PTP code
      out into separate drivers (e.g., TI_CPTS_MOD). The above commit also
      changed these PTP-specific drivers to `imply PTP_1588_CLOCK`, making it
      possible to build them without the PTP subsystem. But as Grygorii
      Strashko noted in [1]:
      
      On Wed, Apr 22, 2020 at 02:16:11PM +0300, Grygorii Strashko wrote:
      
      > Another question is that CPTS completely nonfunctional in this case and
      > it was never expected that somebody will even try to use/run such
      > configuration (except for random build purposes).
      
      In my view, enabling a PTP-specific driver without the PTP subsystem is
      a configuration error made possible by the above commit. Kconfig should
      not allow users to create a configuration with missing dependencies that
      results in "completely nonfunctional" drivers.
      
      I audited all network drivers that call ptp_clock_register() but merely
      `imply PTP_1588_CLOCK` and found five PTP-specific drivers that are
      likely nonfunctional without PTP_1588_CLOCK:
      
          NET_DSA_MV88E6XXX_PTP
          NET_DSA_SJA1105_PTP
          MACB_USE_HWSTAMP
          CAVIUM_PTP
          TI_CPTS_MOD
      
      Note how these symbols all reference PTP or timestamping in their name;
      this is a clue that they depend on PTP_1588_CLOCK.
      
      Change them from `imply PTP_1588_CLOCK` [2] to `depends on PTP_1588_CLOCK`.
      I'm not using `select PTP_1588_CLOCK` here because PTP_1588_CLOCK has
      its own dependencies, which `select` would not transitively apply.
      
      Additionally, remove the `select NET_PTP_CLASSIFY` from CPTS_TI_MOD;
      PTP_1588_CLOCK already selects that.
      
      [1]: https://lore.kernel.org/lkml/c04458ed-29ee-1797-3a11-7f3f560553e6@ti.com/
      
      [2]: NET_DSA_SJA1105_PTP had never declared any type of dependency on
      PTP_1588_CLOCK (`imply` or otherwise); adding a `depends on PTP_1588_CLOCK`
      here seems appropriate.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Nicolas Pitre <nico@fluxnic.net>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Fixes: d1cbfd77 ("ptp_clock: Allow for it to be optional")
      Signed-off-by: NClay McClure <clay@daemons.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b6d49cab
    • N
      hv_netvsc: Fix netvsc_start_xmit's return type · 7fdc66de
      Nathan Chancellor 提交于
      netvsc_start_xmit is used as a callback function for the ndo_start_xmit
      function pointer. ndo_start_xmit's return type is netdev_tx_t but
      netvsc_start_xmit's return type is int.
      
      This causes a failure with Control Flow Integrity (CFI), which requires
      function pointer prototypes and callback function definitions to match
      exactly. When CFI is in enforcing, the kernel panics. When booting a
      CFI kernel with WSL 2, the VM is immediately terminated because of this.
      
      The splat when CONFIG_CFI_PERMISSIVE is used:
      
      [    5.916765] CFI failure (target: netvsc_start_xmit+0x0/0x10):
      [    5.916771] WARNING: CPU: 8 PID: 0 at kernel/cfi.c:29 __cfi_check_fail+0x2e/0x40
      [    5.916772] Modules linked in:
      [    5.916774] CPU: 8 PID: 0 Comm: swapper/8 Not tainted 5.7.0-rc3-next-20200424-microsoft-cbl-00001-ged4eb37d2c69-dirty #1
      [    5.916776] RIP: 0010:__cfi_check_fail+0x2e/0x40
      [    5.916777] Code: 48 c7 c7 70 98 63 a9 48 c7 c6 11 db 47 a9 e8 69 55 59 00 85 c0 75 02 5b c3 48 c7 c7 73 c6 43 a9 48 89 de 31 c0 e8 12 2d f0 ff <0f> 0b 5b c3 00 00 cc cc 00 00 cc cc 00 00 cc cc 00 00 85 f6 74 25
      [    5.916778] RSP: 0018:ffffa803c0260b78 EFLAGS: 00010246
      [    5.916779] RAX: 712a1af25779e900 RBX: ffffffffa8cf7950 RCX: ffffffffa962cf08
      [    5.916779] RDX: ffffffffa9c36b60 RSI: 0000000000000082 RDI: ffffffffa9c36b5c
      [    5.916780] RBP: ffff8ffc4779c2c0 R08: 0000000000000001 R09: ffffffffa9c3c300
      [    5.916781] R10: 0000000000000151 R11: ffffffffa9c36b60 R12: ffff8ffe39084000
      [    5.916782] R13: ffffffffa8cf7950 R14: ffffffffa8d12cb0 R15: ffff8ffe39320140
      [    5.916784] FS:  0000000000000000(0000) GS:ffff8ffe3bc00000(0000) knlGS:0000000000000000
      [    5.916785] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    5.916786] CR2: 00007ffef5749408 CR3: 00000002f4f5e000 CR4: 0000000000340ea0
      [    5.916787] Call Trace:
      [    5.916788]  <IRQ>
      [    5.916790]  __cfi_check+0x3ab58/0x450e0
      [    5.916793]  ? dev_hard_start_xmit+0x11f/0x160
      [    5.916795]  ? sch_direct_xmit+0xf2/0x230
      [    5.916796]  ? __dev_queue_xmit.llvm.11471227737707190958+0x69d/0x8e0
      [    5.916797]  ? neigh_resolve_output+0xdf/0x220
      [    5.916799]  ? neigh_connected_output.cfi_jt+0x8/0x8
      [    5.916801]  ? ip6_finish_output2+0x398/0x4c0
      [    5.916803]  ? nf_nat_ipv6_out+0x10/0xa0
      [    5.916804]  ? nf_hook_slow+0x84/0x100
      [    5.916807]  ? ip6_input_finish+0x8/0x8
      [    5.916807]  ? ip6_output+0x6f/0x110
      [    5.916808]  ? __ip6_local_out.cfi_jt+0x8/0x8
      [    5.916810]  ? mld_sendpack+0x28e/0x330
      [    5.916811]  ? ip_rt_bug+0x8/0x8
      [    5.916813]  ? mld_ifc_timer_expire+0x2db/0x400
      [    5.916814]  ? neigh_proxy_process+0x8/0x8
      [    5.916816]  ? call_timer_fn+0x3d/0xd0
      [    5.916817]  ? __run_timers+0x2a9/0x300
      [    5.916819]  ? rcu_core_si+0x8/0x8
      [    5.916820]  ? run_timer_softirq+0x14/0x30
      [    5.916821]  ? __do_softirq+0x154/0x262
      [    5.916822]  ? native_x2apic_icr_write+0x8/0x8
      [    5.916824]  ? irq_exit+0xba/0xc0
      [    5.916825]  ? hv_stimer0_vector_handler+0x99/0xe0
      [    5.916826]  ? hv_stimer0_callback_vector+0xf/0x20
      [    5.916826]  </IRQ>
      [    5.916828]  ? hv_stimer_global_cleanup.cfi_jt+0x8/0x8
      [    5.916829]  ? raw_setsockopt+0x8/0x8
      [    5.916830]  ? default_idle+0xe/0x10
      [    5.916832]  ? do_idle.llvm.10446269078108580492+0xb7/0x130
      [    5.916833]  ? raw_setsockopt+0x8/0x8
      [    5.916833]  ? cpu_startup_entry+0x15/0x20
      [    5.916835]  ? cpu_hotplug_enable.cfi_jt+0x8/0x8
      [    5.916836]  ? start_secondary+0x188/0x190
      [    5.916837]  ? secondary_startup_64+0xa5/0xb0
      [    5.916838] ---[ end trace f2683fa869597ba5 ]---
      
      Avoid this by using the right return type for netvsc_start_xmit.
      
      Fixes: fceaf24a ("Staging: hv: add the Hyper-V virtual network driver")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1009Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7fdc66de
    • D
      net: phy: DP83TC811: Fix WoL in config init to be disabled · 6c599044
      Dan Murphy 提交于
      The WoL feature should be disabled when config_init is called and the
      feature should turned on or off  when set_wol is called.
      
      In addition updated the calls to modify the registers to use the set_bit
      and clear_bit function calls.
      
      Fixes: 6d749428788b ("net: phy: DP83TC811: Introduce support for the
      DP83TC811 phy")
      Signed-off-by: NDan Murphy <dmurphy@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c599044
    • D
      net: phy: DP83822: Fix WoL in config init to be disabled · 600ac36b
      Dan Murphy 提交于
      The WoL feature should be disabled when config_init is called and the
      feature should turned on or off  when set_wol is called.
      
      In addition updated the calls to modify the registers to use the set_bit
      and clear_bit function calls.
      
      Fixes: 3b427751a9d0 ("net: phy: DP83822 initial driver submission")
      Signed-off-by: NDan Murphy <dmurphy@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      600ac36b
  2. 01 5月, 2020 21 次提交
  3. 30 4月, 2020 4 次提交
  4. 29 4月, 2020 1 次提交
    • G
      net/ena: Fix build warning in ena_xdp_set() · caec6619
      Gavin Shan 提交于
      This fixes the following build warning in ena_xdp_set(), which is
      observed on aarch64 with 64KB page size.
      
         In file included from ./include/net/inet_sock.h:19,
            from ./include/net/ip.h:27,
            from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
         drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
         ‘ena_xdp_set’:                                                    \
         drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
         format ‘%lu’                                                      \
         expects argument of type ‘long unsigned int’, but argument 4      \
         has type ‘int’                                                    \
         [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
         larger than the maximum allowed MTU (%lu) while xdp is on",
      Signed-off-by: NGavin Shan <gshan@redhat.com>
      Acked-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      caec6619
  5. 28 4月, 2020 8 次提交