* [PATCH v2] fm10k: Add skb->xmit_more support
@ 2014-10-10 21:30 alexander.duyck
2014-10-11 11:14 ` Jeff Kirsher
0 siblings, 1 reply; 3+ messages in thread
From: alexander.duyck @ 2014-10-10 21:30 UTC (permalink / raw)
To: e1000-devel, netdev, davem, jeffrey.t.kirsher; +Cc: matthew.vick
From: Alexander Duyck <alexander.h.duyck@redhat.com>
This change adds support for skb->xmit_more based on the changes that were
made to igb to support the feature. The main changes are moving up the
check for maybe_stop_tx so that we can check netif_xmit_stopped to determine
if we must write the tail because we can add no further buffers.
Acked-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
v2: Minor fix to patch description for typo.
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 65 +++++++++++++------------
1 file changed, 34 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 6c800a3..8ad7ff4 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -930,6 +930,30 @@ static bool fm10k_tx_desc_push(struct fm10k_ring *tx_ring,
return i == tx_ring->count;
}
+static int __fm10k_maybe_stop_tx(struct fm10k_ring *tx_ring, u16 size)
+{
+ netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);
+
+ smp_mb();
+
+ /* We need to check again in a case another CPU has just
+ * made room available. */
+ if (likely(fm10k_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;
+}
+
+static inline int fm10k_maybe_stop_tx(struct fm10k_ring *tx_ring, u16 size)
+{
+ if (likely(fm10k_desc_unused(tx_ring) >= size))
+ return 0;
+ return __fm10k_maybe_stop_tx(tx_ring, size);
+}
+
static void fm10k_tx_map(struct fm10k_ring *tx_ring,
struct fm10k_tx_buffer *first)
{
@@ -1023,13 +1047,18 @@ static void fm10k_tx_map(struct fm10k_ring *tx_ring,
tx_ring->next_to_use = i;
+ /* Make sure there is space in the ring for the next send. */
+ fm10k_maybe_stop_tx(tx_ring, DESC_NEEDED);
+
/* notify HW of packet */
- writel(i, tx_ring->tail);
+ if (netif_xmit_stopped(txring_txq(tx_ring)) || !skb->xmit_more) {
+ writel(i, tx_ring->tail);
- /* we need this if more than one processor can write to our tail
- * at a time, it synchronizes IO on IA64/Altix systems
- */
- mmiowb();
+ /* we need this if more than one processor can write to our tail
+ * at a time, it synchronizes IO on IA64/Altix systems
+ */
+ mmiowb();
+ }
return;
dma_error:
@@ -1049,30 +1078,6 @@ dma_error:
tx_ring->next_to_use = i;
}
-static int __fm10k_maybe_stop_tx(struct fm10k_ring *tx_ring, u16 size)
-{
- netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);
-
- smp_mb();
-
- /* We need to check again in a case another CPU has just
- * made room available. */
- if (likely(fm10k_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;
-}
-
-static inline int fm10k_maybe_stop_tx(struct fm10k_ring *tx_ring, u16 size)
-{
- if (likely(fm10k_desc_unused(tx_ring) >= size))
- return 0;
- return __fm10k_maybe_stop_tx(tx_ring, size);
-}
-
netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
struct fm10k_ring *tx_ring)
{
@@ -1117,8 +1122,6 @@ netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
fm10k_tx_map(tx_ring, first);
- fm10k_maybe_stop_tx(tx_ring, DESC_NEEDED);
-
return NETDEV_TX_OK;
out_drop:
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] fm10k: Add skb->xmit_more support
2014-10-10 21:30 [PATCH v2] fm10k: Add skb->xmit_more support alexander.duyck
@ 2014-10-11 11:14 ` Jeff Kirsher
2014-10-14 17:09 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Kirsher @ 2014-10-11 11:14 UTC (permalink / raw)
To: alexander.duyck; +Cc: e1000-devel, netdev, davem, matthew.vick
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
On Fri, 2014-10-10 at 14:30 -0700, alexander.duyck@gmail.com wrote:
> From: Alexander Duyck <alexander.h.duyck@redhat.com>
>
> This change adds support for skb->xmit_more based on the changes that
> were
> made to igb to support the feature. The main changes are moving up
> the
> check for maybe_stop_tx so that we can check netif_xmit_stopped to
> determine
> if we must write the tail because we can add no further buffers.
>
> Acked-by: Matthew Vick <matthew.vick@intel.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
> ---
>
> v2: Minor fix to patch description for typo.
>
> drivers/net/ethernet/intel/fm10k/fm10k_main.c | 65
> +++++++++++++------------
> 1 file changed, 34 insertions(+), 31 deletions(-)
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Its like you never left Intel Alex... :-)
Dave, please pull this.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] fm10k: Add skb->xmit_more support
2014-10-11 11:14 ` Jeff Kirsher
@ 2014-10-14 17:09 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2014-10-14 17:09 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: alexander.duyck, e1000-devel, netdev, matthew.vick
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sat, 11 Oct 2014 04:14:43 -0700
> On Fri, 2014-10-10 at 14:30 -0700, alexander.duyck@gmail.com wrote:
>> From: Alexander Duyck <alexander.h.duyck@redhat.com>
>>
>> This change adds support for skb->xmit_more based on the changes that
>> were
>> made to igb to support the feature. The main changes are moving up
>> the
>> check for maybe_stop_tx so that we can check netif_xmit_stopped to
>> determine
>> if we must write the tail because we can add no further buffers.
>>
>> Acked-by: Matthew Vick <matthew.vick@intel.com>
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
>> ---
>>
>> v2: Minor fix to patch description for typo.
>>
>> drivers/net/ethernet/intel/fm10k/fm10k_main.c | 65
>> +++++++++++++------------
>> 1 file changed, 34 insertions(+), 31 deletions(-)
>
> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> Its like you never left Intel Alex... :-)
> Dave, please pull this.
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-14 17:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-10 21:30 [PATCH v2] fm10k: Add skb->xmit_more support alexander.duyck
2014-10-11 11:14 ` Jeff Kirsher
2014-10-14 17:09 ` David Miller
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).