From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Scott Feldman <sfeldma@gmail.com>
Cc: Netdev <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kernel <kernel@savoirfairelinux.com>,
"David S. Miller" <davem@davemloft.net>,
Guenter Roeck <linux@roeck-us.net>, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Jiri Pirko <jiri@resnulli.us>
Subject: Re: [PATCH net-next v2 2/7] net: switchdev: support static FDB addresses
Date: Thu, 6 Aug 2015 10:19:34 -0400 [thread overview]
Message-ID: <20150806141934.GA20660@ketchup.touchtunes.com> (raw)
In-Reply-To: <CAE4R7bBjYZtE-hj8b-0bRcA2bB0Sh+YXhtcmk2FuJu_qLB3xew@mail.gmail.com>
On 15-08-05 23:28:15, Scott Feldman wrote:
> On Wed, Aug 5, 2015 at 10:44 PM, Vivien Didelot
> <vivien.didelot@savoirfairelinux.com> wrote:
> > This patch adds a is_static boolean to the switchdev_obj_fdb structure,
> > in order to set the ndm_state to either NUD_NOARP or NUD_REACHABLE.
> >
> > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> > ---
> > include/net/switchdev.h | 1 +
> > net/switchdev/switchdev.c | 2 +-
> > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> > index e90e1a0..0e296b8 100644
> > --- a/include/net/switchdev.h
> > +++ b/include/net/switchdev.h
> > @@ -72,6 +72,7 @@ struct switchdev_obj {
> > struct switchdev_obj_fdb { /* PORT_FDB */
> > u8 addr[ETH_ALEN];
> > u16 vid;
> > + bool is_static;
>
> What do you think about changing this to u16 ndm_state? That way, it
> can be used on input (fdb add) and output (fdb dump), and the driver
> can privately track the state, kind of like how the bridge keeps
> is_static, is_local, etc.
I'm OK with the change. Should we consider NUD_NONE (0) a valid value?
> > } fdb;
> > } u;
> > };
> > diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
> > index 9db87a3..e9d1cac 100644
> > --- a/net/switchdev/switchdev.c
> > +++ b/net/switchdev/switchdev.c
> > @@ -811,7 +811,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
> > ndm->ndm_flags = NTF_SELF;
> > ndm->ndm_type = 0;
> > ndm->ndm_ifindex = dev->ifindex;
> > - ndm->ndm_state = NUD_REACHABLE;
> > + ndm->ndm_state = obj->u.fdb.is_static ? NUD_NOARP : NUD_REACHABLE;
In other word, do we prefer this:
ndm->ndm_state = obj->u.fdb.ndm_state == NUD_NONE ?
NUD_REACHABLE : obj->u.fdb.ndm_state;
Or this (meaning switchdev users cannot leave it blank and must at least
set NUD_REACHABLE themselves):
ndm->ndm_state = obj->u.fdb.ndm_state;
Thanks,
-v
next prev parent reply other threads:[~2015-08-06 14:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 5:44 [PATCH net-next v2 0/7] net: dsa: mv88e6xxx: support switchdev FDB objects Vivien Didelot
2015-08-06 5:44 ` [PATCH net-next v2 1/7] net: switchdev: change fdb addr for a byte array Vivien Didelot
2015-08-06 5:44 ` [PATCH net-next v2 2/7] net: switchdev: support static FDB addresses Vivien Didelot
2015-08-06 6:28 ` Scott Feldman
2015-08-06 14:19 ` Vivien Didelot [this message]
2015-08-06 16:37 ` Scott Feldman
2015-08-06 5:44 ` [PATCH net-next v2 3/7] net: dsa: add support for switchdev FDB objects Vivien Didelot
2015-08-06 14:04 ` Andrew Lunn
2015-08-06 14:52 ` Vivien Didelot
2015-08-06 5:44 ` [PATCH net-next v2 4/7] net: dsa: mv88e6xxx: extend fid mask Vivien Didelot
2015-08-06 5:44 ` [PATCH net-next v2 5/7] net: dsa: mv88e6xxx: rename ATU MAC accessors Vivien Didelot
2015-08-06 5:44 ` [PATCH net-next v2 6/7] net: dsa: mv88e6xxx: rework FDB getnext operation Vivien Didelot
2015-08-06 5:44 ` [PATCH net-next v2 7/7] net: dsa: mv88e6xxx: rework FDB add/del operations Vivien Didelot
2015-08-10 5:48 ` [PATCH net-next v2 0/7] net: dsa: mv88e6xxx: support switchdev FDB objects David Miller
2015-08-10 13:39 ` Vivien Didelot
2015-08-11 16:25 ` Vivien Didelot
2015-08-11 17:38 ` David Miller
2015-08-11 18:03 ` Florian Fainelli
2015-08-11 18:07 ` David Miller
2015-08-11 18:18 ` Vivien Didelot
2015-08-11 18:52 ` David Miller
2015-08-11 19:00 ` David Miller
2015-08-11 19:05 ` David Miller
2015-08-11 20:10 ` Vivien Didelot
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=20150806141934.GA20660@ketchup.touchtunes.com \
--to=vivien.didelot@savoirfairelinux.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jiri@resnulli.us \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
--cc=sfeldma@gmail.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