From: Marcin Szycik <marcin.szycik@linux.intel.com>
To: Jiri Pirko <jiri@resnulli.us>, Leon Romanovsky <leon@kernel.org>
Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-net] ice: Block switchdev mode when ADQ is acvite and vice versa
Date: Thu, 3 Aug 2023 17:11:16 +0200 [thread overview]
Message-ID: <457944e2-c8bc-74a7-ec5b-4502c4ec2664@linux.intel.com> (raw)
In-Reply-To: <ZMuq9ph8HY6uAiGk@nanopsycho>
On 03.08.2023 15:26, Jiri Pirko wrote:
> Thu, Aug 03, 2023 at 03:11:26PM CEST, leon@kernel.org wrote:
>> On Tue, Aug 01, 2023 at 01:52:35PM +0200, Marcin Szycik wrote:
>>> ADQ and switchdev are not supported simultaneously. Enabling both at the
>>> same time can result in nullptr dereference.
>>>
>>> To prevent this, check if ADQ is active when changing devlink mode to
>>> switchdev mode, and check if switchdev is active when enabling ADQ.
>>>
>>> Fixes: fbc7b27af0f9 ("ice: enable ndo_setup_tc support for mqprio_qdisc")
>>> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
>>> ---
>>> drivers/net/ethernet/intel/ice/ice_eswitch.c | 5 +++++
>>> drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++++
>>> 2 files changed, 11 insertions(+)
>>>
>>> diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
>>> index ad0a007b7398..2ea5aaceee11 100644
>>> --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
>>> +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
>>> @@ -538,6 +538,11 @@ ice_eswitch_mode_set(struct devlink *devlink, u16 mode,
>>> break;
>>> case DEVLINK_ESWITCH_MODE_SWITCHDEV:
>>> {
>>> + if (ice_is_adq_active(pf)) {
>>> + dev_err(ice_pf_to_dev(pf), "switchdev cannot be configured - ADQ is active. Delete ADQ configs using TC and try again\n");
>
> Does this provide sufficient hint to the user? I mean, what's ADQ and
> how it is related to TC objects? Please be more precise.
Application Device Queues, a conflicting feature unrelated to switchdev.
If it's enabled, there's a good chance the user knows what it is because
they configured it.
Could you suggest a better error message?
>
>
>>
>> It needs to be reported through netlink extack.
>>
>>> + return -EOPNOTSUPP;
>>> + }
>>> +
>>> dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to switchdev",
>>> pf->hw.pf_id);
>>> NL_SET_ERR_MSG_MOD(extack, "Changed eswitch mode to switchdev");
>>
>> Thanks
>>
>
Regards,
Marcin
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-08-03 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 11:52 [Intel-wired-lan] [PATCH iwl-net] ice: Block switchdev mode when ADQ is acvite and vice versa Marcin Szycik
2023-08-01 12:06 ` Przemek Kitszel
2023-08-03 13:11 ` Leon Romanovsky
2023-08-03 13:26 ` Jiri Pirko
2023-08-03 15:11 ` Marcin Szycik [this message]
2023-08-03 17:43 ` Jiri Pirko
2023-08-03 14:58 ` Marcin Szycik
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=457944e2-c8bc-74a7-ec5b-4502c4ec2664@linux.intel.com \
--to=marcin.szycik@linux.intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jiri@resnulli.us \
--cc=leon@kernel.org \
--cc=netdev@vger.kernel.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