lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190401130405.GA2655@nanopsycho>
Date:   Mon, 1 Apr 2019 15:04:05 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, mlxsw@...lanox.com,
        idosch@...lanox.com, jakub.kicinski@...ronome.com, andrew@...n.ch,
        vivien.didelot@...il.com, michael.chan@...adcom.com
Subject: Re: [patch net-next 11/12] dsa: pass switch ID through
 devlink_port_attrs_set()

Fri, Mar 29, 2019 at 10:59:54PM CET, f.fainelli@...il.com wrote:
>On 3/28/19 2:12 PM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@...lanox.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@...lanox.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ