lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5412424F.3050701@gmail.com>
Date:	Thu, 11 Sep 2014 17:46:07 -0700
From:	Alexander Duyck <alexander.duyck@...il.com>
To:	Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
CC:	davem@...emloft.net, kernel@...tstofly.org
Subject: Re: [PATCH net-next] net: dsa: change tag_protocol to an enum

On 09/11/2014 11:57 AM, Florian Fainelli wrote:
> Now that we introduced an additional multiplexing/demultiplexing layer
> with commit 3e8a72d1dae37 ("net: dsa: reduce number of protocol hooks")
> that lives within the DSA code, we no longer need to have a given switch
> driver tag_protocol be an actual ethertype value, instead, we can
> replace it with an enum: dsa_tag_protocol.
>
> Do this replacement in the drivers, which allows us to get rid of the
> cpu_to_be16()/htons() dance, and remove ETH_P_BRCMTAG since we do not
> need it anymore.
>
> Suggested-by: Alexander Duyck <alexander.duyck@...il.com>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
>  drivers/net/dsa/bcm_sf2.c         |  2 +-
>  drivers/net/dsa/mv88e6060.c       |  2 +-
>  drivers/net/dsa/mv88e6123_61_65.c |  4 ++--
>  drivers/net/dsa/mv88e6131.c       |  2 +-
>  include/net/dsa.h                 | 14 ++++++++++----
>  net/dsa/slave.c                   |  8 ++++----
>  net/dsa/tag_brcm.c                |  1 -
>  7 files changed, 19 insertions(+), 14 deletions(-)

[...]

> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 97712927a9d2..3e88b4ad274f 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -22,7 +22,13 @@
>  /* Not an official ethertype value, used only internally for DSA
>   * demultiplexing
>   */
> -#define ETH_P_BRCMTAG		(ETH_P_XDSA + 1)
> +enum dsa_tag_protocol {
> +	DSA_TAG_PROTO_NONE = 0,
> +	DSA_TAG_PROTO_DSA,
> +	DSA_TAG_PROTO_TRAILER,
> +	DSA_TAG_PROTO_EDSA,
> +	DSA_TAG_PROTO_BRCM,
> +};
>  
>  #define DSA_MAX_SWITCHES	4
>  #define DSA_MAX_PORTS		12

You might want to either remove or update the comment as well.  Defining
the enum with a comment about ethertype value might be a bit confusing.

Other than that it looks okay to me.

Thanks,

ALex
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ