Subject: Re: [PATCH net-next v1] devlink: Notify eswitch mode changes to devlink monitor

From: Jakub Kicinski <[email-masked]>
Date: Fri, 21 Nov 2025 06:48:13 -0800

On Fri, 21 Nov 2025 09:35:24 +0100 Jiri Pirko wrote:
> Thu, Nov 20, 2025 at 03:52:23PM +0100, [email-masked] wrote:
> >On Thu, 20 Nov 2025 13:09:35 +0100 Jiri Pirko wrote:  
> >> Thu, Nov 20, 2025 at 02:56:28AM +0100, [email-masked] wrote:  
> >> 
> >> Nope, I reviewed internally, that's why the tag was taken.
> >>   
> >> Well, For the rest of the notifications, we have NEW/DEL commands.
> >> However in this case, as "eswitch" is somehow a subobject, there is no
> >> NEW/DEL value defined. I'm fine with using GET for notifications for it.
> >> I'm also okay with adding new ID, up to you.  
> >
> >Let's add a DEVLINK_CMD_ESWITCH_NTF. Having a separate ID makes it
> >easier / possible to use the same socket for requests and notifications.  
> 
> Well, you still can use the same socket with just ESWITCH_GET. Request
> messages are going from userspace, notifications from kernel, there is
> no mixup.

AFAICT DEVLINK_CMD_ESWITCH_GET is already used from kernel.
We could technically use the seq to differentiate but that's not very
generic.

> For the sake of consistency, shouldn't the name be ESWITCH_NEW?

No preference on the naming, we can go with _NEW, tho, as I think Parav
is alluding to, we don't send _NEW when device is created (which would
be the natural fit for _NEW). Perhaps we should?