[sheepdog] [PATCH 1/4] sheep: add option for dual nic support

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jan 15 08:57:09 CET 2013


At Sun, 13 Jan 2013 23:16:58 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> This is a prepare patch, add one option to add another nic for IO requests.
> 
> Usage:
>  sheep -i ip{,port} ...

How about using ':' for the separator and putting an ipv6 address
within square brackets [ ]?

 E.g.
   -i 1.2.3.4:5678
   -i [1:2:3:4:5:6:7:8]:5678

I guess this is more common notation.

If we would have more parameters in future, the following might be
better.
  -i host=1.2.3.4,port=5678
  -i host=1:2:3:4:5:6:7:8,port=5678

> @@ -173,8 +174,10 @@ struct sd_node_rsp {
>  };
>  
>  struct node_id {
> -	uint8_t addr[16];
> +	uint8_t addr[INET6_ADDRSTRLEN];
>  	uint16_t port;
> +	uint8_t io_addr[INET6_ADDRSTRLEN];
> +	uint16_t io_port;
>  };

INET6_ADRSTRLEN is length of the string form for ipv6, and its size is
46 bytes.  I think we should use 16 here because the size of ipv6 is
128 bit.

In addition, this structure should be aligned to 64 byte because it
can be shared with other machines.

Other parts in this series look good to me.

Thanks,

Kazutaka



More information about the sheepdog mailing list