From: Richard Cochran <richardcochran@gmail.com>
To: Vince Bridgers <vbridgers2013@gmail.com>
Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org,
linux-doc@vger.kernel.org, robh+dt@kernel.org,
pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
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 15:39:18 +0100 [thread overview]
Message-ID: <20140314143918.GA2253@netboy> (raw)
In-Reply-To: <1394805887-22030-7-git-send-email-vbridgers2013@gmail.com>
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.
> +
> + 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
next prev parent reply other threads:[~2014-03-14 14:39 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 [this message]
2014-03-14 18:52 ` Vince Bridgers
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=20140314143918.GA2253@netboy \
--to=richardcochran@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=rob@landley.net \
--cc=robh+dt@kernel.org \
--cc=vbridgers2013@gmail.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 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).