* [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
@ 2011-11-23  5:52 Tom Herbert
  2011-11-23 17:46 ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Herbert @ 2011-11-23  5:52 UTC (permalink / raw)
  To: davem, netdev
Add interfaces for drivers to call for recording number of packets and
bytes at send time and transmit completion.  Also, added a function to
"reset" a queue.  These will be used by Byte Queue Limits.
Signed-off-by: Tom Herbert <therbert@google.com>
---
 include/linux/netdevice.h |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index dfb50ed..8b3eb8a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1924,6 +1924,35 @@ static inline int netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_qu
 	return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN;
 }
 
+static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
+					unsigned int pkts, unsigned int bytes)
+{
+}
+
+static inline void netdev_sent_queue(struct net_device *dev,
+				     unsigned int pkts, unsigned int bytes)
+{
+	netdev_tx_sent_queue(netdev_get_tx_queue(dev, 0), pkts, bytes);
+}
+
+static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
+					     unsigned pkts, unsigned bytes)
+{
+}
+
+static inline void netdev_completed_queue(struct net_device *dev,
+					  unsigned pkts, unsigned bytes)
+{
+	netdev_tx_completed_queue(netdev_get_tx_queue(dev, 0), pkts, bytes);
+}
+
+static inline void netdev_tx_reset_queue(struct netdev_queue *q)
+{
+}
+
+static inline void netdev_reset_queue(struct net_device *dev_queue)
+{
+	netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0));
 }
 
 /**
-- 
1.7.3.1
^ permalink raw reply related	[flat|nested] 8+ messages in thread- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-23  5:52 [PATCH v3 03/10] net: Add netdev interfaces recording send/compl Tom Herbert
@ 2011-11-23 17:46 ` Stephen Hemminger
  2011-11-23 23:58   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2011-11-23 17:46 UTC (permalink / raw)
  To: Tom Herbert; +Cc: davem, netdev
On Tue, 22 Nov 2011 21:52:37 -0800 (PST)
Tom Herbert <therbert@google.com> wrote:
> Add interfaces for drivers to call for recording number of packets and
> bytes at send time and transmit completion.  Also, added a function to
> "reset" a queue.  These will be used by Byte Queue Limits.
> 
> Signed-off-by: Tom Herbert <therbert@google.com>
Since all the drivers that you show do this for one packet at a time,
why bother with a packets arguement to netdev_sent_queue()?
^ permalink raw reply	[flat|nested] 8+ messages in thread 
- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-23 17:46 ` Stephen Hemminger
@ 2011-11-23 23:58   ` David Miller
  2011-11-24  0:03     ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2011-11-23 23:58 UTC (permalink / raw)
  To: shemminger; +Cc: therbert, netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 23 Nov 2011 09:46:14 -0800
> Since all the drivers that you show do this for one packet at a time,
> why bother with a packets arguement to netdev_sent_queue()?
They batch the completion, that's why f.e. e1000e's changes keep track of
pkts_compl and bytes_compl, and then pass that in at the end of the TX
completion processing so that we only invoke these interfaces once per
run instead of once per packet.
^ permalink raw reply	[flat|nested] 8+ messages in thread 
- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-23 23:58   ` David Miller
@ 2011-11-24  0:03     ` Stephen Hemminger
  2011-11-24  0:06       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2011-11-24  0:03 UTC (permalink / raw)
  To: David Miller; +Cc: therbert, netdev
On Wed, 23 Nov 2011 18:58:12 -0500 (EST)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Wed, 23 Nov 2011 09:46:14 -0800
> 
> > Since all the drivers that you show do this for one packet at a time,
> > why bother with a packets arguement to netdev_sent_queue()?
> 
> They batch the completion, that's why f.e. e1000e's changes keep track of
> pkts_compl and bytes_compl, and then pass that in at the end of the TX
> completion processing so that we only invoke these interfaces once per
> run instead of once per packet.
I was referring to the transmit routine, there for netdev_sent_queue()
is always called with one packet.
Many drivers batch packets in completion, and call netdev_completed_queue()
with multiple packets (and bytes).
^ permalink raw reply	[flat|nested] 8+ messages in thread 
- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-24  0:03     ` Stephen Hemminger
@ 2011-11-24  0:06       ` David Miller
  2011-11-24  0:32         ` Tom Herbert
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2011-11-24  0:06 UTC (permalink / raw)
  To: shemminger; +Cc: therbert, netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 23 Nov 2011 16:03:20 -0800
> On Wed, 23 Nov 2011 18:58:12 -0500 (EST)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Wed, 23 Nov 2011 09:46:14 -0800
>> 
>> > Since all the drivers that you show do this for one packet at a time,
>> > why bother with a packets arguement to netdev_sent_queue()?
>> 
>> They batch the completion, that's why f.e. e1000e's changes keep track of
>> pkts_compl and bytes_compl, and then pass that in at the end of the TX
>> completion processing so that we only invoke these interfaces once per
>> run instead of once per packet.
> 
> I was referring to the transmit routine, there for netdev_sent_queue()
> is always called with one packet.
Optimism for the future? :-)
But yeah if nobody batches right now, no reason to support this in the
interfaces, we can add it later.
^ permalink raw reply	[flat|nested] 8+ messages in thread 
- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-24  0:06       ` David Miller
@ 2011-11-24  0:32         ` Tom Herbert
  2011-11-24  7:30           ` Dave Taht
  2011-11-28 17:49           ` Ben Hutchings
  0 siblings, 2 replies; 8+ messages in thread
From: Tom Herbert @ 2011-11-24  0:32 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev
>> I was referring to the transmit routine, there for netdev_sent_queue()
>> is always called with one packet.
>
> Optimism for the future? :-)
>
Yep, I am looking forward to the day that someone figures out how to
batch transmits in a meaningful way!
> But yeah if nobody batches right now, no reason to support this in the
> interfaces, we can add it later.
Okay.
>
^ permalink raw reply	[flat|nested] 8+ messages in thread 
- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-24  0:32         ` Tom Herbert
@ 2011-11-24  7:30           ` Dave Taht
  2011-11-28 17:49           ` Ben Hutchings
  1 sibling, 0 replies; 8+ messages in thread
From: Dave Taht @ 2011-11-24  7:30 UTC (permalink / raw)
  To: Tom Herbert; +Cc: David Miller, shemminger, netdev
On Thu, Nov 24, 2011 at 1:32 AM, Tom Herbert <therbert@google.com> wrote:
>>> I was referring to the transmit routine, there for netdev_sent_queue()
>>> is always called with one packet.
>>
>> Optimism for the future? :-)
>>
>
> Yep, I am looking forward to the day that someone figures out how to
> batch transmits in a meaningful way!
I liked it in potentia, as wireless likes to aggregate packets into
batches that fit into an AMPDU directed at a single station
and/or TXOP.
not that BQL can help there at present as this happens below the
mac80211 layer, and packets vanish once consumed by the driver.
>
>> But yeah if nobody batches right now, no reason to support this in the
>> interfaces, we can add it later.
>
> Okay.
>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
-- 
Dave Täht
SKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374
http://www.bufferbloat.net
^ permalink raw reply	[flat|nested] 8+ messages in thread 
- * Re: [PATCH v3 03/10] net: Add netdev interfaces recording send/compl
  2011-11-24  0:32         ` Tom Herbert
  2011-11-24  7:30           ` Dave Taht
@ 2011-11-28 17:49           ` Ben Hutchings
  1 sibling, 0 replies; 8+ messages in thread
From: Ben Hutchings @ 2011-11-28 17:49 UTC (permalink / raw)
  To: Tom Herbert; +Cc: David Miller, shemminger, netdev
On Wed, 2011-11-23 at 16:32 -0800, Tom Herbert wrote:
> >> I was referring to the transmit routine, there for netdev_sent_queue()
> >> is always called with one packet.
> >
> > Optimism for the future? :-)
> >
> 
> Yep, I am looking forward to the day that someone figures out how to
> batch transmits in a meaningful way!
[...]
UFO/TSO do something like that.  Should we count physical or logical
packets?
Ben.
-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply	[flat|nested] 8+ messages in thread 
 
 
 
 
 
end of thread, other threads:[~2011-11-28 17:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23  5:52 [PATCH v3 03/10] net: Add netdev interfaces recording send/compl Tom Herbert
2011-11-23 17:46 ` Stephen Hemminger
2011-11-23 23:58   ` David Miller
2011-11-24  0:03     ` Stephen Hemminger
2011-11-24  0:06       ` David Miller
2011-11-24  0:32         ` Tom Herbert
2011-11-24  7:30           ` Dave Taht
2011-11-28 17:49           ` Ben Hutchings
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).