Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1595284lqm; Thu, 2 May 2024 23:28:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDi3ILfaAwlDMXxOgaKTqS7jrhJ5gImFGX9Uei8aXQd4iVy6Gj74UM7mi5wipq8Vjo56D+UnmsX26pKR/K96ZRlCC6ipU18mda8wKtRw== X-Google-Smtp-Source: AGHT+IEQd/+BXm7B32MvsqXHmRe6GuefT8dNZuXN9jMpN1f+QZq7cKoRnsixeO7zQACnggAjhvXR X-Received: by 2002:a05:6a00:2d8c:b0:6ec:ea4b:f07a with SMTP id fb12-20020a056a002d8c00b006ecea4bf07amr1864887pfb.34.1714717719778; Thu, 02 May 2024 23:28:39 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z1-20020a63ac41000000b0061c7f02da7fsi993128pgn.584.2024.05.02.23.28.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 23:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=selector1 header.b="n/cyHSrc"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-167282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 659AB280A64 for ; Fri, 3 May 2024 06:28:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6382A13A41A; Fri, 3 May 2024 06:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=marvell.com header.i=@marvell.com header.b="n/cyHSrc" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5D6413A27D; Fri, 3 May 2024 06:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.148.174 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714717694; cv=fail; b=hgynz7EWssxV3aY0aY744y7UeOvJHDIhM8uJS+tmpBkoARXjYVfw64gIhCfJFr/hKjPNnUKJyUkPy680B5nr3qmoje+YOtLjBmpcKFJX61U1ie0zSylfiTNBH+8d3YOM+5uY6ngdp6c0e0a7Bkpqd4SZ0sqFtLdYhN88ucG/rEQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714717694; c=relaxed/simple; bh=uHHI/Co9VSu7AHyfntVKWHTviJgAUXNLqwcQhUgYvkU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Q+oXrG7jEuRDUTY1y+RQsuavMki7s9ZTEulGtoNMhOhbL+zJhZLaCdBD5zB7Y9LVOCLasZEHcMaFrrLcIccm1CwcFftv7GHlYBoERdPr5SdHKKxqRLfHl53/LnD8GcYGWugfQe4z2U8jsNrQQQUZEDCPcEK/FQlH3Nb+I2CPiAE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (1024-bit key) header.d=marvell.com header.i=@marvell.com header.b=n/cyHSrc; arc=fail smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4432aN5C000848; Thu, 2 May 2024 23:27:53 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3xvgsej17k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 May 2024 23:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jj8KK7k4W4lF8AABR5NhzhObkLnxsqtfGnH8B3FIUxE60Kxf0k51tNxRb4gRMHor8FmLPC9n5JwcjUeatABX5NmNf9aPwEJldUBLZfijwAHTexor/OcGazAtWMmkDjqb5a8BccwdMIq7f1juO7h3eLdiMdR/d8c5rW+du+V+AHlBESVx/Mr4kZS93ab/YyOrJZncAKTzvQnEMtiT2PtAIwZjz03Q7N0PRP3mR/ytSUqFjXYrawN9u11cFDSE+AGIeW6Hz+Qo1SkwuWDOjrsWz2q0q70J0V4F7etrLhDuO4bU3VGXjM1s1qcU76jmym+5EjNI8MDEVcYztPYDhrqkNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=tuStAyg4g9ZSBDRujsS8Q4etabe0bHbRNcYKgac6QLM=; b=f1Xv5pBUyZQzMCVHzue8t+B6OQ1opZoMjuOcDWbXl4v+CVTfKjbnUUyRIinGZncKPBL/jS6DCo4NmSXA+RLIYqJu966qsyrDq0BF8COynHnaWRgfZMPbdbH/xQmtgi30c7haeejdASMM9Ic4Lf4cdkSqs9YeDJHvZBYIz57C/zJ/Ue2J5NvhORjXTTqZvPSMzh6jm9V92w6acrrKADVFtkM6soiEcyW95GOxiLO+mux6sVKonYBy2cCyNTVxM00JQrm7yrZm9L9u5PIzQd2ZqaYRyrnivT2lOtNLFMJTFcbLNKXF8Z8llv+rpRzlSbDc9zEPonzzpEMarOaaNg078g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tuStAyg4g9ZSBDRujsS8Q4etabe0bHbRNcYKgac6QLM=; b=n/cyHSrcfuJDsH0Yv0yXImq/Ed+59iAUFY9awefeyQWEH/i/IvT/BSU3XP/BLQEtWdZZ4q8EfQe5AKUOBGF5aFZqia8kgKGUrj6ZALaswLP3DamdU8nvDelgJ1MvfCfapui5f05T0e7DSo8tJzDG2D7CWziVT5iNPA6O0tCyxBw= Received: from CH0PR18MB4339.namprd18.prod.outlook.com (2603:10b6:610:d2::17) by DM4PR18MB5025.namprd18.prod.outlook.com (2603:10b6:8:50::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.40; Fri, 3 May 2024 06:27:48 +0000 Received: from CH0PR18MB4339.namprd18.prod.outlook.com ([fe80::61a0:b58d:907c:16af]) by CH0PR18MB4339.namprd18.prod.outlook.com ([fe80::61a0:b58d:907c:16af%5]) with mapi id 15.20.7544.023; Fri, 3 May 2024 06:27:48 +0000 From: Geethasowjanya Akula To: Simon Horman CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kuba@kernel.org" , "davem@davemloft.net" , "pabeni@redhat.com" , "edumazet@google.com" , Sunil Kovvuri Goutham , Subbaraya Sundeep Bhatta , Hariprasad Kelam , Dan Carpenter Subject: RE: [EXTERNAL] Re: [net-next PATCH v3 3/9] octeontx2-pf: Create representor netdev Thread-Topic: [EXTERNAL] Re: [net-next PATCH v3 3/9] octeontx2-pf: Create representor netdev Thread-Index: AQHamVpOk4r/tpYYKkK9e3oUMm7yXbGCsf8AgAJhACA= Date: Fri, 3 May 2024 06:27:48 +0000 Message-ID: References: <20240428105312.9731-1-gakula@marvell.com> <20240428105312.9731-4-gakula@marvell.com> <20240501180656.GX2575892@kernel.org> In-Reply-To: <20240501180656.GX2575892@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH0PR18MB4339:EE_|DM4PR18MB5025:EE_ x-ms-office365-filtering-correlation-id: 294c8844-42c7-448e-5375-08dc6b3a26e2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?xGWtck8RewzSau2U49d8GbCyGXf/3dsZKcNDQzYn4+PXS+hwkyKZGVnhbJEu?= =?us-ascii?Q?LK3M7DJurrZ5ynyrW4jLNQn4ZIk8nxb80jGUY1qD8BtEXfYUucjNQpk+RbPS?= =?us-ascii?Q?nYf9HomYDO4/A00kh6s0l6pB6CGvVy+5a+0sUbCFoPFFTT5cvx53EQoxNphP?= =?us-ascii?Q?/yVmUd9NGSOJM+piYvV6/Fw+dR4JjPEzNnHPqH2GrcXpWHmQfHHuQjqidRVB?= =?us-ascii?Q?xgiUtBhqYNjJBZWqbSMKM4Mf0iKjCZqS9zLowHtR48mMAq5skzDeg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3fAXnK5JWDwATmXvkmAMRfNtVeS569B?= =?us-ascii?Q?xZldiJdqcMIHg58ltGkU6LgP/s0XYpDRkTrNQfhRXXXJKpDj0HJjKA3/AXzJ?= =?us-ascii?Q?ZsGjYGXXeKV7XO0SR/G6sMY1h8CX5KwYHpRrNHLML7INg1inNEbvmBWcdRrO?= =?us-ascii?Q?4so+VbHiwn/ANZcEM6ctbtg/hi+bOkcvJ3joY/6JZU9c/A=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR18MB4339.namprd18.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vCzrdfQD1NbmrHEsln9FEqvlZpXCdwV5wBhNUV3ZHPRne0bXihaczMv9ARX8?= =?us-ascii?Q?jXReFz3tUC7S6zZx+gJROfebEjBqzL8gfNkogSudLG2X4pS3z/Mtjxs6R/wW?= =?us-ascii?Q?7EQwXt4SL5Q/d4CqH7LuNuIahcuTW8Xh0kMPpCXZEJqgzZDql9cJgGhrfUhb?= =?us-ascii?Q?53UZZK5SG/AWJ4uUtF7t9RK4L0wFdB0LyEV7RfR9/nJs+Jkj2LXo9duwRV2E?= =?us-ascii?Q?TunQTJAIFGf0O9ukpADWtvfSlQKDj39caZBh+leeAl8V7wGhcWl97uB69D5u?= =?us-ascii?Q?w6sgbkWYKLRldfMeRtBSuQe4XPEzaXvuzzDDqpe1fp/R0rDuNpqz6T0ZU4+I?= =?us-ascii?Q?SRGwrjn576uePi3EiqoSJfKuTJbg5LsN1mzr8H76g/p/B4O9Z6W6uJQIb3+6?= =?us-ascii?Q?Oac6GxLYtYTm9L2trku7sFDC7+6/LM17lxxmjWwuhyj8LUHA7np4BFmt04M4?= =?us-ascii?Q?d2Ajwu7jKeqbOvjdG20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xxchYirqWERP5Uzl?= =?us-ascii?Q?w9G7g0drUylkWpj8YB52T9DjAtJ6FzXZ7XMHE5EpWs2X55pu58GeRUlWea5X?= =?us-ascii?Q?rtWDjtEYQT7/t9/VdpPv4nphb6RAkZdDKsKBHcAuPJSdgMY0szisBiQ8hAmd?= =?us-ascii?Q?Wby5G58hkipgeSqBRkr8lkTYM6da9sjOLhxiFZhPHGj93iT0tjnqgeBnRgN2?= =?us-ascii?Q?F4a5AhD+t4qWt6jQH4s=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR18MB4339.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 294c8844-42c7-448e-5375-08dc6b3a26e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2024 06:27:48.4221 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FnCBj+vSYdpa5eH48Q7Y6bCjtzN7m/Cu4/grRVJqQLw5OU5p3DdMnlJjEaCeAGPC58FTttGKJZbvu79o4BQJqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR18MB5025 X-Proofpoint-GUID: 5iYlxl8ll2iZFfdQrO_EosAZz70wmjaM X-Proofpoint-ORIG-GUID: 5iYlxl8ll2iZFfdQrO_EosAZz70wmjaM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-03_03,2024-05-03_01,2023-05-22_02 > -----Original Message----- > From: Simon Horman > Sent: Wednesday, May 1, 2024 11:37 PM > To: Geethasowjanya Akula > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; kuba@kernel.org= ; > davem@davemloft.net; pabeni@redhat.com; edumazet@google.com; Sunil > Kovvuri Goutham ; Subbaraya Sundeep Bhatta > ; Hariprasad Kelam ; Dan > Carpenter > Subject: [EXTERNAL] Re: [net-next PATCH v3 3/9] octeontx2-pf: Create > representor netdev >=20 > ---------------------------------------------------------------------- > + Dan Carpenter >=20 > On Sun, Apr 28, 2024 at 04:23:06PM +0530, Geetha sowjanya wrote: > > Adds initial devlink support to set/get the switchdev mode. > > Representor netdevs are created for each rvu devices when the switch > > mode is set to 'switchdev'. These netdevs are be used to control and > > configure VFs. > > > > Signed-off-by: Geetha sowjanya >=20 > Hi Geetha, >=20 > Some minor feedback from my side. >=20 > ... >=20 > > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c > > b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c >=20 > ... >=20 > > +int rvu_rep_create(struct otx2_nic *priv, struct netlink_ext_ack > > +*extack) { > > + int rep_cnt =3D priv->rep_cnt; > > + struct net_device *ndev; > > + struct rep_dev *rep; > > + int rep_id, err; > > + u16 pcifunc; > > + > > + priv->reps =3D devm_kcalloc(priv->dev, rep_cnt, sizeof(struct > > +rep_dev), GFP_KERNEL); >=20 > It looks like the size argument should be sizeof(struct rep_dev *) or > sizeof(*priv->reps). >=20 > Flagged by Coccinelle. >=20 > Please consider limiting lines in Networking code to 80 columns wide wher= e it > can be achieved without too much bother. Ack. Will fix it in next version. >=20 > > + if (!priv->reps) > > + return -ENOMEM; > > + > > + for (rep_id =3D 0; rep_id < rep_cnt; rep_id++) { > > + ndev =3D alloc_etherdev(sizeof(*rep)); > > + if (!ndev) { > > + NL_SET_ERR_MSG_FMT_MOD(extack, "PFVF > representor:%d creation failed\n", > > + rep_id); > > + err =3D -ENOMEM; > > + goto exit; > > + } > > + > > + rep =3D netdev_priv(ndev); > > + priv->reps[rep_id] =3D rep; > > + rep->mdev =3D priv; > > + rep->netdev =3D ndev; > > + rep->rep_id =3D rep_id; > > + > > + ndev->min_mtu =3D OTX2_MIN_MTU; > > + ndev->max_mtu =3D priv->hw.max_mtu; > > + pcifunc =3D priv->rep_pf_map[rep_id]; > > + rep->pcifunc =3D pcifunc; > > + > > + snprintf(ndev->name, sizeof(ndev->name), "r%dp%d", rep_id, > > + rvu_get_pf(pcifunc)); > > + > > + eth_hw_addr_random(ndev); > > + err =3D register_netdev(ndev); > > + if (err) { > > + NL_SET_ERR_MSG_MOD(extack, "PFVF reprentator > registration > > +failed\n"); >=20 > I don't think the string passed to NL_SET_ERR_MSG_MOD needs a trailing > '\n'. > I'm unsure if this also applies to NL_SET_ERR_MSG_FMT_MOD or not. Ack. >=20 > Flagged by Coccinelle. >=20 >=20 > The current ndev appears to be leaked here, as it does not appear to be > covered by the unwind loop below. >=20 > I think this can be resolved using: >=20 > free_netdev(ndev); >=20 > > + goto exit; > > + } > > + } > > + err =3D rvu_rep_napi_init(priv, extack); > > + if (err) > > + goto exit; >=20 > Even with the above fixed, Smatch complains that: >=20 > .../rep.c:180 rvu_rep_create() warn: 'ndev' from alloc_etherdev_mqs() not > released on lines: 180. > .../rep.c:180 rvu_rep_create() warn: 'ndev' from register_netdev() not > released on lines: 180. >=20 > Where line 180 is the very last line of the funciton: return err; >=20 > I think this is triggered by the error handling above. > However, I also think it is a false positive. > I've CCed Dan Carpenter as I'd value a second opinion on this one. >=20 > > + > > + return 0; > > +exit: > > + while (--rep_id >=3D 0) { > > + rep =3D priv->reps[rep_id]; > > + unregister_netdev(rep->netdev); > > + free_netdev(rep->netdev); > > + } > > + return err; > > +} >=20 > ...