From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>
Subject: Re: [PATCH net-next v3 5/7] net: lan966x: Add lag support for lan966x.
Date: Sat, 2 Jul 2022 14:12:20 +0000 [thread overview]
Message-ID: <20220702141219.l75f46sx4hyldfyh@skbuf> (raw)
In-Reply-To: <20220701205227.1337160-6-horatiu.vultur@microchip.com>
On Fri, Jul 01, 2022 at 10:52:25PM +0200, Horatiu Vultur wrote:
> Add link aggregation hardware offload support for lan966x
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
Superficially the code looks OK (maybe if you could only remove the
trailing "." from the commit message). A comment below.
> +int lan966x_lag_port_prechangeupper(struct net_device *dev,
> + struct netdev_notifier_changeupper_info *info)
> +{
> + struct lan966x_port *port = netdev_priv(dev);
> + struct lan966x *lan966x = port->lan966x;
> + struct netdev_lag_upper_info *lui;
> + struct netlink_ext_ack *extack;
> +
> + extack = netdev_notifier_info_to_extack(&info->info);
> + lui = info->upper_info;
> + if (!lui)
> + return NOTIFY_DONE;
> +
> + if (lui->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
> + NL_SET_ERR_MSG_MOD(extack,
> + "LAG device using unsupported Tx type");
> + return notifier_from_errno(-EINVAL);
> + }
> +
> + switch (lui->hash_type) {
> + case NETDEV_LAG_HASH_L2:
> + lan_wr(ANA_AGGR_CFG_AC_DMAC_ENA_SET(1) |
> + ANA_AGGR_CFG_AC_SMAC_ENA_SET(1),
> + lan966x, ANA_AGGR_CFG);
> + break;
> + case NETDEV_LAG_HASH_L34:
> + lan_wr(ANA_AGGR_CFG_AC_IP6_TCPUDP_ENA_SET(1) |
> + ANA_AGGR_CFG_AC_IP4_TCPUDP_ENA_SET(1) |
> + ANA_AGGR_CFG_AC_IP4_SIPDIP_ENA_SET(1),
> + lan966x, ANA_AGGR_CFG);
> + break;
> + case NETDEV_LAG_HASH_L23:
> + lan_wr(ANA_AGGR_CFG_AC_DMAC_ENA_SET(1) |
> + ANA_AGGR_CFG_AC_SMAC_ENA_SET(1) |
> + ANA_AGGR_CFG_AC_IP6_TCPUDP_ENA_SET(1) |
> + ANA_AGGR_CFG_AC_IP4_TCPUDP_ENA_SET(1),
> + lan966x, ANA_AGGR_CFG);
ANA_AGGR_CFG is global to the switch, yet it constantly changes with the
hash_type of each new offloaded LAG. So a LAG that hashes on L3/L4 will
break the hash mode of an existing L2 LAG. I think you should implement
a system that disallows changes to ANA_AGGR_CFG as long as there are
users of a certain mode.
> + break;
> + default:
> + NL_SET_ERR_MSG_MOD(extack,
> + "LAG device using unsupported hash type");
> + return notifier_from_errno(-EINVAL);
> + }
> +
> + return NOTIFY_OK;
> +}
next prev parent reply other threads:[~2022-07-02 14:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 20:52 [PATCH net-next v3 0/7] net: lan966x: Add lag support Horatiu Vultur
2022-07-01 20:52 ` [PATCH net-next v3 1/7] net: lan966x: Add reqisters used to configure lag interfaces Horatiu Vultur
2022-07-02 14:30 ` Vladimir Oltean
2022-07-01 20:52 ` [PATCH net-next v3 2/7] net: lan966x: Split lan966x_fdb_event_work Horatiu Vultur
2022-07-02 14:08 ` Vladimir Oltean
2022-07-05 21:59 ` Horatiu Vultur
2022-07-01 20:52 ` [PATCH net-next v3 3/7] net: lan966x: Expose lan966x_switchdev_nb and lan966x_switchdev_blocking_nb Horatiu Vultur
2022-07-01 20:52 ` [PATCH net-next v3 4/7] net: lan966x: Extend lan966x_foreign_bridging_check Horatiu Vultur
2022-07-02 14:30 ` Vladimir Oltean
2022-07-01 20:52 ` [PATCH net-next v3 5/7] net: lan966x: Add lag support for lan966x Horatiu Vultur
2022-07-02 14:12 ` Vladimir Oltean [this message]
2022-07-05 18:38 ` kernel test robot
2022-07-06 8:45 ` Vladimir Oltean
2022-07-01 20:52 ` [PATCH net-next v3 6/7] net: lan966x: Extend FDB to support also lag Horatiu Vultur
2022-07-01 20:52 ` [PATCH net-next v3 7/7] net: lan966x: Extend MAC to support also lag interfaces Horatiu Vultur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220702141219.l75f46sx4hyldfyh@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horatiu.vultur@microchip.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox