linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
@ 2021-10-14 11:18 Veerendranath Jakkam
  2021-10-21 15:32 ` Johannes Berg
  2021-11-26  7:25 ` [PATCH 1/2] nl80211: Add support to set AP settings flags with single attribute Veerendranath Jakkam
  0 siblings, 2 replies; 9+ messages in thread
From: Veerendranath Jakkam @ 2021-10-14 11:18 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Add AP SME device feature flag to advertise that the SA Query procedures
are handled in driver.

If this flag is advertised SA Query request or response frames from peers
are not reported to userspace. Thus userspace components shall skip SA
Query specific validations.

Ex: When AP started with Operating Channel Validation(OCV) support and
channel switch occurs, hostapd starts SA Query timer for OCV enabled
STAs. Hostapd sends deauth to the STAs which didn't send SA Query
request before timeout, Hostapd can skip such validations when this flag
advertised.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
---
 include/uapi/linux/nl80211.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index eda608b..99746aa 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -5735,13 +5735,17 @@ enum nl80211_tdls_operation {
 	NL80211_TDLS_DISABLE_LINK,
 };
 
-/*
+/**
  * enum nl80211_ap_sme_features - device-integrated AP features
- * Reserved for future use, no bits are defined in
- * NL80211_ATTR_DEVICE_AP_SME yet.
+ * @NL80211_DEVICE_AP_SME_SA_QUERY_OFFLOAD: Driver handles SA Query procedures.
+ *	If this flag is advertised by the driver, SA Query request/response
+ *	frames are handled within the driver and won't be reported to userspace.
+ *	Userspace shall skip SA Query specific validations if the driver is
+ *	advertizing this capability.
+ */
 enum nl80211_ap_sme_features {
+	NL80211_DEVICE_AP_SME_SA_QUERY_OFFLOAD		= 1 << 0,
 };
- */
 
 /**
  * enum nl80211_feature_flags - device/driver features
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
  2021-10-14 11:18 [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device Veerendranath Jakkam
@ 2021-10-21 15:32 ` Johannes Berg
  2021-10-22 13:26   ` vjakkam
  2021-11-26  7:25 ` [PATCH 1/2] nl80211: Add support to set AP settings flags with single attribute Veerendranath Jakkam
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2021-10-21 15:32 UTC (permalink / raw)
  To: Veerendranath Jakkam; +Cc: linux-wireless

On Thu, 2021-10-14 at 16:48 +0530, Veerendranath Jakkam wrote:
> Add AP SME device feature flag to advertise that the SA Query procedures
> are handled in driver.
> 
> If this flag is advertised SA Query request or response frames from peers
> are not reported to userspace. Thus userspace components shall skip SA
> Query specific validations.
> 
> Ex: When AP started with Operating Channel Validation(OCV) support and
> channel switch occurs, hostapd starts SA Query timer for OCV enabled
> STAs. Hostapd sends deauth to the STAs which didn't send SA Query
> request before timeout, Hostapd can skip such validations when this flag
> advertised.

So how's that going to work with older hostapd? It'll be offloaded, and
then hostapd doesn't know, so it's still going to disconnect them?

So should be that hostapd also opts in to this driver behaviour?

Also ... it _really_ would be good if there were upstream drivers with
these things ...

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
  2021-10-21 15:32 ` Johannes Berg
@ 2021-10-22 13:26   ` vjakkam
  2021-10-22 13:29     ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: vjakkam @ 2021-10-22 13:26 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 2021-10-21 21:02, Johannes Berg wrote:
> On Thu, 2021-10-14 at 16:48 +0530, Veerendranath Jakkam wrote:
>> Add AP SME device feature flag to advertise that the SA Query 
>> procedures
>> are handled in driver.
>> 
>> If this flag is advertised SA Query request or response frames from 
>> peers
>> are not reported to userspace. Thus userspace components shall skip SA
>> Query specific validations.
>> 
>> Ex: When AP started with Operating Channel Validation(OCV) support and
>> channel switch occurs, hostapd starts SA Query timer for OCV enabled
>> STAs. Hostapd sends deauth to the STAs which didn't send SA Query
>> request before timeout, Hostapd can skip such validations when this 
>> flag
>> advertised.
> 
> So how's that going to work with older hostapd? It'll be offloaded, and
> then hostapd doesn't know, so it's still going to disconnect them?
> 
> So should be that hostapd also opts in to this driver behaviour?

yes, we have to update hostapd also with new implementation based on the
feature flag.

> 
> Also ... it _really_ would be good if there were upstream drivers with
> these things ...

I fully agree. But unfortunately none of the upstream drivers 
implemented
OCV features within them.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
  2021-10-22 13:26   ` vjakkam
@ 2021-10-22 13:29     ` Johannes Berg
  2021-10-25  8:27       ` vjakkam
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2021-10-22 13:29 UTC (permalink / raw)
  To: vjakkam; +Cc: linux-wireless

On Fri, 2021-10-22 at 18:56 +0530, vjakkam@codeaurora.org wrote:
> > 
> > So how's that going to work with older hostapd? It'll be offloaded, and
> > then hostapd doesn't know, so it's still going to disconnect them?
> > 
> > So should be that hostapd also opts in to this driver behaviour?
> 
> yes, we have to update hostapd also with new implementation based on the
> feature flag.

That wasn't my question. My question was what happens if you have a
hostapd that's *not* updated?>

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
  2021-10-22 13:29     ` Johannes Berg
@ 2021-10-25  8:27       ` vjakkam
  2021-10-25  8:28         ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: vjakkam @ 2021-10-25  8:27 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 2021-10-22 18:59, Johannes Berg wrote:
> On Fri, 2021-10-22 at 18:56 +0530, vjakkam@codeaurora.org wrote:
>> >
>> > So how's that going to work with older hostapd? It'll be offloaded, and
>> > then hostapd doesn't know, so it's still going to disconnect them?
>> >
>> > So should be that hostapd also opts in to this driver behaviour?
>> 
>> yes, we have to update hostapd also with new implementation based on 
>> the
>> feature flag.
> 
> That wasn't my question. My question was what happens if you have a
> hostapd that's *not* updated?>
> 
> johannes

Apologies for not clear answer in my previous reply.
Yes, If hostapd is not updated, it's going to disconnect the STAs.

We should update hostapd also to opt in this driver behavior.

Thanks,
Veeru

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
  2021-10-25  8:27       ` vjakkam
@ 2021-10-25  8:28         ` Johannes Berg
  2021-11-22  6:11           ` vjakkam
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2021-10-25  8:28 UTC (permalink / raw)
  To: vjakkam; +Cc: linux-wireless

On Mon, 2021-10-25 at 13:57 +0530, vjakkam@codeaurora.org wrote:
> On 2021-10-22 18:59, Johannes Berg wrote:
> > On Fri, 2021-10-22 at 18:56 +0530, vjakkam@codeaurora.org wrote:
> > > > 
> > > > So how's that going to work with older hostapd? It'll be offloaded, and
> > > > then hostapd doesn't know, so it's still going to disconnect them?
> > > > 
> > > > So should be that hostapd also opts in to this driver behaviour?
> > > 
> > > yes, we have to update hostapd also with new implementation based on 
> > > the
> > > feature flag.
> > 
> > That wasn't my question. My question was what happens if you have a
> > hostapd that's *not* updated?>
> > 
> > johannes
> 
> Apologies for not clear answer in my previous reply.
> Yes, If hostapd is not updated, it's going to disconnect the STAs.
> 
> We should update hostapd also to opt in this driver behavior.

That would also mean the driver opts in and asks the firmware to offload
only if hostapd did, right?

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device
  2021-10-25  8:28         ` Johannes Berg
@ 2021-11-22  6:11           ` vjakkam
  0 siblings, 0 replies; 9+ messages in thread
From: vjakkam @ 2021-11-22  6:11 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 2021-10-25 13:58, Johannes Berg wrote:
> On Mon, 2021-10-25 at 13:57 +0530, vjakkam@codeaurora.org wrote:
>> On 2021-10-22 18:59, Johannes Berg wrote:
>> > On Fri, 2021-10-22 at 18:56 +0530, vjakkam@codeaurora.org wrote:
>> > > >
>> > > > So how's that going to work with older hostapd? It'll be offloaded, and
>> > > > then hostapd doesn't know, so it's still going to disconnect them?
>> > > >
>> > > > So should be that hostapd also opts in to this driver behaviour?
>> > >
>> > > yes, we have to update hostapd also with new implementation based on
>> > > the
>> > > feature flag.
>> >
>> > That wasn't my question. My question was what happens if you have a
>> > hostapd that's *not* updated?>
>> >
>> > johannes
>> 
>> Apologies for not clear answer in my previous reply.
>> Yes, If hostapd is not updated, it's going to disconnect the STAs.
>> 
>> We should update hostapd also to opt in this driver behavior.
> 
> That would also mean the driver opts in and asks the firmware to 
> offload
> only if hostapd did, right?
> 
> johannes

Yeah, Thanks for the comments.
I will upload v2 patch with suggested changes.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] nl80211: Add support to set AP settings flags with single attribute
  2021-10-14 11:18 [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device Veerendranath Jakkam
  2021-10-21 15:32 ` Johannes Berg
@ 2021-11-26  7:25 ` Veerendranath Jakkam
  2021-11-26  7:25   ` [PATCH 2/2] nl80211: Add support to offload SA Query procedures for AP SME device Veerendranath Jakkam
  1 sibling, 1 reply; 9+ messages in thread
From: Veerendranath Jakkam @ 2021-11-26  7:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

In previous method each AP settings flag is represented by a top-level
flag attribute and conversion to enum cfg80211_ap_settings_flags had to
be done before sending them to driver. This commit is to make it easier
to define new AP settings flags and sending them to driver.

This commit also deprecate sending of
%NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP. But to
maintain backwards compatibility checks for
%NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP when
%NL80211_ATTR_AP_SETTINGS_FLAGS not present in %NL80211_CMD_START_AP.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
---
 include/net/cfg80211.h       | 11 -----------
 include/uapi/linux/nl80211.h | 20 +++++++++++++++++++-
 net/wireless/nl80211.c       |  8 ++++++--
 3 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 362da9f..5ccd9b4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1188,17 +1188,6 @@ struct cfg80211_unsol_bcast_probe_resp {
 };
 
 /**
- * enum cfg80211_ap_settings_flags - AP settings flags
- *
- * Used by cfg80211_ap_settings
- *
- * @AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external authentication
- */
-enum cfg80211_ap_settings_flags {
-	AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = BIT(0),
-};
-
-/**
  * struct cfg80211_ap_settings - AP configuration
  *
  * Used to configure an AP interface.
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 3e73482..52ac549 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2470,7 +2470,9 @@ enum nl80211_commands {
  *	space supports external authentication. This attribute shall be used
  *	with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
  *	may offload authentication processing to user space if this capability
- *	is indicated in the respective requests from the user space.
+ *	is indicated in the respective requests from the user space. (This flag
+ *	attribute deprecated for %NL80211_CMD_START_AP, use
+ *	%NL80211_ATTR_AP_SETTINGS_FLAGS)
  *
  * @NL80211_ATTR_NSS: Station's New/updated  RX_NSS value notified using this
  *	u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
@@ -2646,6 +2648,10 @@ enum nl80211_commands {
  *	switching on a different channel during CAC detection on the selected
  *	radar channel.
  *
+ * @NL80211_ATTR_AP_SETTINGS_FLAGS: u32 attribute contains ap settings flags,
+ *	enumerated in &enum nl80211_ap_settings_flags. This attribute shall be
+ *	used with %NL80211_CMD_START_AP request.
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3154,6 +3160,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_RADAR_OFFCHAN,
 
+	NL80211_ATTR_AP_SETTINGS_FLAGS,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -7475,4 +7483,14 @@ enum nl80211_mbssid_config_attributes {
 	NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
 };
 
+/**
+ * enum nl80211_ap_settings_flags - AP settings flags
+ *
+ * @NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external
+ *	authentication.
+ */
+enum nl80211_ap_settings_flags {
+	NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT	= 1 << 0,
+};
+
 #endif /* __LINUX_NL80211_H */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 83a1ba9..744917b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -777,6 +777,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 			NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
 	[NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
 	[NL80211_ATTR_RADAR_OFFCHAN] = { .type = NLA_FLAG },
+	[NL80211_ATTR_AP_SETTINGS_FLAGS] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -5712,8 +5713,11 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 
 	nl80211_calculate_ap_params(params);
 
-	if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
-		params->flags |= AP_SETTINGS_EXTERNAL_AUTH_SUPPORT;
+	if (info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS])
+		params->flags = nla_get_u32(
+			info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]);
+	else if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
+		params->flags |= NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT;
 
 	wdev_lock(wdev);
 	err = rdev_start_ap(rdev, dev, params);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] nl80211: Add support to offload SA Query procedures for AP SME device
  2021-11-26  7:25 ` [PATCH 1/2] nl80211: Add support to set AP settings flags with single attribute Veerendranath Jakkam
@ 2021-11-26  7:25   ` Veerendranath Jakkam
  0 siblings, 0 replies; 9+ messages in thread
From: Veerendranath Jakkam @ 2021-11-26  7:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Add a flag attribute to use in ap settings to indicate userspace
supports offloading of SA Query procedures to driver. Also add AP SME
device feature flag to advertise that the SA Query procedures offloaded
to driver when userspace indicates support for offloading of SA Query
procedures.

Driver handles SA Query procedures in driver's SME it self and skip
sending SA Query request or response frames to userspace when userspace
indicates support for SA Query procedures offload. But if userspace
doesn't advertise support for SA Query procedures offload driver shall
not offload SA Query procedures handling.

Also userspace with SA Query procedures offload capability shall skip SA
Query specific validations when driver indicates support for handling SA
Query procedures.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
---
 include/uapi/linux/nl80211.h | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 52ac549..96fbb60 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -5754,13 +5754,15 @@ enum nl80211_tdls_operation {
 	NL80211_TDLS_DISABLE_LINK,
 };
 
-/*
+/**
  * enum nl80211_ap_sme_features - device-integrated AP features
- * Reserved for future use, no bits are defined in
- * NL80211_ATTR_DEVICE_AP_SME yet.
+ * @NL80211_AP_SME_SA_QUERY_OFFLOAD: SA Query procedures offloaded to driver
+ *	when user space indicates support for SA Query procedures offload during
+ *	"start ap" with %NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT.
+ */
 enum nl80211_ap_sme_features {
+	NL80211_AP_SME_SA_QUERY_OFFLOAD		= 1 << 0,
 };
- */
 
 /**
  * enum nl80211_feature_flags - device/driver features
@@ -7488,9 +7490,15 @@ enum nl80211_mbssid_config_attributes {
  *
  * @NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external
  *	authentication.
+ * @NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT: Userspace supports SA Query
+ *	procedures offload to driver. If driver advertises
+ *	%NL80211_AP_SME_SA_QUERY_OFFLOAD in AP SME features, userspace shall
+ *	ignore SA Query procedures and validations when this flag is set by
+ *	userspace.
  */
 enum nl80211_ap_settings_flags {
 	NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT	= 1 << 0,
+	NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT	= 1 << 1,
 };
 
 #endif /* __LINUX_NL80211_H */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-26  7:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 11:18 [PATCH] nl80211: Indicate SA Query procedures offload for AP SME device Veerendranath Jakkam
2021-10-21 15:32 ` Johannes Berg
2021-10-22 13:26   ` vjakkam
2021-10-22 13:29     ` Johannes Berg
2021-10-25  8:27       ` vjakkam
2021-10-25  8:28         ` Johannes Berg
2021-11-22  6:11           ` vjakkam
2021-11-26  7:25 ` [PATCH 1/2] nl80211: Add support to set AP settings flags with single attribute Veerendranath Jakkam
2021-11-26  7:25   ` [PATCH 2/2] nl80211: Add support to offload SA Query procedures for AP SME device Veerendranath Jakkam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).