All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Christoph Hellwig <hch@infradead.org>,
	Jeremy Fitzhardinge <jeremy@goop.org>, Andi Kleen <ak@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	virtualization@lists.osdl.org,
	lkml <linux-kernel@vger.kernel.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Ian Pratt <ian.pratt@xensource.com>,
	Christian Limpach <Christian.Limpach@cl.cam.ac.uk>,
	netdev@vger.kernel.org, Jeff Garzik <jeff@garzik.org>,
	Stephen Hemminger <shemminge@linux-foundation.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Subject: Re: [patch 27/32] xen: Add the Xen virtual network device driver.
Date: Mon, 30 Apr 2007 11:11:25 -0700	[thread overview]
Message-ID: <4636314D.7070006@goop.org> (raw)
In-Reply-To: <20070429175942.GA3551@infradead.org>

Christoph Hellwig wrote:
> On Sun, Apr 29, 2007 at 10:29:02AM -0700, Jeremy Fitzhardinge wrote:
>   
>> +#include <linux/version.h>
>>     
>
> not needed.
>   

Yup.

>> +#include <xen/xenbus.h>
>> +#include <xen/interface/io/netif.h>
>> +#include <xen/interface/memory.h>
>> +#ifdef CONFIG_XEN_BALLOON
>> +#include <xen/balloon.h>
>> +#endif
>> +#include <xen/interface/grant_table.h>
>>     
>
> Please don't try to put such a fucked up include hierachy in.
> Just move everything under include/xen or you will soon get
> problems with the 80 line length limit for your includes..
>   

I'm trying to draw the distinction between kernel-internal Xen-related
headers, and the Xen hypervisor ABI itself.  The stuff under
xen/interface is more or less copied in from the main Xen tree, so it
would be nice to keep it distinct.

> Also please make sure that <xen/balloon.h> can be included unconditionally,
> as we really don't like ifdefs around includes.
>   

The balloon driver isn't in this patch set, so I'll drop all references
to it.

>> +	grant_ref_t gref_tx_head;
>>     
>
> What's a grant_ref_t?  Should this really be a typedef or better
> a struct type?

Structurally it's just a u32.  I could wrap it up in a structure for
typedef reasons, I suppose.

>   Also it really wants a xen_ prefix instead of someting
> so generic.
>   

OK.

>> + * Implement our own carrier flag: the network stack's version causes delays
>> + * when the carrier is re-enabled (in particular, dev_activate() may not
>> + * immediately be called, which can cause packet loss).
>> + */
>>     
>
> Did you talk to the networking folks about these problems?
>   

Not sure what the deliberations were leading to those changes.

Herbert, Keir?


>> +#define netfront_carrier_on(netif)	((netif)->carrier = 1)
>> +#define netfront_carrier_off(netif)	((netif)->carrier = 0)
>> +#define netfront_carrier_ok(netif)	((netif)->carrier)
>>     
>
> Please use proper symbolic names for the ctal states and kill these
> wrappers.
>   

OK.

>
> Any chance you could avoid these forward-prototypes by reordering
> the functions a little?
>   

I'll give it a go.

> Also a lot of these names are horribly generic.  A proper xennet_
> prefix would probably help.
>   

Yes.

>> +static int __devexit netfront_remove(struct xenbus_device *dev)
>> +{
>> +	struct netfront_info *info = dev->dev.driver_data;
>> +
>> +	dev_dbg(&dev->dev, "%s\n", dev->nodename);
>> +
>> +	netif_disconnect_backend(info);
>> +
>> +	del_timer_sync(&info->rx_refill_timer);
>> +
>> +	xennet_sysfs_delif(info->netdev);
>> +
>> +	unregister_netdev(info->netdev);
>> +
>> +	free_netdev(info->netdev);
>>     
>
> This looks like very wrong ordering to me.  unregister_netdev should
> be the first thing in the remove function.
>   

I know this ordering was the result of a relatively recent bugfix
replacing something that was completely broken.

>> +	SHARED_RING_INIT(rxs);
>> +	FRONT_RING_INIT(&info->rx, rxs, PAGE_SIZE);
>>     
>
> Can you replace these shouting macros with proper named functions?
>   

Will do.

>> +	 * receive ring. This creates a less bursty demand on the memory
>> +	 * allocator, so should reduce the chance of failed allocation requests
>> +	 * both for ourself and for other kernel subsystems.
>> +	 */
>> +	batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
>> +	for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
>> +		/*
>> +		 * Allocate an skb and a page. Do not use __dev_alloc_skb as
>> +		 * that will allocate page-sized buffers which is not
>> +		 * necessary here.
>> +		 * 16 bytes added as necessary headroom for netif_receive_skb.
>> +		 */
>> +		skb = alloc_skb(RX_COPY_THRESHOLD + 16 + NET_IP_ALIGN,
>> +				GFP_ATOMIC | __GFP_NOWARN);
>>     
>
> This comment doesn't make any sense, __dev_alloc_skb is:
>   

Yes, it has probably dated.  I'll give it another look.

>> +		skb->nh.raw = (void *)skb_shinfo(skb)->frags[0].page;
>> +		skb->h.raw = skb->nh.raw + rx->offset;
>>     
>
> Stuff like this won't compile anymore in the current tree.
>   

Fixed later in the series.

Thanks,
    J

  reply	other threads:[~2007-04-30 18:11 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-29 17:28 [patch 00/32] xen: Xen implementation for paravirt_ops Jeremy Fitzhardinge
2007-04-29 17:28 ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 01/32] xen: Add apply_to_page_range() which applies a function to a pte range Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 02/32] xen: Allocate and free vmalloc areas Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 03/32] xen: Add nosegneg capability to the vsyscall page notes Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 19:08   ` Roland McGrath
2007-04-30  4:54     ` Jeremy Fitzhardinge
2007-04-30  4:54       ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 04/32] xen: Add Xen interface header files Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 05/32] xen: Core Xen implementation Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 06/32] xen: Xen virtual mmu Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 07/32] xen: xen event channels Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 08/32] xen: xen time implementation Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 09/32] xen: xen configuration Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-30 22:36   ` Zachary Amsden
2007-05-01  3:37     ` Andi Kleen
2007-04-29 17:28 ` [patch 10/32] xen: Complete pagetable pinning for Xen Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 11/32] xen: ignore RW mapping of RO pages in pagetable_init Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 12/32] xen: fix multicall batching Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 13/32] xen: Account for time stolen by Xen Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 14/32] xen: Implement xen_sched_clock Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 15/32] xen: Xen SMP guest support Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 16/32] xen: Add support for preemption Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 17/32] xen: lazy-mmu operations Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 18/32] xen: deal with negative stolen time Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 19/32] xen: xen time fixups Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 20/32] xen: Use the hvc console infrastructure for Xen console Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 21/32] xen: Add early printk support via hvc console Jeremy Fitzhardinge
2007-04-29 17:28   ` Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 22/32] xen: Add Xen grant table support Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 23/32] xen: Add the Xenbus sysfs and virtual device hotplug driver Jeremy Fitzhardinge
2007-04-29 17:28 ` [patch 24/32] xen: use xenbus_watch_pathfmt rather than watch_path2 Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 25/32] xen: rename dev_changed to xenbus_dev_changed Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 26/32] xen: Add Xen virtual block device driver Jeremy Fitzhardinge
2007-04-29 18:16   ` Christoph Hellwig
2007-04-30 18:52     ` Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 27/32] xen: Add the Xen virtual network " Jeremy Fitzhardinge
2007-04-29 17:59   ` Christoph Hellwig
2007-04-30 18:11     ` Jeremy Fitzhardinge [this message]
2007-04-29 17:29 ` [patch 28/32] xen: xen-netfront: use skb.cb for storing private data Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 29/32] xen: Lockdep fixes for xen-netfront Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 30/32] xen: diddle netfront Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 31/32] xen: --- drivers/net/xen-netfront.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Jeremy Fitzhardinge
2007-05-02  6:33   ` Herbert Xu
2007-05-02  6:33     ` Herbert Xu
2007-05-02  6:45     ` Chris Wright
2007-05-02  6:48       ` Jeremy Fitzhardinge
2007-04-29 17:29 ` [patch 32/32] xen: Xen machine operations Jeremy Fitzhardinge

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=4636314D.7070006@goop.org \
    --to=jeremy@goop.org \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=hch@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=ian.pratt@xensource.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminge@linux-foundation.org \
    --cc=virtualization@lists.osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.