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] Don't use the grant pre-allocation system for the ring g

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Don't use the grant pre-allocation system for the ring grants.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Aug 2005 10:32:12 +0000
Delivery-date: Wed, 24 Aug 2005 09:30:33 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID ccfc31779d36e7d3628ebb2e3fdce1d611419ff9
# Parent  ac57c81692b24685345603ea5892d89451b6ef31
Don't use the grant pre-allocation system for the ring grants.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r ac57c81692b2 -r ccfc31779d36 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed Aug 24 
08:55:14 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed Aug 24 
09:31:52 2005
@@ -200,6 +200,7 @@
     [BEST_CONNECTED]    = "connected",
 };
 
+#define DEBUG
 #ifdef DEBUG
 #define DPRINTK(fmt, args...) \
     printk(KERN_ALERT "xen_net (%s:%d) " fmt, __FUNCTION__, __LINE__, ##args)
@@ -919,6 +920,7 @@
 /* Send a connect message to xend to tell it to bring up the interface. */
 static void send_interface_connect(struct net_private *np)
 {
+    int err;
     ctrl_msg_t cmsg = {
         .type    = CMSG_NETIF_FE,
         .subtype = CMSG_NETIF_FE_INTERFACE_CONNECT,
@@ -929,24 +931,22 @@
     msg->handle = np->handle;
     msg->tx_shmem_frame = virt_to_mfn(np->tx);
 #ifdef CONFIG_XEN_NETDEV_GRANT_TX
-    msg->tx_shmem_ref   = (u32)gnttab_claim_grant_reference(&gref_tx_head);
-    if(msg->tx_shmem_ref < 0) { 
-        printk(KERN_ALERT "#### netfront can't claim tx_shmem reference\n");
+    err = gnttab_grant_foreign_access(rdomid, msg->tx_shmem_frame, 0);
+    if (err < 0) {
+        printk(KERN_ALERT "#### netfront can't grant access to tx_shmem\n");
         BUG();
     }
-    gnttab_grant_foreign_access_ref (msg->tx_shmem_ref, rdomid, 
-                                     msg->tx_shmem_frame, 0);
+    msg->tx_shmem_ref = err;
 #endif
 
     msg->rx_shmem_frame = virt_to_mfn(np->rx);
 #ifdef CONFIG_XEN_NETDEV_GRANT_RX
-    msg->rx_shmem_ref   = (u32)gnttab_claim_grant_reference(&gref_rx_head);
-    if(msg->rx_shmem_ref < 0) {
-        printk(KERN_ALERT "#### netfront can't claim rx_shmem reference\n");
+    err = gnttab_grant_foreign_access(rdomid, msg->rx_shmem_frame, 0);
+    if (err < 0) {
+        printk(KERN_ALERT "#### netfront can't grant access to rx_shmem\n");
         BUG();
     }
-    gnttab_grant_foreign_access_ref (msg->rx_shmem_ref, rdomid, 
-                                     msg->rx_shmem_frame, 0);
+    msg->rx_shmem_ref = err;
 #endif
 
     ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
@@ -1416,8 +1416,8 @@
     if (xen_start_info.flags & SIF_INITDOMAIN)
         return 0;
 #ifdef CONFIG_XEN_NETDEV_GRANT_TX
-    /* A grant for every ring slot, plus one for the ring itself */
-    if (gnttab_alloc_grant_references(NETIF_TX_RING_SIZE + 1,
+    /* A grant for every ring slot */
+    if (gnttab_alloc_grant_references(NETIF_TX_RING_SIZE,
                                       &gref_tx_head) < 0) {
         printk(KERN_ALERT "#### netfront can't alloc tx grant refs\n");
         return 1;
@@ -1425,8 +1425,8 @@
     printk(KERN_ALERT "Netdev frontend (TX) is using grant tables.\n"); 
 #endif
 #ifdef CONFIG_XEN_NETDEV_GRANT_RX
-    /* A grant for every ring slot, plus one for the ring itself */
-    if (gnttab_alloc_grant_references(NETIF_RX_RING_SIZE + 1,
+    /* A grant for every ring slot */
+    if (gnttab_alloc_grant_references(NETIF_RX_RING_SIZE,
                                       &gref_rx_head) < 0) {
         printk(KERN_ALERT "#### netfront can't alloc rx grant refs\n");
         return 1;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Don't use the grant pre-allocation system for the ring grants., Xen patchbot -unstable <=