All of lore.kernel.org
 help / color / mirror / Atom feed
* VNET - full update
@ 2005-02-09 21:49 B.G. Bruce
  2005-02-10 10:28 ` Mike Wray
  0 siblings, 1 reply; 2+ messages in thread
From: B.G. Bruce @ 2005-02-09 21:49 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

I would like to revoke my patch from earlier today for vnets and instead
submit the attached patch in it's place as a full update that allows
vnets to compile and run under 2.6.10/xen-testing.

PATCH: vnet-cleanup.patch
Signed off by:  bgb@nt-nv.com


[-- Attachment #2: vnet-cleanup.patch --]
[-- Type: text/x-patch, Size: 6987 bytes --]

diff -ruN xen-2.0-testing.bk/tools/vnet/INSTALL xen/tools/vnet/INSTALL
--- xen-2.0-testing.bk/tools/vnet/INSTALL	1969-12-31 20:00:00.000000000 -0400
+++ xen/tools/vnet/INSTALL	2005-02-09 17:43:33.050255000 -0400
@@ -0,0 +1,31 @@
+To compile and install run "make install"; if it fails or you need to reinstall 
+run "make clean" first or the build will fail, at least that is what I have 
+found under 2.6.10.
+
+Other important items:
+1)	You will need to have your xen0 kernel compiled with HMAC_SUPPORT 
+	2.6.x = (MAIN MENU: Cryptographic Options -> HMAC Support)
+	BEFORE running "make install".
+
+2)	You will want at least some of the other alogorithms listed under
+	"Cryptographic Options" for the kernel compiled as modules.
+
+3)	You will want the networking IPsec/VLAN options compiled in as modules
+	2.6.x = (MAIN MENU: Device Drivers -> Networking Support -> 
+				Networking Options ->
+					IP: AH transformation
+					IP: ESP transformation
+					IP: IPComp transformation 
+					IP: tunnel transformation
+
+					IPsec user configuration interface
+	
+					802.1Q VLAN Support
+
+4)	The module (vnet_module) will not properly load from the command line
+	with a "modprobe vnet_module".  Use network-vnet to properly configure
+	your system and load the module for you.
+
+Please refer to the additional documentation found in tools/vnet/doc for
+proper syntax and config file parameters.
+
diff -ruN xen-2.0-testing.bk/tools/vnet/Makefile xen/tools/vnet/Makefile
--- xen-2.0-testing.bk/tools/vnet/Makefile	2005-01-31 20:38:33.000000000 -0400
+++ xen/tools/vnet/Makefile	2005-02-09 13:39:34.000000000 -0400
@@ -12,6 +12,7 @@
 all: compile
 
 compile: vnetd vnet-module
+#compile: vnet-module
 
 gc.tar.gz:
 	wget http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/$@
@@ -20,10 +21,8 @@
 	tar xfz gc.tar.gz
 	ln -sf gc?.? gc
 
-gc/Makefile:
-	(cd gc && ./configure --prefix=`pwd`/install)
-
-gc-install: gc gc/Makefile
+gc-install: gc 
+	(cd gc && make test && ./configure --prefix=`pwd`/install)
 	make -C gc
 	make -C gc install
 
@@ -47,5 +46,6 @@
 clean:
 	-$(MAKE) -C vnetd clean
 	-$(MAKE) -C vnet-module clean
-
+	-rm -rf gc?.? gc
+	
 pristine: clean gc-pristine
diff -ruN xen-2.0-testing.bk/tools/vnet/vnet-module/Makefile-2.6 xen/tools/vnet/vnet-module/Makefile-2.6
--- xen-2.0-testing.bk/tools/vnet/vnet-module/Makefile-2.6	2005-01-31 20:38:33.000000000 -0400
+++ xen/tools/vnet/vnet-module/Makefile-2.6	2005-02-09 14:56:55.000000000 -0400
@@ -38,8 +38,8 @@
 
 .PHONY: install install-module modules_install
 install install-module modules_install: module
-	install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)
-	install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)
+	install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
+	install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
 
 .PHONY: clean
 clean:
diff -ruN xen-2.0-testing.bk/tools/vnet/vnet-module/if_varp.h xen/tools/vnet/vnet-module/if_varp.h
--- xen-2.0-testing.bk/tools/vnet/vnet-module/if_varp.h	2005-01-31 20:38:33.000000000 -0400
+++ xen/tools/vnet/vnet-module/if_varp.h	2005-02-09 14:03:46.000000000 -0400
@@ -36,7 +36,7 @@
 } __attribute__((packed)) VnetMsgHdr;
 
 typedef struct VarpHdr {
-    VnetMsgHdr;
+    VnetMsgHdr vnetmsghdr;
     uint32_t vnet;
     Vmac vmac;
     uint32_t addr;
@@ -50,4 +50,4 @@
 
 
 
-#endif /* ! _VNET_IF_VARP_H */
+#endif  /* ! _VNET_IF_VARP_H */
diff -ruN xen-2.0-testing.bk/tools/vnet/vnet-module/varp.c xen/tools/vnet/vnet-module/varp.c
--- xen-2.0-testing.bk/tools/vnet/vnet-module/varp.c	2005-01-31 20:38:33.000000000 -0400
+++ xen/tools/vnet/vnet-module/varp.c	2005-02-09 14:22:47.000000000 -0400
@@ -368,8 +368,8 @@
     // Varp header.
     varph = (void*)skb_put(skbout, varp_n);
     *varph = (VarpHdr){};
-    varph->id                = htons(VARP_ID);
-    varph->opcode            = htons(opcode);
+    varph->vnetmsghdr.id     = htons(VARP_ID);
+    varph->vnetmsghdr.opcode = htons(opcode);
     varph->vnet              = htonl(vnet);
     varph->vmac              = *vmac;
     varph->addr              = saddr;
@@ -1076,9 +1076,9 @@
         goto exit;
     }
     mine = 1;
-    if(varph->id != htons(VARP_ID)){
+    if(varph->vnetmsghdr.id != htons(VARP_ID)){
         // It's not varp at all - ignore it.
-        wprintf("> Unknown id: %d \n", ntohs(varph->id));
+        wprintf("> Unknown id: %d \n", ntohs(varph->vnetmsghdr.id));
         goto exit;
     }
     if(1){
@@ -1086,13 +1086,13 @@
                 NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr));
         dprintf("> sport=%u dport=%u\n", ntohs(skb->h.uh->source), ntohs(skb->h.uh->dest));
         dprintf("> opcode=%d vnet=%u vmac=" MACFMT " addr=" IPFMT "\n",
-                ntohs(varph->opcode),
+                ntohs(varph->vnetmsghdr.opcode),
                 ntohl(varph->vnet),
                 MAC6TUPLE(varph->vmac.mac),
                 NIPQUAD(varph->addr));
         varp_dprint();
     }
-    switch(ntohs(varph->opcode)){
+    switch(ntohs(varph->vnetmsghdr.opcode)){
     case VARP_OP_REQUEST:
         err = varp_handle_request(skb, varph);
         break;
@@ -1100,7 +1100,7 @@
         err = varp_handle_announce(skb, varph);
         break;
     default:
-        wprintf("> Unknown opcode: %d \n", ntohs(varph->opcode));
+        wprintf("> Unknown opcode: %d \n", ntohs(varph->vnetmsghdr.opcode));
        break;
     }
   exit:
diff -ruN xen-2.0-testing.bk/tools/vnet/vnetd/vcache.c xen/tools/vnet/vnetd/vcache.c
--- xen-2.0-testing.bk/tools/vnet/vnetd/vcache.c	2005-01-31 20:38:33.000000000 -0400
+++ xen/tools/vnet/vnetd/vcache.c	2005-02-09 14:13:59.000000000 -0400
@@ -102,11 +102,11 @@
     int varp_n = sizeof(VarpHdr);
     VarpHdr varph = {};
 
-    varph.id     = htons(VARP_ID);
-    varph.opcode = htons(opcode);
-    varph.vnet   = vnet;
-    varph.vmac   = *vmac;
-    varph.addr   = addr;
+    varph.vnetmsghdr.id     = htons(VARP_ID);
+    varph.vnetmsghdr.opcode = htons(opcode);
+    varph.vnet              = vnet;
+    varph.vmac              = *vmac;
+    varph.addr              = addr;
 
     if(0){
         struct sockaddr_in self;
@@ -503,7 +503,7 @@
  * @param local whether it's local or not
  */
 void vcache_forward_varp(VarpHdr *varph, int local){
-    uint16_t opcode = ntohs(varph->opcode);
+    uint16_t opcode = ntohs(varph->vnetmsghdr.opcode);
     if(local){
         ConnList *l;
         for(l = vnetd->connections; l; l = l->next){
@@ -611,7 +611,7 @@
         dprintf("> opcode=%d vnet=%u vmac=" MACFMT "\n",
                 ntohs(varph->opcode), ntohl(varph->vnet), MAC6TUPLE(varph->vmac.mac));
     }
-    switch(ntohs(varph->opcode)){
+    switch(ntohs(varph->vnetmsghdr.opcode)){
     case VARP_OP_REQUEST:
         err = vcache_handle_request(msg, varph, local);
         break;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: VNET - full update
  2005-02-09 21:49 VNET - full update B.G. Bruce
@ 2005-02-10 10:28 ` Mike Wray
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Wray @ 2005-02-10 10:28 UTC (permalink / raw)
  To: bgb; +Cc: xen-devel

B.G. Bruce wrote:
> I would like to revoke my patch from earlier today for vnets and instead
> submit the attached patch in it's place as a full update that allows
> vnets to compile and run under 2.6.10/xen-testing.

 From your patch it looks like I might have missed a use of inline structs.
I thought all these had been removed ages ago - oh well :-(.

Thanks for you persistence in trying to get this to work.

> 
> PATCH: vnet-cleanup.patch
> Signed off by:  bgb@nt-nv.com
> 
> 
> 
> ------------------------------------------------------------------------
> 
> diff -ruN xen-2.0-testing.bk/tools/vnet/INSTALL xen/tools/vnet/INSTALL
> --- xen-2.0-testing.bk/tools/vnet/INSTALL	1969-12-31 20:00:00.000000000 -0400
> +++ xen/tools/vnet/INSTALL	2005-02-09 17:43:33.050255000 -0400
> @@ -0,0 +1,31 @@
> +To compile and install run "make install"; if it fails or you need to reinstall 
> +run "make clean" first or the build will fail, at least that is what I have 
> +found under 2.6.10.
> +
> +Other important items:
> +1)	You will need to have your xen0 kernel compiled with HMAC_SUPPORT 
> +	2.6.x = (MAIN MENU: Cryptographic Options -> HMAC Support)
> +	BEFORE running "make install".
> +
> +2)	You will want at least some of the other alogorithms listed under
> +	"Cryptographic Options" for the kernel compiled as modules.
> +
> +3)	You will want the networking IPsec/VLAN options compiled in as modules
> +	2.6.x = (MAIN MENU: Device Drivers -> Networking Support -> 
> +				Networking Options ->
> +					IP: AH transformation
> +					IP: ESP transformation
> +					IP: IPComp transformation 
> +					IP: tunnel transformation
> +
> +					IPsec user configuration interface
> +	
> +					802.1Q VLAN Support

You do need hmac and the crypto modules, but as far as I am aware
you should not need kernel ipsec or vlan.
As the vnet module has its own ESP stuff kernel ipsec might even conflict.
This may be due to changes in kernel version for 2.6.10, I'll take
a look.

It's probably the ip tunneling you really need.

> +
> +4)	The module (vnet_module) will not properly load from the command line
> +	with a "modprobe vnet_module".  Use network-vnet to properly configure
> +	your system and load the module for you.
> +
> +Please refer to the additional documentation found in tools/vnet/doc for
> +proper syntax and config file parameters.
> +
> diff -ruN xen-2.0-testing.bk/tools/vnet/Makefile xen/tools/vnet/Makefile
> --- xen-2.0-testing.bk/tools/vnet/Makefile	2005-01-31 20:38:33.000000000 -0400
> +++ xen/tools/vnet/Makefile	2005-02-09 13:39:34.000000000 -0400
> @@ -12,6 +12,7 @@
>  all: compile
>  
>  compile: vnetd vnet-module
> +#compile: vnet-module
>  
>  gc.tar.gz:
>  	wget http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/$@
> @@ -20,10 +21,8 @@
>  	tar xfz gc.tar.gz
>  	ln -sf gc?.? gc
>  
> -gc/Makefile:
> -	(cd gc && ./configure --prefix=`pwd`/install)
> -
> -gc-install: gc gc/Makefile
> +gc-install: gc 
> +	(cd gc && make test && ./configure --prefix=`pwd`/install)
>  	make -C gc
>  	make -C gc install
>  
> @@ -47,5 +46,6 @@
>  clean:
>  	-$(MAKE) -C vnetd clean
>  	-$(MAKE) -C vnet-module clean
> -
> +	-rm -rf gc?.? gc
> +	
>  pristine: clean gc-pristine
> diff -ruN xen-2.0-testing.bk/tools/vnet/vnet-module/Makefile-2.6 xen/tools/vnet/vnet-module/Makefile-2.6
> --- xen-2.0-testing.bk/tools/vnet/vnet-module/Makefile-2.6	2005-01-31 20:38:33.000000000 -0400
> +++ xen/tools/vnet/vnet-module/Makefile-2.6	2005-02-09 14:56:55.000000000 -0400
> @@ -38,8 +38,8 @@
>  
>  .PHONY: install install-module modules_install
>  install install-module modules_install: module
> -	install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)
> -	install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)
> +	install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
> +	install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
>  
>  .PHONY: clean
>  clean:
> diff -ruN xen-2.0-testing.bk/tools/vnet/vnet-module/if_varp.h xen/tools/vnet/vnet-module/if_varp.h
> --- xen-2.0-testing.bk/tools/vnet/vnet-module/if_varp.h	2005-01-31 20:38:33.000000000 -0400
> +++ xen/tools/vnet/vnet-module/if_varp.h	2005-02-09 14:03:46.000000000 -0400
> @@ -36,7 +36,7 @@
>  } __attribute__((packed)) VnetMsgHdr;
>  
>  typedef struct VarpHdr {
> -    VnetMsgHdr;
> +    VnetMsgHdr vnetmsghdr;
>      uint32_t vnet;
>      Vmac vmac;
>      uint32_t addr;
> @@ -50,4 +50,4 @@
>  
>  
>  
> -#endif /* ! _VNET_IF_VARP_H */
> +#endif  /* ! _VNET_IF_VARP_H */
> diff -ruN xen-2.0-testing.bk/tools/vnet/vnet-module/varp.c xen/tools/vnet/vnet-module/varp.c
> --- xen-2.0-testing.bk/tools/vnet/vnet-module/varp.c	2005-01-31 20:38:33.000000000 -0400
> +++ xen/tools/vnet/vnet-module/varp.c	2005-02-09 14:22:47.000000000 -0400
> @@ -368,8 +368,8 @@
>      // Varp header.
>      varph = (void*)skb_put(skbout, varp_n);
>      *varph = (VarpHdr){};
> -    varph->id                = htons(VARP_ID);
> -    varph->opcode            = htons(opcode);
> +    varph->vnetmsghdr.id     = htons(VARP_ID);
> +    varph->vnetmsghdr.opcode = htons(opcode);
>      varph->vnet              = htonl(vnet);
>      varph->vmac              = *vmac;
>      varph->addr              = saddr;
> @@ -1076,9 +1076,9 @@
>          goto exit;
>      }
>      mine = 1;
> -    if(varph->id != htons(VARP_ID)){
> +    if(varph->vnetmsghdr.id != htons(VARP_ID)){
>          // It's not varp at all - ignore it.
> -        wprintf("> Unknown id: %d \n", ntohs(varph->id));
> +        wprintf("> Unknown id: %d \n", ntohs(varph->vnetmsghdr.id));
>          goto exit;
>      }
>      if(1){
> @@ -1086,13 +1086,13 @@
>                  NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr));
>          dprintf("> sport=%u dport=%u\n", ntohs(skb->h.uh->source), ntohs(skb->h.uh->dest));
>          dprintf("> opcode=%d vnet=%u vmac=" MACFMT " addr=" IPFMT "\n",
> -                ntohs(varph->opcode),
> +                ntohs(varph->vnetmsghdr.opcode),
>                  ntohl(varph->vnet),
>                  MAC6TUPLE(varph->vmac.mac),
>                  NIPQUAD(varph->addr));
>          varp_dprint();
>      }
> -    switch(ntohs(varph->opcode)){
> +    switch(ntohs(varph->vnetmsghdr.opcode)){
>      case VARP_OP_REQUEST:
>          err = varp_handle_request(skb, varph);
>          break;
> @@ -1100,7 +1100,7 @@
>          err = varp_handle_announce(skb, varph);
>          break;
>      default:
> -        wprintf("> Unknown opcode: %d \n", ntohs(varph->opcode));
> +        wprintf("> Unknown opcode: %d \n", ntohs(varph->vnetmsghdr.opcode));
>         break;
>      }
>    exit:
> diff -ruN xen-2.0-testing.bk/tools/vnet/vnetd/vcache.c xen/tools/vnet/vnetd/vcache.c
> --- xen-2.0-testing.bk/tools/vnet/vnetd/vcache.c	2005-01-31 20:38:33.000000000 -0400
> +++ xen/tools/vnet/vnetd/vcache.c	2005-02-09 14:13:59.000000000 -0400
> @@ -102,11 +102,11 @@
>      int varp_n = sizeof(VarpHdr);
>      VarpHdr varph = {};
>  
> -    varph.id     = htons(VARP_ID);
> -    varph.opcode = htons(opcode);
> -    varph.vnet   = vnet;
> -    varph.vmac   = *vmac;
> -    varph.addr   = addr;
> +    varph.vnetmsghdr.id     = htons(VARP_ID);
> +    varph.vnetmsghdr.opcode = htons(opcode);
> +    varph.vnet              = vnet;
> +    varph.vmac              = *vmac;
> +    varph.addr              = addr;
>  
>      if(0){
>          struct sockaddr_in self;
> @@ -503,7 +503,7 @@
>   * @param local whether it's local or not
>   */
>  void vcache_forward_varp(VarpHdr *varph, int local){
> -    uint16_t opcode = ntohs(varph->opcode);
> +    uint16_t opcode = ntohs(varph->vnetmsghdr.opcode);
>      if(local){
>          ConnList *l;
>          for(l = vnetd->connections; l; l = l->next){
> @@ -611,7 +611,7 @@
>          dprintf("> opcode=%d vnet=%u vmac=" MACFMT "\n",
>                  ntohs(varph->opcode), ntohl(varph->vnet), MAC6TUPLE(varph->vmac.mac));
>      }
> -    switch(ntohs(varph->opcode)){
> +    switch(ntohs(varph->vnetmsghdr.opcode)){
>      case VARP_OP_REQUEST:
>          err = vcache_handle_request(msg, varph, local);
>          break;

Mike




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-10 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-09 21:49 VNET - full update B.G. Bruce
2005-02-10 10:28 ` Mike Wray

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.