* [PATCH] xen-netfront: rearrange netfront_info structure to separate tx and rx
@ 2007-10-09 18:44 Jeremy Fitzhardinge
2007-10-10 0:46 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2007-10-09 18:44 UTC (permalink / raw)
To: Jeff Garzik
Cc: NetDev, Linux Kernel Mailing List, Keir Fraser, Stephen Hemminger,
Christoph Hellwig
Keep tx and rx elements separate on different cachelines to prevent
bouncing.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>
---
drivers/net/xen-netfront.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
===================================================================
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -72,22 +72,12 @@ struct netfront_info {
struct list_head list;
struct net_device *netdev;
+ unsigned int evtchn;
+ struct xenbus_device *xbdev;
+
+ spinlock_t tx_lock;
struct xen_netif_tx_front_ring tx;
- struct xen_netif_rx_front_ring rx;
-
- spinlock_t tx_lock;
- spinlock_t rx_lock;
-
- unsigned int evtchn;
-
- /* Receive-ring batched refills. */
-#define RX_MIN_TARGET 8
-#define RX_DFL_MIN_TARGET 64
-#define RX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
- unsigned rx_min_target, rx_max_target, rx_target;
- struct sk_buff_head rx_batch;
-
- struct timer_list rx_refill_timer;
+ int tx_ring_ref;
/*
* {tx,rx}_skbs store outstanding skbuffs. Free tx_skb entries
@@ -106,13 +96,22 @@ struct netfront_info {
grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
unsigned tx_skb_freelist;
+ spinlock_t rx_lock ____cacheline_aligned_in_smp;
+ struct xen_netif_rx_front_ring rx;
+ int rx_ring_ref;
+
+ /* Receive-ring batched refills. */
+#define RX_MIN_TARGET 8
+#define RX_DFL_MIN_TARGET 64
+#define RX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
+ unsigned rx_min_target, rx_max_target, rx_target;
+ struct sk_buff_head rx_batch;
+
+ struct timer_list rx_refill_timer;
+
struct sk_buff *rx_skbs[NET_RX_RING_SIZE];
grant_ref_t gref_rx_head;
grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
-
- struct xenbus_device *xbdev;
- int tx_ring_ref;
- int rx_ring_ref;
unsigned long rx_pfn_array[NET_RX_RING_SIZE];
struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xen-netfront: rearrange netfront_info structure to separate tx and rx
2007-10-09 18:44 [PATCH] xen-netfront: rearrange netfront_info structure to separate tx and rx Jeremy Fitzhardinge
@ 2007-10-10 0:46 ` Jeff Garzik
2007-10-10 1:03 ` Jeremy Fitzhardinge
2007-10-10 1:08 ` Jeremy Fitzhardinge
0 siblings, 2 replies; 4+ messages in thread
From: Jeff Garzik @ 2007-10-10 0:46 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: NetDev, Linux Kernel Mailing List, Keir Fraser, Stephen Hemminger,
Christoph Hellwig
Jeremy Fitzhardinge wrote:
> Keep tx and rx elements separate on different cachelines to prevent
> bouncing.
>
> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
> Cc: Christoph Hellwig <hch@infradead.org>
>
> ---
> drivers/net/xen-netfront.c | 37 ++++++++++++++++++-------------------
> 1 file changed, 18 insertions(+), 19 deletions(-)
ACK but does not apply to jgarzik/netdev-2.6.git#upstream nor
davem/net-2.6.24.git
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xen-netfront: rearrange netfront_info structure to separate tx and rx
2007-10-10 0:46 ` Jeff Garzik
@ 2007-10-10 1:03 ` Jeremy Fitzhardinge
2007-10-10 1:08 ` Jeremy Fitzhardinge
1 sibling, 0 replies; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2007-10-10 1:03 UTC (permalink / raw)
To: Jeff Garzik
Cc: NetDev, Linux Kernel Mailing List, Keir Fraser, Stephen Hemminger,
Christoph Hellwig
Jeff Garzik wrote:
> Jeremy Fitzhardinge wrote:
>> Keep tx and rx elements separate on different cachelines to prevent
>> bouncing.
>>
>> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
>> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
>> Cc: Christoph Hellwig <hch@infradead.org>
>>
>> ---
>> drivers/net/xen-netfront.c | 37 ++++++++++++++++++-------------------
>> 1 file changed, 18 insertions(+), 19 deletions(-)
>
> ACK but does not apply to jgarzik/netdev-2.6.git#upstream nor
> davem/net-2.6.24.git
Oh, OK, I'll have a look. I wasn't aware of any other changes in
xen-netfront. Or rather, there are a couple of other changes which I
think you already have: one to use the common netdev stats structure,
and another to remove a chunk of dead code.
J
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xen-netfront: rearrange netfront_info structure to separate tx and rx
2007-10-10 0:46 ` Jeff Garzik
2007-10-10 1:03 ` Jeremy Fitzhardinge
@ 2007-10-10 1:08 ` Jeremy Fitzhardinge
1 sibling, 0 replies; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2007-10-10 1:08 UTC (permalink / raw)
To: Jeff Garzik
Cc: NetDev, Linux Kernel Mailing List, Keir Fraser, Stephen Hemminger,
Christoph Hellwig
Jeff Garzik wrote:
> ACK but does not apply to jgarzik/netdev-2.6.git#upstream nor
> davem/net-2.6.24.git
OK, looks like you don't have the other two patches. Will post in a sec.
J
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-10 1:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-09 18:44 [PATCH] xen-netfront: rearrange netfront_info structure to separate tx and rx Jeremy Fitzhardinge
2007-10-10 0:46 ` Jeff Garzik
2007-10-10 1:03 ` Jeremy Fitzhardinge
2007-10-10 1:08 ` Jeremy Fitzhardinge
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).