From: Jiri Pirko <jiri@resnulli.us>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next] devlink: Set device as early as possible
Date: Mon, 9 Aug 2021 11:07:30 +0200 [thread overview]
Message-ID: <YRDwUrOK1YHsK7CE@nanopsycho> (raw)
In-Reply-To: <6859503f7e3e6cd706bf01ef06f1cae8c0b0970b.1628449004.git.leonro@nvidia.com>
Sun, Aug 08, 2021 at 08:57:43PM CEST, leon at kernel.org wrote:
>From: Leon Romanovsky <leonro@nvidia.com>
>
>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->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 <leonro@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
next prev parent reply other threads:[~2021-08-09 9:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-08 18:57 [Intel-wired-lan] [PATCH net-next] devlink: Set device as early as possible Leon Romanovsky
2021-08-09 9:07 ` Jiri Pirko [this message]
2021-08-09 9:30 ` patchwork-bot+netdevbpf
2021-08-10 12:38 ` Prabhakar Kushwaha
2021-08-10 13:45 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YRDwUrOK1YHsK7CE@nanopsycho \
--to=jiri@resnulli.us \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox