From: Scott Feldman <sfeldma@gmail.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.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: Wed, 5 Aug 2015 23:28:15 -0700 [thread overview]
Message-ID: <CAE4R7bBjYZtE-hj8b-0bRcA2bB0Sh+YXhtcmk2FuJu_qLB3xew@mail.gmail.com> (raw)
In-Reply-To: <1438839848-505-3-git-send-email-vivien.didelot@savoirfairelinux.com>
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.
> } 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;
>
> if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr))
> goto nla_put_failure;
> --
> 2.4.6
>
next prev parent reply other threads:[~2015-08-06 6:28 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 [this message]
2015-08-06 14:19 ` Vivien Didelot
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=CAE4R7bBjYZtE-hj8b-0bRcA2bB0Sh+YXhtcmk2FuJu_qLB3xew@mail.gmail.com \
--to=sfeldma@gmail.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=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).