From: "Ahmed S. Darwish" <darwish.07@gmail.com>
To: "Thomas Körper" <thomas.koerper@esd.eu>
Cc: linux-can@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>,
Andri Yngvason <andri.yngvason@marel.com>
Subject: Re: [PATCH V6 1/1] can: Add support for esd CAN PCIe/402 card
Date: Tue, 17 Mar 2015 10:51:52 -0400 [thread overview]
Message-ID: <20150317145152.GC30168@linux> (raw)
In-Reply-To: <20150317133309.GA30168@linux>
On Tue, Mar 17, 2015 at 09:33:09AM -0400, Ahmed S. Darwish wrote:
> Hi,
>
> [ Adding Marc to the CC list. Kindly add him in future submissions.. ]
>
> On Tue, Mar 17, 2015 at 12:38:28PM +0100, Thomas Körper wrote:
> ...
> > +netdev_tx_t acc_start_xmit(struct sk_buff *skb, struct net_device *netdev)
> > +{
> > + struct acc_net_priv *priv = netdev_priv(netdev);
> > + struct acc_core *core = priv->core;
> > + struct can_frame *cf = (struct can_frame *)skb->data;
> > + u8 new_fifo_head = (core->tx_fifo_head + 1) % core->tx_fifo_size;
> > + u32 esd_id;
> > + u8 esd_len;
> > +
> > + if ((new_fifo_head == core->tx_fifo_tail) || !acc_txq_isready(core)) {
> > + netif_stop_queue(netdev);
> > + return NETDEV_TX_BUSY;
> > + }
> > +
>
> In that case, an error or warning message is in order. Quoting from
> Documentation/networking/{driver.txt,netdevices.txt}:
>
> When this happens, it usually means start/stop flow control
> is broken in the driver. This is a hard error that should be logged:
> netdev_err("BUG: Tx ring full when queue awake!\n");
>
> [ Actually it would be nice to print such message and _heavily_ test
> the driver tx/rx pathes afterwards, making sure no practical race
> conditions exist regarding the netif tx queue .. ]
>
> On another topic, I've searched the code for the part where it stops
> the queue because "we've taken the last slot in the ring, and we will
> not be able to handle further transmissions" but couldn't find it at
> all. AFAIK, that part calls netif_stop_queue(), but _always_ return
> with NETDEV_TX_OK. Am I missing something obvious?
>
s/_always_/should always
next prev parent reply other threads:[~2015-03-17 14:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 11:38 [PATCH V6 1/1] can: Add support for esd CAN PCIe/402 card Thomas Körper
2015-03-17 13:33 ` Ahmed S. Darwish
2015-03-17 14:51 ` Ahmed S. Darwish [this message]
2015-03-17 21:55 ` Ahmed S. Darwish
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=20150317145152.GC30168@linux \
--to=darwish.07@gmail.com \
--cc=andri.yngvason@marel.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=thomas.koerper@esd.eu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).