Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1413946

Re: [PATCH 01/12] net: mediatek: fix DQL support

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH 01/12] net: mediatek: fix DQL support
Date 2016-06-05 09:40 +0200
Message-ID <rGAP7-3Qt-1@gated-at.bofh.it> (permalink)
References <rGzT3-3iX-3@gated-at.bofh.it> <rGzT3-3iX-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: John Crispin <john@phrozen.org>
Date: Sun,  5 Jun 2016 08:32:54 +0200

> @@ -625,7 +625,16 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev,
>  	WRITE_ONCE(itxd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(skb_headlen(skb)) |
>  				(!nr_frags * TX_DMA_LS0)));
>  
> -	netdev_sent_queue(dev, skb->len);
> +	/* we have a single DMA ring so BQL needs to be updated for all devices
> +	 * sitting on this ring
> +	 */
> +	for (i = 0; i < MTK_MAC_COUNT; i++) {
> +		if (!eth->netdev[i])
> +			continue;
> +
> +		netdev_sent_queue(eth->netdev[i], skb->len);
> +	}
> +
>  	skb_tx_timestamp(skb);

Sorry, this is very far from working.

You cannot asynchronously touch the DQL state of another netdevice.

You have to hold the TX lock of a queue while changing it's DQL state,
otherwise you'll corrupt the state.

This "loop over all possible devices on this DMA ring" is pretty
expensive for the problem you're trying to solve.

You'll have to find another way to fix this bug, which BTW I'm not too
clear about.  The commit message doesn't explain sufficiently what the
actual problem is.  "not deterministic" doesn't give enough details.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/12] net: mediatek: various small fixes John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
  [PATCH 09/12] net: mediatek: increase watchdog_timeo John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
    Re: [PATCH 09/12] net: mediatek: increase watchdog_timeo Andrew Lunn <andrew@lunn.ch> - 2016-06-05 17:00 +0200
      Re: [PATCH 09/12] net: mediatek: increase watchdog_timeo John Crispin <john@phrozen.org> - 2016-06-06 08:30 +0200
        Re: [PATCH 09/12] net: mediatek: increase watchdog_timeo Andrew Lunn <andrew@lunn.ch> - 2016-06-06 14:30 +0200
          Re: [PATCH 09/12] net: mediatek: increase watchdog_timeo John Crispin <john@phrozen.org> - 2016-06-06 14:40 +0200
  [PATCH 01/12] net: mediatek: fix DQL support John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
    Re: [PATCH 01/12] net: mediatek: fix DQL support David Miller <davem@davemloft.net> - 2016-06-05 09:40 +0200
      Re: [PATCH 01/12] net: mediatek: fix DQL support John Crispin <john@phrozen.org> - 2016-06-06 08:50 +0200
        Re: [PATCH 01/12] net: mediatek: fix DQL support David Miller <davem@davemloft.net> - 2016-06-08 01:10 +0200
          Re: [PATCH 01/12] net: mediatek: fix DQL support Tom Herbert <tom@herbertland.com> - 2016-06-08 01:30 +0200
  [PATCH 07/12] net: mediatek: disable all interrupts during probe John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
  [PATCH 04/12] net: mediatek: invalid buffer lookup in mtk_tx_map() John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
  [PATCH 05/12] net: mediatek: dropped rx packets are not being counted properly John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
  [PATCH 06/12] net: mediatek: add next data pointer coherency protection John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
  [PATCH 08/12] net: mediatek: fix threshold value John Crispin <john@phrozen.org> - 2016-06-05 08:40 +0200
  [PATCH 12/12] net: mediatek: remove superfluous queue wake up call John Crispin <john@phrozen.org> - 2016-06-05 09:10 +0200
  [PATCH 10/12] net: mediatek: fix off by one in the TX ring allocation John Crispin <john@phrozen.org> - 2016-06-05 09:10 +0200
  [PATCH 11/12] net: mediatek: only wake the queue if it is stopped John Crispin <john@phrozen.org> - 2016-06-05 09:10 +0200

csiph-web