netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vince Bridgers <vbridgers2013@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>, Rob Landley <rob@landley.net>
Subject: Re: [PATCH net-next V5 6/9] Altera TSE: Add main and header file for Altera Ethernet Driver
Date: Fri, 14 Mar 2014 13:52:04 -0500	[thread overview]
Message-ID: <CAOwfj2NosO9t-C6ArW6WX02nko-7fWyBS3vqYaDQ1-CpbGdH3A@mail.gmail.com> (raw)
In-Reply-To: <20140314143918.GA2253@netboy>

Hi Richard,

On Fri, Mar 14, 2014 at 9:39 AM, Richard Cochran
<richardcochran@gmail.com> wrote:
> On Fri, Mar 14, 2014 at 09:04:44AM -0500, Vince Bridgers wrote:
>> +static int tse_start_xmit(struct sk_buff *skb, struct net_device *dev)
>> +{
>> +     struct altera_tse_private *priv = netdev_priv(dev);
>> +     unsigned int txsize = priv->tx_ring_size;
>> +     unsigned int entry;
>> +     struct tse_buffer *buffer = NULL;
>> +     int nfrags = skb_shinfo(skb)->nr_frags;
>> +     unsigned int nopaged_len = skb_headlen(skb);
>> +     enum netdev_tx ret = NETDEV_TX_OK;
>> +     dma_addr_t dma_addr;
>> +     int txcomplete = 0;
>> +
>> +     spin_lock_bh(&priv->tx_lock);
>> +
>> +     if (unlikely(tse_tx_avail(priv) < nfrags + 1)) {
>> +             if (!netif_queue_stopped(dev)) {
>> +                     netif_stop_queue(dev);
>> +                     /* This is a hard error, log it. */
>> +                     netdev_err(priv->dev,
>> +                                "%s: Tx list full when queue awake\n",
>> +                                __func__);
>> +             }
>> +             ret = NETDEV_TX_BUSY;
>> +             goto out;
>> +     }
>> +
>> +     /* Map the first skb fragment */
>> +     entry = priv->tx_prod % txsize;
>> +     buffer = &priv->tx_ring[entry];
>> +
>> +     dma_addr = dma_map_single(priv->device, skb->data, nopaged_len,
>> +                               DMA_TO_DEVICE);
>> +     if (dma_mapping_error(priv->device, dma_addr)) {
>> +             netdev_err(priv->dev, "%s: DMA mapping error\n", __func__);
>> +             ret = NETDEV_TX_OK;
>> +             goto out;
>> +     }
>> +
>> +     buffer->skb = skb;
>> +     buffer->dma_addr = dma_addr;
>> +     buffer->len = nopaged_len;
>> +
>> +     /* Push data out of the cache hierarchy into main memory */
>> +     dma_sync_single_for_device(priv->device, buffer->dma_addr,
>> +                                buffer->len, DMA_TO_DEVICE);
>> +
>> +     txcomplete = priv->dmaops->tx_buffer(priv, buffer);
>> +
>> +     priv->tx_prod++;
>> +     dev->stats.tx_bytes += skb->len;
>
> This could use a call to skb_tx_timestamp() somewhere around here.

Thank you, I'll add the call

>
>> +
>> +     if (unlikely(tse_tx_avail(priv) <= TXQUEUESTOP_THRESHHOLD)) {
>> +             if (netif_msg_hw(priv))
>> +                     netdev_dbg(priv->dev, "%s: stop transmitted packets\n",
>> +                                __func__);
>> +             netif_stop_queue(dev);
>> +     }
>> +
>> +out:
>> +     spin_unlock_bh(&priv->tx_lock);
>> +
>> +     return ret;
>> +}
>
> Thanks,
> Richard

All the best,

Vince

  reply	other threads:[~2014-03-14 18:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 14:04 [PATCH net-next V5 0/9] Altera Triple Speed Ethernet (TSE) Driver Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 1/9] dts: Add bindings for the Altera Triple Speed Ethernet driver Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 2/9] Documentation: networking: Add Altera Ethernet (TSE) Documentation Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 3/9] Altera TSE: Add Altera Ethernet Driver MSGDMA File Components Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 4/9] Altera TSE: Add Altera Ethernet Driver SGDMA file components Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 5/9] Altera TSE: Add Miscellaneous Files for Altera Ethernet Driver Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 6/9] Altera TSE: Add main and header file " Vince Bridgers
2014-03-14 14:39   ` Richard Cochran
2014-03-14 18:52     ` Vince Bridgers [this message]
2014-03-14 19:05     ` David Miller
2014-03-14 14:04 ` [PATCH net-next V5 7/9] Altera TSE: Add Altera Ethernet Driver Makefile and Kconfig Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 8/9] MAINTAINERS: Add entry for Altera Triple Speed Ethernet Driver Vince Bridgers
2014-03-14 14:04 ` [PATCH net-next V5 9/9] net: ethernet: Change Ethernet Makefile and Kconfig for Altera TSE driver Vince Bridgers
2014-03-14 19:07 ` [PATCH net-next V5 0/9] Altera Triple Speed Ethernet (TSE) Driver David Miller
2014-03-14 19:15   ` David Miller
2014-03-15 20:52     ` Vince Bridgers

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=CAOwfj2NosO9t-C6ArW6WX02nko-7fWyBS3vqYaDQ1-CpbGdH3A@mail.gmail.com \
    --to=vbridgers2013@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=richardcochran@gmail.com \
    --cc=rob@landley.net \
    --cc=robh+dt@kernel.org \
    /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).