WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [RFC PATCH 34/35] Add the Xen virtual network device dri

To: Chris Wright <chrisw@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [RFC PATCH 34/35] Add the Xen virtual network device driver.
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Tue, 9 May 2006 11:56:33 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxx, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Delivery-date: Tue, 09 May 2006 11:56:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060509085201.446830000@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: OSDL
References: <20060509084945.373541000@xxxxxxxxxxxx> <20060509085201.446830000@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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?


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>