From: Alexander Duyck <alexander.duyck@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kernel@wantstofly.org
Subject: Re: [PATCH net-next] net: dsa: change tag_protocol to an enum
Date: Thu, 11 Sep 2014 17:46:07 -0700 [thread overview]
Message-ID: <5412424F.3050701@gmail.com> (raw)
In-Reply-To: <1410461842-15792-1-git-send-email-f.fainelli@gmail.com>
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@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.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
prev parent reply other threads:[~2014-09-12 0:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 18:57 [PATCH net-next] net: dsa: change tag_protocol to an enum Florian Fainelli
2014-09-12 0:46 ` Alexander Duyck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5412424F.3050701@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kernel@wantstofly.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.