* [PATCH net-next] tg3: Add skb->xmit_more support
@ 2014-10-13 16:21 Prashant Sreedharan
2014-10-13 16:48 ` Eric Dumazet
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Prashant Sreedharan @ 2014-10-13 16:21 UTC (permalink / raw)
To: davem; +Cc: netdev, dborkman, mchan, Prashant Sreedharan
Ring TX doorbell only if xmit_more is not set or the queue is stopped.
Suggested-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index ba49948..dbb41c1 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8099,9 +8099,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Sync BD data before updating mailbox */
wmb();
- /* Packets are ready, update Tx producer idx local and on card. */
- tw32_tx_mbox(tnapi->prodmbox, entry);
-
tnapi->tx_prod = entry;
if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
netif_tx_stop_queue(txq);
@@ -8116,7 +8113,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_tx_wake_queue(txq);
}
- mmiowb();
+ if (!skb->xmit_more || netif_xmit_stopped(txq)) {
+ /* Packets are ready, update Tx producer idx on card. */
+ tw32_tx_mbox(tnapi->prodmbox, entry);
+ mmiowb();
+ }
+
return NETDEV_TX_OK;
dma_error:
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] tg3: Add skb->xmit_more support
2014-10-13 16:21 [PATCH net-next] tg3: Add skb->xmit_more support Prashant Sreedharan
@ 2014-10-13 16:48 ` Eric Dumazet
2014-10-13 17:14 ` Rick Jones
2014-10-13 17:38 ` Florian Westphal
2014-10-14 19:34 ` David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2014-10-13 16:48 UTC (permalink / raw)
To: Prashant Sreedharan; +Cc: davem, netdev, dborkman, mchan
On Mon, 2014-10-13 at 09:21 -0700, Prashant Sreedharan wrote:
> Ring TX doorbell only if xmit_more is not set or the queue is stopped.
>
> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/tg3.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
Have you noticed any performance change ?
I did the patch for bnx2x but got no real difference...
Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] tg3: Add skb->xmit_more support
2014-10-13 16:48 ` Eric Dumazet
@ 2014-10-13 17:14 ` Rick Jones
0 siblings, 0 replies; 6+ messages in thread
From: Rick Jones @ 2014-10-13 17:14 UTC (permalink / raw)
To: Eric Dumazet, Prashant Sreedharan; +Cc: davem, netdev, dborkman, mchan
On 10/13/2014 09:48 AM, Eric Dumazet wrote:
> On Mon, 2014-10-13 at 09:21 -0700, Prashant Sreedharan wrote:
>> Ring TX doorbell only if xmit_more is not set or the queue is stopped.
>>
>> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
>> Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
>> Signed-off-by: Michael Chan <mchan@broadcom.com>
>> ---
>> drivers/net/ethernet/broadcom/tg3.c | 10 ++++++----
>> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> Have you noticed any performance change ?
>
> I did the patch for bnx2x but got no real difference...
If ringing the doorbell is just a pio write, it may just get lost in the
noise. If though the programming model (or some sort of defect
workaround) of the NIC requires a pio read of some sort when ringing the
doorbell...
rick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] tg3: Add skb->xmit_more support
2014-10-13 16:21 [PATCH net-next] tg3: Add skb->xmit_more support Prashant Sreedharan
2014-10-13 16:48 ` Eric Dumazet
@ 2014-10-13 17:38 ` Florian Westphal
2014-10-13 18:01 ` Florian Westphal
2014-10-14 19:34 ` David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Florian Westphal @ 2014-10-13 17:38 UTC (permalink / raw)
To: Prashant Sreedharan; +Cc: davem, netdev, dborkman, mchan
Prashant Sreedharan <prashant@broadcom.com> wrote:
> Ring TX doorbell only if xmit_more is not set or the queue is stopped.
>
> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/tg3.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index ba49948..dbb41c1 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -8099,9 +8099,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
> /* Sync BD data before updating mailbox */
> wmb();
>
> - /* Packets are ready, update Tx producer idx local and on card. */
> - tw32_tx_mbox(tnapi->prodmbox, entry);
> -
> tnapi->tx_prod = entry;
> if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
> netif_tx_stop_queue(txq);
> @@ -8116,7 +8113,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
> netif_tx_wake_queue(txq);
> }
>
> - mmiowb();
> + if (!skb->xmit_more || netif_xmit_stopped(txq)) {
> + /* Packets are ready, update Tx producer idx on card. */
> + tw32_tx_mbox(tnapi->prodmbox, entry);
I think you need to swap the test, i.e.
netif_xmit_stopped() || xmit_more
Otherwise, hw may not be aware of further packets wainting
and queue might not be restarted?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] tg3: Add skb->xmit_more support
2014-10-13 17:38 ` Florian Westphal
@ 2014-10-13 18:01 ` Florian Westphal
0 siblings, 0 replies; 6+ messages in thread
From: Florian Westphal @ 2014-10-13 18:01 UTC (permalink / raw)
To: Florian Westphal; +Cc: Prashant Sreedharan, davem, netdev, dborkman, mchan
Florian Westphal <fw@strlen.de> wrote:
> Prashant Sreedharan <prashant@broadcom.com> wrote:
> > Ring TX doorbell only if xmit_more is not set or the queue is stopped.
> >
> > Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> > Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
> > Signed-off-by: Michael Chan <mchan@broadcom.com>
> > ---
> > drivers/net/ethernet/broadcom/tg3.c | 10 ++++++----
> > 1 files changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index ba49948..dbb41c1 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -8099,9 +8099,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > /* Sync BD data before updating mailbox */
> > wmb();
> >
> > - /* Packets are ready, update Tx producer idx local and on card. */
> > - tw32_tx_mbox(tnapi->prodmbox, entry);
> > -
> > tnapi->tx_prod = entry;
> > if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
> > netif_tx_stop_queue(txq);
> > @@ -8116,7 +8113,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > netif_tx_wake_queue(txq);
> > }
> >
> > - mmiowb();
> > + if (!skb->xmit_more || netif_xmit_stopped(txq)) {
> > + /* Packets are ready, update Tx producer idx on card. */
> > + tw32_tx_mbox(tnapi->prodmbox, entry);
>
> I think you need to swap the test, i.e.
Never mind, sorry for the noise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] tg3: Add skb->xmit_more support
2014-10-13 16:21 [PATCH net-next] tg3: Add skb->xmit_more support Prashant Sreedharan
2014-10-13 16:48 ` Eric Dumazet
2014-10-13 17:38 ` Florian Westphal
@ 2014-10-14 19:34 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-14 19:34 UTC (permalink / raw)
To: prashant; +Cc: netdev, dborkman, mchan
From: Prashant Sreedharan <prashant@broadcom.com>
Date: Mon, 13 Oct 2014 09:21:42 -0700
> Ring TX doorbell only if xmit_more is not set or the queue is stopped.
>
> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-10-14 19:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-13 16:21 [PATCH net-next] tg3: Add skb->xmit_more support Prashant Sreedharan
2014-10-13 16:48 ` Eric Dumazet
2014-10-13 17:14 ` Rick Jones
2014-10-13 17:38 ` Florian Westphal
2014-10-13 18:01 ` Florian Westphal
2014-10-14 19:34 ` 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).