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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5571e217-b850-6c50-468b-a226c328f41a@gmail.com>
Date:   Tue, 25 Jan 2022 19:50:47 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Ansuel Smith <ansuelsmth@...il.com>, Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [RFC PATCH v7 13/16] net: dsa: qca8k: move page cache to driver
 priv



On 1/22/2022 5:33 PM, Ansuel Smith wrote:
> There can be multiple qca8k switch on the same system. Move the static
> qca8k_current_page to qca8k_priv and make it specific for each switch.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> ---
>   drivers/net/dsa/qca8k.c | 47 +++++++++++++++++++++++------------------
>   drivers/net/dsa/qca8k.h |  9 ++++++++
>   2 files changed, 36 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> index e7bc0770bae9..c2f5414033d8 100644
> --- a/drivers/net/dsa/qca8k.c
> +++ b/drivers/net/dsa/qca8k.c
> @@ -75,12 +75,6 @@ static const struct qca8k_mib_desc ar8327_mib[] = {
>   	MIB_DESC(1, 0xac, "TXUnicast"),
>   };
>   
> -/* The 32bit switch registers are accessed indirectly. To achieve this we need
> - * to set the page of the register. Track the last page that was set to reduce
> - * mdio writes
> - */
> -static u16 qca8k_current_page = 0xffff;
> -
>   static void
>   qca8k_split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page)
>   {
> @@ -134,11 +128,11 @@ qca8k_mii_write32(struct mii_bus *bus, int phy_id, u32 regnum, u32 val)
>   }
>   
>   static int
> -qca8k_set_page(struct mii_bus *bus, u16 page)
> +qca8k_set_page(struct mii_bus *bus, u16 page, u16 *cached_page)
>   {

bus->priv is assigned a qca8k_priv pointer, so we can just de-reference 
it here from bus->priv and avoid changing a whole bunch of function 
signatures that are now getting both a qca8k_priv *and* a 
qca8k_mdio_cache set of pointers when you can just use back pointers to 
those.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ