netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Chris Wright <chrisw@sous-sol.org>
Cc: xen-devel@lists.xensource.com,
	Ian Pratt <ian.pratt@xensource.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.osdl.org,
	Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Subject: Re: [RFC PATCH 34/35] Add the Xen virtual network device driver.
Date: Tue, 9 May 2006 11:56:33 -0700	[thread overview]
Message-ID: <20060509115633.36b4879e@localhost.localdomain> (raw)
In-Reply-To: <20060509085201.446830000@sous-sol.org>

The stuff in /proc could easily just be added attributes to the class_device kobject
of the net device (and then show up in sysfs).


> +
> +#define GRANT_INVALID_REF	0
> +
> +#define NET_TX_RING_SIZE __RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE)
> +#define NET_RX_RING_SIZE __RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE)
> +
> +static inline void init_skb_shinfo(struct sk_buff *skb)
> +{
> +	atomic_set(&(skb_shinfo(skb)->dataref), 1);
> +	skb_shinfo(skb)->nr_frags = 0;
> +	skb_shinfo(skb)->frag_list = NULL;
> +}
> +

Could you use existing sk_buff_head instead of inventing your
own skb queue?

> +struct netfront_info
> +{
> +	struct list_head list;
> +	struct net_device *netdev;
> +
> +	struct net_device_stats stats;
> +	unsigned int tx_full;
> +
> +	struct netif_tx_front_ring tx;
> +	struct netif_rx_front_ring rx;
> +
> +	spinlock_t   tx_lock;
> +	spinlock_t   rx_lock;
> +
> +	unsigned int handle;
> +	unsigned int evtchn, irq;
> +
> +	/* What is the status of our connection to the remote backend? */
> +#define BEST_CLOSED       0
> +#define BEST_DISCONNECTED 1
> +#define BEST_CONNECTED    2
> +	unsigned int backend_state;
> +
> +	/* Is this interface open or closed (down or up)? */
> +#define UST_CLOSED        0
> +#define UST_OPEN          1
> +	unsigned int user_state;
> +
> +	/* Receive-ring batched refills. */
> +#define RX_MIN_TARGET 8
> +#define RX_DFL_MIN_TARGET 64
> +#define RX_MAX_TARGET NET_RX_RING_SIZE
> +	int rx_min_target, rx_max_target, rx_target;
> +	struct sk_buff_head rx_batch;
> +
> +	struct timer_list rx_refill_timer;
> +
> +	/*
> +	 * {tx,rx}_skbs store outstanding skbuffs. The first entry in each
> +	 * array is an index into a chain of free entries.
> +	 */
> +	struct sk_buff *tx_skbs[NET_TX_RING_SIZE+1];
> +	struct sk_buff *rx_skbs[NET_RX_RING_SIZE+1];
> +
> +	grant_ref_t gref_tx_head;
> +	grant_ref_t grant_tx_ref[NET_TX_RING_SIZE + 1];
> +	grant_ref_t gref_rx_head;
> +	grant_ref_t grant_rx_ref[NET_TX_RING_SIZE + 1];
> +
> +	struct xenbus_device *xbdev;
> +	int tx_ring_ref;
> +	int rx_ring_ref;
> +	u8 mac[ETH_ALEN];

Isn't mac address already stored in dev->dev_addr and/or dev->perm_addr?

  parent reply	other threads:[~2006-05-09 18:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060509084945.373541000@sous-sol.org>
2006-05-09  7:00 ` [RFC PATCH 34/35] Add the Xen virtual network device driver Chris Wright
2006-05-09 11:55   ` [Xen-devel] " Herbert Xu
2006-05-09 12:43     ` Christian Limpach
2006-05-09 13:01       ` Herbert Xu
2006-05-09 13:14         ` Andi Kleen
2006-05-09 13:16         ` Christian Limpach
2006-05-09 13:26           ` Herbert Xu
2006-05-09 14:00             ` Christian Limpach
2006-05-09 14:30               ` [Xen-devel] " David Boutcher
2006-05-09 23:35                 ` Chris Wright
2006-05-09 11:58   ` Christoph Hellwig
2006-05-09 23:37     ` Chris Wright
2006-05-09 18:56   ` Stephen Hemminger [this message]
2006-05-09 23:39     ` Chris Wright
2006-05-09 20:25   ` Stephen Hemminger
2006-05-09 20:26     ` Keir Fraser
2006-05-09 20:46       ` Roland Dreier
2006-05-10 18:28         ` Andi Kleen
2006-05-11  0:33           ` Herbert Xu
2006-05-11  7:49             ` Keir Fraser
2006-05-11  8:04               ` Herbert Xu
2006-05-11  9:47               ` Andi Kleen
2006-05-11 16:18                 ` Stephen Hemminger
2006-05-11 16:48                 ` Rick Jones
2006-05-11 17:30                   ` Andi Kleen
2006-05-09 20:32     ` Chris Wright
2006-05-09 22:41   ` [Xen-devel] " Herbert Xu
2006-05-09 23:51     ` Chris Wright
2006-05-10  6:36       ` Keir Fraser

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=20060509115633.36b4879e@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=chrisw@sous-sol.org \
    --cc=ian.pratt@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=xen-devel@lists.xensource.com \
    /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 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).