[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZG3Wp2HhwLrwpvHq@corigine.com>
Date: Wed, 24 May 2023 11:19:35 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Justin Chen <justin.chen@...adcom.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
bcm-kernel-feedback-list@...adcom.com, justinpopo6@...il.com,
f.fainelli@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, opendmb@...il.com,
andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
richardcochran@...il.com, sumit.semwal@...aro.org,
christian.koenig@....com, conor@...nel.org,
Florian Fainelli <florian.fainelli@...adcom.com>
Subject: Re: [PATCH net-next v4 3/6] net: bcmasp: Add support for ASP2.0
Ethernet controller
On Tue, May 23, 2023 at 02:53:44PM -0700, Justin Chen wrote:
> Add support for the Broadcom ASP 2.0 Ethernet controller which is first
> introduced with 72165. This controller features two distinct Ethernet
> ports that can be independently operated.
>
> This patch supports:
>
> - Wake-on-LAN using magic packets
> - basic ethtool operations (link, counters, message level)
> - MAC destination address filtering (promiscuous, ALL_MULTI, etc.)
>
> Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Signed-off-by: Justin Chen <justin.chen@...adcom.com>
Hi Justin,
Reviewed-by: Simon Horman <simon.horman@...igine.com>
As I see there will be a v5 I have added a few nits from my side.
Feel free to ignore them as you see fit.
...
> +int bcmasp_netfilt_check_dup(struct bcmasp_intf *intf,
> + struct ethtool_rx_flow_spec *fs)
nit: the return type of this function could be bool
> +{
> + struct bcmasp_priv *priv = intf->parent;
> + struct ethtool_rx_flow_spec *cur;
> + size_t fs_size = 0;
> + int i;
> +
> + for (i = 0; i < NUM_NET_FILTERS; i++) {
> + if (!priv->net_filters[i].claimed ||
> + priv->net_filters[i].port != intf->port)
> + continue;
> +
> + cur = &priv->net_filters[i].fs;
> +
> + if (cur->flow_type != fs->flow_type ||
> + cur->ring_cookie != fs->ring_cookie)
> + continue;
> +
> + switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {
> + case ETHER_FLOW:
> + fs_size = sizeof(struct ethhdr);
> + break;
> + case IP_USER_FLOW:
> + fs_size = sizeof(struct ethtool_usrip4_spec);
> + break;
> + case TCP_V6_FLOW:
> + case UDP_V6_FLOW:
> + fs_size = sizeof(struct ethtool_tcpip6_spec);
> + break;
> + case TCP_V4_FLOW:
> + case UDP_V4_FLOW:
> + fs_size = sizeof(struct ethtool_tcpip4_spec);
> + break;
> + default:
> + continue;
> + }
> +
> + if (memcmp(&cur->h_u, &fs->h_u, fs_size) ||
> + memcmp(&cur->m_u, &fs->m_u, fs_size))
> + continue;
> +
> + if (cur->flow_type & FLOW_EXT) {
> + if (cur->h_ext.vlan_etype != fs->h_ext.vlan_etype ||
> + cur->m_ext.vlan_etype != fs->m_ext.vlan_etype ||
> + cur->h_ext.vlan_tci != fs->h_ext.vlan_tci ||
> + cur->m_ext.vlan_tci != fs->m_ext.vlan_tci ||
> + cur->h_ext.data[0] != fs->h_ext.data[0])
> + continue;
> + }
> + if (cur->flow_type & FLOW_MAC_EXT) {
> + if (memcmp(&cur->h_ext.h_dest,
> + &fs->h_ext.h_dest, ETH_ALEN) ||
> + memcmp(&cur->m_ext.h_dest,
> + &fs->m_ext.h_dest, ETH_ALEN))
> + continue;
> + }
> +
> + return 1;
> + }
> +
> + return 0;
> +}
...
> +static int bcmasp_is_port_valid(struct bcmasp_priv *priv, int port)
> +{
> + /* Quick sanity check
> + * Ports 0/1 reserved for unimac
> + * Max supported ports is 2
> + */
> + return (port == 0 || port == 1);
nit: unnecessary parentheses
> +}
...
Powered by blists - more mailing lists