Commit Graph

10 Commits

Author SHA1 Message Date
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 058e7740f4 devlink: convert linecard nested devlink to new rel infrastructure
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: convert linecard nested devlink to new rel infrastructure

    Benefit from the newly introduced rel infrastructure, treat the linecard
    nested devlink instances in the same way as port function instances.
    Convert the code to use the rel infrastructure.

    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 d85d2b504b devlink: extend devlink_nl_put_nested_handle() with attrtype arg
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: extend devlink_nl_put_nested_handle() with attrtype arg

    As the next patch is going to call this helper with need to fill another
    type of nested attribute, pass it over function arg.

    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 bd8ba7a254 devlink: move devlink_nl_put_nested_handle() into netlink.c
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: move devlink_nl_put_nested_handle() into netlink.c

    As the next patch is going to call this helper out of the linecard.c,
    move to netlink.c.

    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
Petr Oros 4633ef815e devlink: put netnsid to nested handle
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: put netnsid to nested handle

    If netns of devlink instance and nested devlink instance differs,
    put netnsid attr to indicate that.

    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
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 aa11b4eb8a devlink: push linecard related code into separate file
JIRA: https://issues.redhat.com/browse/RHEL-30656

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

    devlink: push linecard related code into separate file

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

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Link: https://lore.kernel.org/r/20230828061657.300667-13-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