All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ooi, Joyce" <joyce.ooi@intel.com>
To: David Miller <davem@davemloft.net>
Cc: "thor.thayer@linux.intel.com" <thor.thayer@linux.intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Westergreen, Dalon" <dalon.westergreen@intel.com>,
	"Tan, Ley Foon" <ley.foon.tan@intel.com>,
	"See, Chin Liang" <chin.liang.see@intel.com>,
	"Nguyen, Dinh" <dinh.nguyen@intel.com>
Subject: RE: [PATCHv2 01/10] net: eth: altera: tse_start_xmit ignores tx_buffer call response
Date: Tue, 5 May 2020 09:27:13 +0000	[thread overview]
Message-ID: <BL0PR11MB305783B621110C7A38675659F2A70@BL0PR11MB3057.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200504.103935.1584665284135386530.davem@davemloft.net>

> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: Tuesday, May 5, 2020 1:40 AM
> To: Ooi, Joyce <joyce.ooi@intel.com>
> Cc: thor.thayer@linux.intel.com; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; Westergreen, Dalon <dalon.westergreen@intel.com>;
> Tan, Ley Foon <ley.foon.tan@intel.com>; See, Chin Liang
> <chin.liang.see@intel.com>; Nguyen, Dinh <dinh.nguyen@intel.com>
> Subject: Re: [PATCHv2 01/10] net: eth: altera: tse_start_xmit ignores tx_buffer
> call response
> 
> From: Joyce Ooi <joyce.ooi@intel.com>
> Date: Mon,  4 May 2020 16:25:49 +0800
> 
> > The return from tx_buffer call in tse_start_xmit is inapropriately
> > ignored.  tse_buffer calls should return
> > 0 for success or NETDEV_TX_BUSY.  tse_start_xmit should return not
> > report a successful transmit when the tse_buffer call returns an error
> > condition.
> 
> From driver.txt:
> 
> ====================
> 1) The ndo_start_xmit method must not return NETDEV_TX_BUSY under
>    any normal circumstances.  It is considered a hard error unless
>    there is no way your device can tell ahead of time when it's
>    transmit function will become busy.
> ====================
> 
> The problem is that when you return this error code, something has to trigger
> restarting the transmit queue to start sending packets to your device again.  The
> usual mechanism is waking the transmit queue, but it's obviously already awake
> since your transmit routine is being called.  Therefore nothing will reliably restart
> the queue when you return this error code.
> 
> The best thing to do honestly is to drop the packet and return NETDEV_TX_OK,
> meanwhile bumping a statistic counter to record this event.

My change is similar to this hard error mentioned in drvier.txt:
/* This is a hard error log it. */
if (TX_BUFFS_AVAIL(dp) <= (skb_shinfo(skb)->nr_frags + 1)) {
	netif_stop_queue(dev);
	unlock_tx(dp);
	printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
	       dev->name);
	return NETDEV_TX_BUSY;
}

So, before returning NETDEV_TX_BUSY, I can stop the queue first by calling
netif_stop_queue().


  reply	other threads:[~2020-05-05  9:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  8:25 [PATCHv2 00/10] net: eth: altera: tse: Add PTP and mSGDMA prefetcher Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 01/10] net: eth: altera: tse_start_xmit ignores tx_buffer call response Joyce Ooi
2020-05-04 17:39   ` David Miller
2020-05-05  9:27     ` Ooi, Joyce [this message]
2020-05-04  8:25 ` [PATCHv2 02/10] net: eth: altera: set rx and tx ring size before init_dma call Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 03/10] net: eth: altera: fix altera_dmaops declaration Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 04/10] net: eth: altera: add optional function to start tx dma Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 05/10] net: eth: altera: Move common functions to altera_utils Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 06/10] net: eth: altera: Add missing identifier names to function declarations Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 07/10] net: eth: altera: change tx functions to type netdev_tx_t Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 08/10] net: eth: altera: add support for ptp and timestamping Joyce Ooi
2020-05-04 16:52   ` Richard Cochran
2020-05-04  8:25 ` [PATCHv2 09/10] net: eth: altera: add msgdma prefetcher Joyce Ooi
2020-05-04  8:25 ` [PATCHv2 10/10] net: eth: altera: update devicetree bindings documentation Joyce Ooi
2020-05-12 22:52   ` Rob Herring
2020-05-13 12:00     ` Ooi, Joyce
2020-05-13 13:00       ` Ooi, Joyce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BL0PR11MB305783B621110C7A38675659F2A70@BL0PR11MB3057.namprd11.prod.outlook.com \
    --to=joyce.ooi@intel.com \
    --cc=chin.liang.see@intel.com \
    --cc=dalon.westergreen@intel.com \
    --cc=davem@davemloft.net \
    --cc=dinh.nguyen@intel.com \
    --cc=ley.foon.tan@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thor.thayer@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.