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: <20211007202955.vwasddyxouqy5ccw@skbuf>
Date:   Thu, 7 Oct 2021 23:29:55 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Prasanna Vengateshan <prasanna.vengateshan@...rochip.com>
Cc:     andrew@...n.ch, netdev@...r.kernel.org, robh+dt@...nel.org,
        UNGLinuxDriver@...rochip.com, Woojung.Huh@...rochip.com,
        hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
        kuba@...nel.org, linux-kernel@...r.kernel.org,
        vivien.didelot@...il.com, f.fainelli@...il.com,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v4 net-next 09/10] net: dsa: microchip: add support for
 fdb and mdb management

On Thu, Oct 07, 2021 at 08:41:59PM +0530, Prasanna Vengateshan wrote:
> Support for fdb_add, mdb_add, fdb_del, mdb_del and
> fdb_dump operations. ALU1 and ALU2 are used for fdb operations.
> 
> fdb_add: find any existing entries and update the port map.
> if ALU1 write is failed and attempt to write ALU2.
> If ALU2 is also failed then exit. Clear WRITE_FAIL for both ALU1
> & ALU2.
> 
> fdb_del: find the matching entry and clear the respective port
> in the port map by writing the ALU tables
> 
> fdb_dump: read and dump 2 ALUs upto last entry. ALU_START bit is
> used to find the last entry. If the read is timed out, then pass
> the error message.
> 
> mdb_add: Find the empty slot in ALU and update the port map &
> mac address by writing the ALU
> 
> mdb_del: find the matching entry and delete the respective port
> in port map by writing the ALU
> 
> For MAC address, could not use upper_32_bits() & lower_32_bits()
> as per Vladimir proposal since it gets accessed in terms of 16bits.
> I tried to have common API to get 16bits based on index but shifting
> seems to be straight-forward.
> 
> Signed-off-by: Prasanna Vengateshan <prasanna.vengateshan@...rochip.com>
> ---

Reviewed-by: Vladimir Oltean <olteanv@...il.com>

> +static int lan937x_port_fdb_dump(struct dsa_switch *ds, int port,
> +				 dsa_fdb_dump_cb_t *cb, void *data)
> +{

> +			if (alu.port_forward & BIT(port)) {
> +				ret = cb(alu.mac, alu.fid, alu.is_static, data);

A bit strange that you report the FID and not the VID here.

> +				if (ret)
> +					goto exit;
> +			}
> +		} while (lan937x_data & ALU_START);
> +
> +exit:
> +		/* stop ALU search & continue to next ALU if available */
> +		ret = ksz_write32(dev, REG_SW_ALU_CTRL(i), 0);
> +	}
> +
> +	mutex_unlock(&dev->alu_mutex);
> +
> +	return ret;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ