Oh, that was a bug.
Well, in my netlink command vport add I used the full name (including the null 
terminator) for the hash.
And in the OvsFindVportByOvsName I use length = strlen(name) + 1.

When I pulled the latest modifs from the repo, I noticed I was doing some kind 
of revert to this patch.
I would personally prefer to keep the null terminator both in lookups and in 
hashing / insertion, instead of removing in both. As it is used in my latest 
patches.

Regards,
Sam

________________________________________
From: Nithin Raju [nit...@vmware.com]
Sent: Tuesday, September 30, 2014 7:35 PM
To: Samuel Ghinet
Cc: dev@openvswitch.org
Subject: Re: [PATCH] datapath-windows: NUL character should be left out during 
VPORT hash lookup

> From: Samuel Ghinet
> Sent: Tuesday, September 30, 2014 6:24 PM
> To: Nithin Raju
> Subject: RE: [PATCH] datapath-windows: NUL character should be left out 
> during VPORT hash lookup
>
> The vport names given by the userspace using netlink command vport add are 
> null-terminated.
> I personally see this patch as an unnecessary complexity.

Samuel,
If we include the NUL character, the hash calculation is off since while 
inserting the port, we did not add the NUL character to the hash calculation. 
Why do you see this patch as unnecessary? Without this patch, lookup was 
failing.

I could have fixed this in the place where we add the port to the hash table. I 
chose this patch instead.

Thanks,
-- Nithin
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to