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 13:25:56 -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 13:26:24 -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
> +static int setup_device(struct xenbus_device *dev, struct
> netfront_info *info) +{
> +     struct netif_tx_sring *txs;
> +     struct netif_rx_sring *rxs;
> +     int err;
> +     struct net_device *netdev = info->netdev;
> +
> +     info->tx_ring_ref = GRANT_INVALID_REF;
> +     info->rx_ring_ref = GRANT_INVALID_REF;
> +     info->rx.sring = NULL;
> +     info->tx.sring = NULL;
> +     info->irq = 0;
> +
> +     txs = (struct netif_tx_sring *)get_zeroed_page(GFP_KERNEL);
> +     if (!txs) {
> +             err = -ENOMEM;
> +             xenbus_dev_fatal(dev, err, "allocating tx ring
> page");
> +             goto fail;
> +     }
> +     rxs = (struct netif_rx_sring *)get_zeroed_page(GFP_KERNEL);
> +     if (!rxs) {
> +             err = -ENOMEM;
> +             xenbus_dev_fatal(dev, err, "allocating rx ring
> page");
> +             free_page((unsigned long)txs);
> +             goto fail;
> +     }
> +     info->backend_state = BEST_DISCONNECTED;
> +
> +     SHARED_RING_INIT(txs);
> +     FRONT_RING_INIT(&info->tx, txs, PAGE_SIZE);
> +
> +     SHARED_RING_INIT(rxs);
> +     FRONT_RING_INIT(&info->rx, rxs, PAGE_SIZE);
> +
> +     err = xenbus_grant_ring(dev, virt_to_mfn(txs));
> +     if (err < 0)
> +             goto fail;
> +     info->tx_ring_ref = err;
> +
> +     err = xenbus_grant_ring(dev, virt_to_mfn(rxs));
> +     if (err < 0)
> +             goto fail;
> +     info->rx_ring_ref = err;
> +
> +     err = xenbus_alloc_evtchn(dev, &info->evtchn);
> +     if (err)
> +             goto fail;
> +
> +     memcpy(netdev->dev_addr, info->mac, ETH_ALEN);
> +     network_connect(netdev);
> +     info->irq = bind_evtchn_to_irqhandler(
> +             info->evtchn, netif_int, SA_SAMPLE_RANDOM,
> netdev->name,
> 

This doesn't look like a real random entropy source. packets
arriving from another domain are easily timed.

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

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