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-changelog

[Xen-changelog] [xen-unstable] minios : netfront driver fixes.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios : netfront driver fixes.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 27 Jan 2007 13:00:18 -0800
Delivery-date: Sat, 27 Jan 2007 13:01:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Date 1169819460 0
# Node ID baf1d6ebf29cc15fdebc89c8769c0963c05524bc
# Parent  5d440c35a7843539848e573a64cb3968ce302185
minios : netfront driver fixes.

- Handle returned backend==NULL || mac==NULL, this leads sometimes to a crash.
- Remove unnecessary (and bogus) initialisation of np->rx.req_prod_pvt

Signed-off-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 extras/mini-os/netfront.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff -r 5d440c35a784 -r baf1d6ebf29c extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Fri Jan 26 13:46:29 2007 +0000
+++ b/extras/mini-os/netfront.c Fri Jan 26 13:51:00 2007 +0000
@@ -324,6 +324,14 @@ done:
     msg = xenbus_read(XBT_NIL, "device/vif/0/backend", &backend);
     msg = xenbus_read(XBT_NIL, "device/vif/0/mac", &mac);
 
+    if ((backend == NULL) || (mac == NULL)) {
+        struct evtchn_close op = { info->local_port };
+        printk("%s: backend/mac failed\n", __func__);
+        unbind_evtchn(info->local_port);
+        HYPERVISOR_event_channel_op(EVTCHNOP_close, &op);
+        return;
+    }
+
     printk("backend at %s\n",backend);
     printk("mac is %s\n",mac);
 
@@ -383,10 +391,7 @@ void init_rx_buffers(void)
     netif_rx_request_t *req;
     int notify;
 
-    np->rx.req_prod_pvt = requeue_idx;
-
-
-    /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
+    /* Rebuild the RX buffer freelist and the RX ring itself. */
     for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) 
     {
         struct net_buffer* buf = &rx_buffers[requeue_idx];
@@ -402,16 +407,12 @@ void init_rx_buffers(void)
 
     np->rx.req_prod_pvt = requeue_idx;
 
-
-
     RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&np->rx, notify);
 
-    if(notify) 
+    if (notify) 
         notify_remote_via_evtchn(np->evtchn);
 
     np->rx.sring->rsp_event = np->rx.rsp_cons + 1;
-
-
 }
 
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] minios : netfront driver fixes., Xen patchbot-unstable <=