ia64/xen-unstable

changeset 3759:b5019559f1ca

bitkeeper revision 1.1159.223.85 (420a9b72OGag4m4sDtlxM-918tbudQ)

Subject: [Xen-devel] VNET - full update

Allows vnets to compile and run under 2.6.10/xen-testing.
PATCH: vnet-cleanup.patch
Signed off by: bgb@nt-nv.com
Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Wed Feb 09 23:23:30 2005 +0000 (2005-02-09)
parents 9376fcbfd5a0
children 736089c11af9
files .rootkeys tools/vnet/INSTALL tools/vnet/Makefile tools/vnet/vnet-module/Makefile-2.6 tools/vnet/vnet-module/if_varp.h tools/vnet/vnet-module/varp.c tools/vnet/vnetd/vcache.c
line diff
     1.1 --- a/.rootkeys	Wed Feb 09 19:44:49 2005 +0000
     1.2 +++ b/.rootkeys	Wed Feb 09 23:23:30 2005 +0000
     1.3 @@ -556,6 +556,7 @@ 40fcefb3yMSrZvApO9ToIi-iQwnchA tools/sv/
     1.4  41013a83z27rKvWIxAfUBMVZ1eDCDg tools/sv/inc/script.js
     1.5  40fcefb3zGC9XNBkSwTEobCoq8YClA tools/sv/inc/style.css
     1.6  41a21888_WlknVWjSxb32Fo13_ujsw tools/vnet/00README
     1.7 +420a9b706I-bN_uPdiy0m3rmDifNNg tools/vnet/INSTALL
     1.8  41a21888bOiOJc7blzRbe4MNJoaYTw tools/vnet/Makefile
     1.9  41a21888mg2k5HeiVjlQYEtJBZT4Qg tools/vnet/doc/vnet-module.txt
    1.10  41a21888cuxfT8wjCdRR6V1lqf5NtA tools/vnet/doc/vnet-xend.txt
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/vnet/INSTALL	Wed Feb 09 23:23:30 2005 +0000
     2.3 @@ -0,0 +1,31 @@
     2.4 +To compile and install run "make install"; if it fails or you need to reinstall 
     2.5 +run "make clean" first or the build will fail, at least that is what I have 
     2.6 +found under 2.6.10.
     2.7 +
     2.8 +Other important items:
     2.9 +1)	You will need to have your xen0 kernel compiled with HMAC_SUPPORT 
    2.10 +	2.6.x = (MAIN MENU: Cryptographic Options -> HMAC Support)
    2.11 +	BEFORE running "make install".
    2.12 +
    2.13 +2)	You will want at least some of the other alogorithms listed under
    2.14 +	"Cryptographic Options" for the kernel compiled as modules.
    2.15 +
    2.16 +3)	You will want the networking IPsec/VLAN options compiled in as modules
    2.17 +	2.6.x = (MAIN MENU: Device Drivers -> Networking Support -> 
    2.18 +				Networking Options ->
    2.19 +					IP: AH transformation
    2.20 +					IP: ESP transformation
    2.21 +					IP: IPComp transformation 
    2.22 +					IP: tunnel transformation
    2.23 +
    2.24 +					IPsec user configuration interface
    2.25 +	
    2.26 +					802.1Q VLAN Support
    2.27 +
    2.28 +4)	The module (vnet_module) will not properly load from the command line
    2.29 +	with a "modprobe vnet_module".  Use network-vnet to properly configure
    2.30 +	your system and load the module for you.
    2.31 +
    2.32 +Please refer to the additional documentation found in tools/vnet/doc for
    2.33 +proper syntax and config file parameters.
    2.34 +
     3.1 --- a/tools/vnet/Makefile	Wed Feb 09 19:44:49 2005 +0000
     3.2 +++ b/tools/vnet/Makefile	Wed Feb 09 23:23:30 2005 +0000
     3.3 @@ -12,6 +12,7 @@ export prefix?=$(shell cd ../../dist/ins
     3.4  all: compile
     3.5  
     3.6  compile: vnetd vnet-module
     3.7 +#compile: vnet-module
     3.8  
     3.9  gc.tar.gz:
    3.10  	wget http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/$@
    3.11 @@ -20,10 +21,8 @@ gc: gc.tar.gz
    3.12  	tar xfz gc.tar.gz
    3.13  	ln -sf gc?.? gc
    3.14  
    3.15 -gc/Makefile:
    3.16 -	(cd gc && ./configure --prefix=`pwd`/install)
    3.17 -
    3.18 -gc-install: gc gc/Makefile
    3.19 +gc-install: gc 
    3.20 +	(cd gc && make test && ./configure --prefix=`pwd`/install)
    3.21  	make -C gc
    3.22  	make -C gc install
    3.23  
    3.24 @@ -47,5 +46,6 @@ install: compile
    3.25  clean:
    3.26  	-$(MAKE) -C vnetd clean
    3.27  	-$(MAKE) -C vnet-module clean
    3.28 -
    3.29 +	-rm -rf gc?.? gc
    3.30 +	
    3.31  pristine: clean gc-pristine
     4.1 --- a/tools/vnet/vnet-module/Makefile-2.6	Wed Feb 09 19:44:49 2005 +0000
     4.2 +++ b/tools/vnet/vnet-module/Makefile-2.6	Wed Feb 09 23:23:30 2005 +0000
     4.3 @@ -38,8 +38,8 @@ module modules:
     4.4  
     4.5  .PHONY: install install-module modules_install
     4.6  install install-module modules_install: module
     4.7 -	install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)
     4.8 -	install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)
     4.9 +	install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
    4.10 +	install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
    4.11  
    4.12  .PHONY: clean
    4.13  clean:
     5.1 --- a/tools/vnet/vnet-module/if_varp.h	Wed Feb 09 19:44:49 2005 +0000
     5.2 +++ b/tools/vnet/vnet-module/if_varp.h	Wed Feb 09 23:23:30 2005 +0000
     5.3 @@ -36,7 +36,7 @@ typedef struct VnetMsgHdr {
     5.4  } __attribute__((packed)) VnetMsgHdr;
     5.5  
     5.6  typedef struct VarpHdr {
     5.7 -    VnetMsgHdr;
     5.8 +    VnetMsgHdr vnetmsghdr;
     5.9      uint32_t vnet;
    5.10      Vmac vmac;
    5.11      uint32_t addr;
    5.12 @@ -50,4 +50,4 @@ typedef struct VarpHdr {
    5.13  
    5.14  
    5.15  
    5.16 -#endif /* ! _VNET_IF_VARP_H */
    5.17 +#endif  /* ! _VNET_IF_VARP_H */
     6.1 --- a/tools/vnet/vnet-module/varp.c	Wed Feb 09 19:44:49 2005 +0000
     6.2 +++ b/tools/vnet/vnet-module/varp.c	Wed Feb 09 23:23:30 2005 +0000
     6.3 @@ -368,8 +368,8 @@ int varp_send(u16 opcode, struct net_dev
     6.4      // Varp header.
     6.5      varph = (void*)skb_put(skbout, varp_n);
     6.6      *varph = (VarpHdr){};
     6.7 -    varph->id                = htons(VARP_ID);
     6.8 -    varph->opcode            = htons(opcode);
     6.9 +    varph->vnetmsghdr.id     = htons(VARP_ID);
    6.10 +    varph->vnetmsghdr.opcode = htons(opcode);
    6.11      varph->vnet              = htonl(vnet);
    6.12      varph->vmac              = *vmac;
    6.13      varph->addr              = saddr;
    6.14 @@ -1076,9 +1076,9 @@ int varp_handle_message(struct sk_buff *
    6.15          goto exit;
    6.16      }
    6.17      mine = 1;
    6.18 -    if(varph->id != htons(VARP_ID)){
    6.19 +    if(varph->vnetmsghdr.id != htons(VARP_ID)){
    6.20          // It's not varp at all - ignore it.
    6.21 -        wprintf("> Unknown id: %d \n", ntohs(varph->id));
    6.22 +        wprintf("> Unknown id: %d \n", ntohs(varph->vnetmsghdr.id));
    6.23          goto exit;
    6.24      }
    6.25      if(1){
    6.26 @@ -1086,13 +1086,13 @@ int varp_handle_message(struct sk_buff *
    6.27                  NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr));
    6.28          dprintf("> sport=%u dport=%u\n", ntohs(skb->h.uh->source), ntohs(skb->h.uh->dest));
    6.29          dprintf("> opcode=%d vnet=%u vmac=" MACFMT " addr=" IPFMT "\n",
    6.30 -                ntohs(varph->opcode),
    6.31 +                ntohs(varph->vnetmsghdr.opcode),
    6.32                  ntohl(varph->vnet),
    6.33                  MAC6TUPLE(varph->vmac.mac),
    6.34                  NIPQUAD(varph->addr));
    6.35          varp_dprint();
    6.36      }
    6.37 -    switch(ntohs(varph->opcode)){
    6.38 +    switch(ntohs(varph->vnetmsghdr.opcode)){
    6.39      case VARP_OP_REQUEST:
    6.40          err = varp_handle_request(skb, varph);
    6.41          break;
    6.42 @@ -1100,7 +1100,7 @@ int varp_handle_message(struct sk_buff *
    6.43          err = varp_handle_announce(skb, varph);
    6.44          break;
    6.45      default:
    6.46 -        wprintf("> Unknown opcode: %d \n", ntohs(varph->opcode));
    6.47 +        wprintf("> Unknown opcode: %d \n", ntohs(varph->vnetmsghdr.opcode));
    6.48         break;
    6.49      }
    6.50    exit:
     7.1 --- a/tools/vnet/vnetd/vcache.c	Wed Feb 09 19:44:49 2005 +0000
     7.2 +++ b/tools/vnet/vnetd/vcache.c	Wed Feb 09 23:23:30 2005 +0000
     7.3 @@ -102,11 +102,11 @@ int varp_send(Conn *conn, uint16_t opcod
     7.4      int varp_n = sizeof(VarpHdr);
     7.5      VarpHdr varph = {};
     7.6  
     7.7 -    varph.id     = htons(VARP_ID);
     7.8 -    varph.opcode = htons(opcode);
     7.9 -    varph.vnet   = vnet;
    7.10 -    varph.vmac   = *vmac;
    7.11 -    varph.addr   = addr;
    7.12 +    varph.vnetmsghdr.id     = htons(VARP_ID);
    7.13 +    varph.vnetmsghdr.opcode = htons(opcode);
    7.14 +    varph.vnet              = vnet;
    7.15 +    varph.vmac              = *vmac;
    7.16 +    varph.addr              = addr;
    7.17  
    7.18      if(0){
    7.19          struct sockaddr_in self;
    7.20 @@ -503,7 +503,7 @@ void VarpCache_sweep(VarpCache *z, int a
    7.21   * @param local whether it's local or not
    7.22   */
    7.23  void vcache_forward_varp(VarpHdr *varph, int local){
    7.24 -    uint16_t opcode = ntohs(varph->opcode);
    7.25 +    uint16_t opcode = ntohs(varph->vnetmsghdr.opcode);
    7.26      if(local){
    7.27          ConnList *l;
    7.28          for(l = vnetd->connections; l; l = l->next){
    7.29 @@ -611,7 +611,7 @@ int vcache_handle_message(IPMessage *msg
    7.30          dprintf("> opcode=%d vnet=%u vmac=" MACFMT "\n",
    7.31                  ntohs(varph->opcode), ntohl(varph->vnet), MAC6TUPLE(varph->vmac.mac));
    7.32      }
    7.33 -    switch(ntohs(varph->opcode)){
    7.34 +    switch(ntohs(varph->vnetmsghdr.opcode)){
    7.35      case VARP_OP_REQUEST:
    7.36          err = vcache_handle_request(msg, varph, local);
    7.37          break;