Skip to contentSkip to conversation

ath10k: Disable 4addr source port learning in 10.4 FW by default

PATCH Superseded Sathishkumar Muruganandam 2 participants 9 messages Nov 9, 2018 – Nov 13, 2018 Qualcomm Atheros ATH10K wireless driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Disable 4addr source port learning in 10.4 FW by default

Currently in 10.4 FW, all the received 4addr frames are processed for source port learning which is enabled by default. This learning can't be disabled by default in FW since it breaks backward compatibility.

Since ath10k uses mac80211 based 4addr mode, source port learning done in 10.4 FW is redundant and also causes issues when 3addr frames are transmitted/received for a 4addr station.

One such visible functional impact is when GTK rekey frame from hostapd based AP to 4addr STA is dropped in AP's 10.4 FW. This is since GTK rekey EAPOL frame is 3addr frame on AP interface and STA enabled with 4addr is already allowed for receiving 3addr EAPOL frames.

Source port learning implementation in 10.4 FW drops this 3addr GTK rekey frame in AP destinated for 4addr STA causing disassociation and re-association for every GTK rekey session. GTK rekey issue is not seen when learning is disabled in FW.

To prevent such issues without breaking backward compatibility, FW advertises new service bit making the source port learning configurable and this learning is being currently disabled during ath10k vdev creation.

* Tested HW: QCA9984
* Tested FW: 10.4-3.6.0.1-00003

---
 drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++++++
 drivers/net/wireless/ath/ath10k/wmi.c |  2 ++
 drivers/net/wireless/ath/ath10k/wmi.h | 21 ++++++++++++++++++++-
 3 files changed, 33 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/mac.c +11 -0
index c5130fa264eb..aac4d842d504 100644
@@ -5154,6 +5154,17 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
 		goto err;
 	}
 
+	if (test_bit(WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
+		     ar->wmi.svc_map)) {
+		vdev_param = ar->wmi.vdev_param->disable_4addr_src_lrn;
+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+						WMI_VDEV_DISABLE_4_ADDR_SRC_LRN);
+		if (ret && ret != -EOPNOTSUPP) {
+			ath10k_warn(ar, "failed to disable 4addr src lrn vdev %i: %d\n",
+				    arvif->vdev_id, ret);
+		}
+	}
+
 	ar->free_vdev_map &= ~(1LL << arvif->vdev_id);
 	spin_lock_bh(&ar->data_lock);
 	list_add(&arvif->list, &ar->arvifs);
drivers/net/wireless/ath/ath10k/wmi.c +2 -0
index 659513bf4ddc..8757ae297084 100644
@@ -825,6 +825,7 @@ static struct wmi_vdev_param_map wmi_vdev_param_map = {
 	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,
 	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,
 	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED,
+	.disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED,
 };
 
 /* 10.X WMI VDEV param map */
@@ -900,6 +901,7 @@ static struct wmi_vdev_param_map wmi_10x_vdev_param_map = {
 	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,
 	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,
 	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED,
+	.disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED,
 };
 
 static struct wmi_vdev_param_map wmi_10_2_4_vdev_param_map = {
drivers/net/wireless/ath/ath10k/wmi.h +20 -1
index 58e33ab9e0e9..3e17be938420 100644
@@ -205,6 +205,7 @@ enum wmi_service {
 	WMI_SERVICE_SPOOF_MAC_SUPPORT,
 	WMI_SERVICE_TX_DATA_ACK_RSSI,
 	WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+	WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
 
 	/* keep last */
 	WMI_SERVICE_MAX,
@@ -359,6 +360,9 @@ enum wmi_10_4_service {
 	WMI_10_4_SERVICE_PEER_TID_CONFIGS_SUPPORT,
 	WMI_10_4_SERVICE_VDEV_BCN_RATE_CONTROL,
 	WMI_10_4_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+	WMI_10_4_SERVICE_HTT_ASSERT_TRIGGER_SUPPORT,
+	WMI_10_4_SERVICE_VDEV_FILTER_NEIGHBOR_RX_PACKETS,
+	WMI_10_4_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
 };
 
 static inline char *wmi_service_name(int service_id)
@@ -786,6 +790,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
 	       WMI_SERVICE_TX_DATA_ACK_RSSI, len);
 	SVCMAP(WMI_10_4_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
 	       WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT, len);
+	SVCMAP(WMI_10_4_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
+	       WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT, len);
 }
 
 #undef SVCMAP
@@ -5065,6 +5071,7 @@ struct wmi_vdev_param_map {
 	u32 bw_nss_ratemask;
 	u32 inc_tsf;
 	u32 dec_tsf;
+	u32 disable_4addr_src_lrn;
 };
 
 #define WMI_VDEV_PARAM_UNSUPPORTED 0
@@ -5404,7 +5411,19 @@ enum wmi_10_4_vdev_param {
 	WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY,
 	WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS,
 	WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
-};
+	WMI_10_4_VDEV_PARAM_SELFGEN_FIXED_RATE,
+	WMI_10_4_VDEV_PARAM_AMPDU_SUBFRAME_SIZE_PER_AC,
+	WMI_10_4_VDEV_PARAM_NSS_VHT160,
+	WMI_10_4_VDEV_PARAM_NSS_VHT80_80,
+	WMI_10_4_VDEV_PARAM_AMSDU_SUBFRAME_SIZE_PER_AC,
+	WMI_10_4_VDEV_PARAM_DISABLE_CABQ,
+	WMI_10_4_VDEV_PARAM_SIFS_TRIGGER_RATE,
+	WMI_10_4_VDEV_PARAM_TX_POWER,
+	WMI_10_4_VDEV_PARAM_ENABLE_DISABLE_RTT_RESPONDER_ROLE,
+	WMI_10_4_VDEV_PARAM_DISABLE_4_ADDR_SRC_LRN,
+};
+
+#define WMI_VDEV_DISABLE_4_ADDR_SRC_LRN 1
 
 #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
 #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
Signature · 1 line
2.17.1
#2 lore raw
In reply to Sathishkumar Muruganandam

after tested 2 WDS devices (one WDS AP, one WDS STA) with 9984 (netgear r7800) i found out that the issue persists. gtk rekeying fails, so disconnect and reconnect after 60 minutes. but the issue is not present with other classic atheros 802.11n WDS STA devices. so there is still a issue with 9984 WDS STA

Sebastian

Am 09.11.2018 um 07:11 schrieb Sathishkumar Muruganandam:

Quoted 134 lines

Currently in 10.4 FW, all the received 4addr frames are processed for source port learning which is enabled by default. This learning can't be disabled by default in FW since it breaks backward compatibility.

Since ath10k uses mac80211 based 4addr mode, source port learning done in 10.4 FW is redundant and also causes issues when 3addr frames are transmitted/received for a 4addr station.

One such visible functional impact is when GTK rekey frame from hostapd based AP to 4addr STA is dropped in AP's 10.4 FW. This is since GTK rekey EAPOL frame is 3addr frame on AP interface and STA enabled with 4addr is already allowed for receiving 3addr EAPOL frames.

Source port learning implementation in 10.4 FW drops this 3addr GTK rekey frame in AP destinated for 4addr STA causing disassociation and re-association for every GTK rekey session. GTK rekey issue is not seen when learning is disabled in FW.

To prevent such issues without breaking backward compatibility, FW advertises new service bit making the source port learning configurable and this learning is being currently disabled during ath10k vdev creation.

* Tested HW: QCA9984
* Tested FW: 10.4-3.6.0.1-00003

---
  drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++++++
  drivers/net/wireless/ath/ath10k/wmi.c |  2 ++
  drivers/net/wireless/ath/ath10k/wmi.h | 21 ++++++++++++++++++++-
  3 files changed, 33 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/mac.c +11 -0
index c5130fa264eb..aac4d842d504 100644
@@ -5154,6 +5154,17 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
  		goto err;
  	}
 
+	if (test_bit(WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
+		     ar->wmi.svc_map)) {
+		vdev_param = ar->wmi.vdev_param->disable_4addr_src_lrn;
+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+						WMI_VDEV_DISABLE_4_ADDR_SRC_LRN);
+		if (ret && ret != -EOPNOTSUPP) {
+			ath10k_warn(ar, "failed to disable 4addr src lrn vdev %i: %d\n",
+				    arvif->vdev_id, ret);
+		}
+	}
+
  	ar->free_vdev_map &= ~(1LL << arvif->vdev_id);
  	spin_lock_bh(&ar->data_lock);
  	list_add(&arvif->list, &ar->arvifs);
drivers/net/wireless/ath/ath10k/wmi.c +2 -0
index 659513bf4ddc..8757ae297084 100644
@@ -825,6 +825,7 @@ static struct wmi_vdev_param_map wmi_vdev_param_map = {
  	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,
  	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,
  	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED,
+	.disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED,
  };
 
  /* 10.X WMI VDEV param map */
@@ -900,6 +901,7 @@ static struct wmi_vdev_param_map wmi_10x_vdev_param_map = {
  	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,
  	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,
  	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED,
+	.disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED,
  };
 
  static struct wmi_vdev_param_map wmi_10_2_4_vdev_param_map = {
drivers/net/wireless/ath/ath10k/wmi.h +20 -1
index 58e33ab9e0e9..3e17be938420 100644
@@ -205,6 +205,7 @@ enum wmi_service {
  	WMI_SERVICE_SPOOF_MAC_SUPPORT,
  	WMI_SERVICE_TX_DATA_ACK_RSSI,
  	WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+	WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
 
  	/* keep last */
  	WMI_SERVICE_MAX,
@@ -359,6 +360,9 @@ enum wmi_10_4_service {
  	WMI_10_4_SERVICE_PEER_TID_CONFIGS_SUPPORT,
  	WMI_10_4_SERVICE_VDEV_BCN_RATE_CONTROL,
  	WMI_10_4_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+	WMI_10_4_SERVICE_HTT_ASSERT_TRIGGER_SUPPORT,
+	WMI_10_4_SERVICE_VDEV_FILTER_NEIGHBOR_RX_PACKETS,
+	WMI_10_4_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
  };
 
  static inline char *wmi_service_name(int service_id)
@@ -786,6 +790,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
  	       WMI_SERVICE_TX_DATA_ACK_RSSI, len);
  	SVCMAP(WMI_10_4_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
  	       WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT, len);
+	SVCMAP(WMI_10_4_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
+	       WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT, len);
  }
 
  #undef SVCMAP
@@ -5065,6 +5071,7 @@ struct wmi_vdev_param_map {
  	u32 bw_nss_ratemask;
  	u32 inc_tsf;
  	u32 dec_tsf;
+	u32 disable_4addr_src_lrn;
  };
 
  #define WMI_VDEV_PARAM_UNSUPPORTED 0
@@ -5404,7 +5411,19 @@ enum wmi_10_4_vdev_param {
  	WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY,
  	WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS,
  	WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
-};
+	WMI_10_4_VDEV_PARAM_SELFGEN_FIXED_RATE,
+	WMI_10_4_VDEV_PARAM_AMPDU_SUBFRAME_SIZE_PER_AC,
+	WMI_10_4_VDEV_PARAM_NSS_VHT160,
+	WMI_10_4_VDEV_PARAM_NSS_VHT80_80,
+	WMI_10_4_VDEV_PARAM_AMSDU_SUBFRAME_SIZE_PER_AC,
+	WMI_10_4_VDEV_PARAM_DISABLE_CABQ,
+	WMI_10_4_VDEV_PARAM_SIFS_TRIGGER_RATE,
+	WMI_10_4_VDEV_PARAM_TX_POWER,
+	WMI_10_4_VDEV_PARAM_ENABLE_DISABLE_RTT_RESPONDER_ROLE,
+	WMI_10_4_VDEV_PARAM_DISABLE_4_ADDR_SRC_LRN,
+};
+
+#define WMI_VDEV_DISABLE_4_ADDR_SRC_LRN 1
 
  #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
  #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
#3 lore raw

Hi Sebastian,

Quoted 3 lines

after tested 2 WDS devices (one WDS AP, one WDS STA) with 9984 (netgear r7800) i found out that the issue persists. gtk rekeying fails, so disconnect and reconnect after 60 minutes.

Are you using the latest FW 10.4-3.6.0.1-00003 for 9984 ( mainly on the AP side ) ?

(https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=a00e61b9203186561dc90de1ff7ed4d5f5e920d5)

Thanks,
Sathishkumar

#4 lore raw

hint for a possible fix

disable_4addr_src_lrn is not set in 10_4 vdev parameter map. so this feature cannot work

wmi.c       (Arbeitskopie) renamed from wmi.c       (Revision 4214) +0 -0
@@ -972,6 +972,7 @@

        .meru_vc = WMI_VDEV_PARAM_UNSUPPORTED, .rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED, .bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, +       .disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED, };

 static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = {
@@ -1049,6 +1050,7 @@
        .bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, .inc_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
        .dec_tsf = WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
+       .disable_4addr_src_lrn = WMI_10_4_VDEV_PARAM_DISABLE_4_ADDR_SRC_LRN, };

Am 11.11.2018 um 08:13 schrieb [email protected]:

Quoted 14 lines

Hi Sebastian,

Quoted 3 lines

after tested 2 WDS devices (one WDS AP, one WDS STA) with 9984 (netgear r7800) i found out that the issue persists. gtk rekeying fails, so disconnect and reconnect after 60 minutes.

Are you using the latest FW 10.4-3.6.0.1-00003 for 9984 ( mainly on the AP side ) ?

(https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=a00e61b9203186561dc90de1ff7ed4d5f5e920d5)

Thanks,
Sathishkumar

#5 lore raw

i tested my proposal now and it fixes the issue. the submitted patch was simply broken at that small point

Am 12.11.2018 um 03:44 schrieb Sebastian Gottschall:

Quoted 40 lines

hint for a possible fix

disable_4addr_src_lrn is not set in 10_4 vdev parameter map. so this feature cannot work

wmi.c       (Arbeitskopie) renamed from wmi.c       (Revision 4214) +2 -0
@@ -972,6 +972,7 @@
         .meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,
         .rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,
         .bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED,
+       .disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED,
  };
 
  static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = {
@@ -1049,6 +1050,7 @@
         .bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
         .inc_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
         .dec_tsf = WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
+       .disable_4addr_src_lrn = 
 WMI_10_4_VDEV_PARAM_DISABLE_4_ADDR_SRC_LRN,
  };
 

Am 11.11.2018 um 08:13 schrieb [email protected]:

Quoted 15 lines

Hi Sebastian,

Quoted 3 lines

after tested 2 WDS devices (one WDS AP, one WDS STA) with 9984 (netgear r7800) i found out that the issue persists. gtk rekeying fails, so disconnect and reconnect after 60 minutes.

Are you using the latest FW 10.4-3.6.0.1-00003 for 9984 ( mainly on the AP side ) ?

(https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=a00e61b9203186561dc90de1ff7ed4d5f5e920d5)

Thanks,
Sathishkumar

#6 lore raw
Quoted 3 lines · Sebastian Gottschall

i tested my proposal now and it fixes the issue. the submitted patch was simply broken at that small point

You're right. Thanks for your finding !

Due to some reason, my patch formatting missed the vdev param assignments to 10.4 and 10.2.4 (unsupported).

Sorry for the confusion, let me resend the patch.

Signature · 2 lines
Thanks,
Sathishkumar
#7 lore raw

no problem. glad to help you.

Sebastian

Am 12.11.2018 um 06:34 schrieb Sathishkumar Muruganandam:

Quoted 12 lines · Sebastian Gottschall
Quoted 3 lines

i tested my proposal now and it fixes the issue. the submitted patch was simply broken at that small point

You're right. Thanks for your finding !

Due to some reason, my patch formatting missed the vdev param assignments to 10.4 and 10.2.4 (unsupported).

Sorry for the confusion, let me resend the patch.

#8 lore raw

is it possible to supply a firmware for 99X0 based devices which suffer from the same issue? i know the firmware codebase is the same for these chipsets and there are alot of embedded devices around which this older one. unfortunatly this device suffers from the same issue

Sebastian

Am 12.11.2018 um 08:33 schrieb Sebastian Gottschall:

Quoted 18 lines

no problem. glad to help you.

Sebastian

Am 12.11.2018 um 06:34 schrieb Sathishkumar Muruganandam:

Quoted 12 lines · Sebastian Gottschall
Quoted 3 lines

i tested my proposal now and it fixes the issue. the submitted patch was simply broken at that small point

You're right. Thanks for your finding !

Due to some reason, my patch formatting missed the vdev param assignments to 10.4 and 10.2.4 (unsupported).

Sorry for the confusion, let me resend the patch.