From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [net-next S4 12/15] i40evf: skb->xmit_more support
Date: Tue, 05 May 2015 10:27:54 -0700 [thread overview]
Message-ID: <5548FD9A.6010901@redhat.com> (raw)
In-Reply-To: <1429229172-143692-13-git-send-email-catherine.sullivan@intel.com>
On 04/16/2015 05:06 PM, Catherine Sullivan wrote:
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> Eric added support for skb->xmit_more in i40e, this ports that into i40evf as well.
>
> Support skb->xmit_more in i40evf is straightforward; we need to move
> around i40e_maybe_stop_tx() call to correctly test netif_xmit_stopped()
> before taking the decision to not kick the NIC.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Change-ID: Idddda6a2e4a7ab335631c91ced51f55b25eb8468
> ---
This patch description is confusing. Maybe you should include and
indent the original patch description from what you are porting into the
VF rather than just including the Signed-off-by from the original
patch. At first I thought Eric was helping to port the patch and had
contributed code to the porting effort. Also Daniel's email address is
no longer valid so you probably shouldn't be Ccing the message to him.
> drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 88 ++++++++++++++-------------
> 1 file changed, 47 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> index e1a44dd..4f77d38 100644
> --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> @@ -1672,6 +1672,47 @@ linearize_chk_done:
> }
>
> /**
> + * __i40evf_maybe_stop_tx - 2nd level check for tx stop conditions
> + * @tx_ring: the ring to be checked
> + * @size: the size buffer we want to assure is available
> + *
> + * Returns -EBUSY if a stop is needed, else 0
> + **/
> +static inline int __i40evf_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
> +{
> + netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);
> + /* Memory barrier before checking head and tail */
> + smp_mb();
> +
> + /* Check again in a case another CPU has just made room available. */
> + if (likely(I40E_DESC_UNUSED(tx_ring) < size))
> + return -EBUSY;
> +
> + /* A reprieve! - use start_queue because it doesn't call schedule */
> + netif_start_subqueue(tx_ring->netdev, tx_ring->queue_index);
> + ++tx_ring->tx_stats.restart_queue;
> + return 0;
> +}
> +
> +/**
> + * i40evf_maybe_stop_tx - 1st level check for tx stop conditions
> + * @tx_ring: the ring to be checked
> + * @size: the size buffer we want to assure is available
> + *
> + * Returns 0 if stop is not needed
> + **/
> +#ifdef I40E_FCOE
> +int i40evf_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
> +#else
> +static int i40evf_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
> +#endif
> +{
> + if (likely(I40E_DESC_UNUSED(tx_ring) >= size))
> + return 0;
> + return __i40evf_maybe_stop_tx(tx_ring, size);
> +}
> +
> +/**
I didn't think the VF could do FCoE can it?
> * i40e_tx_map - Build the Tx descriptor
> * @tx_ring: ring to send buffer on
> * @skb: send buffer
> @@ -1808,8 +1849,12 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
>
> tx_ring->next_to_use = i;
>
> + i40evf_maybe_stop_tx(tx_ring, DESC_NEEDED);
> /* notify HW of packet */
> - writel(i, tx_ring->tail);
> + if (!skb->xmit_more ||
> + netif_xmit_stopped(netdev_get_tx_queue(tx_ring->netdev,
> + tx_ring->queue_index)))
> + writel(i, tx_ring->tail);
>
> return;
>
You might want to just add a helper macro to take care of all of the
netdev_get_tx_queue stuff, it would help readability.
> @@ -1831,43 +1876,6 @@ dma_error:
> }
>
> /**
> - * __i40e_maybe_stop_tx - 2nd level check for tx stop conditions
> - * @tx_ring: the ring to be checked
> - * @size: the size buffer we want to assure is available
> - *
> - * Returns -EBUSY if a stop is needed, else 0
> - **/
> -static inline int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
> -{
> - netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);
> - /* Memory barrier before checking head and tail */
> - smp_mb();
> -
> - /* Check again in a case another CPU has just made room available. */
> - if (likely(I40E_DESC_UNUSED(tx_ring) < size))
> - return -EBUSY;
> -
> - /* A reprieve! - use start_queue because it doesn't call schedule */
> - netif_start_subqueue(tx_ring->netdev, tx_ring->queue_index);
> - ++tx_ring->tx_stats.restart_queue;
> - return 0;
> -}
> -
> -/**
> - * i40e_maybe_stop_tx - 1st level check for tx stop conditions
> - * @tx_ring: the ring to be checked
> - * @size: the size buffer we want to assure is available
> - *
> - * Returns 0 if stop is not needed
> - **/
> -static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
> -{
> - if (likely(I40E_DESC_UNUSED(tx_ring) >= size))
> - return 0;
> - return __i40e_maybe_stop_tx(tx_ring, size);
> -}
> -
> -/**
> * i40e_xmit_descriptor_count - calculate number of tx descriptors needed
> * @skb: send buffer
> * @tx_ring: ring to send buffer on
> @@ -1892,7 +1900,7 @@ static int i40e_xmit_descriptor_count(struct sk_buff *skb,
> count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
>
> count += TXD_USE_COUNT(skb_headlen(skb));
> - if (i40e_maybe_stop_tx(tx_ring, count + 4 + 1)) {
> + if (i40evf_maybe_stop_tx(tx_ring, count + 4 + 1)) {
> tx_ring->tx_stats.tx_busy++;
> return 0;
> }
> @@ -1968,8 +1976,6 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
> i40e_tx_map(tx_ring, skb, first, tx_flags, hdr_len,
> td_cmd, td_offset);
>
> - i40e_maybe_stop_tx(tx_ring, DESC_NEEDED);
> -
> return NETDEV_TX_OK;
>
> out_drop:
next prev parent reply other threads:[~2015-05-05 17:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 0:05 [Intel-wired-lan] [net-next S4 00/15] i40e/i40evf updates Catherine Sullivan
2015-04-17 0:05 ` [Intel-wired-lan] [net-next S4 01/15] i40e: Collect PFC XOFF RX stats even in single TC case Catherine Sullivan
2015-05-05 17:44 ` Young, James M
2015-04-17 0:05 ` [Intel-wired-lan] [net-next S4 02/15] i40e: Disable offline diagnostics if VFs are enabled Catherine Sullivan
2015-05-05 17:53 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 03/15] i40e/i40evf: Add ATR support for tunneled TCP/IPv4/IPv6 packets Catherine Sullivan
2015-05-08 19:24 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 04/15] i40e/i40evf: Add stats to count Tunnel ATR hits Catherine Sullivan
2015-05-08 17:56 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 05/15] i40e: Remove unnecessary pf members Catherine Sullivan
2015-05-06 16:33 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 06/15] i40e/i40evf: Remove unneeded TODO Catherine Sullivan
2015-05-05 17:51 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 07/15] i40evf: restore state Catherine Sullivan
2015-05-05 17:35 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 08/15] i40e: fix unrecognized FCOE EOF case Catherine Sullivan
2015-05-05 16:15 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 09/15] i40e: Move the FD ATR/SB messages to a higher debug level Catherine Sullivan
2015-05-09 0:06 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 10/15] i40e/i40evf: Add stats to track FD ATR and SB dynamic enable state Catherine Sullivan
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 11/15] i40e/i40evf: Update Flex-10 related device/function capabilities Catherine Sullivan
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 12/15] i40evf: skb->xmit_more support Catherine Sullivan
2015-05-05 17:27 ` Alexander Duyck [this message]
2015-05-09 0:21 ` Young, James M
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 13/15] i40e/i40evf: force inline transmit functions Catherine Sullivan
2015-05-05 16:12 ` Young, James M
2015-05-05 16:55 ` Alexander Duyck
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 14/15] i40e/i40evf: remove time_stamp member Catherine Sullivan
2015-04-17 0:06 ` [Intel-wired-lan] [net-next S4 15/15] i40e: Bump version to 1.3.4 Catherine Sullivan
2015-05-05 16:11 ` Young, James M
2015-04-17 18:53 ` [Intel-wired-lan] [net-next S4 00/15] i40e/i40evf updates Jeff Kirsher
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=5548FD9A.6010901@redhat.com \
--to=alexander.h.duyck@redhat.com \
--cc=intel-wired-lan@osuosl.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