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 B52CDD1037E for ; Wed, 26 Nov 2025 06:18:06 +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:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=njRL/wp1iCkqO69EYYorLtrNKLXhDungO1SZ8XuDZA4=; b=l94swZBaN4tsA3W//KegTxxHFR jV3Ewj6jO4t5PVrZSw0a5UILToxvox+kPcxJO3En/czTOFjUvJj5b//lvnLkmI3YvSZjZucPJM3g2 ZO0r5ZCnHJhbjtTJyLfMhPEKilGjfCmBImXqDcxgv3TBA1S9XxZuEjOUDST2+aOwZleXs/a/YJPHo 8Qa3fHSLkIWljUmpIbRoJQBJtjUAPEyO4A8NUoDIderW6+HeNbykBHdzLiZ4Q3c5dEBKaQ4Um4BNu iK5NmLa4j+tRmDirgibN0Xii6OWIfqGZRqPXkYfD3q0dlCyGjbijxIHpWe1QGuLpMMiMDkdlvB0kS 6rWxmYlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vO8qm-0000000EQms-121v; Wed, 26 Nov 2025 06:18:00 +0000 Received: from server.couthit.com ([162.240.164.96]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vO8qi-0000000EQlB-1Aho for linux-arm-kernel@lists.infradead.org; Wed, 26 Nov 2025 06:17:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=couthit.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=njRL/wp1iCkqO69EYYorLtrNKLXhDungO1SZ8XuDZA4=; b=2l2h4cR5ky5UT9XKYNwy6qYVCs EdUZbSUh33sqPEbmFDUcMNYEuBH57fiRShFcqlYAybcHXehJ0zKE0JMofbMDm8AXPFIQjG0VxhSYY uPtjR7jqeSlw9InYP2ZwLOceL2BsOYajBJBn75xe7E+Rmg9gSdOWPdgeiSVXQKOjBB3nbHXDMAFh3 SYnLiJBt0D48nISo0G6xN8TFviRGHu+XKASW/5n8u0oijbSCwNSNiqyDd6D+VxbYyEe9MHUDjJWob chj/IQmppUdrs66AdVGGY99JQmJMn+DyW2kcuQttfgyimLcl3B1pKhLGvvKkkRzkvRoYndO7MlaHo FeTR4p+g==; Received: from [122.175.9.182] (port=41747 helo=zimbra.couthit.local) by server.couthit.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1vO8pz-0000000CBjb-49pf; Wed, 26 Nov 2025 01:17:12 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.couthit.local (Postfix) with ESMTP id 762FE1A820EA; Wed, 26 Nov 2025 11:47:04 +0530 (IST) Received: from zimbra.couthit.local ([127.0.0.1]) by localhost (zimbra.couthit.local [127.0.0.1]) (amavis, port 10032) with ESMTP id 1-IdLgzFHwXl; Wed, 26 Nov 2025 11:47:04 +0530 (IST) Received: from localhost (localhost [127.0.0.1]) by zimbra.couthit.local (Postfix) with ESMTP id 21E931A820E7; Wed, 26 Nov 2025 11:47:04 +0530 (IST) X-Virus-Scanned: amavis at couthit.local Received: from zimbra.couthit.local ([127.0.0.1]) by localhost (zimbra.couthit.local [127.0.0.1]) (amavis, port 10026) with ESMTP id qG9HVHOSzlBM; Wed, 26 Nov 2025 11:47:04 +0530 (IST) Received: from zimbra.couthit.local (zimbra.couthit.local [10.10.10.103]) by zimbra.couthit.local (Postfix) with ESMTP id F405A1A820EA; Wed, 26 Nov 2025 11:47:03 +0530 (IST) Date: Wed, 26 Nov 2025 11:47:03 +0530 (IST) From: Parvathi Pudi To: Jakub Kicinski Cc: Parvathi Pudi , andrew+netdev , davem , edumazet , pabeni , danishanwar , rogerq , pmohan , basharath , afd , linux-kernel , netdev , linux-arm-kernel , ALOK TIWARI , horms , pratheesh , j-rameshbabu , Vignesh Raghavendra , praneeth , srk , rogerq , krishna , mohan Message-ID: <1268174479.21081.1764137823922.JavaMail.zimbra@couthit.local> In-Reply-To: <20251124200322.615773bb@kernel.org> References: <20251124135800.2219431-1-parvathi@couthit.com> <20251124135800.2219431-3-parvathi@couthit.com> <20251124200322.615773bb@kernel.org> Subject: Re: [PATCH net-next v6 2/3] net: ti: icssm-prueth: Adds switchdev support for icssm_prueth driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.10.10.233] X-Mailer: Zimbra 9.0.0_ZEXTRAS_20240927 (ZimbraWebClient - GC138 (Linux)/9.0.0_ZEXTRAS_20240927) Thread-Topic: icssm-prueth: Adds switchdev support for icssm_prueth driver Thread-Index: MhmPbhazM+vc1QgT/0XqLnqRaUMf+A== X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.couthit.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - couthit.com X-Get-Message-Sender-Via: server.couthit.com: authenticated_id: smtp@couthit.com X-Authenticated-Sender: server.couthit.com: smtp@couthit.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251125_221756_359649_C61FADFB X-CRM114-Status: UNSURE ( 7.05 ) X-CRM114-Notice: Please train this message. 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 Hi, > On Mon, 24 Nov 2025 19:25:11 +0530 Parvathi Pudi wrote: >> Subject: [PATCH net-next v6 2/3] net: ti: icssm-prueth: Adds switchdev s= upport >> for icssm_prueth driver >=20 > Adds -> Add >=20 >> This patch adds support for offloading the RSTP switch feature to the >=20 > s/This patch adds/Add/ >=20 > imperative mood, please.. >=20 Sure, we will address this in the next version. >> +static void icssm_prueth_sw_fdb_work(struct work_struct *work) >> +{ >> +=09struct icssm_prueth_sw_fdb_work *fdb_work =3D >> +=09=09container_of(work, struct icssm_prueth_sw_fdb_work, work); >> +=09struct prueth_emac *emac =3D fdb_work->emac; >> + >> +=09rtnl_lock(); >> + >> +=09/* Interface is not up */ >> +=09if (!emac->prueth->fdb_tbl) >> +=09=09goto free; >> + >> +=09switch (fdb_work->event) { >> +=09case FDB_LEARN: >> +=09=09icssm_prueth_sw_insert_fdb_entry(emac, fdb_work->addr, 0); >> +=09=09break; >> +=09case FDB_PURGE: >> +=09=09icssm_prueth_sw_do_purge_fdb(emac); >> +=09=09break; >> +=09default: >> +=09=09break; >> +=09} >> + >> +free: >> +=09rtnl_unlock(); >> +=09kfree(fdb_work); >> +=09dev_put(emac->ndev); >=20 > please use netdev_put() and a netdev tracker >=20 We will replace dev_put() with netdev_put() as shown below and add a netdevice_tracker to the icssm_prueth_sw_fdb_work struct. "netdev_put(emac->ndev, &fdb_work=E2=86=92ndev_tracker);" We will address this in the next version. >> +} >> + >> +int icssm_prueth_sw_learn_fdb(struct prueth_emac *emac, u8 *src_mac) >> +{ >> +=09struct icssm_prueth_sw_fdb_work *fdb_work; >> + >> +=09fdb_work =3D kzalloc(sizeof(*fdb_work), GFP_ATOMIC); >> +=09if (WARN_ON(!fdb_work)) >> +=09=09return -ENOMEM; >> + >> +=09INIT_WORK(&fdb_work->work, icssm_prueth_sw_fdb_work); >> + >> +=09fdb_work->event =3D FDB_LEARN; >> +=09fdb_work->emac =3D emac; >> +=09ether_addr_copy(fdb_work->addr, src_mac); >> + >> +=09dev_hold(emac->ndev); >=20 > same here. >=20 > This significantly helps debugging in case some code leaks a reference. > -- > pw-bot: cr Here as well, we will replace dev_hold() with netdev_hold() as shown below and will address this in next version. "netdev_hold(emac->ndev, &fdb_work->ndev_tracker, GFP_ATOMIC);" Thanks and Regards, Parvathi.