Subject: [PATCH V2 1/2] ath10k: Move ath10k_vdev_stop() up before ath10k_vdev_start_restart()

This patches does not modify any functionality. Just a code move
so that ath10k_vdev_stop() can be used in ath10k_vdev_start_restart()
for any failure cases which involves vdev_stop().

Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
---

V2:
- Call ath10k_vdev_stop() when ath10k_monitor_recalc() failed.
This results in code move done in patch 1.

drivers/net/wireless/ath/ath10k/mac.c | 66 ++++++++++++++++-----------------
1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0f39af7..3b5aaa3 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -872,6 +872,39 @@ static void ath10k_recalc_radar_detection(struct ath10k *ar)
}
}

+static int ath10k_vdev_stop(struct ath10k_vif *arvif)
+{
+ struct ath10k *ar = arvif->ar;
+ int ret;
+
+ lockdep_assert_held(&ar->conf_mutex);
+
+ reinit_completion(&ar->vdev_setup_done);
+
+ ret = ath10k_wmi_vdev_stop(ar, arvif->vdev_id);
+ if (ret) {
+ ath10k_warn(ar, "failed to stop WMI vdev %i: %d\n",
+ arvif->vdev_id, ret);
+ return ret;
+ }
+
+ ret = ath10k_vdev_setup_sync(ar);
+ if (ret) {
+ ath10k_warn(ar, "failed to syncronise setup for vdev %i: %d\n",
+ arvif->vdev_id, ret);
+ return ret;
+ }
+
+ WARN_ON(ar->num_started_vdevs == 0);
+
+ if (ar->num_started_vdevs != 0) {
+ ar->num_started_vdevs--;
+ ath10k_recalc_radar_detection(ar);
+ }
+
+ return ret;
+}
+
static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart)
{
struct ath10k *ar = arvif->ar;
@@ -949,39 +982,6 @@ static int ath10k_vdev_restart(struct ath10k_vif *arvif)
return ath10k_vdev_start_restart(arvif, true);
}

-static int ath10k_vdev_stop(struct ath10k_vif *arvif)
-{
- struct ath10k *ar = arvif->ar;
- int ret;
-
- lockdep_assert_held(&ar->conf_mutex);
-
- reinit_completion(&ar->vdev_setup_done);
-
- ret = ath10k_wmi_vdev_stop(ar, arvif->vdev_id);
- if (ret) {
- ath10k_warn(ar, "failed to stop WMI vdev %i: %d\n",
- arvif->vdev_id, ret);
- return ret;
- }
-
- ret = ath10k_vdev_setup_sync(ar);
- if (ret) {
- ath10k_warn(ar, "failed to synchronize setup for vdev %i stop: %d\n",
- arvif->vdev_id, ret);
- return ret;
- }
-
- WARN_ON(ar->num_started_vdevs == 0);
-
- if (ar->num_started_vdevs != 0) {
- ar->num_started_vdevs--;
- ath10k_recalc_radar_detection(ar);
- }
-
- return ret;
-}
-
static int ath10k_mac_setup_bcn_p2p_ie(struct ath10k_vif *arvif,
struct sk_buff *bcn)
{
--
1.7.9.5



Subject: Re: [PATCH V2 2/2] ath10k: Fix interrupt storm



On Tuesday 17 February 2015 02:53 PM, Michal Kazior wrote:
> On 17 February 2015 at 08:43, Vasanthakumar Thiagarajan
> <[email protected]> wrote:
>> Promiscuous mode is enabled when wlan interface is added to
>> bridge. ath10k creates a monitor mode when promiscuous mode
>> is enabled. When monitor vdev is runing along with other
>> vdev(s) there is a huge number of interrupts generated
>> especially in noisy condition. Fix this by not enabling
>> promiscuous(monitor) mode when already a vdev is running.
>> This does not change the support of virtual interface of
>> type monitor along with other vdevs.
>>
>> Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
>> ---
>> drivers/net/wireless/ath/ath10k/mac.c | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
>> index 3b5aaa3..66cc0a8 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -969,6 +969,15 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart)
>> ar->num_started_vdevs++;
>> ath10k_recalc_radar_detection(ar);
>>
>> + if (ar->filter_flags & FIF_PROMISC_IN_BSS) {
>> + ar->filter_flags &= ~FIF_PROMISC_IN_BSS;
>> + ath10k_dbg(ar, ATH10K_DBG_MAC,
>> + "mac disabling promiscuous mode because vdev is started\n");
>> + ret = ath10k_monitor_recalc(ar);
>
> The entire logic should go to ath10k_monitor_recalc().

Sure.

>
> Also I'm pretty sure this breaks 4addr station briding for main 636
> fw. I can't fully test this now though (there seems to be a regression
> against fw 636 and it keeps crashing with monitor vdev over and over
> again).

Ok. Can we make this change specific to non-sta mode?.

Vasanth
>
> Michał
>

2015-02-17 09:23:13

by Michal Kazior

[permalink] [raw]
Subject: Re: [PATCH V2 2/2] ath10k: Fix interrupt storm

On 17 February 2015 at 08:43, Vasanthakumar Thiagarajan
<[email protected]> wrote:
> Promiscuous mode is enabled when wlan interface is added to
> bridge. ath10k creates a monitor mode when promiscuous mode
> is enabled. When monitor vdev is runing along with other
> vdev(s) there is a huge number of interrupts generated
> especially in noisy condition. Fix this by not enabling
> promiscuous(monitor) mode when already a vdev is running.
> This does not change the support of virtual interface of
> type monitor along with other vdevs.
>
> Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
> ---
> drivers/net/wireless/ath/ath10k/mac.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 3b5aaa3..66cc0a8 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -969,6 +969,15 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart)
> ar->num_started_vdevs++;
> ath10k_recalc_radar_detection(ar);
>
> + if (ar->filter_flags & FIF_PROMISC_IN_BSS) {
> + ar->filter_flags &= ~FIF_PROMISC_IN_BSS;
> + ath10k_dbg(ar, ATH10K_DBG_MAC,
> + "mac disabling promiscuous mode because vdev is started\n");
> + ret = ath10k_monitor_recalc(ar);

The entire logic should go to ath10k_monitor_recalc().

Also I'm pretty sure this breaks 4addr station briding for main 636
fw. I can't fully test this now though (there seems to be a regression
against fw 636 and it keeps crashing with monitor vdev over and over
again).


Michał

Subject: [PATCH V2 2/2] ath10k: Fix interrupt storm

Promiscuous mode is enabled when wlan interface is added to
bridge. ath10k creates a monitor mode when promiscuous mode
is enabled. When monitor vdev is runing along with other
vdev(s) there is a huge number of interrupts generated
especially in noisy condition. Fix this by not enabling
promiscuous(monitor) mode when already a vdev is running.
This does not change the support of virtual interface of
type monitor along with other vdevs.

Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 3b5aaa3..66cc0a8 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -969,6 +969,15 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart)
ar->num_started_vdevs++;
ath10k_recalc_radar_detection(ar);

+ if (ar->filter_flags & FIF_PROMISC_IN_BSS) {
+ ar->filter_flags &= ~FIF_PROMISC_IN_BSS;
+ ath10k_dbg(ar, ATH10K_DBG_MAC,
+ "mac disabling promiscuous mode because vdev is started\n");
+ ret = ath10k_monitor_recalc(ar);
+ if (ret)
+ ath10k_vdev_stop(arvif);
+ }
+
return ret;
}

@@ -3476,6 +3485,13 @@ static void ath10k_configure_filter(struct ieee80211_hw *hw,

changed_flags &= SUPPORTED_FILTERS;
*total_flags &= SUPPORTED_FILTERS;
+ if (*total_flags & FIF_PROMISC_IN_BSS) {
+ if (ar->num_started_vdevs) {
+ ath10k_dbg(ar, ATH10K_DBG_MAC,
+ "mac does not enable promiscuous mode when already a vdev is running\n");
+ *total_flags &= ~FIF_PROMISC_IN_BSS;
+ }
+ }
ar->filter_flags = *total_flags;

ret = ath10k_monitor_recalc(ar);
--
1.7.9.5