From patchwork Thu Oct 1 20:06:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 51016 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n91K6X3O029294 for ; Thu, 1 Oct 2009 20:06:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756085AbZJAUG1 (ORCPT ); Thu, 1 Oct 2009 16:06:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756084AbZJAUG1 (ORCPT ); Thu, 1 Oct 2009 16:06:27 -0400 Received: from xc.sipsolutions.net ([83.246.72.84]:36164 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756056AbZJAUG0 (ORCPT ); Thu, 1 Oct 2009 16:06:26 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MtRv2-00045K-PC; Thu, 01 Oct 2009 22:06:29 +0200 Subject: [PATCH v2 2.6.32] mac80211: fix vlan and optimise RX From: Johannes Berg To: John Linville Cc: linux-wireless@vger.kernel.org, =?UTF-8?Q?Bla=C5=BE_Ba=C4=8Dnik?= In-Reply-To: <1254341893.3959.13.camel@johannes.local> References: <57b62e7d0909291754x352ae254sa33ee7efb430d497@mail.gmail.com> <1254341787.3959.11.camel@johannes.local> <1254341893.3959.13.camel@johannes.local> Date: Thu, 01 Oct 2009 22:06:29 +0200 Message-Id: <1254427589.3959.38.camel@johannes.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- wireless-testing.orig/net/mac80211/rx.c 2009-09-30 21:38:59.000000000 +0200 +++ wireless-testing/net/mac80211/rx.c 2009-09-30 22:09:54.000000000 +0200 @@ -2164,11 +2164,17 @@ static void __ieee80211_rx_handle_packet skb = rx.skb; - list_for_each_entry_rcu(sdata, &local->interfaces, list) { + if (rx.sdata && ieee80211_is_data(hdr->frame_control)) { + rx.flags |= IEEE80211_RX_RA_MATCH; + prepares = prepare_for_handlers(rx.sdata, &rx, hdr); + if (prepares) + prev = rx.sdata; + } else list_for_each_entry_rcu(sdata, &local->interfaces, list) { if (!netif_running(sdata->dev)) continue; - if (sdata->vif.type == NL80211_IFTYPE_MONITOR) + if (sdata->vif.type == NL80211_IFTYPE_MONITOR || + sdata->vif.type == NL80211_IFTYPE_AP_VLAN) continue; rx.flags |= IEEE80211_RX_RA_MATCH; --- wireless-testing.orig/net/mac80211/tx.c 2009-09-30 21:49:34.000000000 +0200 +++ wireless-testing/net/mac80211/tx.c 2009-09-30 22:04:25.000000000 +0200 @@ -1704,7 +1704,8 @@ netdev_tx_t ieee80211_subif_start_xmit(s if (!is_multicast_ether_addr(hdr.addr1)) { rcu_read_lock(); sta = sta_info_get(local, hdr.addr1); - if (sta) + /* XXX: in the future, use sdata to look up the sta */ + if (sta && sta->sdata == sdata) sta_flags = get_sta_flags(sta); rcu_read_unlock(); } --- wireless-testing.orig/net/mac80211/sta_info.c 2009-10-01 21:59:00.000000000 +0200 +++ wireless-testing/net/mac80211/sta_info.c 2009-10-01 22:05:00.000000000 +0200 @@ -361,6 +361,7 @@ int sta_info_insert(struct sta_info *sta u.ap); drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, &sta->sta); + sdata = sta->sdata; } #ifdef CONFIG_MAC80211_VERBOSE_DEBUG @@ -496,6 +497,7 @@ static void __sta_info_unlink(struct sta drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE, &(*sta)->sta); + sdata = (*sta)->sdata; } if (ieee80211_vif_is_mesh(&sdata->vif)) {