public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Atharva Tiwari <evepolonium@gmail.com>
Cc: Meir Elisha <meir6264@gmail.com>,
	Philipp Hortmann <philipp.g.hortmann@gmail.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: fix network selection and A-MPDU reordering in rtw_mlme.c
Date: Tue, 24 Dec 2024 09:02:03 +0100	[thread overview]
Message-ID: <2024122411--0ad4@gregkh> (raw)
In-Reply-To: <20241224072754.2352-1-evepolonium@gmail.com>

On Tue, Dec 24, 2024 at 12:57:52PM +0530, Atharva Tiwari wrote:
> this patch fixes the network selection logic to avoid selecting a network with the same ESSID as the oldest scanned network
> if it was scanned within the last second. it also improves A-MPDU reordering bu enabling it only if the AP supports it,and disabling it otherwise

What commit id does this fix?

And please wrap your changelog at 72 columns like your editor asked you
to do when making the commit :)

> and also i have a question what does "new enough" mean on line 481?

This doesn't belong in a changelog, but rather below the --- line,
right?

> 
> Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_mlme.c | 28 +++++++++++++++--------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 5ded183aa08c..b33846f88680 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -481,7 +481,9 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
>  		}
>  
>  		if (rtw_roam_flags(adapter)) {
> -			/* TODO: don't select network in the same ess as oldest if it's new enough*/
> +			if (is_same_ess(&pnetwork->network, &oldest->network) &&
> +				time_after(pnetwork->last_scanned, (unsigned long)msecs_to_jiffies(1000)))

Where did this magic number come from?

> +				continue;
>  		}
>  
>  		if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
> @@ -1000,15 +1002,23 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
>  
>  		/* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */
>  		/* if A-MPDU Rx is enabled, resetting  rx_ordering_ctrl wstart_b(indicate_seq) to default value = 0xffff */
> -		/* todo: check if AP can send A-MPDU packets */
> -		for (i = 0; i < 16 ; i++) {
> -			preorder_ctrl = &psta->recvreorder_ctrl[i];
> -			preorder_ctrl->enable = false;
> -			preorder_ctrl->indicate_seq = 0xffff;
> -			preorder_ctrl->wend_b = 0xffff;
> -			preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
> +		if (rtw_check_ap_supports_ampdu(pnetwork)) {
> +			for (i = 0; i < 16 ; i++) {
> +				preorder_ctrl = &psta->recvreorder_ctrl[i];
> +				preorder_ctrl->enable = true; /* Enable A-MPDU reordering */
> +				preorder_ctrl->indicate_seq = 0; /* Starting sequence number */
> +				preorder_ctrl->wend_b = 0xffff;
> +				preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
> +			}
> +		} else {
> +			for (i = 0; i < 16; i++) {
> +				preorder_ctrl = &psta->recvreorder_ctrl[i];
> +				preorder_ctrl->enable = false;
> +				preorder_ctrl->indicate_seq = 0xffff;

So only two fields are different, right?  Why not just set those in a
separate loop instead?

> +				preorder_ctrl->wend_b = 0xffff;
> +				preorder_ctrl->wsize_b = 64;  /* max_ampdu_sz; adjust as needed */

When is this "needed"?

And you have tested all of this, right?

thanks,

greg k-h

  reply	other threads:[~2024-12-24  8:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-24  7:27 [PATCH] staging: rtl8723bs: fix network selection and A-MPDU reordering in rtw_mlme.c Atharva Tiwari
2024-12-24  8:02 ` Greg Kroah-Hartman [this message]
2024-12-24 16:51 ` kernel test robot
2024-12-25  0:56 ` kernel test robot

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=2024122411--0ad4@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=evepolonium@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=meir6264@gmail.com \
    --cc=philipp.g.hortmann@gmail.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