<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/ethernet/pensando/ionic/ionic_devlink.c, branch linux-6.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.18.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.18.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-05-03T08:14:47Z</updated>
<entry>
<title>ionic: catch failure from devlink_alloc</title>
<updated>2023-05-03T08:14:47Z</updated>
<author>
<name>Shannon Nelson</name>
<email>shannon.nelson@amd.com</email>
</author>
<published>2023-05-02T18:35:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4a54903ff68ddb33b6463c94b4eb37fc584ef760'/>
<id>urn:sha1:4a54903ff68ddb33b6463c94b4eb37fc584ef760</id>
<content type='text'>
Add a check for NULL on the alloc return.  If devlink_alloc() fails and
we try to use devlink_priv() on the NULL return, the kernel gets very
unhappy and panics. With this fix, the driver load will still fail,
but at least it won't panic the kernel.

Fixes: df69ba43217d ("ionic: Add basic framework for IONIC Network device driver")
Signed-off-by: Shannon Nelson &lt;shannon.nelson@amd.com&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: devlink: let the core report the driver name instead of the drivers</title>
<updated>2022-12-01T05:49:38Z</updated>
<author>
<name>Vincent Mailhol</name>
<email>mailhol.vincent@wanadoo.fr</email>
</author>
<published>2022-11-29T09:51:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=226bf980550627c88549b112ac6c8fb40873afb4'/>
<id>urn:sha1:226bf980550627c88549b112ac6c8fb40873afb4</id>
<content type='text'>
The driver name is available in device_driver::name. Right now,
drivers still have to report this piece of information themselves in
their devlink_ops::info_get callback function.

In order to factorize code, make devlink_nl_info_fill() add the driver
name attribute.

Now that the core sets the driver name attribute, drivers are not
supposed to call devlink_info_driver_name_put() anymore. Remove
devlink_info_driver_name_put() and clean-up all the drivers using this
function in their callback.

Signed-off-by: Vincent Mailhol &lt;mailhol.vincent@wanadoo.fr&gt;
Tested-by: Ido Schimmel &lt;idosch@nvidia.com&gt; # mlxsw
Reviewed-by: Jacob Keller  &lt;jacob.e.keller@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port</title>
<updated>2022-11-04T03:48:34Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2022-11-02T16:02:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ac73d4bf2cdaf2cb8a43df8ee4a5c066d2c5d7b4'/>
<id>urn:sha1:ac73d4bf2cdaf2cb8a43df8ee4a5c066d2c5d7b4</id>
<content type='text'>
Benefit from the previously implemented tracking of netdev events in
devlink code and instead of calling  devlink_port_type_eth_set() and
devlink_port_type_clear() to set devlink port type and link to related
netdev, use SET_NETDEV_DEVLINK_PORT() macro to assign devlink_port
pointer to netdevice which is about to be registered.

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ionic: no devlink_unregister if not registered</title>
<updated>2021-10-13T00:39:33Z</updated>
<author>
<name>Shannon Nelson</name>
<email>snelson@pensando.io</email>
</author>
<published>2021-10-12T23:15:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d1f24712a86abd04d82cf4b00fb4ab8ff2d23c8a'/>
<id>urn:sha1:d1f24712a86abd04d82cf4b00fb4ab8ff2d23c8a</id>
<content type='text'>
Don't try to unregister the devlink if it hasn't been registered
yet.  This bit of error cleanup code got missed in the recent
devlink registration changes.

Fixes: 7911c8bd546f ("ionic: Move devlink registration to be last devlink command")
Signed-off-by: Shannon Nelson &lt;snelson@pensando.io&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211012231520.72582-1-snelson@pensando.io
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ionic: Move devlink registration to be last devlink command</title>
<updated>2021-09-27T15:31:59Z</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2021-09-25T11:22:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7911c8bd546fa85e408544426646dd1f1a684286'/>
<id>urn:sha1:7911c8bd546fa85e408544426646dd1f1a684286</id>
<content type='text'>
This change prevents from users to access device before devlink is
fully configured.

Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>devlink: Make devlink_register to be void</title>
<updated>2021-09-22T13:15:12Z</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2021-09-22T08:58:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=db4278c55fa53760893266538e86e638330b03bb'/>
<id>urn:sha1:db4278c55fa53760893266538e86e638330b03bb</id>
<content type='text'>
devlink_register() can't fail and always returns success, but all drivers
are obligated to check returned status anyway. This adds a lot of boilerplate
code to handle impossible flow.

Make devlink_register() void and simplify the drivers that use that
API call.

Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Acked-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Acked-by: Vladimir Oltean &lt;olteanv@gmail.com&gt; # dsa
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>devlink: Set device as early as possible</title>
<updated>2021-08-09T09:21:40Z</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2021-08-08T18:57:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=919d13a7e455c2e7676042d7a5f94c164e859d8a'/>
<id>urn:sha1:919d13a7e455c2e7676042d7a5f94c164e859d8a</id>
<content type='text'>
All kernel devlink implementations call to devlink_alloc() during
initialization routine for specific device which is used later as
a parent device for devlink_register().

Such late device assignment causes to the situation which requires us to
call to device_register() before setting other parameters, but that call
opens devlink to the world and makes accessible for the netlink users.

Any attempt to move devlink_register() to be the last call generates the
following error due to access to the devlink-&gt;dev pointer.

[    8.758862]  devlink_nl_param_fill+0x2e8/0xe50
[    8.760305]  devlink_param_notify+0x6d/0x180
[    8.760435]  __devlink_params_register+0x2f1/0x670
[    8.760558]  devlink_params_register+0x1e/0x20

The simple change of API to set devlink device in the devlink_alloc()
instead of devlink_register() fixes all this above and ensures that
prior to call to devlink_register() everything already set.

Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ionic: cleanly release devlink instance</title>
<updated>2021-07-21T21:35:52Z</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2021-07-21T12:39:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c2255ff47768c94a0ebc3968f007928bb47ea43b'/>
<id>urn:sha1:c2255ff47768c94a0ebc3968f007928bb47ea43b</id>
<content type='text'>
The failure to register devlink will leave the system with dangled
devlink resource, which is not cleaned if devlink_port_register() fails.

In order to remove access to ".registered" field of struct devlink_port,
require both devlink_register and devlink_port_register to success and
check it through device pointer.

Fixes: fbfb8031533c ("ionic: Add hardware init and device commands")
Reviewed-by: Moshe Shemesh &lt;moshe@nvidia.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Acked-by: Shannon Nelson &lt;snelson@pensando.io&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>devlink: move request_firmware out of driver</title>
<updated>2020-11-20T05:40:57Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.e.keller@intel.com</email>
</author>
<published>2020-11-18T19:06:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b44cfd4f5b912454387a4bf735d42eb4e7078ca8'/>
<id>urn:sha1:b44cfd4f5b912454387a4bf735d42eb4e7078ca8</id>
<content type='text'>
All drivers which implement the devlink flash update support, with the
exception of netdevsim, use either request_firmware or
request_firmware_direct to locate the firmware file. Rather than having
each driver do this separately as part of its .flash_update
implementation, perform the request_firmware within net/core/devlink.c

Replace the file_name parameter in the struct devlink_flash_update_params
with a pointer to the fw object.

Use request_firmware rather than request_firmware_direct. Although most
Linux distributions today do not have the fallback mechanism
implemented, only about half the drivers used the _direct request, as
compared to the generic request_firmware. In the event that
a distribution does support the fallback mechanism, the devlink flash
update ought to be able to use it to provide the firmware contents. For
distributions which do not support the fallback userspace mechanism,
there should be essentially no difference between request_firmware and
request_firmware_direct.

Signed-off-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Acked-by: Shannon Nelson &lt;snelson@pensando.io&gt;
Acked-by: Vasundhara Volam &lt;vasundhara-v.volam@broadcom.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>devlink: convert flash_update to use params structure</title>
<updated>2020-09-26T00:20:57Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.e.keller@intel.com</email>
</author>
<published>2020-09-25T20:46:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bc75c054f04048517e0b153ab38d973bbcdcef59'/>
<id>urn:sha1:bc75c054f04048517e0b153ab38d973bbcdcef59</id>
<content type='text'>
The devlink core recently gained support for checking whether the driver
supports a flash_update parameter, via `supported_flash_update_params`.
However, parameters are specified as function arguments. Adding a new
parameter still requires modifying the signature of the .flash_update
callback in all drivers.

Convert the .flash_update function to take a new `struct
devlink_flash_update_params` instead. By using this structure, and the
`supported_flash_update_params` bit field, a new parameter to
flash_update can be added without requiring modification to existing
drivers.

As before, all parameters except file_name will require driver opt-in.
Because file_name is a necessary field to for the flash_update to make
sense, no "SUPPORTED" bitflag is provided and it is always considered
valid. All future additional parameters will require a new bit in the
supported_flash_update_params bitfield.

Signed-off-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Reviewed-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Jiri Pirko &lt;jiri@mellanox.com&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Michael Chan &lt;michael.chan@broadcom.com&gt;
Cc: Bin Luo &lt;luobin9@huawei.com&gt;
Cc: Saeed Mahameed &lt;saeedm@mellanox.com&gt;
Cc: Leon Romanovsky &lt;leon@kernel.org&gt;
Cc: Ido Schimmel &lt;idosch@mellanox.com&gt;
Cc: Danielle Ratson &lt;danieller@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
