1. 05 Mar, 2020 6 commits
    • Jakub Kicinski's avatar
      ethtool: add infrastructure for centralized checking of coalescing parameters · 95cddcb5
      Jakub Kicinski authored
      Linux supports 22 different interrupt coalescing parameters.
      No driver implements them all. Some drivers just ignore the
      ones they don't support, while others have to carry a long
      list of checks to reject unsupported settings.
      
      To simplify the drivers add the ability to specify inside
      ethtool_ops which parameters are supported and let the core
      reject attempts to set any other one.
      
      This commit makes the mechanism an opt-in, only drivers which
      set ethtool_opts->coalesce_types to a non-zero value will have
      the checks enforced.
      
      The same mask is used for global and per queue settings.
      
      v3: - move the (temporary) check if driver defines types
            earlier (Michal)
          - rename used_types -> nonzero_params, and
            coalesce_types -> supported_coalesce_params (Alex)
          - use EOPNOTSUPP instead of EINVAL (Andrew, Michal)
      
      Leaving the long series of ifs for now, it seems nice to
      be able to grep for the field and flag names. This will
      probably have to be revisited once netlink support lands.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarAlexander Duyck <alexander.h.duyck@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95cddcb5
    • Taehee Yoo's avatar
      hsr: fix refcnt leak of hsr slave interface · 56dc0a0e
      Taehee Yoo authored
      In the commit e0a4b997 ("hsr: use upper/lower device infrastructure"),
      dev_get() was removed but dev_put() in the error path wasn't removed.
      So, if creating hsr interface command is failed, the reference counter leak
      of lower interface would occur.
      
      Test commands:
          ip link add dummy0 type dummy
          ip link add ipvlan0 link dummy0 type ipvlan mode l2
          ip link add ipvlan1 link dummy0 type ipvlan mode l2
          ip link add hsr0 type hsr slave1 ipvlan0 slave2 ipvlan1
          ip link del ipvlan0
      
      Result:
      [  633.271992][ T1280] unregister_netdevice: waiting for ipvlan0 to become free. Usage count = -1
      
      Fixes: e0a4b997 ("hsr: use upper/lower device infrastructure")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56dc0a0e
    • David S. Miller's avatar
      Merge branch 'rmnet-cleanups' · d9904528
      David S. Miller authored
      Taehee Yoo says:
      
      ====================
      net: rmnet: several code cleanup for rmnet module
      
      This patchset is to cleanup rmnet module code.
      
      1. The first patch is to add module alias
      rmnet module can not be loaded automatically because there is no
      alias name.
      
      2. The second patch is to add extack error message code.
      When rmnet netlink command fails, it doesn't print any error message.
      So, users couldn't know the exact reason.
      In order to tell the exact reason to the user, the extack error message
      is used in this patch.
      
      3. The third patch is to use GFP_KERNEL instead of GFP_ATOMIC.
      In the sleepable context, GFP_KERNEL can be used.
      So, in this patch, GFP_KERNEL is used instead of GFP_ATOMIC.
      
      Change log:
       - v1->v2: change error message in the second patch.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9904528
    • Taehee Yoo's avatar
      net: rmnet: use GFP_KERNEL instead of GFP_ATOMIC · 9c9cc918
      Taehee Yoo authored
      In the current code, rmnet_register_real_device() and rmnet_newlink()
      are using GFP_ATOMIC.
      But, these functions are allowed to sleep.
      So, GFP_KERNEL can be used.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c9cc918
    • Taehee Yoo's avatar
      net: rmnet: print error message when command fails · fcf8f4eb
      Taehee Yoo authored
      When rmnet netlink command fails, it doesn't print any error message.
      So, users couldn't know the exact reason.
      In order to tell the exact reason to the user, the extack error message
      is used in this patch.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fcf8f4eb
    • Taehee Yoo's avatar
      net: rmnet: add missing module alias · eed22a06
      Taehee Yoo authored
      In the current rmnet code, there is no module alias.
      So, RTNL couldn't load rmnet module automatically.
      
      Test commands:
          ip link add dummy0 type dummy
          modprobe -rv rmnet
          ip link add rmnet0 link dummy0 type rmnet  mux_id 1
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eed22a06
  2. 04 Mar, 2020 34 commits