diff mbox

[v2] ath9k: fix more-data flag for buffered multicast packets

Message ID 20170725174616.81638-1-nbd@nbd.name (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Felix Fietkau July 25, 2017, 5:46 p.m. UTC
The flag needs to be cleared for the last packet in the list, not the
first one. Fixes some issues with multicast packet loss for powersave
clients connected to an ath9k AP.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Kalle Valo July 28, 2017, 11:32 a.m. UTC | #1
Felix Fietkau <nbd@nbd.name> wrote:

> The flag needs to be cleared for the last packet in the list, not the
> first one. Fixes some issues with multicast packet loss for powersave
> clients connected to an ath9k AP.
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Failed to compile:

drivers/net/wireless/ath/ath9k/xmit.c: In function ‘ath_tx_cabq’:
drivers/net/wireless/ath/ath9k/xmit.c:2454:2: error: implicit declaration of function ‘ath9k_set_moredata’ [-Werror=implicit-function-declaration]
  ath9k_set_moredata(sc, bf, false);
  ^
cc1: some warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/ath9k/xmit.o] Error 1
make[4]: *** [drivers/net/wireless/ath/ath9k] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

Patch set to Changes Requested.
kernel test robot July 30, 2017, 3:15 a.m. UTC | #2
Hi Felix,

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v4.13-rc2 next-20170728]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Felix-Fietkau/ath9k-fix-more-data-flag-for-buffered-multicast-packets/20170727-133416
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/net//wireless/ath/ath9k/xmit.c: In function 'ath_tx_cabq':
>> drivers/net//wireless/ath/ath9k/xmit.c:2454:2: error: implicit declaration of function 'ath9k_set_moredata' [-Werror=implicit-function-declaration]
     ath9k_set_moredata(sc, bf, false);
     ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/ath9k_set_moredata +2454 drivers/net//wireless/ath/ath9k/xmit.c

  2401	
  2402	void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  2403			 struct sk_buff *skb)
  2404	{
  2405		struct ath_softc *sc = hw->priv;
  2406		struct ath_tx_control txctl = {
  2407			.txq = sc->beacon.cabq
  2408		};
  2409		struct ath_tx_info info = {};
  2410		struct ath_buf *bf_tail = NULL;
  2411		struct ath_buf *bf;
  2412		LIST_HEAD(bf_q);
  2413		int duration = 0;
  2414		int max_duration;
  2415	
  2416		max_duration =
  2417			sc->cur_chan->beacon.beacon_interval * 1000 *
  2418			sc->cur_chan->beacon.dtim_period / ATH_BCBUF;
  2419	
  2420		do {
  2421			struct ath_frame_info *fi = get_frame_info(skb);
  2422	
  2423			if (ath_tx_prepare(hw, skb, &txctl))
  2424				break;
  2425	
  2426			bf = ath_tx_setup_buffer(sc, txctl.txq, NULL, skb);
  2427			if (!bf)
  2428				break;
  2429	
  2430			bf->bf_lastbf = bf;
  2431			ath_set_rates(vif, NULL, bf);
  2432			ath_buf_set_rate(sc, bf, &info, fi->framelen, false);
  2433			duration += info.rates[0].PktDuration;
  2434			if (bf_tail)
  2435				bf_tail->bf_next = bf;
  2436	
  2437			list_add_tail(&bf->list, &bf_q);
  2438			bf_tail = bf;
  2439			skb = NULL;
  2440	
  2441			if (duration > max_duration)
  2442				break;
  2443	
  2444			skb = ieee80211_get_buffered_bc(hw, vif);
  2445		} while(skb);
  2446	
  2447		if (skb)
  2448			ieee80211_free_txskb(hw, skb);
  2449	
  2450		if (list_empty(&bf_q))
  2451			return;
  2452	
  2453		bf = list_last_entry(&bf_q, struct ath_buf, list);
> 2454		ath9k_set_moredata(sc, bf, false);
  2455	
  2456		bf = list_first_entry(&bf_q, struct ath_buf, list);
  2457		ath_txq_lock(sc, txctl.txq);
  2458		ath_tx_fill_desc(sc, bf, txctl.txq, 0);
  2459		ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false);
  2460		TX_STAT_INC(txctl.txq->axq_qnum, queued);
  2461		ath_txq_unlock(sc, txctl.txq);
  2462	}
  2463	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 30efe79e9d89..abc7c2e88e22 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2451,7 +2451,6 @@  void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		.txq = sc->beacon.cabq
 	};
 	struct ath_tx_info info = {};
-	struct ieee80211_hdr *hdr;
 	struct ath_buf *bf_tail = NULL;
 	struct ath_buf *bf;
 	LIST_HEAD(bf_q);
@@ -2495,15 +2494,10 @@  void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	if (list_empty(&bf_q))
 		return;
 
-	bf = list_first_entry(&bf_q, struct ath_buf, list);
-	hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
-
-	if (hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) {
-		hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA);
-		dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
-			sizeof(*hdr), DMA_TO_DEVICE);
-	}
+	bf = list_last_entry(&bf_q, struct ath_buf, list);
+	ath9k_set_moredata(sc, bf, false);
 
+	bf = list_first_entry(&bf_q, struct ath_buf, list);
 	ath_txq_lock(sc, txctl.txq);
 	ath_tx_fill_desc(sc, bf, txctl.txq, 0);
 	ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false);