[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] vnet-module



patch_vnet_1
  Replacing the socketcall with direct calling the needed
  functions (my patch from 28.3)

patch_vnet_2
  Modify the module-parameter for kernel 2.6.* (the old one
  will not compile with the actual kernel 2.6.16)
  Exporting the default-values of the parameters in /sys/module

patch_vnet_3
  Some "extentions" to error-messages to identify the position
  in the code.
  I had searched a bug, but it was a wrong vnet-id ;-/
  A hint for docu: using "123459" as vnet-id has not 4 digits
  and will be punished with errors  ;-)


--
wbr
Robert Valentan

diff -r 2604abf98ede tools/vnet/vnet-module/varp_socket.c
--- a/tools/vnet/vnet-module/varp_socket.c      Tue Mar 28 09:09:44 2006
+++ b/tools/vnet/vnet-module/varp_socket.c      Tue Mar 28 17:10:53 2006
@@ -16,6 +16,9 @@
  * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
  *
  */
+
+static int errno;
+
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/version.h>
@@ -36,7 +39,6 @@
 
 /* Get macros needed to define system calls as functions in the kernel. */
 #define __KERNEL_SYSCALLS__
-static int errno;
 #include <linux/unistd.h>
 
 #define MODULE_NAME "VARP"
@@ -75,110 +77,254 @@
  * The parts we need anyway.
  */
 
-/* Define the socketcall() syscall.
- * Multiplexes all the socket-related calls.
- *
- * @param call socket call id
- * @param args arguments (upto 6)
- * @return call-dependent value
- */
-static inline _syscall2(int, socketcall,
-                        int, call,
-                        unsigned long *, args)
+/* the following code is copied from linux-kernel/net/socket.c
+ * As replacement of the __NR_socketcall, which exists not in x86_64 and
+ * same other systems.
+ * An alternate will be an export of the copied-functions in net/socket.c
+ */ 
+#define MAX_SOCK_ADDR 128
 
 int socket(int family, int type, int protocol){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)family;
-    args[1] = (unsigned long)type;
-    args[2] = (unsigned long)protocol;
-    return socketcall(SYS_SOCKET, args);
+
+       int retval;
+       struct socket *sock;
+       retval = sock_create(family, type, protocol, &sock);
+       if (retval < 0)
+               goto out;
+
+       retval = sock_map_fd(sock);
+       if (retval < 0)
+               goto out_release;
+
+out:
+       /* It may be already another descriptor 8) Not kernel problem. */
+       return retval;
+
+out_release:
+       sock_release(sock);
+       return retval;
 }
 
 int bind(int fd, struct sockaddr *umyaddr, int addrlen){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)umyaddr;
-    args[2] = (unsigned long)addrlen;
-    return socketcall(SYS_BIND, args);
+
+       struct socket *sock;
+       char address[MAX_SOCK_ADDR];
+       int err;
+
+       if((sock = sockfd_lookup(fd,&err))!=NULL)
+       {
+               if((err=move_addr_to_kernel(umyaddr,addrlen,address))>=0) {
+                       err = security_socket_bind(sock, (struct sockaddr 
*)address, addrlen);
+                       if (err) {
+                               sockfd_put(sock);
+                               return err;
+                       }
+                       err = sock->ops->bind(sock, (struct sockaddr *)address, 
addrlen);
+               }
+               sockfd_put(sock);
+       }                       
+       return err;
 }
 
 int connect(int fd, struct sockaddr *uservaddr, int addrlen){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)uservaddr;
-    args[2] = (unsigned long)addrlen;
-    return socketcall(SYS_CONNECT, args);
+
+       struct socket *sock;
+       char address[MAX_SOCK_ADDR];
+       int err;
+
+       sock = sockfd_lookup(fd, &err);
+       if (!sock)
+               goto out;
+       err = move_addr_to_kernel(uservaddr, addrlen, address);
+       if (err < 0)
+               goto out_put;
+
+       err = security_socket_connect(sock, (struct sockaddr *)address, 
addrlen);
+       if (err)
+               goto out_put;
+
+       err = sock->ops->connect(sock, (struct sockaddr *) address, addrlen,
+                                sock->file->f_flags);
+out_put:
+       sockfd_put(sock);
+out:
+       return err;
 }
 
 int sendto(int fd, void * buff, size_t len,
            unsigned flags, struct sockaddr *addr,
            int addr_len){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)buff;
-    args[2] = (unsigned long)len;
-    args[3] = (unsigned long)flags;
-    args[4] = (unsigned long)addr;
-    args[5] = (unsigned long)addr_len;
-    return socketcall(SYS_SENDTO, args);
+
+       struct socket *sock;
+       char address[MAX_SOCK_ADDR];
+       int err;
+       struct msghdr msg;
+       struct iovec iov;
+       
+       sock = sockfd_lookup(fd, &err);
+       if (!sock)
+               goto out;
+       iov.iov_base=buff;
+       iov.iov_len=len;
+       msg.msg_name=NULL;
+       msg.msg_iov=&iov;
+       msg.msg_iovlen=1;
+       msg.msg_control=NULL;
+       msg.msg_controllen=0;
+       msg.msg_namelen=0;
+       if(addr)
+       {
+               err = move_addr_to_kernel(addr, addr_len, address);
+               if (err < 0)
+                       goto out_put;
+               msg.msg_name=address;
+               msg.msg_namelen=addr_len;
+       }
+       if (sock->file->f_flags & O_NONBLOCK)
+               flags |= MSG_DONTWAIT;
+       msg.msg_flags = flags;
+       err = sock_sendmsg(sock, &msg, len);
+
+out_put:               
+       sockfd_put(sock);
+out:
+       return err;
 }
 
 int recvfrom(int fd, void * ubuf, size_t size,
              unsigned flags, struct sockaddr *addr,
              int *addr_len){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)ubuf;
-    args[2] = (unsigned long)size;
-    args[3] = (unsigned long)flags;
-    args[4] = (unsigned long)addr;
-    args[5] = (unsigned long)addr_len;
-    return socketcall(SYS_RECVFROM, args);
+
+       struct socket *sock;
+       struct iovec iov;
+       struct msghdr msg;
+       char address[MAX_SOCK_ADDR];
+       int err,err2;
+
+       sock = sockfd_lookup(fd, &err);
+       if (!sock)
+               goto out;
+
+       msg.msg_control=NULL;
+       msg.msg_controllen=0;
+       msg.msg_iovlen=1;
+       msg.msg_iov=&iov;
+       iov.iov_len=size;
+       iov.iov_base=ubuf;
+       msg.msg_name=address;
+       msg.msg_namelen=MAX_SOCK_ADDR;
+       if (sock->file->f_flags & O_NONBLOCK)
+               flags |= MSG_DONTWAIT;
+       err=sock_recvmsg(sock, &msg, size, flags);
+
+       if(err >= 0 && addr != NULL)
+       {
+               err2=move_addr_to_user(address, msg.msg_namelen, addr, 
addr_len);
+               if(err2<0)
+                       err=err2;
+       }
+       sockfd_put(sock);                       
+out:
+       return err;
 }
 
 int setsockopt(int fd, int level, int optname, void *optval, int optlen){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)level;
-    args[2] = (unsigned long)optname;
-    args[3] = (unsigned long)optval;
-    args[4] = (unsigned long)optlen;
-    return socketcall(SYS_SETSOCKOPT, args);
-}
-
+
+       int err;
+       struct socket *sock;
+
+       if (optlen < 0)
+               return -EINVAL;
+                       
+       if ((sock = sockfd_lookup(fd, &err))!=NULL)
+       {
+               err = security_socket_setsockopt(sock,level,optname);
+               if (err) {
+                       sockfd_put(sock);
+                       return err;
+               }
+
+               if (level == SOL_SOCKET)
+                       err=sock_setsockopt(sock,level,optname,optval,optlen);
+               else
+                       err=sock->ops->setsockopt(sock, level, optname, optval, 
optlen);
+               sockfd_put(sock);
+       }
+       return err;
+}
+
+/*  not possible, because sock_getsockopt is not exported ...
 int getsockopt(int fd, int level, int optname, void *optval, int *optlen){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)level;
-    args[2] = (unsigned long)optname;
-    args[3] = (unsigned long)optval;
-    args[4] = (unsigned long)optlen;
-    return socketcall(SYS_GETSOCKOPT, args);
-}
+
+       int err;
+       struct socket *sock;
+
+       if ((sock = sockfd_lookup(fd, &err))!=NULL)
+       {
+               err = security_socket_getsockopt(sock, level, optname);
+               if (err) {
+                       sockfd_put(sock);
+                       return err;
+               }
+
+               if (level == SOL_SOCKET)
+                       err=sock_getsockopt(sock,level,optname,optval,optlen);
+               else
+                       err=sock->ops->getsockopt(sock, level, optname, optval, 
optlen);
+               sockfd_put(sock);
+       }
+       return err;
+}
+*/
 
 int shutdown(int fd, int how){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)how;
-    return socketcall(SYS_SHUTDOWN, args);
+
+       int err;
+       struct socket *sock;
+
+       if ((sock = sockfd_lookup(fd, &err))!=NULL)
+       {
+               err = security_socket_shutdown(sock, how);
+               if (err) {
+                       sockfd_put(sock);
+                       return err;
+               }
+                               
+               err=sock->ops->shutdown(sock, how);
+               sockfd_put(sock);
+       }
+       return err;
 }
 
 int getsockname(int fd, struct sockaddr *usockaddr, int *usockaddr_len){
-    unsigned long args[6];
-    
-    args[0] = (unsigned long)fd;
-    args[1] = (unsigned long)usockaddr;
-    args[2] = (unsigned long)usockaddr_len;
-    return socketcall(SYS_GETSOCKNAME, args);
-}
+
+       struct socket *sock;
+       char address[MAX_SOCK_ADDR];
+       int len, err;
+       
+       sock = sockfd_lookup(fd, &err);
+       if (!sock)
+               goto out;
+
+       err = security_socket_getsockname(sock);
+       if (err)
+               goto out_put;
+
+       err = sock->ops->getname(sock, (struct sockaddr *)address, &len, 0);
+       if (err)
+               goto out_put;
+       err = move_addr_to_user(address, len, usockaddr, usockaddr_len);
+
+out_put:
+       sockfd_put(sock);
+out:
+       return err;
+}
+
+/**
+ * End of copy from net/socket.c
+ */
+
 
 
/*============================================================================*/
 /** Socket flags. */
@@ -577,7 +723,7 @@
     int err = 0;
     mm_segment_t oldfs;
 
-    dprintf("> mcaddr=%u.%u.%u.%u port=%u\n", NIPQUAD(mcaddr), ntohs(port));
+    iprintf("> mcaddr=%u.%u.%u.%u port=%u\n", NIPQUAD(mcaddr), ntohs(port));
     oldfs = change_fs(KERNEL_DS);
     err = varp_mcast_open(mcaddr, port, &varp_mcast_sock);
     if(err < 0 ) goto exit;
diff -r 89b98811ce56 tools/vnet/vnet-module/if_varp.h
--- a/tools/vnet/vnet-module/if_varp.h  Fri Mar 31 13:29:05 2006
+++ b/tools/vnet/vnet-module/if_varp.h  Fri Mar 31 15:39:27 2006
@@ -97,7 +97,7 @@
 
 
 /** Default address for varp/vnet broadcasts: 224.10.0.1 */
-#define VARP_MCAST_ADDR     0xe00a0001
+#define VARP_MCAST_ADDR     "224.10.0.1"
 
 /** UDP port to use for varp protocol. */
 #define VARP_PORT           1798
diff -r 89b98811ce56 tools/vnet/vnet-module/tunnel.h
--- a/tools/vnet/vnet-module/tunnel.h   Fri Mar 31 13:29:05 2006
+++ b/tools/vnet/vnet-module/tunnel.h   Fri Mar 31 15:39:27 2006
@@ -74,7 +74,7 @@
  *
  * @param tunnel tunnel (may be null)
  */
-static inline void Tunnel_decref(struct Tunnel *tunnel){
+static void Tunnel_decref(struct Tunnel *tunnel){
     if(!tunnel) return;
     if(atomic_dec_and_test(&tunnel->refcount)){
         tunnel->type->close(tunnel);
diff -r 89b98811ce56 tools/vnet/vnet-module/varp.c
--- a/tools/vnet/vnet-module/varp.c     Fri Mar 31 13:29:05 2006
+++ b/tools/vnet/vnet-module/varp.c     Fri Mar 31 15:39:27 2006
@@ -200,7 +200,8 @@
 /** UDP port (network order). */
 u16 varp_port = 0;
 
-char *varp_device = "xen-br0";
+#define VARP_DEVICE_DEFAULT "xen-br0"
+char *varp_device = NULL;
 
 #define VarpTable_read_lock(vtable, flags)    \
   do{ read_lock_irqsave(&(vtable)->lock, (flags)); } while(0)
@@ -262,8 +263,9 @@
 int varp_ucast_addr(uint32_t *addr)
 {
     int err = -ENODEV;
-    const char *devices[] = { varp_device, "eth0", "eth1", "eth2", NULL };
+    char *devices[] = { varp_device, "eth0", "eth1", "eth2", NULL };
     const char **p;
+
     for(p = devices; err && *p; p++){
         err = device_ucast_addr(*p, addr);
     }
@@ -1485,12 +1487,14 @@
 static void varp_init_mcast_addr(char *s){
     unsigned long v = 0;
 
-    dprintf("> %s\n", s);
+    dprintf("> mcast_addr init=%s\n", s);
     if(s && (get_inet_addr(s, &v) >= 0)){
-        varp_mcast_addr = (u32)v;
+        varp_mcaddr = s;
     } else {
-        varp_mcast_addr = htonl(VARP_MCAST_ADDR);
-    }
+        varp_mcaddr = VARP_MCAST_ADDR;
+        get_inet_addr(varp_mcaddr, &v);
+    }
+    varp_mcast_addr = (u32)v;
 }
 
 /** Initialize the varp cache.
@@ -1510,9 +1514,12 @@
     varp_init_mcast_addr(varp_mcaddr);
     varp_port = htons(VARP_PORT);
 
+    if (varp_device == NULL)
+       varp_device = VARP_DEVICE_DEFAULT;
+
     err = varp_open(varp_mcast_addr, varp_port);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_init err=%d\n", err);
     return err;
 }
 
@@ -1529,8 +1536,10 @@
     dprintf("<\n");
 }
 
-MODULE_PARM(varp_mcaddr, "s");
+#ifdef __KERNEL__
+module_param_named(mcaddr, varp_mcaddr, charp, 0444);
 MODULE_PARM_DESC(varp_mcaddr, "VARP multicast address");
 
-MODULE_PARM(varp_device, "s");
+module_param_named(device, varp_device, charp, 0444);
 MODULE_PARM_DESC(varp_device, "VARP network device");
+#endif
diff -r 89b98811ce56 tools/vnet/vnet-module/vnet.c
--- a/tools/vnet/vnet-module/vnet.c     Fri Mar 31 13:29:05 2006
+++ b/tools/vnet/vnet-module/vnet.c     Fri Mar 31 15:39:27 2006
@@ -657,6 +657,9 @@
 
     if(vnet_encaps && !strcmp(vnet_encaps, "udp")){
         etherip_in_udp = 1;
+        vnet_encaps = "etherip";
+    } else {
+        vnet_encaps = "udp";
     }
     dprintf(">\n");
     err = random_module_init();
@@ -691,7 +694,7 @@
 module_exit(vnet_module_exit);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(vnet_encaps, "s");
+module_param_named(encaps, vnet_encaps, charp, 0444);
 MODULE_PARM_DESC(vnet_encaps, "Vnet encapsulation: etherip or udp.");
 
 #endif
diff -r 18eecf71f690 tools/vnet/vnet-module/esp.c
--- a/tools/vnet/vnet-module/esp.c      Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/esp.c      Fri Mar 31 15:42:56 2006
@@ -281,7 +281,7 @@
     }
     skb_trim_tail(skb, icv_n);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_check_icv err=%d\n", err);
     return err;
 }
 
@@ -384,7 +384,7 @@
     }
     err = Tunnel_send(tunnel, skb);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_sa_send err=%d\n", err);
     return err;
 }
 
@@ -487,7 +487,7 @@
         }
         err = 1;
     }
-    dprintf("< skb=%p err=%d\n", skb, err);
+    dprintf("< esp_sa_recv skb=%p err=%d\n", skb, err);
     return err;
 }
 
@@ -627,7 +627,7 @@
     crypto_cipher_setkey(esp->cipher.tfm, esp->cipher.key, esp->cipher.key_n);
     err = 0;
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_cipher_int err=%d\n", err);
     return err;
 }
 
@@ -674,7 +674,7 @@
         goto exit;
     }
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_digest_init err=%d\n", err);
     return err;
 }
 
@@ -704,7 +704,7 @@
     if(err){
         if(esp) esp_fini(esp);
     }
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_sa_init err=%d\n", err);
     return err;
 }
 
@@ -793,7 +793,7 @@
         kfree_skb(skb);
         err = 0;
     }
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_protocol_recv err=%d\n", err);
     return err;
 }
 
@@ -884,7 +884,7 @@
     }
     esp_protocol_add();
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< esp_module_init err=%d\n", err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/etherip.c
--- a/tools/vnet/vnet-module/etherip.c  Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/etherip.c  Fri Mar 31 15:42:56 2006
@@ -198,7 +198,7 @@
     skb = NULL;
   exit:
     if(err && skb){
-        wprintf("< err=%d\n", err);
+        wprintf("< etherip_tunnel_send err=%d\n", err);
         kfree_skb(skb);
     }
     return err;
@@ -347,7 +347,7 @@
     err = vnet_skb_recv(skb, vinfo);
   exit:
     if(vinfo) Vnet_decref(vinfo);
-    dprintf("< skb=%p err=%d\n", skb, err);
+    dprintf("< etherip_protocol_recv skb=%p err=%d\n", skb, err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/sa.c
--- a/tools/vnet/vnet-module/sa.c       Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/sa.c       Fri Mar 31 15:42:56 2006
@@ -365,7 +365,7 @@
     if(err && entries){
         sa_table_delete(state);
     }
-    dprintf("< err=%d\n", err);
+    dprintf("< sa_table_add err=%d\n", err);
     return err;
 }
 
@@ -441,7 +441,7 @@
     if(err) goto exit;
     sa_table_delete(existing);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< sa_table_replace err=%d\n", err);
     return err;
 }
 
@@ -524,7 +524,7 @@
         state = NULL;
     }
     *statep = state;
-    dprintf("< err=%d\n", err);
+    dprintf("< SAState_create err=%d\n", err);
     return err;
 }
 
@@ -587,7 +587,7 @@
     }
 
     err = sa_set(&info, 0, sa);
-    dprintf("< err=%d\n", err);
+    dprintf("< sa_create err=%d\n", err);
     return err;
 }
 
@@ -625,7 +625,7 @@
     } else {
         SAState_decref(state);
     }
-    dprintf("< err=%d\n", err);
+    dprintf("< sa_set err=%d\n", err);
     return err;
 }
 
@@ -691,7 +691,7 @@
 static int sa_tunnel_open(Tunnel *tunnel){
     int err = 0;
     //dprintf(">\n");
-    //dprintf("< err=%d\n", err);
+    //dprintf("< sa_tunnel_open err=%d\n", err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/skb_context.c
--- a/tools/vnet/vnet-module/skb_context.c      Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/skb_context.c      Fri Mar 31 15:42:56 2006
@@ -73,7 +73,7 @@
     context->next = *val;
     *val = context;
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< SkbContext_push err=%d\n", err);
     return err;
 }
 
@@ -85,7 +85,7 @@
 
     //err = SkbContext_push(&ctxt, vnet, addr, protocol, data, free_fn); 
//todo fixme
     //SKB_CONTEXT(skb) = ctxt;//todo fixme
-    dprintf("< err=%d\n", err);
+    dprintf("< skb_push_context err=%d\n", err);
     return err;
 }
                                        
diff -r 18eecf71f690 tools/vnet/vnet-module/skb_util.c
--- a/tools/vnet/vnet-module/skb_util.c Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/skb_util.c Fri Mar 31 15:42:56 2006
@@ -133,7 +133,7 @@
             skb_headroom(*pskb), head_n,
             skb_tailroom(*pskb), tail_n);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< skb_make_room err=%d\n", err);
     return err;
 }
 
@@ -374,7 +374,7 @@
     }
   exit:
     if(!err) *sg_n = sg_i;
-    if(len) wprintf("> len=%d\n", len);
+    if(len) wprintf("> sbk_scatterlist len=%d\n", len);
     if(len) BUG();
     if(err) dprintf("< err=%d sg_n=%d\n", err, *sg_n);
     return err;
diff -r 18eecf71f690 tools/vnet/vnet-module/tunnel.c
--- a/tools/vnet/vnet-module/tunnel.c   Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/tunnel.c   Fri Mar 31 15:42:56 2006
@@ -95,12 +95,12 @@
         tunnel = NULL;
     }
     *val = tunnel;
-    dprintf("< err=%d\n", err);
+    dprintf("< tunnel_create err=%d\n", err);
     return err;
 }
 
 void TunnelStats_update(TunnelStats *stats, int len, int err){
-    dprintf(">len=%d  err=%d\n", len, err);
+    dprintf("> TunnelStats_update len=%d  err=%d\n", len, err);
     if(err){
         stats->dropped_bytes += len;
         stats->dropped_packets++;
@@ -139,7 +139,7 @@
     tunnel_table->key_hash_fn = tunnel_table_key_hash_fn;
     tunnel_table->key_equal_fn = tunnel_table_key_equal_fn;
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< Tunnel_init(): err=%d\n", err);
     return err;
 }
     
@@ -213,7 +213,7 @@
         err = -ENOMEM;
     }
     tunnel_write_unlock(flags);
-    dprintf("< err=%d\n", err);
+    dprintf("< Tunnel_add err=%d\n", err);
     return err;
 }
 
@@ -244,7 +244,7 @@
     } else {
         err = skb_xmit(skb);
     }
-    dprintf("< err=%d\n", err);
+    dprintf("< Tunnel_send err=%d\n", err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/varp.c
--- a/tools/vnet/vnet-module/varp.c     Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/varp.c     Fri Mar 31 15:42:56 2006
@@ -512,7 +512,7 @@
 
   exit:
     if(err && skbout) kfree_skb(skbout);
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_send err=%d\n", err);
     return err;
 }
 
@@ -1002,7 +1002,7 @@
     VarpEntry_unlock(ventry, flags);
     err = vnet_tunnel_send(&vnet, &addr, skb);
     VarpEntry_lock(ventry, flags);
-    dprintf("< err=%d\n", err);
+    dprintf("< VarpEntry_send err=%d\n", err);
     return err;
 }
 
@@ -1050,7 +1050,7 @@
     } else {
         err = VarpEntry_send(ventry, skb);
     }
-    dprintf("< err=%d\n", err);
+    dprintf("< VarpEntry_resolve err=%d\n", err);
     return err;
 }
 
@@ -1143,7 +1143,7 @@
     //}
   exit:
     VarpEntry_unlock(ventry, flags);
-    dprintf("< err=%d\n", err);
+    dprintf("< VarpEntry_update err=%d\n", err);
     return err;
 }
     
@@ -1180,7 +1180,7 @@
     err = VarpEntry_update(ventry, addr, state, flags);
     VarpEntry_decref(ventry);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< VarpTable_update err=%d\n", err);
     return err;
 }
 
@@ -1297,7 +1297,7 @@
     varp_send(VARP_OP_ANNOUNCE, skb->dev, skb, vnet, vmac);
     vif_decref(vif);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_handle_request err=%d\n", err);
     return err;
 }
 
@@ -1316,7 +1316,7 @@
     }
     err = varp_send(VARP_OP_ANNOUNCE, dev, NULL, &vif->vnet, &vif->vmac);
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_announce_vif err=%d\n", err);
     return err;
 }
 
@@ -1335,7 +1335,7 @@
                            &varph->vnet, &varph->vmac, &varph->addr,
                            VARP_STATE_REACHABLE, 
                            (VARP_UPDATE_CREATE | VARP_UPDATE_QUEUE));
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_handle_announce err=%d\n", err);
     return err;
 }
 
@@ -1419,7 +1419,7 @@
         break;
     }
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_handle_message err=%d\n", err);
     return err;
 }
 
@@ -1462,7 +1462,7 @@
         }
     }
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_output err=%d\n", err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/varp_socket.c
--- a/tools/vnet/vnet-module/varp_socket.c      Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/varp_socket.c      Fri Mar 31 15:42:56 2006
@@ -507,7 +507,7 @@
     }
   exit:
     *val = (err ? -1 : sock);
-    if(err) eprintf("> err=%d errno=%d\n", err, errno);
+    if(err) eprintf("> create_socket err=%d errno=%d\n", err, errno);
     return err;
 }
 
@@ -538,7 +538,7 @@
         shutdown(sock, 2);
     }
     *val = (err ? -1 : sock);
-    dprintf("< err=%d val=%d\n", err, *val);
+    dprintf("< varp_mcast_open err=%d val=%d\n", err, *val);
     return err;
 }
 
@@ -554,7 +554,7 @@
     int flags = (VSOCK_BIND | VSOCK_REUSE);
     dprintf(">\n");
     err = create_socket(SOCK_DGRAM, addr, port, flags, val);
-    dprintf("< err=%d val=%d\n", err, *val);
+    dprintf("< varp_ucast_open err=%d val=%d\n", err, *val);
     return err;
 }
 
@@ -733,7 +733,7 @@
     sock_set_callback(varp_mcast_sock);
   exit:
     set_fs(oldfs);
-    dprintf("< err=%d\n", err);
+    dprintf("< varp_socket_open err=%d\n", err);
     return err;
 }      
 
@@ -792,7 +792,7 @@
     sock_remove_wait_queue(varp_mcast_sock, &mcast_wait);
     varp_sockets_close();
     if(err){
-        eprintf("%s< err=%d\n", __FUNCTION__, err);
+        eprintf("%s< varp_main err=%d\n", __FUNCTION__, err);
     }
     varp_thread_err = err;
     atomic_set(&varp_state, VARP_STATE_EXITED);
@@ -842,7 +842,7 @@
 #endif
   exit:
     if(err){
-        wprintf("> err=%d\n", err);
-    }
-    return err;
-}
+        wprintf("> varp_open err=%d\n", err);
+    }
+    return err;
+}
diff -r 18eecf71f690 tools/vnet/vnet-module/vnet.c
--- a/tools/vnet/vnet-module/vnet.c     Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/vnet.c     Fri Mar 31 15:42:56 2006
@@ -448,7 +448,7 @@
     }
 #endif
   exit:
-    dprintf("< err=%d\n", err);
+    dprintf("< _skb_xmit err=%d\n", err);
     return err;
 }
 
@@ -486,7 +486,7 @@
         vif_update(vnet, (Vmac*)eth_hdr(skb)->h_source);
         err = varp_output(skb, vnet);
     }
-    //dprintf("< err=%d\n", err);
+    //dprintf("< vnet_skb_send err=%d\n", err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/vnet_eval.c
--- a/tools/vnet/vnet-module/vnet_eval.c        Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/vnet_eval.c        Fri Mar 31 15:42:56 2006
@@ -354,7 +354,7 @@
             break;
         }
     }
-    iprintf("< err=%d\n", err);
+    iprintf("< vnet_eval_defs err=%d\n", err);
     return err;
 }
 
diff -r 18eecf71f690 tools/vnet/vnet-module/vnet_ioctl.c
--- a/tools/vnet/vnet-module/vnet_ioctl.c       Fri Mar 31 13:39:42 2006
+++ b/tools/vnet/vnet-module/vnet_ioctl.c       Fri Mar 31 15:42:56 2006
@@ -247,7 +247,7 @@
   exit:
     Parser_free(parser);
     file->private_data = NULL;
-    dprintf("< err=%d\n", err);
+    dprintf("< proc_policy_release err=%d\n", err);
     return err;
 }
 
@@ -301,7 +301,7 @@
     int err = 0;
     IOStream *io = file->private_data;
     if(io) IOStream_close(io);
-    dprintf("< err=%d\n", err);
+    dprintf("< proc_io_release_fn err=%d\n", err);
     return err;
 }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.