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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGVrzcb_ve=gOAnAo73-TqzZgWN6F3gr7Tu0BtWS8UBYQ2MciQ@mail.gmail.com>
Date:   Tue, 6 Jun 2017 19:38:45 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc:     netdev <netdev@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>,
        John Crispin <john@...ozen.org>,
        David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next v2 5/5] net: dsa: Stop accessing ds->dst->cpu_dp
 in drivers

2017-06-06 19:11 GMT-07:00 Vivien Didelot <vivien.didelot@...oirfairelinux.com>:
> Hi Florian,
>
> Florian Fainelli <f.fainelli@...il.com> writes:
>
>> +static inline struct dsa_port *dsa_ds_get_cpu_dp(struct dsa_switch *ds)
>> +{
>> +     return &ds->ports[fls(ds->cpu_port_mask) - 1];
>> +}
>
> So as I said in v2, now that a driver is guaranteed that dp->cpu_dp is
> correctly assigned at setup time, isn't better (especially for future
> multi-CPU support) to provide an helper which returns the CPU port for a
> given port? i.e. dsa_get_cpu_port(struct dsa_switch *ds, int port).
>
> Or is there something blocking? I might be wrong.

mt7530.c needs access to the CPU port at ops->setup() time which is
why this is still here.

>
> Note that I'm suggesting s/dsa_ds_get_cpu_dp/dsa_get_cpu_port/ since
> public DSA API does not need to use variable shortcuts such as ds or dp,
> but that's a minor suggestion?

We also have a dsa_dst_get_cpu_dp() but sure dsa_get_cpu_port() works for me.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ