From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7893AC02198 for ; Wed, 12 Feb 2025 23:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To: Content-Type:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=N6ufTQ+UPzzgBestUZjKF4q9YoZVKOh1u7P6OWeSFlI=; b=mfkCTm31LRCDNiHj9WZ26JnCmp 6ek+k7id0WEc4o/TPdpUE/QoSd9i4LRd6Wi1MdBodi/g9aVIgnDLqTk+7Cxz9MiGbKylPsV0PZ0wS BW00jnkpb03vSkb/yynu28mlfpJ8QwN0gXOtyVQUhkCZcX3BMnX9oOBQ1B9+oYAbbwYnuN6omYez7 VpravbGdXF6ZD+qJ4CvlR2WdG4HRAMMdcvAAcem9tMEBapluWzeeycPGR2h+nZYFvt/YqusWVP4Ti C/BHfISjX6trJaMJokWo6WYB6hd6LkDaL5mTEscaqFB3oo6HfBgv7KFxU45K2rMo6AGQfBEzR5K0A Pt0+oZkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tiLtE-000000098Rk-1f1q; Wed, 12 Feb 2025 23:11:32 +0000 Received: from mail-am6eur05on2068.outbound.protection.outlook.com ([40.107.22.68] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tiLrn-000000098Kz-24AR for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2025 23:10:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AKlngkmdNDJh/yWq7HGn2fmvOj5Lcg9zuALE5GeR1SbG/ktPlBMk+jC07PvIgou7Z8Dk7N8kZrfH08YreAQoNHWDkhCm671M630rMb4a3vpdwo7wlJNDlS+b6RK2mn1+xxgYQdKjq9hzj9b8mZC6p0ZKo2Tn3ZFowIVi8baxVuBaOISc9Oxfn2f8bOb1Xg8+pjbPtRZ5ysVHQgtEE6aubVqzOWkX6173aVqLLldBBN69TjTkZ43ZuCnx5Wwcc6SL2WGngzJKKXgd8Fby3/Mgrcr4N5SIoKZ5Da24czvny6wIGU76Nbaq6JF5KVUuSOVuZYxTPweh6ZcUth/1eI9Ayw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N6ufTQ+UPzzgBestUZjKF4q9YoZVKOh1u7P6OWeSFlI=; b=MumjsyksA1eoI118RJCtuNJB4lWSSequsHNQ6auqfp+XxBU+Te+qBMj3pa+LzoES0M8L/yyQMPaDUnF2Kmlu0edMCc+serH8yFH2KJvhED9LzXNvM3xLnKIDSyUWHeACvAa3muRxXNM1E2FjmwZwil+kwn5s9tTe5LI8prDGifoeNjLWTX5MYnoOIbqJBXTE8gqN0WJ6Jl5J1EjNSWNjhkIvGn7ROmWYITp/ZUWZdA++u8V8mzvaQxHU8EHZGMqn58Pjnce0rDbToe0F/RF5s2bwMlv/iKlG7ci/p1NduFokS02raSxi7Snk+P0zvVlAa/apc+bjIHe7OUWS7y2eOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N6ufTQ+UPzzgBestUZjKF4q9YoZVKOh1u7P6OWeSFlI=; b=EDhWvl4J27Hgq3Cx4yEMwh6N3llQMVbcWUt/me0lZWWytHPpyGls7+ypwyws5m3zXzMnuSr4ABK8F1CUGGXoOS2n1TJmHkh2jQt0NxPz+W/SeSR4vhjopyRPpktIDji9LiuOTC1fUAGYHebK0ab1FKzQ+kTP74BkzpQhxbY+y19PcWIoejJaYL6w7fBkrgmM7wuM+05QJ5nY80YoMNm9NY8UAgJZAo/Npf5WbGfhfUbylMUGbCnQVldG8mwNIaIXX6dCg0fu8JWTEvbIHn+dPRyUl5va51RkEvGlr3BXLXtTBX0i7iCIEnek3/2ltYDdOVvz/ig9mrgMuUI7bI6j8w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) by AS4PR04MB9550.eurprd04.prod.outlook.com (2603:10a6:20b:4f9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8445.12; Wed, 12 Feb 2025 23:09:55 +0000 Received: from AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2]) by AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2%6]) with mapi id 15.20.8445.013; Wed, 12 Feb 2025 23:09:55 +0000 Date: Thu, 13 Feb 2025 01:09:51 +0200 From: Vladimir Oltean To: Faizal Rahim Cc: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Simon Horman , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Furong Xu <0x1207@gmail.com>, Russell King , Serge Semin , Xiaolei Wang , Suraj Jaiswal , Kory Maincent , Gal Pressman , Jesper Nilsson , Andrew Halaney , Choong Yong Liang , Kunihiko Hayashi , Vinicius Costa Gomes , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org Subject: Re: [PATCH iwl-next v4 1/9] net: ethtool: mm: extract stmmac verification logic into common library Message-ID: <20250212230951.2lx7fba6avurmgls@skbuf> References: <20250210070207.2615418-1-faizal.abdul.rahim@linux.intel.com> <20250210070207.2615418-2-faizal.abdul.rahim@linux.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250210070207.2615418-2-faizal.abdul.rahim@linux.intel.com> X-ClientProxiedBy: VI1PR09CA0098.eurprd09.prod.outlook.com (2603:10a6:803:78::21) To AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7779:EE_|AS4PR04MB9550:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c1aa7b5-79d4-41e2-508f-08dd4bba5cbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/VbmTTswx1grzUsbL4w4FNmjYeduuirTcNDWJaFSYaEfRQUpVd8u7xSeNe0K?= =?us-ascii?Q?48iadAOqfqJfmxUwP/ehBKX0wEoSCmkI+TTUUpSazVovVr72vluBEra6ay7Z?= =?us-ascii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6cqKcS0jxHfoqBoPK0jbho/FLuxLP?= =?us-ascii?Q?3hnM92Dlyj+yLAgVFmxt8gwPZuL9JVrRdKOlHv6pZOHuIq+8wQsfyvDmxWCF?= =?us-ascii?Q?9fNyAEcNcm6rCsgsViTs6yZCy1JEkOWeeeBWENfLepRM13OlBqWHiKHszU8w?= =?us-ascii?Q?5U8HcBK9pgeIfh+qnDUniIPwVTYNnPU0T1sukNKXitBH8tFt4hMgedsK9qaS?= =?us-ascii?Q?tLJxX4h/qcvMsBrkYtvfTgr9F8AfYyKPmb8cdpdLB2jrsbqoe1/e5FPz5ANe?= =?us-ascii?Q?KKz8kqQ7e/MgrbCMweoytujZL1mgmxxqdcVpSQVlJykhUnpjhgG1oX9dR7l4?= =?us-ascii?Q?RITOmSV3dEpsuj+RQWLNmkG3UIet846iPC89IiK9SH5mZhfdOYy80qbYmtzX?= =?us-ascii?Q?HzcUp6DQhlAjPP1rbhKRI7RC73sB?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7779.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(366016)(7053199007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?p/uXpMvc55azn4LvZiYHOHDuW04DH1UyJA6zjl5s06dbW8OX8MEVAA7Seo+5?= =?us-ascii?Q?y8Rbr0sR01mwhSfkbnhdCfBuCMfYt0x8sI1XazUgygiLELc3NBBnIb3qJqzl?= =?us-ascii?Q?Qgi/vePsO1nu/BoIQBS2dn+nA+0jJSknDkshPw5XEu9zWffrDlZRy7kypuMg?= =?us-ascii?Q?FCORfBch3fRLiIOEfLZYLaI7cHWNnQNBaTWEPA5zdko46XOR05akTitpxL56?= =?us-ascii?Q?eVPcINFkjktyZY0qoBNIEd2bgKe8srj7Umx3lqY4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HHe3n3HGbhdsj0vYa/Vd2ZNENfUxuBDmPUtBRhzlRCwD65Rqmn?= =?us-ascii?Q?YWw4DNcFwB7+ov191omWaxD6olkHrf5Fl1LepQMWHRBuf6j4PvXVtHJUiQ/8?= =?us-ascii?Q?Fd8e8uwWUO6gusMn/Gb69ippvcHDlsqRi/Tly04XCCZE8SyjUNsYya+e+uC8?= =?us-ascii?Q?2oSkOe4/S92b9Pqb/XAbBdS2C3SXyBKIVdteFX6IIH6aSGl45Ptp6UU0ihSP?= =?us-ascii?Q?2Ug1usYPFHCHdng5Ukh0dgiIrQTtBeXOkKOf14cb5t7SdV6wu7l6U104htSl?= =?us-ascii?Q?OiURj1Du7EGppNM1Wq/BK2nZGRhFiyi/+VvdCqQsrqF6u0uaQBZpDlW2VZQn?= =?us-ascii?Q?sI8myPcq+4i/gEbyQCEQRW2l4w+AbnajFQ38GpeyDHXQ0RVohxupky8yYQ1I?= =?us-ascii?Q?6CILFs8mzMU+RPJ+yOpCs2bTr3Pw2EOJQfSklyhU0xfS93riDLtjyWwaqK5e?= =?us-ascii?Q?kw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c1aa7b5-79d4-41e2-508f-08dd4bba5cbd X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7779.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2025 23:09:55.0475 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qhM67HiNf4vrlXJrqZcsgT9iezgfER7q52NTJPqQXn2KVQRxtYFk0T0atQh2XqwMDW8XG1RohkINZSlpnc4T+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9550 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250212_151003_706958_AB1AFB16 X-CRM114-Status: GOOD ( 29.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 10, 2025 at 02:01:59AM -0500, Faizal Rahim wrote: > From: Vladimir Oltean > > It appears that stmmac is not the only hardware which requires a > software-driven verification state machine for the MAC Merge layer. > > While on the one hand it's good to encourage hardware implementations, > on the other hand it's quite difficult to tolerate multiple drivers > implementing independently fairly non-trivial logic. > > Extract the hardware-independent logic from stmmac into library code and > put it in ethtool. Name the state structure "mmsv" for MAC Merge > Software Verification. Let this expose an operations structure for > executing the hardware stuff: sync hardware with the tx_active boolean > (result of verification process), enable/disable the pMAC, send mPackets, > notify library of external events (reception of mPackets), as well as > link state changes. > > Note that it is assumed that the external events are received in hardirq > context. If they are not, it is probably a good idea to disable hardirqs > when calling ethtool_mmsv_event_handle(), because the library does not > do so. > > Also, the MM software verification process has no business with the > tx_min_frag_size, that is all the driver's to handle. > > Signed-off-by: Vladimir Oltean > Co-developed-by: Choong Yong Liang > Signed-off-by: Choong Yong Liang > Co-developed-by: Faizal Rahim > Signed-off-by: Faizal Rahim > Tested-by: Choong Yong Liang > --- > drivers/net/ethernet/stmicro/stmmac/stmmac.h | 16 +- > .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 41 +--- > .../net/ethernet/stmicro/stmmac/stmmac_fpe.c | 174 +++----------- > .../net/ethernet/stmicro/stmmac/stmmac_fpe.h | 5 - > .../net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +- > include/linux/ethtool.h | 61 +++++ > net/ethtool/mm.c | 222 ++++++++++++++++++ > 7 files changed, 327 insertions(+), 200 deletions(-) So I'm not exactly sure how this is supposed to work, but this is moving a non-negligible portion of code from stmmac_fpe.c which has Furong Xu's copyright, to ethtool/mm.c which doesn't. That being said, commit 8d43e99a5a03 ("net: stmmac: refactor FPE verification process") which added that logic said that it was co-developed together with me (NXP), and I clearly remember both of us contributing to it. So, how about expanding NXP's current 2022-2023 copyright in ethtool/mm.c to 2022-2025 (date of commit 8d43e99a5a03 plus date of this patch), and also copy Furong's copyright 2024 line? > @@ -710,6 +714,63 @@ struct ethtool_mm_stats { > u64 MACMergeHoldCount; > }; > > +enum ethtool_mmsv_event { > + ETHTOOL_MMSV_LP_SENT_VERIFY_MPACKET, > + ETHTOOL_MMSV_LD_SENT_VERIFY_MPACKET, > + ETHTOOL_MMSV_LP_SENT_RESPONSE_MPACKET, > +}; > + > +/* MAC Merge verification mPacket type */ > +enum ethtool_mpacket { > + ETHTOOL_MPACKET_VERIFY, > + ETHTOOL_MPACKET_RESPONSE, > +}; > + > +struct ethtool_mmsv; > + > +struct ethtool_mmsv_ops { Since these are driver-facing API, how about a kernel-doc? The content is subject to further review comments, of course. /** * struct ethtool_mmsv_ops - Operations for MAC Merge Software Verification * @configure_tx: Driver callback for the event where the preemptible TX * becomes active or inactive. Preemptible traffic * classes must be committed to hardware only while * preemptible TX is active. * @configure_pmac: Driver callback for the event where the pMAC state * changes as result of an administrative setting * (ethtool) or a call to ethtool_mmsv_link_state_handle(). * @send_mpacket: Driver-provided method for sending a Verify or a Response * mPacket. */ > + void (*configure_tx)(struct ethtool_mmsv *mmsv, bool tx_active); > + void (*configure_pmac)(struct ethtool_mmsv *mmsv, bool pmac_enabled); > + void (*send_mpacket)(struct ethtool_mmsv *mmsv, enum ethtool_mpacket mpacket); > +}; > + > +/** > + * struct ethtool_mmsv - MAC Merge Software Verification > + * @ops: operations for MAC Merge Software Verification > + * @dev: pointer to net_device structure > + * @lock: serialize access to MAC Merge state between > + * ethtool requests and link state updates. > + * @status: current verification FSM state > + * @verify_timer: timer for verification in local TX direction > + * @verify_enabled: indicates if verification is enabled > + * @verify_retries: number of retries for verification > + * @pmac_enabled: indicates if the preemptible MAC is enabled > + * @verify_time: time for verification in milliseconds > + * @tx_enabled: indicates if transmission is enabled > + */ > +struct ethtool_mmsv { > + const struct ethtool_mmsv_ops *ops; > + struct net_device *dev; > + spinlock_t lock; > + enum ethtool_mm_verify_status status; > + struct timer_list verify_timer; > + bool verify_enabled; > + int verify_retries; > + bool pmac_enabled; > + u32 verify_time; > + bool tx_enabled; > +}; > + /** * ethtool_mmsv_stop() - Stop MAC Merge Software Verification * @mmsv: MAC Merge Software Verification state * * Drivers should call this method in a state where the hardware is * about to lose state, like ndo_stop() or suspend(), and turning off * MAC Merge features would be superfluous. Otherwise, prefer * ethtool_mmsv_link_state_handle() with up=false. */ > +void ethtool_mmsv_stop(struct ethtool_mmsv *mmsv); /** * ethtool_mmsv_link_state_handle() - Inform MAC Merge Software Verification * of link state changes * @mmsv: MAC Merge Software Verification state * @up: True if device carrier is up and able to pass verification packets * * Calling context is expected to be from a thread, interrupts enabled. */ > +void ethtool_mmsv_link_state_handle(struct ethtool_mmsv *mmsv, bool up); /** * ethtool_mmsv_event_handle() - Inform MAC Merge Software Verification * of interrupt-based events * @mmsv: MAC Merge Software Verification state * @event: Event which took place (packet transmission or reception) * * Calling context expects to have interrupts disabled. */ > +void ethtool_mmsv_event_handle(struct ethtool_mmsv *mmsv, > + enum ethtool_mmsv_event event); /** * ethtool_mmsv_get_mm() - get_mm() hook for MAC Merge Software Verification * @mmsv: MAC Merge Software Verification state * @state: see struct ethtool_mm_state * * Drivers are expected to call this from their ethtool_ops :: get_mm() * method. */ > +void ethtool_mmsv_get_mm(struct ethtool_mmsv *mmsv, > + struct ethtool_mm_state *state); /** * ethtool_mmsv_set_mm() - set_mm() hook for MAC Merge Software Verification * @mmsv: MAC Merge Software Verification state * @state: see struct ethtool_mm_state * * Drivers are expected to call this from their ethtool_ops :: set_mm() * method. */ > +void ethtool_mmsv_set_mm(struct ethtool_mmsv *mmsv, struct ethtool_mm_cfg *cfg); /** * ethtool_mmsv_init() - Initialize MAC Merge Software Verification state * @mmsv: MAC Merge Software Verification state * @dev: Pointer to network interface * @ops: Methods for implementing the generic functionality * * The MAC Merge Software Verification is a timer- and event-based state * machine intended for network interfaces which lack a hardware-based * TX verification process (as per IEEE 802.3 clause 99.4.3). The timer * is managed by the core code, whereas events are supplied by the * driver explicitly calling one of the other API functions. */ > +void ethtool_mmsv_init(struct ethtool_mmsv *mmsv, struct net_device *dev, > + const struct ethtool_mmsv_ops *ops); > + > /** > * struct ethtool_rxfh_param - RXFH (RSS) parameters > * @hfunc: Defines the current RSS hash function used by HW (or to be set to).