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]
Date:   Fri, 17 Dec 2021 18:12:35 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Horatiu Vultur <horatiu.vultur@...rochip.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "vivien.didelot@...il.com" <vivien.didelot@...il.com>,
        "andrew@...n.ch" <andrew@...n.ch>
Subject: Re: [PATCH net-next v7 9/9] net: lan966x: Extend switchdev with fdb
 support

On Fri, Dec 17, 2021 at 04:53:53PM +0100, Horatiu Vultur wrote:
> Extend lan966x driver with fdb support by implementing the switchdev
> calls SWITCHDEV_FDB_ADD_TO_DEVICE and SWITCHDEV_FDB_DEL_TO_DEVICE.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
> ---

Looks pretty good. Just one question, since I can't figure this out by
looking at the code. Is the CPU port in the unknown unicast flood mask
currently?

>  .../net/ethernet/microchip/lan966x/Makefile   |   2 +-
>  .../ethernet/microchip/lan966x/lan966x_fdb.c  | 244 ++++++++++++++++++
>  .../ethernet/microchip/lan966x/lan966x_main.c |   5 +
>  .../ethernet/microchip/lan966x/lan966x_main.h |  14 +
>  .../microchip/lan966x/lan966x_switchdev.c     |  21 ++
>  .../ethernet/microchip/lan966x/lan966x_vlan.c |  15 +-
>  6 files changed, 298 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c
(...)
> +static void lan966x_fdb_add_entry(struct lan966x *lan966x,
> +				  struct switchdev_notifier_fdb_info *fdb_info)
> +{
> +	struct lan966x_fdb_entry *fdb_entry;
> +
> +	fdb_entry = lan966x_fdb_find_entry(lan966x, fdb_info);
> +	if (fdb_entry) {
> +		fdb_entry->references++;
> +		return;
> +	}
> +
> +	fdb_entry = kzalloc(sizeof(*fdb_entry), GFP_KERNEL);
> +	if (!fdb_entry)
> +		return;
> +
> +	memcpy(fdb_entry->mac, fdb_info->addr, ETH_ALEN);

ether_addr_copy

> +	fdb_entry->vid = fdb_info->vid;
> +	fdb_entry->references = 1;
> +	list_add_tail(&fdb_entry->list, &lan966x->fdb_entries);
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ