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: <20240530190825.GC123401@kernel.org>
Date: Thu, 30 May 2024 20:08:25 +0100
From: Simon Horman <horms@...nel.org>
To: MD Danish Anwar <danishanwar@...com>
Cc: Dan Carpenter <dan.carpenter@...aro.org>,
	Diogo Ivo <diogo.ivo@...mens.com>,
	Jan Kiszka <jan.kiszka@...mens.com>, Andrew Lunn <andrew@...n.ch>,
	Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	"David S. Miller" <davem@...emloft.net>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, srk@...com,
	Vignesh Raghavendra <vigneshr@...com>, r-gunasekaran@...com,
	Roger Quadros <rogerq@...nel.org>
Subject: Re: [RFC PATCH net-next 2/2] net: ti: icssg-prueth: Add multicast
 filtering support

On Thu, May 16, 2024 at 02:47:52PM +0530, MD Danish Anwar wrote:
> Add multicast filtering support for ICSSG Driver.
> 
> Signed-off-by: MD Danish Anwar <danishanwar@...com>
> ---
>  drivers/net/ethernet/ti/icssg/icssg_config.c | 16 +++++--
>  drivers/net/ethernet/ti/icssg/icssg_prueth.c | 50 ++++++++++++++++++--
>  drivers/net/ethernet/ti/icssg/icssg_prueth.h |  3 ++
>  3 files changed, 62 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_config.c b/drivers/net/ethernet/ti/icssg/icssg_config.c
> index 2213374d4d45..4e30bb995078 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_config.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_config.c
> @@ -318,17 +318,27 @@ static int prueth_emac_buffer_setup(struct prueth_emac *emac)
>  
>  static void icssg_init_emac_mode(struct prueth *prueth)
>  {
> +	u32 addr = prueth->shram.pa + VLAN_STATIC_REG_TABLE_OFFSET;
>  	/* When the device is configured as a bridge and it is being brought
>  	 * back to the emac mode, the host mac address has to be set as 0.
>  	 */
>  	u8 mac[ETH_ALEN] = { 0 };
> +	int i;
>  
>  	if (prueth->emacs_initialized)
>  		return;
>  
> -	regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1,
> -			   SMEM_VLAN_OFFSET_MASK, 0);
> -	regmap_write(prueth->miig_rt, FDB_GEN_CFG2, 0);
> +	/* Set VLAN TABLE address base */
> +	regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, SMEM_VLAN_OFFSET_MASK,
> +			   addr <<  SMEM_VLAN_OFFSET);
> +	/* Configure CFG2 register */
> +	regmap_write(prueth->miig_rt, FDB_GEN_CFG2, (FDB_PRU0_EN | FDB_PRU1_EN | FDB_HOST_EN));
> +
> +	prueth->vlan_tbl = prueth->shram.va + VLAN_STATIC_REG_TABLE_OFFSET;
> +	for (i = 0; i < SZ_4K - 1; i++) {
> +		prueth->vlan_tbl[i].fid = i;
> +		prueth->vlan_tbl[i].fid_c1 = 0;
> +	}

Hi MD,

This isnot a full review, but I did notice one thing.

According to Sparse, prueth->shram.va is __iomem.
I don't think it is portable to directly access __iomem like this.
Rather, I suspect that either ioremap(), or writel() or similar should be used.

>  	/* Clear host MAC address */
>  	icssg_class_set_host_mac_addr(prueth->miig_rt, mac);
>  }

..

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ