Browse Source

mac80211: decouple # of netdev queues from HW queues

When we get more hardware queues, we'll still want
to only have netdev queues per AC, so set it up in
that way. If the hardware doesn't support QoS (by
not supporting at least 4 queues) the netdevs get
a single queue only (this is no change in behavior
as there are no drivers with 2 or 3 queues today.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg 13 năm trước cách đây
mục cha
commit
ded81f6ba9
2 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 5 1
      net/mac80211/iface.c
  2. 1 1
      net/mac80211/wme.c

+ 5 - 1
net/mac80211/iface.c

@@ -1133,11 +1133,15 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 	struct net_device *ndev;
 	struct net_device *ndev;
 	struct ieee80211_sub_if_data *sdata = NULL;
 	struct ieee80211_sub_if_data *sdata = NULL;
 	int ret, i;
 	int ret, i;
+	int txqs = 1;
 
 
 	ASSERT_RTNL();
 	ASSERT_RTNL();
 
 
+	if (local->hw.queues >= IEEE80211_NUM_ACS)
+		txqs = IEEE80211_NUM_ACS;
+
 	ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size,
 	ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size,
-				name, ieee80211_if_setup, local->hw.queues, 1);
+				name, ieee80211_if_setup, txqs, 1);
 	if (!ndev)
 	if (!ndev)
 		return -ENOMEM;
 		return -ENOMEM;
 	dev_net_set(ndev, wiphy_net(local->hw.wiphy));
 	dev_net_set(ndev, wiphy_net(local->hw.wiphy));

+ 1 - 1
net/mac80211/wme.c

@@ -108,7 +108,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
 
 
 	if (local->hw.queues < 4 || skb->len < 6) {
 	if (local->hw.queues < 4 || skb->len < 6) {
 		skb->priority = 0; /* required for correct WPA/11i MIC */
 		skb->priority = 0; /* required for correct WPA/11i MIC */
-		return min_t(u16, local->hw.queues - 1, IEEE80211_AC_BE);
+		return 0;
 	}
 	}
 
 
 	rcu_read_lock();
 	rcu_read_lock();