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 13:25:56 -0700	[thread overview]
Message-ID: <20060509132556.76deaa91@localhost.localdomain> (raw)
In-Reply-To: <20060509085201.446830000@sous-sol.org>

> +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.

  parent reply	other threads:[~2006-05-09 20:25 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
2006-05-09 23:39     ` Chris Wright
2006-05-09 20:25   ` Stephen Hemminger [this message]
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=20060509132556.76deaa91@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).