Hi, > -----Original Message----- > From: Kalle Valo <kvalo@xxxxxxxxxx> > Sent: Thursday, 6 June 2024 12:28 > To: Korenblit, Miriam Rachel <miriam.rachel.korenblit@xxxxxxxxx> > Cc: johannes@xxxxxxxxxxxxxxxx; linux-wireless@xxxxxxxxxxxxxxx; Peer, Ilan > <ilan.peer@xxxxxxxxx>; Berg, Johannes <johannes.berg@xxxxxxxxx>; > iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@xxxxxxxxx> > Subject: Re: [PATCH 6/7] wifi: cfg80211: Add support for interface usage > notification > > Miri Korenblit <miriam.rachel.korenblit@xxxxxxxxx> writes: > > > From: Ilan Peer <ilan.peer@xxxxxxxxx> > > > > In some cases, when an interface is added by user space, user space > > might not know yet what is the intended type of the interface, e.g., > > before a P2P Group Ownership Negotiation (GON) an interface is added > > but only at the end of the GON flow the final interface type is > > determined. This doesn't allow the kernel drivers to prepare for the > > actual interface type, e.g., make resources available for the > > interface type etc. > > > > Generally, adding an interface doesn't necessarily imply that it will > > actually be used soon, and as described the interface might not be > > used with the type it's added as. > > > > This new API allows user space to indicate that it does indeed intend > > to use the interface soon, along with the types (of which the > > interface must be one) that may be selected for that usage. This will > > allow the underlying driver to adjust resources accordingly. > > > > Signed-off-by: Ilan Peer <ilan.peer@xxxxxxxxx> > > Reviewed-by: Johannes Berg <johannes.berg@xxxxxxxxx> > > Tested-by: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@xxxxxxxxx> > > This new command just looks weird to me, do we really need it? I would > expect to see a workaround like this in out-of-tree drivers but not in upstream. > As depicted above, the need to inform the driver about the intended usage of the interface is real. We encountered several P2P cases in which an interface was added and P2P Group Ownership Negotiation and P2P Invitation signalling were completed successfully, but the P2P Group Session establishment failed since the interface type changed from P2P Client to P2P GO and the local device was no longer able to accommodate the P2P GO operation due to resource constraints. With this new API, user space can now inform the driver about the intended usage of the interface so the driver will make the resources available for all possible interface types. With this the information exchanged during the P2P signalling would correctly reflect state and the P2P group session would be able to be established. I think that this could be useful in other use cases where the interface type is changed, e.g., when starting AP operation on the interface, but before the AP is setup, the interface type is set to station mode to allow scanning operation etc. Regards, Ilan.