Message ID | 1348145936.2388.18.camel@sauron.fi.intel.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Try to pull 40 bytes : Thats OK for tcp performance, because 40 bytes is the minimum size of IP+TCP headers pskb_may_pull(skb, 40); (instead of your skb_linearize(skb);) On Thu, Sep 20, 2012 at 2:58 PM, Artem Bityutskiy <artem.bityutskiy@linux.intel.com> wrote: > On Thu, 2012-09-20 at 14:45 +0200, Eric Dumazet wrote: >> I guess you only need to make sure 14 bytes of ethernet header are >> available before eth_type_trans(skb, dev); >> >> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c >> index 61c621e..ffe5f84 100644 >> --- a/net/mac80211/rx.c >> +++ b/net/mac80211/rx.c >> @@ -1795,9 +1795,13 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) >> >> if (skb) { >> /* deliver to local stack */ >> - skb->protocol = eth_type_trans(skb, dev); >> - memset(skb->cb, 0, sizeof(skb->cb)); >> - netif_receive_skb(skb); >> + if (pskb_may_pull(skb, sizeof(struct ethhdr))) { >> + skb->protocol = eth_type_trans(skb, dev); >> + memset(skb->cb, 0, sizeof(skb->cb)); >> + netif_receive_skb(skb); >> + } else { >> + kfree_skb(skb); >> + } >> } >> } > > Does not help, this one does: > > diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c > index 61c621e..6888586 100644 > --- a/net/mac80211/rx.c > +++ b/net/mac80211/rx.c > @@ -1797,6 +1797,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) > /* deliver to local stack */ > skb->protocol = eth_type_trans(skb, dev); > memset(skb->cb, 0, sizeof(skb->cb)); > + skb_linearize(skb); > netif_receive_skb(skb); > } > > -- > Best Regards, > Artem Bityutskiy -- 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
On Thu, 2012-09-20 at 15:04 +0200, Eric Dumazet wrote: > Try to pull 40 bytes : Thats OK for tcp performance, because 40 bytes > is the minimum size of IP+TCP headers > > pskb_may_pull(skb, 40); > > (instead of your skb_linearize(skb);) Oh well, I just realize all these mails were on netdev. Sorry for the noise. -- 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
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 61c621e..6888586 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1797,6 +1797,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) /* deliver to local stack */ skb->protocol = eth_type_trans(skb, dev); memset(skb->cb, 0, sizeof(skb->cb)); + skb_linearize(skb); netif_receive_skb(skb); }