[lldp-devel] [PATCH] vdp22 remove pcp and ps from structure definition

John Fastabend john.r.fastabend at intel.com
Fri Nov 15 04:42:08 UTC 2013


On 11/12/2013 4:48 AM, Thomas Richter wrote:
> Remove the Priority code point (PCP) and PCP Significant (PS)
> members from the structure fid22. Both members are now stored
> in the upper bits in the vlan identifier. This is the same format
> as in the TLV definition.
>
> Compare MAC address and group identifiers in the filter
> data only when the filter information format indicates
> valid data.
>
> Signed-off-by: Thomas Richter <tmricht at linux.vnet.ibm.com>
> ---

[...]

> +
> +static inline unsigned short vdp22_get_qos(unsigned short x)
> +{
> +	return (x >> 12) & 0xf;
> +}
> +
> +static inline unsigned short vdp22_set_qos(unsigned short x)
> +{
> +	return (x & 0xf) << 12;
> +}
> +

[...]

Is the following actually equivalent?

> -	if (fp->pcp & ~7)

this is checking if the 4th bit is set (abcd & 1000) = a000

> +	if (vdp22_get_qos(fp->vlan) > 15)

and this is checking if the 4bits are greater than 15. What about
vdp22_get_qos(vlan) = 1001 = 9? Did you mean greater than 7?

>   		return false;
>   	return true;
>   }

Or did I just miss it entirely.

[...]

Thanks,
John


More information about the lldp-devel mailing list