All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Calaby <julian.calaby@gmail.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Janusz Dziedzic <janusz.dziedzic@tieto.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Felix Fietkau <nbd@openwrt.org>
Subject: Re: [RFC/RFT 2/2] ath9k: request aligned skb
Date: Tue, 22 Dec 2015 09:48:17 +1100	[thread overview]
Message-ID: <CAGRGNgUv0A_G20xFzi4iem78ay_HKPqmnG1_pnky3kPa0M2bmQ@mail.gmail.com> (raw)
In-Reply-To: <CAFqt6zY_aQKmHi=ai+4MUVKcy7oDSNsERG0NiDYAAi4HYq+V8w@mail.gmail.com>

Hi,

On Tue, Dec 22, 2015 at 5:53 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Thu, Dec 17, 2015 at 2:50 PM, Janusz Dziedzic
> <janusz.dziedzic@tieto.com> wrote:
>>
>> Set NEEDS_ALIGNED4_SKB hw flag.
>> This allow driver to save CPU and remove two memmove
>> from tx path.
>>
>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>> ---
>>  drivers/net/wireless/ath/ath9k/init.c |  1 +
>>  drivers/net/wireless/ath/ath9k/xmit.c | 15 ++++++++++-----
>>  2 files changed, 11 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
>> index 6abace6..d578a00 100644
>> --- a/drivers/net/wireless/ath/ath9k/init.c
>> +++ b/drivers/net/wireless/ath/ath9k/init.c
>> @@ -831,6 +831,7 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
>>         ieee80211_hw_set(hw, RX_INCLUDES_FCS);
>>         ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING);
>>         ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
>> +       ieee80211_hw_set(hw, NEEDS_ALIGNED4_SKBS);
>>
>>         if (ath9k_ps_enable)
>>                 ieee80211_hw_set(hw, SUPPORTS_PS);
>> diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
>> index 82fc76f..c3bd1b1 100644
>> --- a/drivers/net/wireless/ath/ath9k/xmit.c
>> +++ b/drivers/net/wireless/ath/ath9k/xmit.c
>> @@ -2267,11 +2267,15 @@ static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
>>         padpos = ieee80211_hdrlen(hdr->frame_control);
>>         padsize = padpos & 3;
>>         if (padsize && skb->len > padpos) {
>> -               if (skb_headroom(skb) < padsize)
>> -                       return -ENOMEM;
>> +               if (ieee80211_hw_check(hw, NEEDS_ALIGNED4_SKBS)) {
>> +                       frmlen -= padsize;
>> +               } else {
>> +                       if (skb_headroom(skb) < padsize)
>> +                               return -ENOMEM;
>>
>> -               skb_push(skb, padsize);
>> -               memmove(skb->data, skb->data + padsize, padpos);
>
>                   why the same lines has been removed and added again ?

The indentation is different as they're now in another if statement
under the if (padsize... statement.

>> +                       skb_push(skb, padsize);
>> +                       memmove(skb->data, skb->data + padsize, padpos);
>> +               }
>>         }
>
>
>
>>
>>
>>         setup_frame_info(hw, sta, skb, frmlen);
>> @@ -2494,7 +2498,8 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
>>
>>         padpos = ieee80211_hdrlen(hdr->frame_control);
>>         padsize = padpos & 3;
>> -       if (padsize && skb->len>padpos+padsize) {
>> +       if (padsize && skb->len > padpos + padsize &&
>> +           !ieee80211_hw_check(sc->hw, NEEDS_ALIGNED4_SKBS)) {
>>                 /*
>>                  * Remove MAC header padding before giving the frame back to
>>                  * mac80211.
>> --
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Regards
> Souptick
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

  reply	other threads:[~2015-12-21 22:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17  9:20 [RFC/RFT 1/2] mac80211: Add NEED_ALIGNED4_SKBS hw flag Janusz Dziedzic
2015-12-17  9:20 ` [RFC/RFT 2/2] ath9k: request aligned skb Janusz Dziedzic
2015-12-21 18:53   ` Souptick Joarder
2015-12-21 22:48     ` Julian Calaby [this message]
2015-12-17  9:39 ` [RFC/RFT 1/2] mac80211: Add NEED_ALIGNED4_SKBS hw flag Felix Fietkau
2015-12-17 10:04 ` Johannes Berg
2015-12-17 10:09   ` Felix Fietkau
2015-12-17 10:12 ` Felix Fietkau
2015-12-18  8:43   ` Janusz Dziedzic
2015-12-17 10:29 ` Johannes Berg
2015-12-17 10:35   ` Felix Fietkau
2015-12-17 10:45     ` Johannes Berg

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=CAGRGNgUv0A_G20xFzi4iem78ay_HKPqmnG1_pnky3kPa0M2bmQ@mail.gmail.com \
    --to=julian.calaby@gmail.com \
    --cc=janusz.dziedzic@tieto.com \
    --cc=johannes@sipsolutions.net \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@openwrt.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.