1. Oct 04, 2019
  2. Oct 03, 2019
  3. Oct 02, 2019
    • David S. Miller's avatar
      Merge branch 'ionic-driver-updates' · 1f6d768a
      David S. Miller authored
      
      
      Shannon Nelson says:
      
      ====================
      ionic: driver updates
      
      These patches are a few updates to clean up some code
      issues and add an ethtool feature.
      
      v3: drop the Fixes tags as they really aren't fixing bugs
          simplify ionic_lif_quiesce() as no return is necessary
      
      v2: add cover letter
          edit a couple of patch descriptions for clarity
            and add Fixes: tags
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f6d768a
    • Shannon Nelson's avatar
      ionic: add lif_quiesce to wait for queue activity to stop · e982ae6a
      Shannon Nelson authored
      
      
      Even though we've already turned off the queue activity with
      the ionic_qcq_disable(), we need to wait for any device queues
      that are processing packets to drain down before we try to
      flush our packets and tear down the queues.
      
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e982ae6a
    • Shannon Nelson's avatar
      ionic: implement ethtool set-fec · e95f922f
      Shannon Nelson authored
      
      
      Wire up the --set-fec and --show-fec features in the ethtool
      callbacks and pull the related code out of set_link_ksettings.
      
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e95f922f
    • Shannon Nelson's avatar
      ionic: report users coalesce request · 780eded3
      Shannon Nelson authored
      
      
      The user's request for an interrupt coalescing value gets
      translated into a hardware value to be used with the NIC,
      and was getting reported back based on the hw value, which,
      due to hw tic resolution, could be reported as a different
      number than what the user originally asked for.  This code
      now tracks both the user request and what was put into the
      hardware so we can report back to the user what they
      requested.
      
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      780eded3
    • Shannon Nelson's avatar
      ionic: use wait_on_bit_lock() rather than open code · d229be4b
      Shannon Nelson authored
      
      
      Replace the open-coded ionic_wait_for_bit() with the
      kernel's wait_on_bit_lock().
      
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d229be4b
    • Shannon Nelson's avatar
      ionic: simplify returns in devlink info · da0729e8
      Shannon Nelson authored
      
      
      There is no need for a goto in this bit of code.
      
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da0729e8
    • David S. Miller's avatar
      Merge branch 'per-netns-notifier' · df428e40
      David S. Miller authored
      Jiri Pirko says:
      
      ====================
      net: introduce per-netns netdevice notifiers and use them in mlxsw
      
      Some drivers, like mlxsw, are not interested in notifications coming in
      for netdevices from other network namespaces. So introduce per-netns
      notifiers and allow to reduce overhead by listening only for
      notifications from the same netns.
      
      This is also a preparation for upcoming patchset "devlink: allow devlink
      instances to change network namespace". This resolves deadlock during
      reload mlxsw into initial netns made possible by
      328fbe74
      
       ("net: Close race between {un, }register_netdevice_notifier() and setup_net()/cleanup_net()").
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df428e40
    • Jiri Pirko's avatar
      mlxsw: spectrum: Use per-netns netdevice notifier registration · f1cdaa07
      Jiri Pirko authored
      
      
      The mlxsw_sp instance is not interested in events happening in other
      network namespaces. So use "_net" variants for netdevice notifier
      registration/unregistration and get only events which are happening in
      the net the instance is in.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f1cdaa07
    • Jiri Pirko's avatar
      net: introduce per-netns netdevice notifiers · a30c7b42
      Jiri Pirko authored
      
      
      Often the code for example in drivers is interested in getting notifier
      call only from certain network namespace. In addition to the existing
      global netdevice notifier chain introduce per-netns chains and allow
      users to register to that. Eventually this would eliminate unnecessary
      overhead in case there are many netdevices in many network namespaces.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a30c7b42
    • Jiri Pirko's avatar
      net: push loops and nb calls into helper functions · afa0df59
      Jiri Pirko authored
      
      
      Push iterations over net namespaces and netdevices from
      register_netdevice_notifier() and unregister_netdevice_notifier()
      into helper functions. Along with that introduce continue_reverse macros
      to make the code a bit nicer allowing to get rid of "last" marks.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      afa0df59
    • Prashant Malani's avatar
      r8152: Use guard clause and fix comment typos · c01ebd6c
      Prashant Malani authored
      
      
      Use a guard clause in tx_bottom() to reduce the indentation of the
      do-while loop.
      
      Also, fix a couple of spelling and grammatical mistakes in the
      r8152_csum_workaround() function comment.
      
      Change-Id: I460befde150ad92248fd85b0f189ec2df2ab8431
      Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
      Reviewed-by: default avatarGrant Grundler <grundler@chromium.org>
      Acked-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c01ebd6c
    • Matias Ezequiel Vara Larsen's avatar
      vsock/virtio: add support for MSG_PEEK · a786ab36
      Matias Ezequiel Vara Larsen authored
      
      
      This patch adds support for MSG_PEEK. In such a case, packets are not
      removed from the rx_queue and credit updates are not sent.
      
      Signed-off-by: default avatarMatias Ezequiel Vara Larsen <matiasevara@gmail.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Tested-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a786ab36
    • Johan Hovold's avatar
      hso: fix NULL-deref on tty open · 67879919
      Johan Hovold authored
      Fix NULL-pointer dereference on tty open due to a failure to handle a
      missing interrupt-in endpoint when probing modem ports:
      
      	BUG: kernel NULL pointer dereference, address: 0000000000000006
      	...
      	RIP: 0010:tiocmget_submit_urb+0x1c/0xe0 [hso]
      	...
      	Call Trace:
      	hso_start_serial_device+0xdc/0x140 [hso]
      	hso_serial_open+0x118/0x1b0 [hso]
      	tty_open+0xf1/0x490
      
      Fixes: 542f5482
      
       ("tty: Modem functions for the HSO driver")
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67879919
    • Simon Horman's avatar
      dt-bindings: sh_eth convert bindings to json-schema · 37a2fce0
      Simon Horman authored
      
      
      Convert Renesas Electronics SH EtherMAC bindings documentation to
      json-schema.  Also name bindings documentation file according to the compat
      string being documented.
      
      Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37a2fce0
    • Peter Fink's avatar
      net: usb: ax88179_178a: allow optionally getting mac address from device tree · 9fb137ae
      Peter Fink authored
      Adopt and integrate the feature to pass the MAC address via device tree
      from asix_device.c (03fc5d4f
      
      ) also to other ax88179 based asix chips.
      E.g. the bootloader fills in local-mac-address and the driver will then
      pick up and use this MAC address.
      
      Signed-off-by: default avatarPeter Fink <pfink@christ-es.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fb137ae
    • Nicolas Dichtel's avatar
      ipv6: minor code reorg in inet6_fill_ifla6_attrs() · 0d7982ce
      Nicolas Dichtel authored
      
      
      Just put related code together to ease code reading: the memcpy() is
      related to the nla_reserve().
      
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0d7982ce
    • David S. Miller's avatar
      Merge branch 'netdev-altnames' · 7a56493f
      David S. Miller authored
      
      
      Jiri Pirko says:
      
      ====================
      net: introduce alternative names for network interfaces
      
      In the past, there was repeatedly discussed the IFNAMSIZ (16) limit for
      netdevice name length. Now when we have PF and VF representors
      with port names like "pfXvfY", it became quite common to hit this limit:
      0123456789012345
      enp131s0f1npf0vf6
      enp131s0f1npf0vf22
      
      Udev cannot rename these interfaces out-of-the-box and user needs to
      create custom rules to handle them.
      
      Also, udev has multiple schemes of netdev names. From udev code:
       * Type of names:
       *   b<number>                             - BCMA bus core number
       *   c<bus_id>                             - bus id of a grouped CCW or CCW device,
       *                                           with all leading zeros stripped [s390]
       *   o<index>[n<phys_port_name>|d<dev_port>]
       *                                         - on-board device index number
       *   s<slot>[f<function>][n<phys_port_name>|d<dev_port>]
       *                                         - hotplug slot index number
       *   x<MAC>                                - MAC address
       *   [P<domain>]p<bus>s<slot>[f<function>][n<phys_port_name>|d<dev_port>]
       *                                         - PCI geographical location
       *   [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
       *                                         - USB port number chain
       *   v<slot>                               - VIO slot number (IBM PowerVM)
       *   a<vendor><model>i<instance>           - Platform bus ACPI instance id
       *   i<addr>n<phys_port_name>              - Netdevsim bus address and port name
      
      One device can be often renamed by multiple patterns at the
      same time (e.g. pci address/mac).
      
      This patchset introduces alternative names for network interfaces.
      Main goal is to:
      1) Overcome the IFNAMSIZ limitation (altname limitation is 128 bytes)
      2) Allow to have multiple names at the same time (multiple udev patterns)
      3) Allow to use alternative names as handle for commands
      
      The patchset introduces two new commands to add/delete list of properties.
      Currently only alternative names are implemented but the ifrastructure
      could be easily extended later on. This is very similar to the list of vlan
      and tunnels being added/deleted to/from bridge ports.
      
      See following examples.
      
      $ ip link
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
      
      -> Add alternative names for dummy0:
      
      $ ip link prop add dummy0 altname someothername
      $ ip link prop add dummy0 altname someotherveryveryveryverylongname
      $ ip link
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname someothername
          altname someotherveryveryveryverylongname
      $ ip link show someotherveryveryveryverylongname
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname someothername
          altname someotherveryveryveryverylongname
      
      -> Add bridge brx, add it's alternative name and use alternative names to
         do enslavement.
      
      $ ip link add name brx type bridge
      $ ip link prop add brx altname mypersonalsuperspecialbridge
      $ ip link set someotherveryveryveryverylongname master mypersonalsuperspecialbridge
      $ ip link
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop master brx state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname someothername
          altname someotherveryveryveryverylongname
      3: brx: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname mypersonalsuperspecialbridge
      
      -> Add ipv4 address to the bridge using alternative name:
      
      $ ip addr add 192.168.0.1/24 dev mypersonalsuperspecialbridge
      $ ip addr show mypersonalsuperspecialbridge
      3: brx: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname mypersonalsuperspecialbridge
          inet 192.168.0.1/24 scope global brx
             valid_lft forever preferred_lft forever
      
      -> Delete one of dummy0 alternative names:
      
      $ ip link prop del dummy0 altname someotherveryveryveryverylongname
      $ ip link
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop master brx state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname someothername
      3: brx: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname mypersonalsuperspecialbridge
      
      -> Add multiple alternative names at once
      
      $ ip link prop add dummy0 altname a altname b altname c altname d
      $ ip link
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop master brx state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname someothername
          altname a
          altname b
          altname c
          altname d
      3: brx: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:67:a9:67:46:86 brd ff:ff:ff:ff:ff:ff
          altname mypersonalsuperspecialbridge
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a56493f
    • Jiri Pirko's avatar
      net: rtnetlink: add possibility to use alternative names as message handle · 76c9ac0e
      Jiri Pirko authored
      
      
      Extend the basic rtnetlink commands to use alternative interface names
      as a handle instead of ifindex and ifname.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76c9ac0e