From: Jianbo Liu <jianbol@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Tariq Toukan <tariqt@nvidia.com>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Saeed Mahameed <saeedm@nvidia.com>,
"Leon Romanovsky" <leon@kernel.org>,
Mark Bloch <mbloch@nvidia.com>, <netdev@vger.kernel.org>,
<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Gal Pressman <gal@nvidia.com>
Subject: Re: [PATCH net 2/3] net/mlx5e: Prevent entering switchdev mode with inconsistent netns
Date: Thu, 11 Sep 2025 15:48:24 +0800 [thread overview]
Message-ID: <5fa69070-59e8-4eba-877e-f0728088fd48@nvidia.com> (raw)
In-Reply-To: <20250910174842.6c82fb0c@kernel.org>
On 9/11/2025 8:48 AM, Jakub Kicinski wrote:
> On Wed, 10 Sep 2025 11:01:18 +0800 Jianbo Liu wrote:
>> On 9/10/2025 9:23 AM, Jakub Kicinski wrote:
>>> On Mon, 8 Sep 2025 13:07:05 +0300 Tariq Toukan wrote:
>>>> If the PF's netns has been moved and differs from the devlink's netns,
>>>> enabling switchdev mode would create an invalid state where
>>>> representors and PF exist in different namespaces.
>>>>
>>>> To prevent this inconsistent configuration,
>>>
>>> Could you explain clearly what is the problem with having different
>>> netdevs in different namespaces? From networking perspective it really
>>> doesn't matter.
>>
>> There is a requirement from customer who wants to manage openvswitch in
>> a container. But he can't complete the steps (changing eswitch and
>> configuring OVS) in the container if the netns are different.
>
> You're preventing a configuration which you think is "bad" (for a
> reason unknown). How is _rejecting_ a config enabling you to fulfill
> some "customer requirement" which sounds like having all interfaces
> in a separate ns?
>
My apologies, I wasn't clear. The problem is specific to the OVS control
plane. ovs-vsctl cannot manage the switch if the PF uplink and VF
representors are in different namespaces. When the PF is in a container
while the devlink instance is bound to the host, enabling switchdev
creates this exact split: the PF uplink stays in the container, while
the VF representors are created on the host.
Our patch prevents this broken state by requiring the devlink namespace
to be set to the container's namespace before switchdev can be enabled.
>> Besides, ibdev is dependent on netdev, there is refcnt issue if netdev
>> is moved to other netns but devlink netns is not changed by "devlink dev
>> reload netns" command.
>
> shrug
next prev parent reply other threads:[~2025-09-11 7:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 10:07 [PATCH net 0/3] mlx5e misc fixes 2025-09-08 Tariq Toukan
2025-09-08 10:07 ` [PATCH net 1/3] net/mlx5e: Harden uplink netdev access against device unbind Tariq Toukan
2025-09-10 1:23 ` Jakub Kicinski
2025-09-10 3:23 ` Jianbo Liu
2025-09-11 0:45 ` Jakub Kicinski
2025-09-11 7:09 ` Jianbo Liu
2025-09-12 11:07 ` Przemek Kitszel
2025-09-15 0:59 ` Jianbo Liu
2025-09-08 10:07 ` [PATCH net 2/3] net/mlx5e: Prevent entering switchdev mode with inconsistent netns Tariq Toukan
2025-09-10 1:23 ` Jakub Kicinski
2025-09-10 3:01 ` Jianbo Liu
2025-09-11 0:48 ` Jakub Kicinski
2025-09-11 7:48 ` Jianbo Liu [this message]
2025-09-12 0:11 ` Jakub Kicinski
2025-09-12 1:12 ` Jianbo Liu
2025-09-08 10:07 ` [PATCH net 3/3] net/mlx5e: Add a miss level for ipsec crypto offload Tariq Toukan
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=5fa69070-59e8-4eba-877e-f0728088fd48@nvidia.com \
--to=jianbol@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/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
all inboxes | Powered by JetHome®