<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/devlink.c, branch v5.11</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-01-19T19:45:41Z</updated>
<entry>
<title>net: core: devlink: use right genl user_ptr when handling port param get/set</title>
<updated>2021-01-19T19:45:41Z</updated>
<author>
<name>Oleksandr Mazur</name>
<email>oleksandr.mazur@plvision.eu</email>
</author>
<published>2021-01-19T08:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7e238de8283acd32c26c2bc2a50672d0ea862ff7'/>
<id>urn:sha1:7e238de8283acd32c26c2bc2a50672d0ea862ff7</id>
<content type='text'>
Fix incorrect user_ptr dereferencing when handling port param get/set:

    idx [0] stores the 'struct devlink' pointer;
    idx [1] stores the 'struct devlink_port' pointer;

Fixes: 637989b5d77e ("devlink: Always use user_ptr[0] for devlink and simplify post_doit")
CC: Parav Pandit &lt;parav@mellanox.com&gt;
Signed-off-by: Oleksandr Mazur &lt;oleksandr.mazur@plvision.eu&gt;
Signed-off-by: Vadym Kochan &lt;vadym.kochan@plvision.eu&gt;
Link: https://lore.kernel.org/r/20210119085333.16833-1-vadym.kochan@plvision.eu
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: core: devlink: simplify the return expression of devlink_nl_cmd_trap_set_doit()</title>
<updated>2020-12-09T00:22:54Z</updated>
<author>
<name>Zheng Yongjun</name>
<email>zhengyongjun3@huawei.com</email>
</author>
<published>2020-12-08T12:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8daa76a52dfd9dac4be87a37269c225c15977bdd'/>
<id>urn:sha1:8daa76a52dfd9dac4be87a37269c225c15977bdd</id>
<content type='text'>
Simplify the return expression.

Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2020-11-28T02:25:27Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2020-11-28T02:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c39f26e67c984db0fa95f9faecf06eb0198dce7'/>
<id>urn:sha1:5c39f26e67c984db0fa95f9faecf06eb0198dce7</id>
<content type='text'>
Trivial conflict in CAN, keep the net-next + the byteswap wrapper.

Conflicts:
	drivers/net/can/usb/gs_usb.c

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>devlink: Make sure devlink instance and port are in same net namespace</title>
<updated>2020-11-26T01:26:34Z</updated>
<author>
<name>Parav Pandit</name>
<email>parav@nvidia.com</email>
</author>
<published>2020-11-25T09:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a7b43649507dae4e55ff0087cad4e4dd1c6d5b99'/>
<id>urn:sha1:a7b43649507dae4e55ff0087cad4e4dd1c6d5b99</id>
<content type='text'>
When devlink reload operation is not used, netdev of an Ethernet port may
be present in different net namespace than the net namespace of the
devlink instance.

Ensure that both the devlink instance and devlink port netdev are located
in same net namespace.

Fixes: 070c63f20f6c ("net: devlink: allow to change namespaces during reload")
Signed-off-by: Parav Pandit &lt;parav@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>devlink: Hold rtnl lock while reading netdev attributes</title>
<updated>2020-11-26T01:26:34Z</updated>
<author>
<name>Parav Pandit</name>
<email>parav@nvidia.com</email>
</author>
<published>2020-11-25T09:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b187c9b4178b87954dbc94e78a7094715794714f'/>
<id>urn:sha1:b187c9b4178b87954dbc94e78a7094715794714f</id>
<content type='text'>
A netdevice of a devlink port can be moved to different net namespace
than its parent devlink instance.
This scenario occurs when devlink reload is not used.

When netdevice is undergoing migration to net namespace, its ifindex
and name may change.

In such use case, devlink port query may read stale netdev attributes.

Fix it by reading them under rtnl lock.

Fixes: bfcd3a466172 ("Introduce devlink infrastructure")
Signed-off-by: Parav Pandit &lt;parav@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>devlink: Fix reload stats structure</title>
<updated>2020-11-24T21:04:04Z</updated>
<author>
<name>Moshe Shemesh</name>
<email>moshe@mellanox.com</email>
</author>
<published>2020-11-23T05:36:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5204bb683c1633e550c2124ccc2358dd645a80db'/>
<id>urn:sha1:5204bb683c1633e550c2124ccc2358dd645a80db</id>
<content type='text'>
Fix reload stats structure exposed to the user. Change stats structure
hierarchy to have the reload action as a parent of the stat entry and
then stat entry includes value per limit. This will also help to avoid
string concatenation on iproute2 output.

Reload stats structure before this fix:
"stats": {
    "reload": {
        "driver_reinit": 2,
        "fw_activate": 1,
        "fw_activate_no_reset": 0
     }
}

After this fix:
"stats": {
    "reload": {
        "driver_reinit": {
            "unspecified": 2
        },
        "fw_activate": {
            "unspecified": 1,
            "no_reset": 0
        }
}

Fixes: a254c264267e ("devlink: Add reload stats")
Signed-off-by: Moshe Shemesh &lt;moshe@mellanox.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Link: https://lore.kernel.org/r/1606109785-25197-1-git-send-email-moshe@mellanox.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>devlink: Add blackhole_nexthop trap</title>
<updated>2020-11-24T20:14:56Z</updated>
<author>
<name>Ido Schimmel</name>
<email>idosch@nvidia.com</email>
</author>
<published>2020-11-23T07:12:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0a5013e29cbfe55b3e26b7548a741d88a779d91'/>
<id>urn:sha1:f0a5013e29cbfe55b3e26b7548a741d88a779d91</id>
<content type='text'>
Add a packet trap to report packets that were dropped due to a
blackhole nexthop.

Signed-off-by: Ido Schimmel &lt;idosch@nvidia.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: move flash end and begin to core devlink</title>
<updated>2020-11-20T05:41:02Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.e.keller@intel.com</email>
</author>
<published>2020-11-18T19:06:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=52cc5f3a166a33012ebca2cdefebf4c689110068'/>
<id>urn:sha1:52cc5f3a166a33012ebca2cdefebf4c689110068</id>
<content type='text'>
When performing a flash update via devlink, device drivers may inform
user space of status updates via
devlink_flash_update_(begin|end|timeout|status)_notify functions.

It is expected that drivers do not send any status notifications unless
they send a begin and end message. If a driver sends a status
notification without sending the appropriate end notification upon
finishing (regardless of success or failure), the current implementation
of the devlink userspace program can get stuck endlessly waiting for the
end notification that will never come.

The current ice driver implementation may send such a status message
without the appropriate end notification in rare cases.

Fixing the ice driver is relatively simple: we just need to send the
begin_notify at the start of the function and always send an end_notify
no matter how the function exits.

Rather than assuming driver authors will always get this right in the
future, lets just fix the API so that it is not possible to get wrong.
Make devlink_flash_update_begin_notify and
devlink_flash_update_end_notify static, and call them in devlink.c core
code. Always send the begin_notify just before calling the driver's
flash_update routine. Always send the end_notify just after the routine
returns regardless of success or failure.

Doing this makes the status notification easier to use from the driver,
as it no longer needs to worry about catching failures and cleaning up
by calling devlink_flash_update_end_notify. It is now no longer possible
to do the wrong thing in this regard. We also save a couple of lines of
code in each driver.

Signed-off-by: Jacob Keller &lt;jacob.e.keller@intel.com&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: 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://git.shady.money/linux/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: Add missing genlmsg_cancel() in devlink_nl_sb_port_pool_fill()</title>
<updated>2020-11-15T00:23:19Z</updated>
<author>
<name>Wang Hai</name>
<email>wanghai38@huawei.com</email>
</author>
<published>2020-11-13T11:16:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=849920c703392957f94023f77ec89ca6cf119d43'/>
<id>urn:sha1:849920c703392957f94023f77ec89ca6cf119d43</id>
<content type='text'>
If sb_occ_port_pool_get() failed in devlink_nl_sb_port_pool_fill(),
msg should be canceled by genlmsg_cancel().

Fixes: df38dafd2559 ("devlink: implement shared buffer occupancy monitoring interface")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Link: https://lore.kernel.org/r/20201113111622.11040-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
