From: Jiri Pirko <jiri@resnulli.us>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com,
idosch@mellanox.com, jakub.kicinski@netronome.com,
andrew@lunn.ch, vivien.didelot@gmail.com,
michael.chan@broadcom.com
Subject: Re: [patch net-next 11/12] dsa: pass switch ID through devlink_port_attrs_set()
Date: Mon, 1 Apr 2019 15:04:05 +0200 [thread overview]
Message-ID: <20190401130405.GA2655@nanopsycho> (raw)
In-Reply-To: <10e0e438-87b3-a1a4-d23c-98cd6f0dc3d3@gmail.com>
Fri, Mar 29, 2019 at 10:59:54PM CET, f.fainelli@gmail.com wrote:
>On 3/28/19 2:12 PM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> Pass the switch ID down the to devlink through devlink_port_attrs_set()
>> so it can be used by devlink_compat_switch_id_get(). Leave
>> ndo_get_port_parent_id implementation only for legacy.
>
>Nit you are passing the switch fabric id (dst->index), the switch id is
>in ds->index.
I'm doing the same as dsa_slave_get_port_parent_id() does. If it is
not correct, please fix it there.
>
>>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>> ---
>> net/dsa/dsa2.c | 4 +++-
>> net/dsa/slave.c | 1 -
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
>> index 514be0583642..410cb0da9def 100644
>> --- a/net/dsa/dsa2.c
>> +++ b/net/dsa/dsa2.c
>> @@ -260,6 +260,7 @@ static int dsa_port_setup(struct dsa_port *dp)
>> {
>> enum devlink_port_flavour flavour;
>> struct dsa_switch *ds = dp->ds;
>> + struct dsa_switch_tree *dst = ds->dst;
>> int err;
>>
>> if (dp->type == DSA_PORT_TYPE_UNUSED)
>> @@ -285,7 +286,8 @@ static int dsa_port_setup(struct dsa_port *dp)
>> * independent from front panel port numbers.
>> */
>> devlink_port_attrs_set(&dp->devlink_port, flavour,
>> - dp->index, false, 0, NULL, 0);
>> + dp->index, false, 0,
>> + (const char *) &dst->index, sizeof(dst->index));
>> err = devlink_port_register(ds->devlink, &dp->devlink_port,
>> dp->index);
>> if (err)
>> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
>> index 80be8e86c82d..026a4003d520 100644
>> --- a/net/dsa/slave.c
>> +++ b/net/dsa/slave.c
>> @@ -1130,7 +1130,6 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
>> .ndo_get_phys_port_name = dsa_slave_get_phys_port_name,
>> .ndo_setup_tc = dsa_slave_setup_tc,
>> .ndo_get_stats64 = dsa_slave_get_stats64,
>> - .ndo_get_port_parent_id = dsa_slave_get_port_parent_id,
>> .ndo_vlan_rx_add_vid = dsa_slave_vlan_rx_add_vid,
>> .ndo_vlan_rx_kill_vid = dsa_slave_vlan_rx_kill_vid,
>> .ndo_get_devlink_port = dsa_slave_get_devlink_port,
>>
>
>
>--
>Florian
next prev parent reply other threads:[~2019-04-01 13:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 21:12 [patch net-next 00/12] net: expose switch ID via devlink Jiri Pirko
2019-03-28 21:12 ` [patch net-next 01/12] net: devlink: convert devlink_port_attrs bools to bits Jiri Pirko
2019-03-28 21:12 ` [patch net-next 02/12] net: devlink: extend port attrs for switch ID Jiri Pirko
2019-03-28 21:12 ` [patch net-next 03/12] net: devlink: introduce devlink_compat_switch_id_get() helper Jiri Pirko
2019-03-28 21:12 ` [patch net-next 04/12] mlxsw: Pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 05/12] mlxsw: Remove ndo_get_port_parent_id implementation Jiri Pirko
2019-03-28 21:12 ` [patch net-next 06/12] bnxt: pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 07/12] bnxt: remove ndo_get_port_parent_id implementation for physical ports Jiri Pirko
2019-03-28 21:12 ` [patch net-next 08/12] nfp: pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 09/12] nfp: remove ndo_get_port_parent_id implementation Jiri Pirko
2019-03-28 21:12 ` [patch net-next 10/12] mlxsw: switch_ib: Pass valid HW id down to mlxsw_core_port_init() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 11/12] dsa: pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-29 21:59 ` Florian Fainelli
2019-04-01 13:04 ` Jiri Pirko [this message]
2019-03-28 21:12 ` [patch net-next 12/12] net: devlink: add warning for ndo_get_port_parent_id set when not needed Jiri Pirko
2019-03-28 21:40 ` [patch net-next 00/12] net: expose switch ID via devlink Jakub Kicinski
2019-03-29 6:49 ` Jiri Pirko
2019-03-29 18:59 ` Jakub Kicinski
2019-03-29 21:21 ` Jiri Pirko
2019-03-29 22:34 ` Jakub Kicinski
2019-03-30 7:35 ` Jiri Pirko
2019-03-30 19:49 ` Jakub Kicinski
2019-03-31 8:50 ` Jiri Pirko
2019-03-31 20:57 ` Jakub Kicinski
2019-03-29 21:29 ` Florian Fainelli
2019-03-29 21:57 ` Jakub Kicinski
2019-03-29 22:04 ` Florian Fainelli
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=20190401130405.GA2655@nanopsycho \
--to=jiri@resnulli.us \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=michael.chan@broadcom.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@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;
as well as URLs for NNTP newsgroup(s).