From tkudari at gmail.com Wed Jul 1 12:58:17 2009 From: tkudari at gmail.com (Tejus Kudari) Date: Wed, 1 Jul 2009 22:28:17 +0530 Subject: Unable to set up mesh (open80211s) In-Reply-To: <45e8e6c40906282250vf35271csd8061ff1aa2f717c@mail.gmail.com> References: <45e8e6c40906282250vf35271csd8061ff1aa2f717c@mail.gmail.com> Message-ID: Thanks for your help. Sad to hear that it is still not supported.. :( On Mon, Jun 29, 2009 at 11:20 AM, Andrey Yurovsky wrote: > On Sat, Jun 27, 2009 at 11:56 PM, Tejus Kudari wrote: > > I've been trying to enable mesh networking on my Laptop for the last few > > days. > > I have the Intel ProWireless 4965agn card, and am running Ubuntu Hardy > 8.04. > > When trying to add a mesh interface, the following error pops up: > > Intel drivers are not supported at this time. Please see the > following for a list of supported drivers and their status: > http://o11s.org/trac#DriverStatus > > -Andrey > _______________________________________________ > Devel mailing list > Devel at lists.open80211s.org > http://open80211s.com/mailman/listinfo/devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://open80211s.com/pipermail/devel/attachments/20090701/1a67534b/attachment.html From a.moschini at hotmail.it Sat Jul 4 04:16:35 2009 From: a.moschini at hotmail.it (Alessia Moschini) Date: Sat, 4 Jul 2009 10:16:35 +0200 Subject: mesh question Message-ID: Hi! I installed ubuntu 8.10 (kernel 2.6.27-7) on my PCs with chipset Atheros :i have two PCs with 5414 and one with 5212. I want to set a mesh so i kill NetworkManager and i downloaded and installed compat-wireless-2009-03-04. When i set up mesh node i have problem.. i type: ifconfig wlan0 down iw dev wlan0 interface add mesh type mp mesh_id pluto ifconfig mesh 192.168.3.14 up iw dev mesh set channel 8 mesh node is up only for 3 sec!!! in fact after these commands i can see: root at nx9005-08:# iwconfig lo no wireless extensions. eth0 no wireless extensions. wmaster0 no wireless extensions. wlan0 IEEE 802.11abg ESSID:"" Mode:Managed Frequency:2.447 GHz Access Point: Not-Associated Tx-Power=27 dBm Retry min limit:7 RTS thr:off Fragment thr=2352 B Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 pan0 no wireless extensions. mesh IEEE 802.11abg Mode:Auto Frequency:2.447 GHz Tx-Power=27 dBm Retry min limit:7 RTS thr:off Fragment thr=2352 B Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 but after few seconds i see: mesh IEEE 802.11abg ESSID:"" Mode:Managed Frequency:2.447 GHz Access Point: Not-Associated Tx-Power=27 dBm Retry min limit:7 RTS thr:off Fragment thr=2352 B Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 why changes?! When i type "dmesg" after type commands to set up mesh i see: root at nx9005-08:# dmesg |grep ath [ 19.872094] ath5k 0000:00:09.0: PCI INT A -> Link[LNKD] -> GSI 10 (level, low) -> IRQ 10 [ 19.872196] ath5k 0000:00:09.0: registered as 'phy0' [ 20.980345] ath5k phy0: Atheros AR5414 chip found (MAC: 0xa5, PHY: 0x61) [ 20.982954] ath_hal: module license 'Proprietary' taints kernel. [ 20.991382] ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) [ 21.066470] ath_pci: 0.9.4 [ 581.530092] ath5k phy0: bf=d9e17a40 bf_skb=00000000 [ 581.632508] ath5k phy0: bf=d9e17a40 bf_skb=00000000 [ 581.734938] ath5k phy0: bf=d9e17a40 bf_skb=00000000 .... root at nx9005-08:# dmesg |grep ADDRCONF [ 581.482338] ADDRCONF(NETDEV_UP): mesh: link is not ready any idea?? Thanks, Alessia _________________________________________________________________ Windows Live?: Keep your life in sync. Check it out! http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://open80211s.com/pipermail/devel/attachments/20090704/bf1ebf8a/attachment.html From andrey at cozybit.com Sun Jul 5 22:37:36 2009 From: andrey at cozybit.com (Andrey Yurovsky) Date: Sun, 5 Jul 2009 19:37:36 -0700 Subject: mesh question In-Reply-To: References: Message-ID: <45e8e6c40907051937i3c3e90ber78a44cb4c3ce710@mail.gmail.com> Hi. You need the 2.6.29 kernel for ath5k support, also please make sure that the madwifi driver (if present) is disabled. ath5k replaces madwifi (ath_pci and ath_hal) -Andrey On Sat, Jul 4, 2009 at 1:16 AM, Alessia Moschini wrote: > Hi! > > I installed ubuntu 8.10 (kernel 2.6.27-7) on my PCs with chipset Atheros :i > have two PCs with 5414 and one with 5212. > I want to set a mesh so i kill NetworkManager and i downloaded and installed > compat-wireless-2009-03-04. > When i set up mesh node i have problem.. i type: > > ifconfig wlan0 down > iw dev wlan0 interface add mesh type mp mesh_id pluto > ifconfig mesh 192.168.3.14 up > iw dev mesh set channel 8 > > mesh node is up only for 3 sec!!! in fact after these commands i can see: > > root at nx9005-08:# iwconfig > lo??????? no wireless extensions. > > eth0????? no wireless extensions. > > wmaster0? no wireless extensions. > > wlan0???? IEEE 802.11abg? ESSID:"" > ????????? Mode:Managed? Frequency:2.447 GHz? Access Point: Not-Associated > ????????? Tx-Power=27 dBm > ????????? Retry min limit:7?? RTS thr:off?? Fragment thr=2352 B > ????????? Encryption key:off > ????????? Power Management:off > ????????? Link Quality:0? Signal level:0? Noise level:0 > ????????? Rx invalid nwid:0? Rx invalid crypt:0? Rx invalid frag:0 > ????????? Tx excessive retries:0? Invalid misc:0?? Missed beacon:0 > > pan0????? no wireless extensions. > > mesh????? IEEE 802.11abg? Mode:Auto? Frequency:2.447 GHz? Tx-Power=27 dBm > ????????? Retry min limit:7?? RTS thr:off?? Fragment thr=2352 B > ????????? Encryption key:off > ????????? Power Management:off > ????????? Link Quality:0? Signal level:0? Noise level:0 > ????????? Rx invalid nwid:0? Rx invalid crypt:0? Rx invalid frag:0 > ????????? Tx excessive retries:0? Invalid misc:0?? Missed beacon:0 > > but after few seconds i see: > > ?mesh????? IEEE 802.11abg? ESSID:"" > ????????? Mode:Managed? Frequency:2.447 GHz? Access Point: Not-Associated > ????????? Tx-Power=27 dBm > ????????? Retry min limit:7?? RTS thr:off?? Fragment thr=2352 B > ????????? Encryption key:off > ????????? Power Management:off > ????????? Link Quality:0? Signal level:0? Noise level:0 > ????????? Rx invalid nwid:0? Rx invalid crypt:0? Rx invalid frag:0 > ????????? Tx excessive retries:0? Invalid misc:0?? Missed beacon:0 > > why changes?! > > When i type "dmesg" after type commands to set up mesh i see: > > root at nx9005-08:# dmesg |grep ath > [?? 19.872094] ath5k 0000:00:09.0: PCI INT A -> Link[LNKD] -> GSI 10 (level, > low) -> IRQ 10 > [?? 19.872196] ath5k 0000:00:09.0: registered as 'phy0' > [?? 20.980345] ath5k phy0: Atheros AR5414 chip found (MAC: 0xa5, PHY: 0x61) > [?? 20.982954] ath_hal: module license 'Proprietary' taints kernel. > [?? 20.991382] ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, > RF2413, RF5413) > [?? 21.066470] ath_pci: 0.9.4 > [? 581.530092] ath5k phy0: bf=d9e17a40 bf_skb=00000000 > [? 581.632508] ath5k phy0: bf=d9e17a40 bf_skb=00000000 > [? 581.734938] ath5k phy0: bf=d9e17a40 bf_skb=00000000 > .... > > ?root at nx9005-08:# dmesg |grep ADDRCONF > [? 581.482338] ADDRCONF(NETDEV_UP): mesh: link is not ready > > any idea?? > > Thanks, > Alessia > > > > > > > > > > > ________________________________ > Windows Live?: Keep your life in sync. Check it out! > _______________________________________________ > Devel mailing list > Devel at lists.open80211s.org > http://open80211s.com/mailman/listinfo/devel > > From petri.virkkala at ee.tamk.fi Mon Jul 6 03:04:28 2009 From: petri.virkkala at ee.tamk.fi (Petri Virkkala) Date: Mon, 06 Jul 2009 10:04:28 +0300 Subject: Unstable mesh with zd1211rw Message-ID: <7b5f26eb11b37.4a51cc2c@tpu.fi> Hi, we have been testing mesh for a few months now and it seems that the network is now much less stable than before. Sometimes we need to set up each node several times before the network is up and nodes keep leaving the mesh constantly - sometimes after 1-2 mins! We use A-Link WL54USB adapters (zd1211rw driver) in Ubuntu 9.04, kernel 2.6.28-13. According to Driver Status, this kernel should work better than wireless-testing kernel? Is there something that has changed with the Ubuntu kernel updates that relates to mesh performance with zd1211rw? I recall we had much more stability with the older versions of wireless-testing kernel. Is anyone else using zd1211rw with same problems? - Petri From a.moschini at hotmail.it Mon Jul 6 06:05:14 2009 From: a.moschini at hotmail.it (Alessia Moschini) Date: Mon, 6 Jul 2009 12:05:14 +0200 Subject: mesh question In-Reply-To: <45e8e6c40907051937i3c3e90ber78a44cb4c3ce710@mail.gmail.com> References: <45e8e6c40907051937i3c3e90ber78a44cb4c3ce710@mail.gmail.com> Message-ID: Now i have kernel 2.6.29 but nothing is changed!! What can i do?! Thanks! Alessia > Date: Sun, 5 Jul 2009 19:37:36 -0700 > Subject: Re: mesh question > From: andrey at cozybit.com > To: devel at lists.open80211s.org > > Hi. You need the 2.6.29 kernel for ath5k support, also please make > sure that the madwifi driver (if present) is disabled. ath5k replaces > madwifi (ath_pci and ath_hal) > > -Andrey > > On Sat, Jul 4, 2009 at 1:16 AM, Alessia Moschini wrote: > > Hi! > > > > I installed ubuntu 8.10 (kernel 2.6.27-7) on my PCs with chipset Atheros :i > > have two PCs with 5414 and one with 5212. > > I want to set a mesh so i kill NetworkManager and i downloaded and installed > > compat-wireless-2009-03-04. > > When i set up mesh node i have problem.. i type: > > > > ifconfig wlan0 down > > iw dev wlan0 interface add mesh type mp mesh_id pluto > > ifconfig mesh 192.168.3.14 up > > iw dev mesh set channel 8 > > > > mesh node is up only for 3 sec!!! in fact after these commands i can see: > > > > root at nx9005-08:# iwconfig > > lo no wireless extensions. > > > > eth0 no wireless extensions. > > > > wmaster0 no wireless extensions. > > > > wlan0 IEEE 802.11abg ESSID:"" > > Mode:Managed Frequency:2.447 GHz Access Point: Not-Associated > > Tx-Power=27 dBm > > Retry min limit:7 RTS thr:off Fragment thr=2352 B > > Encryption key:off > > Power Management:off > > Link Quality:0 Signal level:0 Noise level:0 > > Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 > > Tx excessive retries:0 Invalid misc:0 Missed beacon:0 > > > > pan0 no wireless extensions. > > > > mesh IEEE 802.11abg Mode:Auto Frequency:2.447 GHz Tx-Power=27 dBm > > Retry min limit:7 RTS thr:off Fragment thr=2352 B > > Encryption key:off > > Power Management:off > > Link Quality:0 Signal level:0 Noise level:0 > > Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 > > Tx excessive retries:0 Invalid misc:0 Missed beacon:0 > > > > but after few seconds i see: > > > > mesh IEEE 802.11abg ESSID:"" > > Mode:Managed Frequency:2.447 GHz Access Point: Not-Associated > > Tx-Power=27 dBm > > Retry min limit:7 RTS thr:off Fragment thr=2352 B > > Encryption key:off > > Power Management:off > > Link Quality:0 Signal level:0 Noise level:0 > > Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 > > Tx excessive retries:0 Invalid misc:0 Missed beacon:0 > > > > why changes?! > > > > When i type "dmesg" after type commands to set up mesh i see: > > > > root at nx9005-08:# dmesg |grep ath > > [ 19.872094] ath5k 0000:00:09.0: PCI INT A -> Link[LNKD] -> GSI 10 (level, > > low) -> IRQ 10 > > [ 19.872196] ath5k 0000:00:09.0: registered as 'phy0' > > [ 20.980345] ath5k phy0: Atheros AR5414 chip found (MAC: 0xa5, PHY: 0x61) > > [ 20.982954] ath_hal: module license 'Proprietary' taints kernel. > > [ 20.991382] ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, > > RF2413, RF5413) > > [ 21.066470] ath_pci: 0.9.4 > > [ 581.530092] ath5k phy0: bf=d9e17a40 bf_skb=00000000 > > [ 581.632508] ath5k phy0: bf=d9e17a40 bf_skb=00000000 > > [ 581.734938] ath5k phy0: bf=d9e17a40 bf_skb=00000000 > > .... > > > > root at nx9005-08:# dmesg |grep ADDRCONF > > [ 581.482338] ADDRCONF(NETDEV_UP): mesh: link is not ready > > > > any idea?? > > > > Thanks, > > Alessia > > > > > > > > > > > > > > > > > > > > > > ________________________________ > > Windows Live?: Keep your life in sync. Check it out! > > _______________________________________________ > > Devel mailing list > > Devel at lists.open80211s.org > > http://open80211s.com/mailman/listinfo/devel > > > > > _______________________________________________ > Devel mailing list > Devel at lists.open80211s.org > http://open80211s.com/mailman/listinfo/devel _________________________________________________________________ Show them the way! Add maps and directions to your party invites. http://www.microsoft.com/windows/windowslive/products/events.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://open80211s.com/pipermail/devel/attachments/20090706/6d3d65b0/attachment.html From austinxxh-ath9k at yahoo.com Mon Jul 6 15:07:54 2009 From: austinxxh-ath9k at yahoo.com (xxiao) Date: Mon, 6 Jul 2009 12:07:54 -0700 (PDT) Subject: ath9k mesh 11n throughput support Message-ID: <947636.83847.qm@web55307.mail.re4.yahoo.com> Hi, I'm running openwrt trunk with ath9k(compat-wireless 06-25, 80211abgn), I can do iperf between two mesh points at a speed of 22.1mbps. check rcstat under debugfs, I can see only 11g speed is supported, is 11s supporting any speed above 11g these days? if not, how can we add that? thanks, xxiao From andrey at cozybit.com Mon Jul 6 17:09:38 2009 From: andrey at cozybit.com (Andrey Yurovsky) Date: Mon, 6 Jul 2009 14:09:38 -0700 Subject: ath9k mesh 11n throughput support In-Reply-To: <947636.83847.qm@web55307.mail.re4.yahoo.com> References: <947636.83847.qm@web55307.mail.re4.yahoo.com> Message-ID: <45e8e6c40907061409n6bf10b6ar7614d84478687393@mail.gmail.com> On Mon, Jul 6, 2009 at 12:07 PM, xxiao wrote: > check rcstat under debugfs, I can see only 11g speed is supported, is 11s supporting any speed above 11g these days? if not, how can we add that? 11n isn't supported at this time. Adding it requires at least adding the HT Control field to the header for mesh frames when required. -Andrey From javier at cozybit.com Mon Jul 6 20:47:42 2009 From: javier at cozybit.com (javier at cozybit.com) Date: Mon, 6 Jul 2009 17:47:42 -0700 Subject: [PATCH] Fix regression in mesh forwarding path. Message-ID: <1246927662-25461-1-git-send-email-javier@cozybit.com> From: Javier Cardona The removal of the master netdev broke the mesh forwarding path. This patch fixes it by using the new internal 'pending' queue. As a result of this change, mesh forwarding no longer does the inefficient 802.11 -> 802.3 -> 802.11 conversion that was done before. Signed-off-by: Javier Cardona --- net/mac80211/mesh_hwmp.c | 3 ++- net/mac80211/mesh_pathtbl.c | 7 +++++-- net/mac80211/rx.c | 17 +++++++++++++++-- net/mac80211/tx.c | 3 --- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index f49ef28..c31fe79 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -784,7 +784,6 @@ int mesh_nexthop_lookup(struct sk_buff *skb, mesh_path_add(dst_addr, sdata); mpath = mesh_path_lookup(dst_addr, sdata); if (!mpath) { - dev_kfree_skb(skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; err = -ENOSPC; goto endlookup; @@ -804,6 +803,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, memcpy(hdr->addr1, mpath->next_hop->sta.addr, ETH_ALEN); } else { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); if (!(mpath->flags & MESH_PATH_RESOLVING)) { /* Start discovery only if it is not running yet */ mesh_queue_preq(mpath, PREQ_Q_F_START); @@ -815,6 +815,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, skb_unlink(skb_to_free, &mpath->frame_queue); } + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; skb_queue_tail(&mpath->frame_queue, skb); if (skb_to_free) mesh_path_discard_frame(skb_to_free, sdata); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 3c72557..ac7d823 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -14,6 +14,7 @@ #include #include #include "ieee80211_i.h" +#include "wme.h" #include "mesh.h" /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ @@ -481,8 +482,10 @@ void mesh_path_tx_pending(struct mesh_path *mpath) struct sk_buff *skb; while ((skb = skb_dequeue(&mpath->frame_queue)) && - (mpath->flags & MESH_PATH_ACTIVE)) - dev_queue_xmit(skb); + (mpath->flags & MESH_PATH_ACTIVE)) { + ieee80211_select_queue(mpath->sdata->local, skb); + ieee80211_add_pending_skb(mpath->sdata->local, skb); + } } /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 91747be..e3b58a4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1485,10 +1485,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) unsigned int hdrlen; struct sk_buff *skb = rx->skb, *fwd_skb; struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata; hdr = (struct ieee80211_hdr *) skb->data; hdrlen = ieee80211_hdrlen(hdr->frame_control); mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); + sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); if (!ieee80211_is_data(hdr->frame_control)) return RX_CONTINUE; @@ -1498,10 +1500,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) return RX_DROP_MONITOR; if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6){ - struct ieee80211_sub_if_data *sdata; struct mesh_path *mppath; - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); rcu_read_lock(); mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); if (!mppath) { @@ -1546,6 +1546,19 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) memset(info, 0, sizeof(*info)); info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; fwd_skb->iif = rx->dev->ifindex; + if (is_multicast_ether_addr(fwd_hdr->addr3)) + memcpy(fwd_hdr->addr1, fwd_hdr->addr3, + ETH_ALEN); + else { + int err = mesh_nexthop_lookup(fwd_skb, sdata); + /* Failed to immediately resolve next hop: + * fwded frame was dropped or will be added + * later to the pending skb queue. */ + if (err) + return RX_DROP_MONITOR; + } + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, + fwded_frames); ieee80211_select_queue(local, fwd_skb); ieee80211_add_pending_skb(local, fwd_skb); } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66d9a42..969a4b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1399,9 +1399,6 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, dev_put(sdata->dev); return; } - if (memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) != 0) - IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, - fwded_frames); } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; -- 1.5.4.3 From javier at cozybit.com Mon Jul 6 20:52:21 2009 From: javier at cozybit.com (javier at cozybit.com) Date: Mon, 6 Jul 2009 17:52:21 -0700 Subject: [PATCH] Fix regression in mesh forwarding path. In-Reply-To: <1246927662-25461-1-git-send-email-javier@cozybit.com> References: <1246927662-25461-1-git-send-email-javier@cozybit.com> Message-ID: <1246927941-27148-1-git-send-email-javier@cozybit.com> From: Javier Cardona The removal of the master netdev broke the mesh forwarding path. This patch fixes it by using the new internal 'pending' queue. As a result of this change, mesh forwarding no longer does the inefficient 802.11 -> 802.3 -> 802.11 conversion that was done before. Signed-off-by: Javier Cardona Signed-off-by: Andrey Yurovsky --- net/mac80211/mesh_hwmp.c | 3 ++- net/mac80211/mesh_pathtbl.c | 7 +++++-- net/mac80211/rx.c | 17 +++++++++++++++-- net/mac80211/tx.c | 3 --- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index f49ef28..c31fe79 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -784,7 +784,6 @@ int mesh_nexthop_lookup(struct sk_buff *skb, mesh_path_add(dst_addr, sdata); mpath = mesh_path_lookup(dst_addr, sdata); if (!mpath) { - dev_kfree_skb(skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; err = -ENOSPC; goto endlookup; @@ -804,6 +803,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, memcpy(hdr->addr1, mpath->next_hop->sta.addr, ETH_ALEN); } else { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); if (!(mpath->flags & MESH_PATH_RESOLVING)) { /* Start discovery only if it is not running yet */ mesh_queue_preq(mpath, PREQ_Q_F_START); @@ -815,6 +815,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, skb_unlink(skb_to_free, &mpath->frame_queue); } + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; skb_queue_tail(&mpath->frame_queue, skb); if (skb_to_free) mesh_path_discard_frame(skb_to_free, sdata); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 3c72557..ac7d823 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -14,6 +14,7 @@ #include #include #include "ieee80211_i.h" +#include "wme.h" #include "mesh.h" /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ @@ -481,8 +482,10 @@ void mesh_path_tx_pending(struct mesh_path *mpath) struct sk_buff *skb; while ((skb = skb_dequeue(&mpath->frame_queue)) && - (mpath->flags & MESH_PATH_ACTIVE)) - dev_queue_xmit(skb); + (mpath->flags & MESH_PATH_ACTIVE)) { + ieee80211_select_queue(mpath->sdata->local, skb); + ieee80211_add_pending_skb(mpath->sdata->local, skb); + } } /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 91747be..e3b58a4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1485,10 +1485,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) unsigned int hdrlen; struct sk_buff *skb = rx->skb, *fwd_skb; struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata; hdr = (struct ieee80211_hdr *) skb->data; hdrlen = ieee80211_hdrlen(hdr->frame_control); mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); + sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); if (!ieee80211_is_data(hdr->frame_control)) return RX_CONTINUE; @@ -1498,10 +1500,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) return RX_DROP_MONITOR; if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6){ - struct ieee80211_sub_if_data *sdata; struct mesh_path *mppath; - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); rcu_read_lock(); mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); if (!mppath) { @@ -1546,6 +1546,19 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) memset(info, 0, sizeof(*info)); info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; fwd_skb->iif = rx->dev->ifindex; + if (is_multicast_ether_addr(fwd_hdr->addr3)) + memcpy(fwd_hdr->addr1, fwd_hdr->addr3, + ETH_ALEN); + else { + int err = mesh_nexthop_lookup(fwd_skb, sdata); + /* Failed to immediately resolve next hop: + * fwded frame was dropped or will be added + * later to the pending skb queue. */ + if (err) + return RX_DROP_MONITOR; + } + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, + fwded_frames); ieee80211_select_queue(local, fwd_skb); ieee80211_add_pending_skb(local, fwd_skb); } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66d9a42..969a4b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1399,9 +1399,6 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, dev_put(sdata->dev); return; } - if (memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) != 0) - IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, - fwded_frames); } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; -- 1.5.4.3 From javier at cozybit.com Mon Jul 6 21:25:54 2009 From: javier at cozybit.com (javier at cozybit.com) Date: Mon, 6 Jul 2009 18:25:54 -0700 Subject: [PATCH v2] Fix regression in mesh forwarding path. In-Reply-To: <1246928780.4652.10.camel@johannes.local> References: <1246928780.4652.10.camel@johannes.local> Message-ID: <1246929954-15282-1-git-send-email-javier@cozybit.com> From: Javier Cardona The removal of the master netdev broke the mesh forwarding path. This patch fixes it by using the new internal 'pending' queue. As a result of this change, mesh forwarding no longer does the inefficient 802.11 -> 802.3 -> 802.11 conversion that was done before. Signed-off-by: Javier Cardona Signed-off-by: Andrey Yurovsky --- net/mac80211/mesh_hwmp.c | 3 ++- net/mac80211/mesh_pathtbl.c | 3 ++- net/mac80211/rx.c | 17 +++++++++++++++-- net/mac80211/tx.c | 3 --- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index f49ef28..c31fe79 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -784,7 +784,6 @@ int mesh_nexthop_lookup(struct sk_buff *skb, mesh_path_add(dst_addr, sdata); mpath = mesh_path_lookup(dst_addr, sdata); if (!mpath) { - dev_kfree_skb(skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; err = -ENOSPC; goto endlookup; @@ -804,6 +803,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, memcpy(hdr->addr1, mpath->next_hop->sta.addr, ETH_ALEN); } else { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); if (!(mpath->flags & MESH_PATH_RESOLVING)) { /* Start discovery only if it is not running yet */ mesh_queue_preq(mpath, PREQ_Q_F_START); @@ -815,6 +815,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, skb_unlink(skb_to_free, &mpath->frame_queue); } + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; skb_queue_tail(&mpath->frame_queue, skb); if (skb_to_free) mesh_path_discard_frame(skb_to_free, sdata); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 3c72557..e716e7d 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -14,6 +14,7 @@ #include #include #include "ieee80211_i.h" +#include "wme.h" #include "mesh.h" /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ @@ -482,7 +483,7 @@ void mesh_path_tx_pending(struct mesh_path *mpath) while ((skb = skb_dequeue(&mpath->frame_queue)) && (mpath->flags & MESH_PATH_ACTIVE)) - dev_queue_xmit(skb); + ieee80211_add_pending_skb(mpath->sdata->local, skb); } /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 91747be..1a22636 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1485,10 +1485,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) unsigned int hdrlen; struct sk_buff *skb = rx->skb, *fwd_skb; struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata; hdr = (struct ieee80211_hdr *) skb->data; hdrlen = ieee80211_hdrlen(hdr->frame_control); mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); + sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); if (!ieee80211_is_data(hdr->frame_control)) return RX_CONTINUE; @@ -1498,10 +1500,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) return RX_DROP_MONITOR; if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6){ - struct ieee80211_sub_if_data *sdata; struct mesh_path *mppath; - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); rcu_read_lock(); mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); if (!mppath) { @@ -1547,6 +1547,19 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; fwd_skb->iif = rx->dev->ifindex; ieee80211_select_queue(local, fwd_skb); + if (is_multicast_ether_addr(fwd_hdr->addr3)) + memcpy(fwd_hdr->addr1, fwd_hdr->addr3, + ETH_ALEN); + else { + int err = mesh_nexthop_lookup(fwd_skb, sdata); + /* Failed to immediately resolve next hop: + * fwded frame was dropped or will be added + * later to the pending skb queue. */ + if (err) + return RX_DROP_MONITOR; + } + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, + fwded_frames); ieee80211_add_pending_skb(local, fwd_skb); } } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66d9a42..969a4b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1399,9 +1399,6 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, dev_put(sdata->dev); return; } - if (memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) != 0) - IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, - fwded_frames); } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; -- 1.5.4.3 From javier at cozybit.com Mon Jul 6 21:35:53 2009 From: javier at cozybit.com (Javier Cardona) Date: Mon, 6 Jul 2009 18:35:53 -0700 Subject: [PATCH] Fix regression in mesh forwarding path. In-Reply-To: <1246928780.4652.10.camel@johannes.local> References: <1246927662-25461-1-git-send-email-javier@cozybit.com> <1246927941-27148-1-git-send-email-javier@cozybit.com> <1246928780.4652.10.camel@johannes.local> Message-ID: <445f43ac0907061835i2b21e8aj71d6ef93aa8123ea@mail.gmail.com> On Mon, Jul 6, 2009 at 6:06 PM, Johannes Berg wrote: > That does a lot of locking operations -- can you not select the queue > earlier, and use ieee80211_add_pending_skbs? Indeed. Just submitted v2 of the patch. Thanks! Javier -- Javier Cardona cozybit Inc. http://www.cozybit.com From javier at cozybit.com Mon Jul 6 22:54:12 2009 From: javier at cozybit.com (javier at cozybit.com) Date: Mon, 6 Jul 2009 19:54:12 -0700 Subject: [PATCH v3] Fix regression in mesh forwarding path. In-Reply-To: <1246929954-15282-1-git-send-email-javier@cozybit.com> References: <1246929954-15282-1-git-send-email-javier@cozybit.com> Message-ID: <1246935252-19823-1-git-send-email-javier@cozybit.com> From: Javier Cardona The removal of the master netdev broke the mesh forwarding path. This patch fixes it by using the new internal 'pending' queue. As a result of this change, mesh forwarding no longer does the inefficient 802.11 -> 802.3 -> 802.11 conversion that was done before. Signed-off-by: Javier Cardona Signed-off-by: Andrey Yurovsky --- net/mac80211/mesh_hwmp.c | 3 ++- net/mac80211/mesh_pathtbl.c | 9 ++++----- net/mac80211/rx.c | 17 +++++++++++++++-- net/mac80211/tx.c | 3 --- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index f49ef28..c31fe79 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -784,7 +784,6 @@ int mesh_nexthop_lookup(struct sk_buff *skb, mesh_path_add(dst_addr, sdata); mpath = mesh_path_lookup(dst_addr, sdata); if (!mpath) { - dev_kfree_skb(skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; err = -ENOSPC; goto endlookup; @@ -804,6 +803,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, memcpy(hdr->addr1, mpath->next_hop->sta.addr, ETH_ALEN); } else { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); if (!(mpath->flags & MESH_PATH_RESOLVING)) { /* Start discovery only if it is not running yet */ mesh_queue_preq(mpath, PREQ_Q_F_START); @@ -815,6 +815,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, skb_unlink(skb_to_free, &mpath->frame_queue); } + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; skb_queue_tail(&mpath->frame_queue, skb); if (skb_to_free) mesh_path_discard_frame(skb_to_free, sdata); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 3c72557..1e32948 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -14,6 +14,7 @@ #include #include #include "ieee80211_i.h" +#include "wme.h" #include "mesh.h" /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ @@ -478,11 +479,9 @@ enddel: */ void mesh_path_tx_pending(struct mesh_path *mpath) { - struct sk_buff *skb; - - while ((skb = skb_dequeue(&mpath->frame_queue)) && - (mpath->flags & MESH_PATH_ACTIVE)) - dev_queue_xmit(skb); + if (mpath->flags & MESH_PATH_ACTIVE) + ieee80211_add_pending_skbs(mpath->sdata->local, + &mpath->frame_queue); } /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 91747be..1a22636 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1485,10 +1485,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) unsigned int hdrlen; struct sk_buff *skb = rx->skb, *fwd_skb; struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata; hdr = (struct ieee80211_hdr *) skb->data; hdrlen = ieee80211_hdrlen(hdr->frame_control); mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); + sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); if (!ieee80211_is_data(hdr->frame_control)) return RX_CONTINUE; @@ -1498,10 +1500,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) return RX_DROP_MONITOR; if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6){ - struct ieee80211_sub_if_data *sdata; struct mesh_path *mppath; - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); rcu_read_lock(); mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); if (!mppath) { @@ -1547,6 +1547,19 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; fwd_skb->iif = rx->dev->ifindex; ieee80211_select_queue(local, fwd_skb); + if (is_multicast_ether_addr(fwd_hdr->addr3)) + memcpy(fwd_hdr->addr1, fwd_hdr->addr3, + ETH_ALEN); + else { + int err = mesh_nexthop_lookup(fwd_skb, sdata); + /* Failed to immediately resolve next hop: + * fwded frame was dropped or will be added + * later to the pending skb queue. */ + if (err) + return RX_DROP_MONITOR; + } + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, + fwded_frames); ieee80211_add_pending_skb(local, fwd_skb); } } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66d9a42..969a4b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1399,9 +1399,6 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, dev_put(sdata->dev); return; } - if (memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) != 0) - IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, - fwded_frames); } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; -- 1.5.4.3 From javier at cozybit.com Mon Jul 6 23:03:59 2009 From: javier at cozybit.com (Javier Cardona) Date: Mon, 6 Jul 2009 20:03:59 -0700 Subject: [PATCH v2] Fix regression in mesh forwarding path. In-Reply-To: <1246930856.4652.11.camel@johannes.local> References: <1246928780.4652.10.camel@johannes.local> <1246929954-15282-1-git-send-email-javier@cozybit.com> <1246930856.4652.11.camel@johannes.local> Message-ID: <445f43ac0907062003r3943e374ue9b6c498e76ea0b8@mail.gmail.com> Johannes, On Mon, Jul 6, 2009 at 6:40 PM, Johannes Berg wrote: > Hmm, now I'm confused, why not just do > > if (mpath->flags & MESH_PATH_ACTIVE) > ? ? ? ?ieee80211_add_pending_skbs(mpath->sdata->local, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &mpath->frame_queue); > ? Ah, yes, much better. I had missed the trailing 's' in your previous e-mail. See v3 of the patch. Thanks, Javier -- Javier Cardona cozybit Inc. http://www.cozybit.com From javier at cozybit.com Tue Jul 7 11:30:52 2009 From: javier at cozybit.com (Javier Cardona) Date: Tue, 7 Jul 2009 08:30:52 -0700 Subject: [PATCH v4] Fix regression in mesh forwarding path. In-Reply-To: <1246935252-19823-1-git-send-email-javier@cozybit.com> References: <1246935252-19823-1-git-send-email-javier@cozybit.com> Message-ID: <1246980652-4001-1-git-send-email-javier@cozybit.com> The removal of the master netdev broke the mesh forwarding path. This patch fixes it by using the new internal 'pending' queue. As a result of this change, mesh forwarding no longer does the inefficient 802.11 -> 802.3 -> 802.11 conversion that was done before. [Changes since v1] Suggested by Johannes: - Select queue before adding to mpath queue - ieee80211_add_pending_skb -> ieee80211_add_pending_skbs - Remove unnecessary header wme.h Signed-off-by: Javier Cardona Signed-off-by: Andrey Yurovsky Reviewed-by: Johannes Berg --- net/mac80211/mesh_hwmp.c | 3 ++- net/mac80211/mesh_pathtbl.c | 8 +++----- net/mac80211/rx.c | 17 +++++++++++++++-- net/mac80211/tx.c | 3 --- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index f49ef28..c31fe79 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -784,7 +784,6 @@ int mesh_nexthop_lookup(struct sk_buff *skb, mesh_path_add(dst_addr, sdata); mpath = mesh_path_lookup(dst_addr, sdata); if (!mpath) { - dev_kfree_skb(skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; err = -ENOSPC; goto endlookup; @@ -804,6 +803,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, memcpy(hdr->addr1, mpath->next_hop->sta.addr, ETH_ALEN); } else { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); if (!(mpath->flags & MESH_PATH_RESOLVING)) { /* Start discovery only if it is not running yet */ mesh_queue_preq(mpath, PREQ_Q_F_START); @@ -815,6 +815,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, skb_unlink(skb_to_free, &mpath->frame_queue); } + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; skb_queue_tail(&mpath->frame_queue, skb); if (skb_to_free) mesh_path_discard_frame(skb_to_free, sdata); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 3c72557..8445dda 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -478,11 +478,9 @@ enddel: */ void mesh_path_tx_pending(struct mesh_path *mpath) { - struct sk_buff *skb; - - while ((skb = skb_dequeue(&mpath->frame_queue)) && - (mpath->flags & MESH_PATH_ACTIVE)) - dev_queue_xmit(skb); + if (mpath->flags & MESH_PATH_ACTIVE) + ieee80211_add_pending_skbs(mpath->sdata->local, + &mpath->frame_queue); } /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 91747be..1a22636 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1485,10 +1485,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) unsigned int hdrlen; struct sk_buff *skb = rx->skb, *fwd_skb; struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata; hdr = (struct ieee80211_hdr *) skb->data; hdrlen = ieee80211_hdrlen(hdr->frame_control); mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); + sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); if (!ieee80211_is_data(hdr->frame_control)) return RX_CONTINUE; @@ -1498,10 +1500,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) return RX_DROP_MONITOR; if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6){ - struct ieee80211_sub_if_data *sdata; struct mesh_path *mppath; - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); rcu_read_lock(); mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); if (!mppath) { @@ -1547,6 +1547,19 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; fwd_skb->iif = rx->dev->ifindex; ieee80211_select_queue(local, fwd_skb); + if (is_multicast_ether_addr(fwd_hdr->addr3)) + memcpy(fwd_hdr->addr1, fwd_hdr->addr3, + ETH_ALEN); + else { + int err = mesh_nexthop_lookup(fwd_skb, sdata); + /* Failed to immediately resolve next hop: + * fwded frame was dropped or will be added + * later to the pending skb queue. */ + if (err) + return RX_DROP_MONITOR; + } + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, + fwded_frames); ieee80211_add_pending_skb(local, fwd_skb); } } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66d9a42..969a4b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1399,9 +1399,6 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, dev_put(sdata->dev); return; } - if (memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) != 0) - IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, - fwded_frames); } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; -- 1.5.4.3 From javier at cozybit.com Tue Jul 7 13:55:03 2009 From: javier at cozybit.com (javier at cozybit.com) Date: Tue, 7 Jul 2009 10:55:03 -0700 Subject: [PATCH v5] Fix regression in mesh forwarding path. In-Reply-To: <20090707170307.GC2768@tuxdriver.com> References: <20090707170307.GC2768@tuxdriver.com> Message-ID: <1246989303-19462-1-git-send-email-javier@cozybit.com> From: Javier Cardona The removal of the master netdev broke the mesh forwarding path. This patch fixes it by using the new internal 'pending' queue. As a result of this change, mesh forwarding no longer does the inefficient 802.11 -> 802.3 -> 802.11 conversion that was done before. [Changes since v1] Suggested by Johannes: - Select queue before adding to mpath queue - ieee80211_add_pending_skb -> ieee80211_add_pending_skbs - Remove unnecessary header wme.h Signed-off-by: Javier Cardona Signed-off-by: Andrey Yurovsky Reviewed-by: Johannes Berg --- net/mac80211/mesh_hwmp.c | 3 ++- net/mac80211/mesh_pathtbl.c | 8 +++----- net/mac80211/rx.c | 17 +++++++++++++++-- net/mac80211/tx.c | 3 --- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index f49ef28..c31fe79 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -784,7 +784,6 @@ int mesh_nexthop_lookup(struct sk_buff *skb, mesh_path_add(dst_addr, sdata); mpath = mesh_path_lookup(dst_addr, sdata); if (!mpath) { - dev_kfree_skb(skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; err = -ENOSPC; goto endlookup; @@ -804,6 +803,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, memcpy(hdr->addr1, mpath->next_hop->sta.addr, ETH_ALEN); } else { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); if (!(mpath->flags & MESH_PATH_RESOLVING)) { /* Start discovery only if it is not running yet */ mesh_queue_preq(mpath, PREQ_Q_F_START); @@ -815,6 +815,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, skb_unlink(skb_to_free, &mpath->frame_queue); } + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; skb_queue_tail(&mpath->frame_queue, skb); if (skb_to_free) mesh_path_discard_frame(skb_to_free, sdata); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 3c72557..ae98766 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -478,11 +478,9 @@ enddel: */ void mesh_path_tx_pending(struct mesh_path *mpath) { - struct sk_buff *skb; - - while ((skb = skb_dequeue(&mpath->frame_queue)) && - (mpath->flags & MESH_PATH_ACTIVE)) - dev_queue_xmit(skb); + if (mpath->flags & MESH_PATH_ACTIVE) + ieee80211_add_pending_skbs(mpath->sdata->local, + &mpath->frame_queue); } /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 9601b22..9d1dcaf 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1485,10 +1485,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) unsigned int hdrlen; struct sk_buff *skb = rx->skb, *fwd_skb; struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata; hdr = (struct ieee80211_hdr *) skb->data; hdrlen = ieee80211_hdrlen(hdr->frame_control); mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); + sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); if (!ieee80211_is_data(hdr->frame_control)) return RX_CONTINUE; @@ -1498,10 +1500,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) return RX_DROP_MONITOR; if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6){ - struct ieee80211_sub_if_data *sdata; struct mesh_path *mppath; - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); rcu_read_lock(); mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); if (!mppath) { @@ -1547,6 +1547,19 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; fwd_skb->iif = rx->dev->ifindex; ieee80211_select_queue(local, fwd_skb); + if (is_multicast_ether_addr(fwd_hdr->addr3)) + memcpy(fwd_hdr->addr1, fwd_hdr->addr3, + ETH_ALEN); + else { + int err = mesh_nexthop_lookup(fwd_skb, sdata); + /* Failed to immediately resolve next hop: + * fwded frame was dropped or will be added + * later to the pending skb queue. */ + if (err) + return RX_DROP_MONITOR; + } + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, + fwded_frames); ieee80211_add_pending_skb(local, fwd_skb); } } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66d9a42..969a4b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1399,9 +1399,6 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, dev_put(sdata->dev); return; } - if (memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) != 0) - IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, - fwded_frames); } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; -- 1.5.4.3 From javier at cozybit.com Wed Jul 8 01:53:23 2009 From: javier at cozybit.com (Javier Cardona) Date: Tue, 7 Jul 2009 22:53:23 -0700 Subject: [PATCH] Assign next hop address to pending mesh frames once the path is resolved. In-Reply-To: <> References: <> Message-ID: <1247032403-8312-1-git-send-email-javier@cozybit.com> Regression. Frames transmitted when a mesh path was wating to be resolved were being transmitted with an invalid Receiver Address. Signed-off-by: Javier Cardona --- net/mac80211/mesh.h | 2 +- net/mac80211/mesh_pathtbl.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 2a2ed18..1827725 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h @@ -61,7 +61,7 @@ enum mesh_path_flags { * retry * @discovery_retries: number of discovery retries * @flags: mesh path flags, as specified on &enum mesh_path_flags - * @state_lock: mesh pat state lock + * @state_lock: mesh path state lock * * * The combination of dst and sdata is unique in the mesh path table. Since the diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index ae98766..75a13ee 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -55,7 +55,23 @@ static DEFINE_RWLOCK(pathtbl_resize_lock); */ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) { - rcu_assign_pointer(mpath->next_hop, sta); + struct sk_buff *skb, *skb_first = NULL; + struct ieee80211_hdr *hdr; + + rcu_read_lock(); + mpath->next_hop = sta; + + while ((skb = skb_dequeue(&mpath->frame_queue)) != skb_first) { + if (!skb_first) + skb_first = skb; + hdr = (struct ieee80211_hdr *) skb->data; + memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); + skb_queue_tail(&mpath->frame_queue, skb); + } + if (skb_first) + skb_queue_tail(&mpath->frame_queue, skb_first); + + rcu_read_unlock(); } -- 1.5.4.3 From javier at cozybit.com Thu Jul 9 17:42:16 2009 From: javier at cozybit.com (Javier Cardona) Date: Thu, 9 Jul 2009 14:42:16 -0700 Subject: [PATCH v2] Assign next hop address to pending mesh frames once the path is resolved. In-Reply-To: <1247049613.4755.65.camel@johannes.local> References: <1247049613.4755.65.camel@johannes.local> Message-ID: <1247175736-6915-1-git-send-email-javier@cozybit.com> Regression. Frames transmitted when a mesh path was wating to be resolved were being transmitted with an invalid Receiver Address. [Changes since v1] Suggested by Johannes: - Improved frame_queue traversal - Narower RCU scope Signed-off-by: Javier Cardona Signed-off-by: Andrey Yurovsky --- net/mac80211/mesh_pathtbl.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index ae98766..1981af9 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -55,7 +55,25 @@ static DEFINE_RWLOCK(pathtbl_resize_lock); */ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) { + struct sk_buff *skb; + struct ieee80211_hdr *hdr; + struct sk_buff_head tmpq; + unsigned long flags; + rcu_assign_pointer(mpath->next_hop, sta); + + __skb_queue_head_init(&tmpq); + + spin_lock_irqsave(&mpath->frame_queue.lock, flags); + + while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) { + hdr = (struct ieee80211_hdr *) skb->data; + memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); + __skb_queue_tail(&tmpq, skb); + } + + skb_queue_splice(&tmpq, &mpath->frame_queue); + spin_unlock_irqrestore(&mpath->frame_queue.lock, flags); } -- 1.5.4.3 From andrey at cozybit.com Fri Jul 10 15:04:30 2009 From: andrey at cozybit.com (Andrey Yurovsky) Date: Fri, 10 Jul 2009 12:04:30 -0700 Subject: [PATCH v5] mac80211: Fix regression in mesh forwarding path. In-Reply-To: <20090710185150.GF2825@tuxdriver.com> References: <20090707170307.GC2768@tuxdriver.com> <1246989303-19462-1-git-send-email-javier@cozybit.com> <20090710185150.GF2825@tuxdriver.com> Message-ID: <45e8e6c40907101204g17e66df2vb89243989d297561@mail.gmail.com> On Fri, Jul 10, 2009 at 11:51 AM, John W. Linville wrote: > On Tue, Jul 07, 2009 at 10:55:03AM -0700, javier at cozybit.com wrote: >> From: Javier Cardona >> >> The removal of the master netdev broke the mesh forwarding path. ?This patch >> fixes it by using the new internal 'pending' queue. >> >> As a result of this change, mesh forwarding no longer does the inefficient >> 802.11 -> 802.3 -> 802.11 conversion that was done before. >> >> [Changes since v1] >> Suggested by Johannes: >> ?- Select queue before adding to mpath queue >> ?- ieee80211_add_pending_skb -> ieee80211_add_pending_skbs >> ?- Remove unnecessary header wme.h >> >> Signed-off-by: Javier Cardona >> Signed-off-by: Andrey Yurovsky >> Reviewed-by: Johannes Berg > > What tree are you basing this on? wireless-testing, the latest (re-spun) version applied on top of commit 5ac0fb5e5044cb578fb352dc65def1a46a2a21aa From stevie.glass at gmail.com Tue Jul 14 21:59:44 2009 From: stevie.glass at gmail.com (stevie.glass) Date: Wed, 15 Jul 2009 11:59:44 +1000 Subject: Unable to set up mesh (open80211s) In-Reply-To: References: Message-ID: <4A5D3810.9060201@gmail.com> Tejus Kudari wrote: > I've been trying to enable mesh networking on my Laptop for the last > few days. > I have the Intel ProWireless 4965agn card/ .../ > I have enabled the wlan0 interface (my wireless interface) and have > checked that my wireless drivers and the mac80211 subsystem are loaded. > > What could the problem be? According to the wiki (http://linuxwireless.org/en/users/Drivers) this hardware does not support wireless mesh operation. The wireless stack returning "Operation not supported" is something of a clue. Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://open80211s.com/pipermail/devel/attachments/20090715/bb1806e9/attachment.html