netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v1 net-next 1/5] net: dsa: mv88e6xxx: Reserved Management frames to CPU
Date: Sun, 4 Dec 2016 21:22:34 +0100	[thread overview]
Message-ID: <20161204202234.GA20743@lunn.ch> (raw)
In-Reply-To: <87y3zvcvhm.fsf@ketchup.i-did-not-set--mail-host-address--so-tickle-me>

> > +int mv88e6095_g2_mgmt_rsvd2cpu(struct mv88e6xxx_chip *chip)
> > +{
> > +	int err;
> > +
> > +	/* Consider the frames with reserved multicast destination
> > +	 * addresses matching 01:80:c2:00:00:2x as MGMT.
> > +	 */
> > +	if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_G2_MGMT_EN_2X)) {
> 
> Please don't just move the old code. You shouldn't need flags anymore.

Hi Vivien

My aim is to get the 6390 supported. Refactoring is secondary. If it
helps implementing the 6390 code, i will refactor stuff. If it does
not help, i will leave it alone. It does not help here, so i left it
alone. Please feel free to submit a follow up patch refactoring this
further.

> The mv88e6xxx_ops actually implements the *features*. They can be
> prefixed for clarity (e.g. .ppu_*, port_*, .atu_*, etc.). They don't
> describe the register layout.
> 
> But we can discuss two ways of seeing this structure implementation:

or

3) We have a prefix for us humans to help us find the code. Now we
have ops, i cannot simply do M-. and emacs will take me to the
implementation. I have to search for it a bit. Having the hint g1_
tells me to go look in global1.c. Having the hint g2_ tells me to go
look in global2.c. Having the port_ tells me to go look in port.c.
Having no prefix tells me the code is scattered around and grep is my
friend.

The prefix is just a hint where the function is in the source
code. Nothing more.

      Andrew

  reply	other threads:[~2016-12-04 20:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03  3:45 [PATCH v1 net-next 0/5] mv88e6390 batch 3 Andrew Lunn
2016-12-03  3:45 ` [PATCH v1 net-next 1/5] net: dsa: mv88e6xxx: Reserved Management frames to CPU Andrew Lunn
2016-12-04 20:03   ` Vivien Didelot
2016-12-04 20:22     ` Andrew Lunn [this message]
2016-12-04 22:12       ` Vivien Didelot
2016-12-04 22:40         ` Andrew Lunn
2016-12-05  0:23           ` Vivien Didelot
2016-12-05  8:26       ` Richard Cochran
2016-12-03  3:45 ` [PATCH v1 net-next 2/5] net: dsa: mv88e6xxx: Refactor setting of jumbo frames Andrew Lunn
2016-12-03  3:45 ` [PATCH v1 net-next 3/5] net: dsa: mv88e6xxx: Refactor egress rate limiting Andrew Lunn
2016-12-03  3:45 ` [PATCH v1 net-next 4/5] net: dsa: mv88e6xxx: Refactor pause configuration Andrew Lunn
2016-12-03  3:45 ` [PATCH v1 net-next 5/5] net: dsa: mv88e6xxx: Implement mv88e6390 pause control 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=20161204202234.GA20743@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /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).