Commit Graph

27 Commits

Author SHA1 Message Date
Petr Oros b9ff5c853a netlink: add nlmsg_consume() and use it in devlink compat
JIRA: https://issues.redhat.com/browse/RHEL-57756

Upstream commit(s):
commit 8e69b3459ca1ed4f6f7bd0b0a11962ddb3e7d34a
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Wed Apr 3 13:22:59 2024 -0700

    netlink: add nlmsg_consume() and use it in devlink compat

    devlink_compat_running_version() sticks out when running
    netdevsim tests and watching dropped skbs. Add nlmsg_consume()
    for cases were we want to free a netlink skb but it is expected,
    rather than a drop. af_netlink code uses consume_skb() directly,
    which is fine, but some may prefer the symmetry of nlmsg_new() /
    nlmsg_consume().

    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-12-10 10:37:53 +01:00
Michal Schmidt 8e7994801b netlink: introduce type-checking attribute iteration
JIRA: https://issues.redhat.com/browse/RHEL-57750

commit e8058a49e67fe7bc7e4a0308851a3ca3a6d2e45d
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Mar 28 20:31:45 2024 +0100

    netlink: introduce type-checking attribute iteration

    There are, especially with multi-attr arrays, many cases
    of needing to iterate all attributes of a specific type
    in a netlink message or a nested attribute. Add specific
    macros to support that case.

    Also convert many instances using this spatch:

        @@
        iterator nla_for_each_attr;
        iterator name nla_for_each_attr_type;
        identifier nla;
        expression head, len, rem;
        expression ATTR;
        type T;
        identifier x;
        @@
        -nla_for_each_attr(nla, head, len, rem)
        +nla_for_each_attr_type(nla, ATTR, head, len, rem)
         {
        <... T x; ...>
        -if (nla_type(nla) == ATTR) {
         ...
        -}
         }

        @@
        identifier nla;
        iterator nla_for_each_nested;
        iterator name nla_for_each_nested_type;
        expression attr, rem;
        expression ATTR;
        type T;
        identifier x;
        @@
        -nla_for_each_nested(nla, attr, rem)
        +nla_for_each_nested_type(nla, ATTR, attr, rem)
         {
        <... T x; ...>
        -if (nla_type(nla) == ATTR) {
         ...
        -}
         }

        @@
        iterator nla_for_each_attr;
        iterator name nla_for_each_attr_type;
        identifier nla;
        expression head, len, rem;
        expression ATTR;
        type T;
        identifier x;
        @@
        -nla_for_each_attr(nla, head, len, rem)
        +nla_for_each_attr_type(nla, ATTR, head, len, rem)
         {
        <... T x; ...>
        -if (nla_type(nla) != ATTR) continue;
         ...
         }

        @@
        identifier nla;
        iterator nla_for_each_nested;
        iterator name nla_for_each_nested_type;
        expression attr, rem;
        expression ATTR;
        type T;
        identifier x;
        @@
        -nla_for_each_nested(nla, attr, rem)
        +nla_for_each_nested_type(nla, ATTR, attr, rem)
         {
        <... T x; ...>
        -if (nla_type(nla) != ATTR) continue;
         ...
         }

    Although I had to undo one bad change this made, and
    I also adjusted some other code for whitespace and to
    use direct variable initialization now.

    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://lore.kernel.org/r/20240328203144.b5a6c895fb80.I1869b44767379f204998ff44dd239803f39c23e0@changeid
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Conflicts:
	drivers/net/ethernet/netronome/nfp/nfp_net_common.c
	- The driver lacks .ndo_bridge_setlink implementation in RHEL 9.
	net/core/bpf_sk_storage.c
	- Missing commit bcc29b7f5af6 ("bpf: Add length check for
	  SK_DIAG_BPF_STORAGE_REQ_MAP_FD parsing")

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
2024-10-01 12:19:13 +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 6975febb78 devlink: use devl_is_registered() helper instead xa_get_mark()
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: use devl_is_registered() helper instead xa_get_mark()

    Instead of checking the xarray mark directly using xa_get_mark() helper
    use devl_is_registered() helper which wraps it up. Note that there are
    couple more users of xa_get_mark() left which are going to be handled
    by the next patch.

    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 1226dc0bc1 devlink: warn about existing entities during reload-reinit
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 9b2348e2d6c94146f50b68d7d2067146e7339ac5
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Tue Nov 28 12:52:55 2023 +0100

    devlink: warn about existing entities during reload-reinit

    During reload-reinit, all entities except for params, resources, regions
    and health reporter should be removed and re-added. Add a warning to
    be triggered in case the driver behaves differently.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:06 +02:00
Petr Oros 084fb5b094 devlink: Add device lock assert in reload operation
JIRA: https://issues.redhat.com/browse/RHEL-30145

Upstream commit(s):
commit 527a07e176eab0f61b1beec9e29b99c9a5ec219f
Author: Ido Schimmel <idosch@nvidia.com>
Date:   Wed Nov 15 13:17:15 2023 +0100

    devlink: Add device lock assert in reload operation

    Add an assert to verify that the device lock is always held throughout
    reload operations.

    Tested the following flows with netdevsim and mlxsw while lockdep is
    enabled:

    netdevsim:

     # echo "10 1" > /sys/bus/netdevsim/new_device
     # devlink dev reload netdevsim/netdevsim10
     # ip netns add bla
     # devlink dev reload netdevsim/netdevsim10 netns bla
     # ip netns del bla
     # echo 10 > /sys/bus/netdevsim/del_device

    mlxsw:

     # devlink dev reload pci/0000:01:00.0
     # ip netns add bla
     # devlink dev reload pci/0000:01:00.0 netns bla
     # ip netns del bla
     # echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
     # echo 1 > /sys/bus/pci/rescan

    Signed-off-by: Ido Schimmel <idosch@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-04-26 17:16:06 +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 a27d3bd029 devlink: introduce possibility to expose info about nested devlinks
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: introduce possibility to expose info about nested devlinks

    In mlx5, there is a devlink instance created for PCI device. Also, one
    separate devlink instance is created for auxiliary device that
    represents the netdev of uplink port. This relation is currently
    invisible to the devlink user.

    Benefit from the rel infrastructure and allow for nested devlink
    instance to set the relationship for the nested-in devlink instance.
    Note that there may be many nested instances, therefore use xarray to
    hold the list of rel_indexes for individual nested instances.

    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 ddad7fb46e devlink: introduce object and nested devlink relationship infra
JIRA: https://issues.redhat.com/browse/RHEL-30145

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

    devlink: introduce object and nested devlink relationship infra

    It is a bit tricky to maintain relationship between devlink objects and
    nested devlink instances due to following aspects:

    1) Locking. It is necessary to lock the devlink instance that contains
       the object first, only after that to lock the nested instance.
    2) Lifetimes. Objects (e.g devlink port) may be removed before
       the nested devlink instance.
    3) Notifications. If nested instance changes (e.g. gets
       registered/unregistered) the nested-in object needs to send
       appropriate notifications.

    Resolve this by introducing an xarray that holds 1:1 relationships
    between devlink object and related nested devlink instance.
    Use that xarray index to get the object/nested devlink instance on
    the other side.

    Provide necessary helpers:
    devlink_rel_nested_in_add/clear() to add and clear the relationship.
    devlink_rel_nested_in_notify() to call the nested-in object to send
            notifications during nested instance register/unregister/netns
            change.
    devlink_rel_devlink_handle_put() to be used by nested-in object fill
            function to fill the nested handle.

    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
Ivan Vecera 46ef5b0dfd devlink: move devlink_notify_register/unregister() to dev.c
JIRA: https://issues.redhat.com/browse/RHEL-30656

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

    devlink: move devlink_notify_register/unregister() to dev.c

    At last, move the last bits out of leftover.c,
    the devlink_notify_register/unregister() functions to dev.c

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

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:34 +02:00
Ivan Vecera 33e81c6578 devlink: pass flags as an arg of dump_one() callback
JIRA: https://issues.redhat.com/browse/RHEL-30656

commit 7d3c6fec6135e10842587f38a15d7d06fd02c21f
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Fri Aug 11 17:57:07 2023 +0200

    devlink: pass flags as an arg of dump_one() callback

    In order to easily set NLM_F_DUMP_FILTERED for partial dumps, pass the
    flags as an arg of dump_one() callback. Currently, it is always
    NLM_F_MULTI.

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

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:30 +02:00
Ivan Vecera 04f6da8c7a devlink: introduce dumpit callbacks for split ops
JIRA: https://issues.redhat.com/browse/RHEL-30656

commit 24c8e56d4f983527cc5e1f6d771fef8ec7ce352e
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Fri Aug 11 17:57:06 2023 +0200

    devlink: introduce dumpit callbacks for split ops

    Introduce dumpit callbacks for generated split ops. Have them
    as a thin wrapper around iteration function and allow to pass dump_one()
    function pointer directly without need to store in devlink_cmd structs.

    Note that the function prototypes are temporary until the generated ones
    will replace them in a follow-up patch.

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

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:29 +02:00
Ivan Vecera 42aeba8287 devlink: rename doit callbacks for per-instance dump commands
JIRA: https://issues.redhat.com/browse/RHEL-30656

commit 8fa995ad1f7f8f615b479edcf540cc12fe7b87ba
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Fri Aug 11 17:57:05 2023 +0200

    devlink: rename doit callbacks for per-instance dump commands

    Rename netlink doit callback functions for the commands that do
    implement per-instance dump to match the generated names that are going
    to be introduce in the follow-up patch.

    Note that the function prototypes are temporary until the generated ones
    will replace them in a follow-up patch.

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

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:29 +02:00
Ivan Vecera ebba2c624c devlink: introduce couple of dumpit callbacks for split ops
JIRA: https://issues.redhat.com/browse/RHEL-30656

commit 491a24872a64cbb8edf996b6113a97586702e5ca
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Thu Aug 3 13:13:35 2023 +0200

    devlink: introduce couple of dumpit callbacks for split ops

    Introduce couple of dumpit callbacks for generated split ops. Have them
    as a thin wrapper around iteration function and allow to pass dump_one()
    function pointer directly without need to store in devlink_cmd structs.

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

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:28 +02:00
Ivan Vecera 2fa72d4f01 devlink: rename couple of doit netlink callbacks to match generated names
JIRA: https://issues.redhat.com/browse/RHEL-30656

commit d61aedcf628ef7467d69638c3b3e5e33cafd75aa
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Thu Aug 3 13:13:34 2023 +0200

    devlink: rename couple of doit netlink callbacks to match generated names

    The generated names of the doit netlink callback are missing "cmd" in
    their names. Change names to be ready to switch to generated split ops
    header.

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

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:19:28 +02:00
Petr Oros 59e7861deb devlink: Fix netdev notifier chain corruption
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Conflicts:
-  adjusted upstream merge conflict which was resolved in 675f176b4dcc2b
   ("Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net")

Upstream commit(s):
commit b20b8aec6ffc07bb547966b356780cd344f20f5b
Author: Ido Schimmel <idosch@nvidia.com>
Date:   Wed Feb 15 09:31:39 2023 +0200

    devlink: Fix netdev notifier chain corruption

    Cited commit changed devlink to register its netdev notifier block on
    the global netdev notifier chain instead of on the per network namespace
    one.

    However, when changing the network namespace of the devlink instance,
    devlink still tries to unregister its notifier block from the chain of
    the old namespace and register it on the chain of the new namespace.
    This results in corruption of the notifier chains, as the same notifier
    block is registered on two different chains: The global one and the per
    network namespace one. In turn, this causes other problems such as the
    inability to dismantle namespaces due to netdev reference count issues.

    Fix by preventing devlink from moving its notifier block between
    namespaces.

    Reproducer:

     # echo "10 1" > /sys/bus/netdevsim/new_device
     # ip netns add test123
     # devlink dev reload netdevsim/netdevsim10 netns test123
     # ip netns del test123
     [   71.935619] unregister_netdevice: waiting for lo to become free. Usage count = 2
     [   71.938348] leaked reference.

    Fixes: 565b4824c39f ("devlink: change port event netdev notifier from per-net to global")
    Signed-off-by: Ido Schimmel <idosch@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Reviewed-by: Jakub Kicinski <kuba@kernel.org>
    Link: https://lore.kernel.org/r/20230215073139.1360108-1-idosch@nvidia.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:28 +02:00
Petr Oros 0275d352b6 devlink: don't allow to change net namespace for FW_ACTIVATE reload action
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit 2edd92570441dd33246210042dc167319a5cf7e3
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Mon Feb 13 12:58:36 2023 +0100

    devlink: don't allow to change net namespace for FW_ACTIVATE reload action

    The change on network namespace only makes sense during re-init reload
    action. For FW activation it is not applicable. So check if user passed
    an ATTR indicating network namespace change request and forbid it.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Acked-by: Jakub Kicinski <kuba@kernel.org>
    Link: https://lore.kernel.org/r/20230213115836.3404039-1-jiri@resnulli.us
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:26 +02:00
Petr Oros b502250fa1 devlink: make sure driver does not read updated driverinit param before reload
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit afd888c3e19ceb5247158fe2fabbf7234937a515
Author: Jiri Pirko <jiri@nvidia.com>
Date:   Fri Feb 10 11:01:26 2023 +0100

    devlink: make sure driver does not read updated driverinit param before reload

    The driverinit param purpose is to serve the driver during init/reload
    time to provide a value, either default or set by user.

    Make sure that driver does not read value updated by user before the
    reload is performed. Hold the new value in a separate struct and switch
    it during reload.

    Note that this is required to be eventually possible to call
    devl_param_driverinit_value_get() without holding instance lock.

    Signed-off-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Simon Horman <simon.horman@corigine.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:25 +02:00
Petr Oros c0ed2b0460 devlink: stop using NL_SET_ERR_MSG_MOD
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit 6d86bb0a5cb82bd459b017f180bdc47bec561b2d
Author: Jacob Keller <jacob.e.keller@intel.com>
Date:   Thu Feb 9 14:20:45 2023 -0800

    devlink: stop using NL_SET_ERR_MSG_MOD

    NL_SET_ERR_MSG_MOD inserts the KBUILD_MODNAME and a ':' before the actual
    extended error message. The devlink feature hasn't been able to be compiled
    as a module since commit f4b6bcc700 ("net: devlink: turn devlink into a
    built-in").

    Stop using NL_SET_ERR_MSG_MOD, and just use the base NL_SET_ERR_MSG. This
    aligns the extended error messages better with the NL_SET_ERR_MSG_ATTR
    messages as well.

    Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
    Acked-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:25 +02:00
Petr Oros d807a660dd devlink: Move devlink dev selftest code to dev
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit 7c976c7cfc70dbe7abfcd7a74cc0baa02b788c77
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:06 2023 +0200

    devlink: Move devlink dev selftest code to dev

    Move devlink dev selftest callbacks and related code from leftover.c to
    file dev.c. No functional change in this patch.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:24 +02:00
Petr Oros 065d2e0d13 devlink: Move devlink_info_req struct to be local
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit ec4a0ce92e0c4abf833ad2c3b1face0f01432bff
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:05 2023 +0200

    devlink: Move devlink_info_req struct to be local

    As all users of the struct devlink_info_req are already in dev.c, move
    this struct from devl_internal.c to be local in dev.c.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:24 +02:00
Petr Oros 47e31052a4 devlink: Move devlink dev flash code to dev
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit a13aab66cbe02daaed3dde3a6d296ad0a5fab543
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:04 2023 +0200

    devlink: Move devlink dev flash code to dev

    Move devlink dev flash callbacks, helpers and other related code from
    leftover.c to dev.c. No functional change in this patch.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:24 +02:00
Petr Oros 2479b43f19 devlink: Move devlink dev info code to dev
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit d60191c46ec9379453c674fcaa40531e2c0b2ba4
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:03 2023 +0200

    devlink: Move devlink dev info code to dev

    Move devlink dev info callbacks, related drivers helpers functions and
    other related code from leftover.c to dev.c. No functional change in
    this patch.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:24 +02:00
Petr Oros e6371e46eb devlink: Move devlink dev eswitch code to dev
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit af2f8c1f82294069c6c02ea7d94c43d7c3e73a36
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:02 2023 +0200

    devlink: Move devlink dev eswitch code to dev

    Move devlink dev eswitch callbacks and related code from leftover.c to
    file dev.c. No functional change in this patch.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:23 +02:00
Petr Oros 379a1e2a89 devlink: Move devlink dev reload code to dev
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit c6ed7d6ef929a4502cc89c90a3c57e8814f4fcc9
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:01 2023 +0200

    devlink: Move devlink dev reload code to dev

    Move devlink dev reload callback and related code from leftover.c to
    file dev.c. No functional change in this patch.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:23 +02:00
Petr Oros b11985c2d5 devlink: Split out dev get and dump code
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172273

Upstream commit(s):
commit dbeeca81bd9399fc60ae69ff944836280b4fd094
Author: Moshe Shemesh <moshe@nvidia.com>
Date:   Thu Feb 2 16:47:00 2023 +0200

    devlink: Split out dev get and dump code

    Move devlink dev get and dump callbacks and related dev code to new file
    dev.c. This file shall include all callbacks that are specific on
    devlink dev object.

    No functional change in this patch.

    Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2023-04-04 11:12:23 +02:00