1. 30 Jan, 2019 16 commits
    • Xin Long's avatar
      sctp: use SCTP_FUTURE_ASSOC for SCTP_MAXSEG sockopt · 6fd769be
      Xin Long authored
      Check with SCTP_FUTURE_ASSOC instead in
      sctp_set/getsockopt_maxseg, it's compatible with 0.
      Also check asoc_id early as other sctp setsockopts does.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6fd769be
    • Xin Long's avatar
      sctp: use SCTP_FUTURE_ASSOC for SCTP_ASSOCINFO sockopt · 8889394d
      Xin Long authored
      Check with SCTP_FUTURE_ASSOC instead in
      sctp_set/getsockopt_associnfo, it's compatible with 0.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8889394d
    • Xin Long's avatar
      sctp: use SCTP_FUTURE_ASSOC for SCTP_RTOINFO sockopt · 7adb5ed5
      Xin Long authored
      Check with SCTP_FUTURE_ASSOC instead in
      sctp_set/getsockopt_rtoinfo, it's compatible with 0.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7adb5ed5
    • Xin Long's avatar
      sctp: use SCTP_FUTURE_ASSOC for SCTP_PEER_ADDR_PARAMS sockopt · b99e5e02
      Xin Long authored
      Check with SCTP_FUTURE_ASSOC instead in
      sctp_/setgetsockopt_peer_addr_params, it's compatible with 0.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b99e5e02
    • Xin Long's avatar
      sctp: introduce SCTP_FUTURE/CURRENT/ALL_ASSOC · 80df2704
      Xin Long authored
      This patch is to add 3 constants SCTP_FUTURE_ASSOC,
      SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC for reserved
      assoc_ids, as defined in rfc6458#section-7.2.
      
      And add the process for them when doing lookup and
      inserting in sctp_id2assoc and sctp_assoc_set_id.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      80df2704
    • David S. Miller's avatar
      Merge branch 'devlink-port' · bde52726
      David S. Miller authored
      Vasundhara Volam says:
      
      ====================
      devlink: Add configuration parameters support for devlink_port
      
      This patchset adds support for configuration parameters setting through
      devlink_port.  Each device registers supported configuration parameters
      table.
      
      The user can retrieve data on these parameters by
      "devlink port param show" command and can set new value to a
      parameter by "devlink port param set" command.
      All configuration modes supported by devlink_dev are supported
      by devlink_port also.
      
      Command examples and output:
      
      pci/0000:3b:00.0/0:
        name wake-on-lan type generic
          values:
            cmode permanent value false
      
      pci/0000:3b:00.1/1:
        name wake-on-lan type generic
          values:
            cmode permanent value false
      
      pci/0000:af:00.0/0:
        name wake-on-lan type generic
          values:
            cmode permanent value true
      
      pci/0000:3b:00.0/0:
        name wake-on-lan type generic
          values:
            cmode permanent value false
      
      There is difference of opinion on adding WOL parameter to devlink, between
      Jakub Kicinski and Michael Chan.
      
      Quote from Jakud Kicinski:
      ********
      As explained previously I think it's a very bad idea to add existing
      configuration options to devlink, just because devlink has the ability
      to persist the setting in NVM.  Especially that for WoL you have to get
      the link up so you potentially have all link config stuff as well.  And
      that n-tuple filters are one of the WoL options, meaning we'd need the
      ability to persist n-tuple filters via devlink.
      
      The effort would be far better spent helping with migrating ethtool to
      netlink, and allowing persisting there.
      
      I have not heard any reason why devlink is a better fit.  I can imagine
      you're just doing it here because it's less effort for you since
      ethtool is not yet migrated.
      ********
      
      Quote from Michael Chan:
      ********
      The devlink's WoL parameter is a persistent WoL parameter stored in the
      NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
      ways. ethtool WoL is not persistent over AC power cycle and is considered
      OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
      including n-tuple with IP address in addition to the more basic types
      (e.g. magic packet). Whereas OS-absent power up WoL should only include
      magic packet and other simple types. The devlink WoL setting does not have
      to match the ethtool WoL setting. The card will autoneg up to the speed
      supported by Vaux so no special devlink link setting is needed.
      ********
      
      Future expansion of WOL parameter to devlink:
      ********
      Add an additional flag to support additional setting to address link settings.
      This will allow attributes to support both runtime and persistent
      configuration.
      ********
      
      v7->v8:
      * Re-ordered function definitions.
      * Append with "Acked-by: Jiri Pirko <jiri@mellanox.com>" to first 3 patches.
      * Add missing devlink_port_param_driverinit_value_get() declaration.
      
      v6->v7:
      * Remove RFC tag from the patch-set.
      
      v5->v6:
      * Replace '-' with '*' in cover letter to avoid cutoff by git.
      
      v4->v5:
      * Added quotes from Jakub Kicinski and Michael chan on devlink's WOL
        parameter in the cover letter.
      
      v3->v4:
      * Update changes done from v2 to v3 version in individual patch
        descriptions.
      
      v2->v3:
      Make following changes as per suggestions from Jiri Pirko and
      Michal Kubecek.
      * Add a helper __devlink_params_register() with common code used by
        both devlink_params_register() and devlink_port_params_register().
      * 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.
      * Modify bnxt_dl_wol_validate(), to throw error message when user gives
        value other than DEVLINK_PARAM_WAKE_MAGIC or 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.
      
      v1->v2:
      Make following changes as per suggestions from Jiri Pirko.
      * Remove separate enum devlink_port_param_generic_id for port params.
        Instead club it with existing device params. Accordingly refactor
        remaining patchset.
      * Move INIT_LIST_HEAD of port param_list to devlink_port_register()
      * Add a helper devlink_param_verify() to be used for both
        devlink_params_register() and devlink_port_params_register().
      * Add a helper __devlink_params_unregister() for common code in
        devlink_params_unregister() and devlink_port_params_unregister().
      * Move DEVLINK_CMD_PORT_PARAM_XXX definitions to the end of the enum.
      * Split the patches for devlink_port_param_driverinit_value_get() and
        devlink_port_param_driverinit_value_set() into separate patches.
      * define DEVLINK_PARAM_GENERIC_ID_WOL type as u8 and define enum for
        different types of WOL. Accordingly modify bnxt_en patch to validate
        wol type.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bde52726
    • 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 24 commits