1. 30 Jan, 2019 10 commits
    • Vasundhara Volam's avatar
      bnxt_en: Add bnxt_en initial port params table and register it · 782a624d
      Vasundhara Volam authored
      Register devlink_port with devlink and create initial port params
      table for bnxt_en. The table consists of a generic parameter:
      
      wake_on_lan: Enables Wake on Lan for this port when magic packet
      is received with this port's MAC address using ACPI pattern.
      If enabled, the controller asserts a wake pin upon reception of
      WoL packet.  ACPI (Advanced Configuration and Power Interface) is
      an industry specification for the efficient handling of power
      consumption in desktop and mobile computers.
      
      v2->v3:
      - Modify bnxt_dl_wol_validate(), to throw error message when user gives
        value other than DEVLINK_PARAM_WAKE_MAGIC ot to disable WOL.
      - Use netdev_err() instead of netdev_warn(), when devlink_port_register()
        and devlink_port_params_register() returns error. Also, don't log rc
        in this message.
      
      Cc: Michael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      782a624d
    • Vasundhara Volam's avatar
      devlink: Add a generic wake_on_lan port parameter · b639583f
      Vasundhara Volam authored
      wake_on_lan - Enables Wake on Lan for this port. If enabled,
      the controller asserts a wake pin based on the WOL type.
      
      v2->v3:
      - Define only WOL types used now and define them as bitfield, so that
        mutliple WOL types can be enabled upon power on.
      - Modify "wake-on-lan" name to "wake_on_lan" to be symmetric with
        previous definitions.
      - Rename DEVLINK_PARAM_WOL_XXX to DEVLINK_PARAM_WAKE_XXX to be
        symmetrical with ethtool WOL definitions.
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b639583f
    • Vasundhara Volam's avatar
      devlink: Add devlink notifications support for port params · c1e5786d
      Vasundhara Volam authored
      Add notification call for devlink port param set, register and unregister
      functions.
      Add devlink_port_param_value_changed() function to enable the driver notify
      devlink on value change. Driver should use this function after value was
      changed on any configuration mode part to driverinit.
      
      v7->v8:
      Order devlink_port_param_value_changed() definitions followed by
      devlink_param_value_changed()
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1e5786d
    • Vasundhara Volam's avatar
      devlink: Add support for driverinit set value for devlink_port · 5473a7bd
      Vasundhara Volam authored
      Add support for "driverinit" configuration mode value for devlink_port
      configuration parameters. Add devlink_port_param_driverinit_value_set()
      function to help the driver set the value to devlink_port.
      
      Also, move the common code to __devlink_param_driverinit_value_set()
      to be used by both device and port params.
      
      v7->v8:
      Re-order the definitions as follows:
      __devlink_param_driverinit_value_get
      __devlink_param_driverinit_value_set
      devlink_param_driverinit_value_get
      devlink_param_driverinit_value_set
      devlink_port_param_driverinit_value_get
      devlink_port_param_driverinit_value_set
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5473a7bd
    • Vasundhara Volam's avatar
      devlink: Add support for driverinit get value for devlink_port · ffd19b9a
      Vasundhara Volam authored
      Add support for "driverinit" configuration mode value for devlink_port
      configuration parameters. Add devlink_port_param_driverinit_value_get()
      function to help the driver get the value from devlink_port.
      
      Also, move the common code to __devlink_param_driverinit_value_get()
      to be used by both device and port params.
      
      v7->v8:
      -Add the missing devlink_port_param_driverinit_value_get() declaration.
      -Also, order devlink_port_param_driverinit_value_get() after
      devlink_param_driverinit_value_get/set() calls
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ffd19b9a
    • Vasundhara Volam's avatar
      devlink: Add port param set command · 9c54873b
      Vasundhara Volam authored
      Add port param set command to set the value for a parameter.
      Value can be set to any of the supported configuration modes.
      
      v7->v8: Append "Acked-by: Jiri Pirko <jiri@mellanox.com>"
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c54873b
    • Vasundhara Volam's avatar
      devlink: Add port param get command · f4601dee
      Vasundhara Volam authored
      Add port param get command which gets data per parameter.
      It also has option to dump the parameters data per port.
      
      v7->v8: Append "Acked-by: Jiri Pirko <jiri@mellanox.com>"
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4601dee
    • Vasundhara Volam's avatar
      devlink: Add devlink_param for port register and unregister · 39e6160e
      Vasundhara Volam authored
      Add functions to register and unregister for the driver supported
      configuration parameters table per port.
      
      v7->v8:
      - Order the definitions following way as suggested by Jiri.
      __devlink_params_register
      __devlink_params_unregister
      devlink_params_register
      devlink_params_unregister
      devlink_port_params_register
      devlink_port_params_unregister
      - Append with Acked-by: Jiri Pirko <jiri@mellanox.com>.
      
      v2->v3:
      - Add a helper __devlink_params_register() with common code used by
        both devlink_params_register() and devlink_port_params_register().
      
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      39e6160e
    • David S. Miller's avatar
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 62967898
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Need to save away the IV across tls async operations, from Dave
          Watson.
      
       2) Upon successful packet processing, we should liberate the SKB with
          dev_consume_skb{_irq}(). From Yang Wei.
      
       3) Only apply RX hang workaround on effected macb chips, from Harini
          Katakam.
      
       4) Dummy netdev need a proper namespace assigned to them, from Josh
          Elsasser.
      
       5) Some paths of nft_compat run lockless now, and thus we need to use a
          proper refcnt_t. From Florian Westphal.
      
       6) Avoid deadlock in mlx5 by doing IRQ locking, from Moni Shoua.
      
       7) netrom does not refcount sockets properly wrt. timers, fix that by
          using the sock timer API. From Cong Wang.
      
       8) Fix locking of inexact inserts of xfrm policies, from Florian
          Westphal.
      
       9) Missing xfrm hash generation bump, also from Florian.
      
      10) Missing of_node_put() in hns driver, from Yonglong Liu.
      
      11) Fix DN_IFREQ_SIZE, from Johannes Berg.
      
      12) ip6mr notifier is invoked during traversal of wrong table, from Nir
          Dotan.
      
      13) TX promisc settings not performed correctly in qed, from Manish
          Chopra.
      
      14) Fix OOB access in vhost, from Jason Wang.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
        MAINTAINERS: Add entry for XDP (eXpress Data Path)
        net: set default network namespace in init_dummy_netdev()
        net: b44: replace dev_kfree_skb_xxx by dev_consume_skb_xxx for drop profiles
        net: caif: call dev_consume_skb_any when skb xmit done
        net: 8139cp: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: macb: Apply RXUBR workaround only to versions with errata
        net: ti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: apple: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: amd8111e: replace dev_kfree_skb_irq by dev_consume_skb_irq
        net: alteon: replace dev_kfree_skb_irq by dev_consume_skb_irq
        net: tls: Fix deadlock in free_resources tx
        net: tls: Save iv in tls_rec for async crypto requests
        vhost: fix OOB in get_rx_bufs()
        qed: Fix stack out of bounds bug
        qed: Fix system crash in ll2 xmit
        qed: Fix VF probe failure while FLR
        qed: Fix LACP pdu drops for VFs
        qed: Fix bug in tx promiscuous mode settings
        net: i825xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        netfilter: ipt_CLUSTERIP: fix warning unused variable cn
        ...
      62967898
  2. 29 Jan, 2019 25 commits
  3. 28 Jan, 2019 5 commits
    • Jakub Kicinski's avatar
      tools: bpftool: warn about risky prog array updates · d76198b0
      Jakub Kicinski authored
      When prog array is updated with bpftool users often refer
      to the map via the ID.  Unfortunately, that's likely
      to lead to confusion because prog arrays get flushed when
      the last user reference is gone.  If there is no other
      reference bpftool will create one, update successfully
      just to close the map again and have it flushed.
      
      Warn about this case in non-JSON mode.
      
      If the problem continues causing confusion we can remove
      the support for referring to a map by ID for prog array
      update completely.  For now it seems like the potential
      inconvenience to users who know what they're doing outweighs
      the benefit.
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      d76198b0
    • YueHaibing's avatar
      selftests: bpf: remove duplicated include · cdd7b406
      YueHaibing authored
      Remove duplicated include.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      cdd7b406
    • David S. Miller's avatar
      Merge branch 'qed-Bug-fixes' · bfe2599d
      David S. Miller authored
      Manish Chopra says:
      
      ====================
      qed: Bug fixes
      
      This series have SR-IOV and some general fixes.
      Please consider applying it to "net"
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bfe2599d
    • Manish Chopra's avatar
      qed: Fix stack out of bounds bug · ffb057f9
      Manish Chopra authored
      KASAN reported following bug in qed_init_qm_get_idx_from_flags
      due to inappropriate casting of "pq_flags". Fix the type of "pq_flags".
      
      [  196.624707] BUG: KASAN: stack-out-of-bounds in qed_init_qm_get_idx_from_flags+0x1a4/0x1b8 [qed]
      [  196.624712] Read of size 8 at addr ffff809b00bc7360 by task kworker/0:9/1712
      [  196.624714]
      [  196.624720] CPU: 0 PID: 1712 Comm: kworker/0:9 Not tainted 4.18.0-60.el8.aarch64+debug #1
      [  196.624723] Hardware name: To be filled by O.E.M. Saber/Saber, BIOS 0ACKL024 09/26/2018
      [  196.624733] Workqueue: events work_for_cpu_fn
      [  196.624738] Call trace:
      [  196.624742]  dump_backtrace+0x0/0x2f8
      [  196.624745]  show_stack+0x24/0x30
      [  196.624749]  dump_stack+0xe0/0x11c
      [  196.624755]  print_address_description+0x68/0x260
      [  196.624759]  kasan_report+0x178/0x340
      [  196.624762]  __asan_report_load_n_noabort+0x38/0x48
      [  196.624786]  qed_init_qm_get_idx_from_flags+0x1a4/0x1b8 [qed]
      [  196.624808]  qed_init_qm_info+0xec0/0x2200 [qed]
      [  196.624830]  qed_resc_alloc+0x284/0x7e8 [qed]
      [  196.624853]  qed_slowpath_start+0x6cc/0x1ae8 [qed]
      [  196.624864]  __qede_probe.isra.10+0x1cc/0x12c0 [qede]
      [  196.624874]  qede_probe+0x78/0xf0 [qede]
      [  196.624879]  local_pci_probe+0xc4/0x180
      [  196.624882]  work_for_cpu_fn+0x54/0x98
      [  196.624885]  process_one_work+0x758/0x1900
      [  196.624888]  worker_thread+0x4e0/0xd18
      [  196.624892]  kthread+0x2c8/0x350
      [  196.624897]  ret_from_fork+0x10/0x18
      [  196.624899]
      [  196.624902] Allocated by task 2:
      [  196.624906]  kasan_kmalloc.part.1+0x40/0x108
      [  196.624909]  kasan_kmalloc+0xb4/0xc8
      [  196.624913]  kasan_slab_alloc+0x14/0x20
      [  196.624916]  kmem_cache_alloc_node+0x1dc/0x480
      [  196.624921]  copy_process.isra.1.part.2+0x1d8/0x4a98
      [  196.624924]  _do_fork+0x150/0xfa0
      [  196.624926]  kernel_thread+0x48/0x58
      [  196.624930]  kthreadd+0x3a4/0x5a0
      [  196.624932]  ret_from_fork+0x10/0x18
      [  196.624934]
      [  196.624937] Freed by task 0:
      [  196.624938] (stack is not available)
      [  196.624940]
      [  196.624943] The buggy address belongs to the object at ffff809b00bc0000
      [  196.624943]  which belongs to the cache thread_stack of size 32768
      [  196.624946] The buggy address is located 29536 bytes inside of
      [  196.624946]  32768-byte region [ffff809b00bc0000, ffff809b00bc8000)
      [  196.624948] The buggy address belongs to the page:
      [  196.624952] page:ffff7fe026c02e00 count:1 mapcount:0 mapping:ffff809b4001c000 index:0x0 compound_mapcount: 0
      [  196.624960] flags: 0xfffff8000008100(slab|head)
      [  196.624967] raw: 0fffff8000008100 dead000000000100 dead000000000200 ffff809b4001c000
      [  196.624970] raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
      [  196.624973] page dumped because: kasan: bad access detected
      [  196.624974]
      [  196.624976] Memory state around the buggy address:
      [  196.624980]  ffff809b00bc7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624983]  ffff809b00bc7280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624985] >ffff809b00bc7300: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f2 f2 f2
      [  196.624988]                                                        ^
      [  196.624990]  ffff809b00bc7380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624993]  ffff809b00bc7400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624995] ==================================================================
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ffb057f9
    • Manish Chopra's avatar
      qed: Fix system crash in ll2 xmit · 7c81626a
      Manish Chopra authored
      Cache number of fragments in the skb locally as in case
      of linear skb (with zero fragments), tx completion
      (or freeing of skb) may happen before driver tries
      to get number of frgaments from the skb which could
      lead to stale access to an already freed skb.
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c81626a