linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>
To: "Greenman, Gregory" <gregory.greenman@intel.com>,
	"quic_jjohnson@quicinc.com" <quic_jjohnson@quicinc.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 01/15] wifi: mac80211: add support for mld in ieee80211_chswitch_done
Date: Sun, 27 Aug 2023 16:50:27 +0000	[thread overview]
Message-ID: <cd9c7bbaedc7d1b951663b2eb29c4341cc689cce.camel@intel.com> (raw)
In-Reply-To: <82a1c9f6-ab55-4e99-a4cb-c549e558ed15@quicinc.com>

On Sun, 2023-08-27 at 09:43 -0700, Jeff Johnson wrote:
> On 8/27/2023 4:05 AM, gregory.greenman@intel.com wrote:
> > From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > 
> > This allows to finalize the CSA per link.
> > In case the switch didn't work, tear down the MLD connection.
> > Also pass the ieee80211_bss_conf to post_channel_switch to let the
> > driver know which link completed the switch.
> > 
> > Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
> > ---
> >   .../net/wireless/intel/iwlegacy/4965-mac.c    |  2 +-
> >   drivers/net/wireless/intel/iwlegacy/common.c  |  2 +-
> >   .../net/wireless/intel/iwlwifi/dvm/mac80211.c |  6 ++--
> >   .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c |  2 +-
> >   .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 +++---
> >   drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  3 +-
> >   .../wireless/intel/iwlwifi/mvm/time-event.c   |  2 +-
> >   drivers/net/wireless/ti/wlcore/event.c        |  2 +-
> >   drivers/net/wireless/ti/wlcore/main.c         |  6 ++--
> >   include/net/mac80211.h                        |  8 +++--
> >   net/mac80211/cfg.c                            | 35 ++++++++++---------
> >   net/mac80211/driver-ops.h                     |  6 ++--
> >   net/mac80211/mlme.c                           | 29 ++++++++++-----
> ...
> > diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> > index 7c707358d15c..67f54825110f 100644
> > --- a/include/net/mac80211.h
> > +++ b/include/net/mac80211.h
> > @@ -4544,7 +4544,8 @@ struct ieee80211_ops {
> >                                   struct ieee80211_channel_switch *ch_switch);
> >   
> >         int (*post_channel_switch)(struct ieee80211_hw *hw,
> > -                                  struct ieee80211_vif *vif);
> > +                                  struct ieee80211_vif *vif,
> > +                                  struct ieee80211_bss_conf *link_conf);
> >         void (*abort_channel_switch)(struct ieee80211_hw *hw,
> >                                      struct ieee80211_vif *vif);
> >         void (*channel_switch_rx_beacon)(struct ieee80211_hw *hw,
> > @@ -6542,11 +6543,14 @@ void ieee80211_radar_detected(struct ieee80211_hw *hw);
> >    * ieee80211_chswitch_done - Complete channel switch process
> >    * @vif: &struct ieee80211_vif pointer from the add_interface callback.
> >    * @success: make the channel switch successful or not
> > + * @link_id: the link_id on which the switch was done. Ignored if success is
> > + *     false.
> 
> I would not call this being ignored:
> +       link = rcu_dereference(sdata->link[link_id]);
> +       if (WARN_ON(!link)) {
> +               rcu_read_unlock();
> +               return;
> +       }
> 

Yeah - you're right. We don't need the link pointer in case success is false and yet we return here,
I'll fix.

> >    *
> >    * Complete the channel switch post-process: set the new operational channel
> >    * and wake up the suspended queues.
> >    */
> > -void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success);
> > +void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success,
> > +                            unsigned int link_id);
> >   
> >   /**
> >    * ieee80211_channel_switch_disconnect - disconnect due to channel switch error
> ...
> > diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> > index f93eb38ae0b8..ca6045f56b4b 100644
> > --- a/net/mac80211/mlme.c
> > +++ b/net/mac80211/mlme.c
> > @@ -1773,7 +1773,7 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_link_data
> > *link)
> >          */
> >         link->u.mgd.beacon_crc_valid = false;
> >   
> > -       ret = drv_post_channel_switch(sdata);
> > +       ret = drv_post_channel_switch(link);
> >         if (ret) {
> >                 sdata_info(sdata,
> >                            "driver post channel switch failed, disconnecting\n");
> > @@ -1785,25 +1785,36 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_link_data
> > *link)
> >         cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef, 0, 0);
> >   }
> >   
> > -void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success)
> > +void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success,
> > +                            unsigned int link_id)
> >   {
> > +       struct ieee80211_link_data *link;
> >         struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> > -       struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
> > -
> > -       if (WARN_ON(ieee80211_vif_is_mld(&sdata->vif)))
> > -               success = false;
> > +       struct ieee80211_link_data_managed *ifmgd;
> >   
> >         trace_api_chswitch_done(sdata, success);
> 
> no value in tracing the link_id?

I can add it.

> 
> > +
> > +       rcu_read_lock();
> > +
> > +       link = rcu_dereference(sdata->link[link_id]);
> > +       if (WARN_ON(!link)) {
> > +               rcu_read_unlock();
> > +               return;
> > +       }
> > +
> > +       ifmgd = &link->u.mgd;
> > +
> >         if (!success) {
> >                 sdata_info(sdata,
> >                            "driver channel switch failed, disconnecting\n");
> >                 wiphy_work_queue(sdata->local->hw.wiphy,
> > -                                &ifmgd->csa_connection_drop_work);
> > +                                &sdata->u.mgd.csa_connection_drop_work);
> >         } else {
> >                 wiphy_delayed_work_queue(sdata->local->hw.wiphy,
> > -                                        &sdata->deflink.u.mgd.chswitch_work,
> > -                                        0);
> > +                                        &ifmgd->chswitch_work, 0);
> >         }
> > +
> > +       rcu_read_unlock();
> >   }
> >   EXPORT_SYMBOL(ieee80211_chswitch_done);
> >   
> 

Gregory / Johannes, I'll send a patch internally to fix the issues raised here and you'll squash
before resending?

  reply	other threads:[~2023-08-27 16:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 11:05 [PATCH 00/15] cfg80211/mac80211 patches from our internal tree 2023-08-27 gregory.greenman
2023-08-27 11:05 ` [PATCH 01/15] wifi: mac80211: add support for mld in ieee80211_chswitch_done gregory.greenman
2023-08-27 16:43   ` Jeff Johnson
2023-08-27 16:50     ` Grumbach, Emmanuel [this message]
2023-08-27 11:05 ` [PATCH 02/15] wifi: cfg80211: fix off-by-one in element defrag gregory.greenman
2023-08-27 11:05 ` [PATCH 03/15] wifi: cfg80211: add first kunit tests, for " gregory.greenman
2023-08-27 11:05 ` [PATCH 04/15] wifi: mac80211: add an element parsing unit test gregory.greenman
2023-09-04 15:23   ` Kalle Valo
2023-08-27 11:05 ` [PATCH 05/15] wifi: cfg80211: add ieee80211_fragment_element to public API gregory.greenman
2023-08-27 11:05 ` [PATCH 06/15] wifi: mac80211: add more warnings about inserting sta info gregory.greenman
2023-08-27 11:05 ` [PATCH 07/15] wifi: mac80211: remove unnecessary struct forward declaration gregory.greenman
2023-08-27 11:05 ` [PATCH 08/15] wifi: mac80211: fix various kernel-doc issues gregory.greenman
2023-08-27 11:05 ` [PATCH 09/15] wifi: cfg80211: reg: " gregory.greenman
2023-08-27 11:05 ` [PATCH 10/15] wifi: mac80211_hwsim: clean up kernel-doc gregory.greenman
2023-08-27 11:05 ` [PATCH 11/15] wifi: mac80211: fix # of MSDU in A-MSDU calculation gregory.greenman
2023-08-27 11:05 ` [PATCH 12/15] wifi: mac80211: Print local link address during authentication gregory.greenman
2023-08-28 10:37   ` Wen Gong
2023-08-27 11:05 ` [PATCH 13/15] wifi: mac80211: take MBSSID/EHT data also from probe resp gregory.greenman
2023-08-27 11:05 ` [PATCH 14/15] wifi: mac80211: Do not force off-channel for management Tx with MLO gregory.greenman
2023-08-27 11:05 ` [PATCH 15/15] wifi: mac80211: fix channel switch link data gregory.greenman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd9c7bbaedc7d1b951663b2eb29c4341cc689cce.camel@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_jjohnson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).