netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	davem@davemloft.net, netdev@vger.kernel.org,
	alexander.h.duyck@intel.com
Subject: Re: [PATCH 1/2] net: dsa: Error out on tagging protocol mismatches
Date: Thu, 23 Oct 2014 15:32:03 +0200	[thread overview]
Message-ID: <20141023133203.GA25190@lunn.ch> (raw)
In-Reply-To: <544841EC.4070103@gmail.com>

On Wed, Oct 22, 2014 at 04:46:52PM -0700, Florian Fainelli wrote:
> On 10/22/2014 04:35 PM, Andrew Lunn wrote:
> > If there is a mismatch between enabled tagging protocols and the
> > protocol the switch supports, error out, rather than continue with a
> > situation which is unlikely to work.
> > 
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > cc: alexander.h.duyck@intel.com
> > ---
> >  net/dsa/dsa.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> > index 22f34cf4cb27..8a31bd81a315 100644
> > --- a/net/dsa/dsa.c
> > +++ b/net/dsa/dsa.c
> > @@ -175,7 +175,8 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
> >  			break;
> >  #endif
> >  		default:
> > -			break;
> > +			ret = -ENOPROTOOPT;
> > +			goto out;
> >  		}
> 
> This prevents using a switch driver without tagging, which is something
> that you might want to do (link setup, ethtool stats, EEE etc...).

Hi Florian

I didn't know that was a use case.

So i assume such a driver would use DSA_TAG_PROTO_NONE? So all i need
to do is add that as a case value to the switch statement, and we
should cover that use case, and still be able to detect a mismatch.

v2 patch soon.

   Andrew

  reply	other threads:[~2014-10-23 13:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 23:35 [PATCH 0/2] DSA tagging mismatches Andrew Lunn
2014-10-22 23:35 ` [PATCH 1/2] net: dsa: Error out on tagging protocol mismatches Andrew Lunn
2014-10-22 23:46   ` Florian Fainelli
2014-10-23 13:32     ` Andrew Lunn [this message]
2014-10-22 23:35 ` [PATCH 2/2] dsa: mv88e6171: Fix tagging protocol/Kconfig Andrew Lunn

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=20141023133203.GA25190@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).