Commit Graph

12 Commits

Author SHA1 Message Date
Petr Oros d1450ffb82 devlink: fix port new reply cmd type
JIRA: https://issues.redhat.com/browse/RHEL-57755

Upstream commit(s):
commit 78a2f5e6c15d8dcbd6495bb9635c7cb89235dfc5
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Mon Mar 18 10:19:08 2024 +0100

    devlink: fix port new reply cmd type

    Due to a c&p error, port new reply fills-up cmd with wrong value,
    any other existing port command replies and notifications.

    Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

    Skimmed through devlink userspace implementations, none of them cares
    about this cmd value.

    Reported-by: Chenyuan Yang <chenyuan0y@gmail.com>
    Closes: https://lore.kernel.org/all/ZfZcDxGV3tSy4qsV@cy-server/
    Fixes: cd76dcd68d ("devlink: Support add and delete devlink port")
    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Link: https://lore.kernel.org/r/20240318091908.2736542-1-jiri@resnulli.us
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-11-20 10:13:46 +01:00
CKI Backport Bot b0ecf5c2ec devlink: Support setting max_io_eqs
JIRA: https://issues.redhat.com/browse/RHEL-64903

commit 5af3e3876d567fb79a355bec1cb48e432d69b4fb
Author: Parav Pandit <parav@nvidia.com>
Date:   Sat Apr 6 04:05:37 2024 +0300

    devlink: Support setting max_io_eqs

    Many devices send event notifications for the IO queues,
    such as tx and rx queues, through event queues.

    Enable a privileged owner, such as a hypervisor PF, to set the number
    of IO event queues for the VF and SF during the provisioning stage.

    example:
    Get maximum IO event queues of the VF device::

      $ devlink port show pci/0000:06:00.0/2
      pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
          function:
              hw_addr 00:00:00:00:00:00 ipsec_packet disabled max_io_eqs 10

    Set maximum IO event queues of the VF device::

      $ devlink port function set pci/0000:06:00.0/2 max_io_eqs 32

      $ devlink port show pci/0000:06:00.0/2
      pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
          function:
              hw_addr 00:00:00:00:00:00 ipsec_packet disabled max_io_eqs 32

    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Shay Drory <shayd@nvidia.com>
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
2024-10-25 09:01:55 +00:00
Petr Oros 7664348519 devlink: fix port dump cmd type
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 61c43780e9444123410cd48c2483e01d2b8f75e8
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Tue Feb 20 08:52:45 2024 +0100

    devlink: fix port dump cmd type

    Unlike other commands, due to a c&p error, port dump fills-up cmd with
    wrong value, different from port-get request cmd, port-get doit reply
    and port notification.

    Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

    Skimmed through devlink userspace implementations, none of them cares
    about this cmd value. Only ynl, for which, this is actually a fix, as it
    expects doit and dumpit ops rsp_value to be the same.

    Omit the fixes tag, even thought this is fix, better to target this for
    next release.

    Fixes: bfcd3a4661 ("Introduce devlink infrastructure")
    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Reviewed-by: Jakub Kicinski <kuba@kernel.org>
    Link: https://lore.kernel.org/r/20240220075245.75416-1-jiri@resnulli.us
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:11 +02:00
Petr Oros 96b1b1004d devlink: Fix referring to hw_addr attribute during state validation
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 1a89e24f8bfd3e3562d69709c9d9cd185ded869b
Author: Parav Pandit <parav@nvidia.com>
Date:   Mon Jan 29 21:10:59 2024 +0200

    devlink: Fix referring to hw_addr attribute during state validation

    When port function state change is requested, and when the driver
    does not support it, it refers to the hw address attribute instead
    of state attribute. Seems like a copy paste error.

    Fix it by referring to the port function state attribute.

    Fixes: c0bea69d1ca7 ("devlink: Validate port function request")
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Link: https://lore.kernel.org/r/20240129191059.129030-1-parav@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:11 +02:00
Petr Oros 298f4a3ca9 devlink: extend multicast filtering by port index
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit ded6f77c05b113001d449cf2cc810e090f20ec4a
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Sat Dec 16 13:30:01 2023 +0100

    devlink: extend multicast filtering by port index

    Expose the previously introduced notification multicast messages
    filtering infrastructure and allow the user to select messages using
    port index.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:10 +02:00
Petr Oros 8b6e99b243 devlink: introduce a helper for netlink multicast send
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 5648de0b1f2b68bffce9bdd49a276607b9a3e3d4
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Sat Dec 16 13:29:56 2023 +0100

    devlink: introduce a helper for netlink multicast send

    Introduce a helper devlink_nl_notify_send() so each object notification
    function does not have to call genlmsg_multicast_netns() with the same
    arguments.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:10 +02:00
Petr Oros 9c60d75257 devlink: send notifications only if there are listeners
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit cddbff470e3318834af518168d3a917b6e975062
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Sat Dec 16 13:29:55 2023 +0100

    devlink: send notifications only if there are listeners

    Introduce devlink_nl_notify_need() helper and using it to check at the
    beginning of notification functions to avoid overhead of composing
    notification messages in case nobody listens.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:10 +02:00
Petr Oros 987f28e0e7 devlink: introduce __devl_is_registered() helper and use it instead of xa_get_mark()
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 11280ddeae238e3ea27d153794472cfca5e8d121
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Sat Dec 16 13:29:54 2023 +0100

    devlink: introduce __devl_is_registered() helper and use it instead of xa_get_mark()

    Introduce __devl_is_registered() which does not assert on devlink
    instance lock and use it in notifications which may be called
    without devlink instance lock held.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:09 +02:00
Petr Oros 73146979d4 devlink: rename netlink callback to be aligned with the generated ones
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 53590934ba9549c55c57a32e2a6980139af00345
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Sat Oct 21 13:27:08 2023 +0200

    devlink: rename netlink callback to be aligned with the generated ones

    All remaining doit and dumpit netlink callback functions are going to be
    used by generated split ops. They expect certain name format. Rename the
    callback to be aligned with generated names.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Link: https://lore.kernel.org/r/20231021112711.660606-8-jiri@resnulli.us
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:04 +02:00
Petr Oros 35f8d5366c devlink: expose peer SF devlink instance
JIRA: https://issues.redhat.com/browse/RHEL-30145

Conflicts:
- adjusted context conflict due to 2b022471f4 ("net: add reserved
  fields to devlink_port")

Upstream commit(s):
commit 0b7a2721e36c11313f8b0f251a508d25a872cd28
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Wed Sep 13 09:12:39 2023 +0200

    devlink: expose peer SF devlink instance

    Introduce a new helper devl_port_fn_devlink_set() to be used by driver
    assigning a devlink instance to the peer devlink port function.

    Expose this to user over new netlink attribute nested under port
    function nest to expose devlink handle related to the port function.

    This is particularly helpful for user to understand the relationship
    between devlink instances created for SFs and the port functions
    they belong to.

    Note that caller of devlink_port_notify() needs to hold devlink
    instance lock, put the assertion to devl_port_fn_devlink_set() to make
    this requirement explicit. Also note the limitations that only allow to
    make this assignment for registered objects.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:00 +02:00
Petr Oros a85eade209 devlink: move linecard struct into linecard.c
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit d0b7e990f760ec9a614fbe5f89a5cede4335a7bb
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Wed Sep 13 09:12:32 2023 +0200

    devlink: move linecard struct into linecard.c

    Instead of exposing linecard struct, expose a simple helper to get the
    linecard index, which is all is needed outside linecard.c. Move the
    linecard struct to linecard.c and keep it private similar to the rest of
    the devlink objects.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:15:59 +02:00
Ivan Vecera 938acf8c08 devlink: push port related code into separate file
JIRA: https://issues.redhat.com/browse/RHEL-30656

commit eec1e5ea1d715ce2df8dcdf3dac7112df77a6e17
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Mon Aug 28 08:16:44 2023 +0200

    devlink: push port related code into separate file

    Cut out another chunk from leftover.c and put port related code
    into a separate file.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Link: https://lore.kernel.org/r/20230828061657.300667-3-jiri@resnulli.us
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:33 +02:00