From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Alex Briskin <br.shurik@gmail.com>,
linux-wireless@vger.kernel.org, johannes@sipsolutions.net
Subject: Re: [PATCH 1/4 v2 iface_work] New function ieee80211_is_skb_handled_by_pkt_type
Date: Fri, 15 Jul 2016 11:32:10 +0200 [thread overview]
Message-ID: <dda1046c-2b71-9f97-c452-ed96d4585eef@broadcom.com> (raw)
In-Reply-To: <1468573596-20055-1-git-send-email-br.shurik@gmail.com>
On 15-7-2016 11:06, Alex Briskin wrote:
> Split ieee80211_iface_work in two. Moved part of a code that checks
> pkt_type.
As mentioned before the subject of the patches should use "mac80211: "
prefix. So:
[PATCH 1/4 v2] mac80211: New function ieee80211_is_skb_handled_by_pkt_type
So I did not mean you should rename function from ieee80211_... to
mac80211_...
Another thing is that a lot of people skim the repository using 'git log
--oneline' to find a commit (unless they use git blame first) so it
would be great to have the subject line summarize the patch intent in a
meaningful manner. Using generic terms like "Further improve radability"
does not really help.
My comment from the initial patch series on the function names is that
it would be better to be consistent and reflect it is used in iface_work
context, eg. ieee80211_iface_Work_handle_pkt_type,
ieee80211_iface_Work_handle_frame_control, and
ieee80211_iface_Work_handle_vif_type.
Regards,
Arend
> Signed-off-by: Alex Briskin <br.shurik@gmail.com>
> ---
> net/mac80211/iface.c | 75 +++++++++++++++++++++++++++++++---------------------
> 1 file changed, 45 insertions(+), 30 deletions(-)
>
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index c59af3e..a68cbac 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -1198,6 +1198,48 @@ static void ieee80211_if_setup(struct net_device *dev)
> dev->destructor = ieee80211_if_free;
> }
>
> +static bool ieee80211_is_skb_handled_by_pkt_type(struct sk_buff *skb,
> + struct ieee80211_sub_if_data
> + *sdata)
> +{
> + struct ieee80211_ra_tid *ra_tid;
> + struct ieee80211_rx_agg *rx_agg;
> + struct ieee80211_local *local = sdata->local;
> + struct sta_info *sta;
> +
> + if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_START) {
> + ra_tid = (void *)&skb->cb;
> + ieee80211_start_tx_ba_cb(&sdata->vif, ra_tid->ra, ra_tid->tid);
> + } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_STOP) {
> + ra_tid = (void *)&skb->cb;
> + ieee80211_stop_tx_ba_cb(&sdata->vif, ra_tid->ra, ra_tid->tid);
> + } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_RX_AGG_START) {
> + rx_agg = (void *)&skb->cb;
> + mutex_lock(&local->sta_mtx);
> + sta = sta_info_get_bss(sdata, rx_agg->addr);
> + if (sta)
> + __ieee80211_start_rx_ba_session(sta,
> + 0, 0, 0, 1, rx_agg->tid,
> + IEEE80211_MAX_AMPDU_BUF,
> + false, true);
> + mutex_unlock(&local->sta_mtx);
> + } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_RX_AGG_STOP) {
> + rx_agg = (void *)&skb->cb;
> + mutex_lock(&local->sta_mtx);
> + sta = sta_info_get_bss(sdata, rx_agg->addr);
> + if (sta)
> + __ieee80211_stop_rx_ba_session(sta,
> + rx_agg->tid,
> + WLAN_BACK_RECIPIENT, 0,
> + false);
> + mutex_unlock(&local->sta_mtx);
> + } else {
> + return false;
> + }
> + /*will return true if pkt_type found and handled */
> + return true;
> +}
> +
> static void ieee80211_iface_work(struct work_struct *work)
> {
> struct ieee80211_sub_if_data *sdata =
> @@ -1205,8 +1247,6 @@ static void ieee80211_iface_work(struct work_struct *work)
> struct ieee80211_local *local = sdata->local;
> struct sk_buff *skb;
> struct sta_info *sta;
> - struct ieee80211_ra_tid *ra_tid;
> - struct ieee80211_rx_agg *rx_agg;
>
> if (!ieee80211_sdata_running(sdata))
> return;
> @@ -1221,34 +1261,8 @@ static void ieee80211_iface_work(struct work_struct *work)
> while ((skb = skb_dequeue(&sdata->skb_queue))) {
> struct ieee80211_mgmt *mgmt = (void *)skb->data;
>
> - if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_START) {
> - ra_tid = (void *)&skb->cb;
> - ieee80211_start_tx_ba_cb(&sdata->vif, ra_tid->ra,
> - ra_tid->tid);
> - } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_STOP) {
> - ra_tid = (void *)&skb->cb;
> - ieee80211_stop_tx_ba_cb(&sdata->vif, ra_tid->ra,
> - ra_tid->tid);
> - } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_RX_AGG_START) {
> - rx_agg = (void *)&skb->cb;
> - mutex_lock(&local->sta_mtx);
> - sta = sta_info_get_bss(sdata, rx_agg->addr);
> - if (sta)
> - __ieee80211_start_rx_ba_session(sta,
> - 0, 0, 0, 1, rx_agg->tid,
> - IEEE80211_MAX_AMPDU_BUF,
> - false, true);
> - mutex_unlock(&local->sta_mtx);
> - } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_RX_AGG_STOP) {
> - rx_agg = (void *)&skb->cb;
> - mutex_lock(&local->sta_mtx);
> - sta = sta_info_get_bss(sdata, rx_agg->addr);
> - if (sta)
> - __ieee80211_stop_rx_ba_session(sta,
> - rx_agg->tid,
> - WLAN_BACK_RECIPIENT, 0,
> - false);
> - mutex_unlock(&local->sta_mtx);
> + if (ieee80211_is_skb_handled_by_pkt_type(skb, sdata)) {
> + goto free_skb;
> } else if (ieee80211_is_action(mgmt->frame_control) &&
> mgmt->u.action.category == WLAN_CATEGORY_BACK) {
> int len = skb->len;
> @@ -1333,6 +1347,7 @@ static void ieee80211_iface_work(struct work_struct *work)
> break;
> }
>
> +free_skb:
> kfree_skb(skb);
> }
>
>
prev parent reply other threads:[~2016-07-15 9:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 9:06 [PATCH 1/4 v2 iface_work] New function ieee80211_is_skb_handled_by_pkt_type Alex Briskin
2016-07-15 9:06 ` [PATCH 2/4 v2 iface_work] Further improve radabilty Alex Briskin
2016-07-15 9:06 ` [PATCH 3/4 v2 iface_work] Simple and well understood logic Alex Briskin
2016-07-15 9:06 ` [PATCH 4/4 v2 iface_work] Function renaming Alex Briskin
2016-07-15 13:29 ` kbuild test robot
2016-07-15 13:39 ` kbuild test robot
2016-07-15 14:01 ` kbuild test robot
2016-07-15 9:32 ` Arend Van Spriel [this message]
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=dda1046c-2b71-9f97-c452-ed96d4585eef@broadcom.com \
--to=arend.vanspriel@broadcom.com \
--cc=br.shurik@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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).