From nobody Tue Nov 26 12:29:00 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FE351DF754; Thu, 17 Oct 2024 18:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729191405; cv=none; b=K0tNcpKUEw3amDP9YEMHJq6rH91/fI30KfWgbRrvYV5lh57KLwBinwAH0awF17yspquajUxY4PXDXbQryffULQ1TRxLWkDEKAjOUUpQyLnLhQH7xawlriuPxiKTkyJRDCCV4GrL7wJQFpumofUHnbx3Od+omhuNei0azqdnl8/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729191405; c=relaxed/simple; bh=1jWi19cLw/O33YUTHG2Apv87raGY8kQsXoFmbI0GCSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eHFZ2xgmU0xxkqke0VnKTOi3NJuGZa5WkbFjPNQL7by3yhPUbgY5CB3/ZY8tYryOBV+vJ94YeueBWActh57ygfhE3vwdcIfb7tiC8oc5JO74zVVI+uCAf8syfBPFvSCRQ17RgBMQ2dQIAP5PLYaq9DlcRwrkJHf8JU7r33o1Z3M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J3owkIRg; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J3owkIRg" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20cbca51687so14394475ad.1; Thu, 17 Oct 2024 11:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729191404; x=1729796204; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7ZGaeyV9U4r0R6f6UfyYJ79PA19GqkLIm1iDSxXpf74=; b=J3owkIRgcjdwtjjnV2qGIvhHFcWHcxQuTI1gPLdeKlKUaHrdl9IBW1P9211dF1E44W Ncy/OGO9gbOn9SLXKBZwf3kMlnaKFReiPl70fgbwg5Upyw+vDOWxWRJsGvOHQM7utPBy lBg1pynJgFD8rHOLGG5RCeuxE5pnfTxDombOt1jQPR0/ywXxBjZ+8JSaaKonH2siFlfU wHM6gaNPn6+qVOVJcOvX8mufvKl8Vy11U177/SMrSWO4QXeQLlPYRiv+iZtuWyi1HK40 L0Zu8higQgejvqv7H7h1zpFVaN29FZST0oMrdZ6ppFEncTaNyI9rbE2W/Qu1bVuGektt N8UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729191404; x=1729796204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ZGaeyV9U4r0R6f6UfyYJ79PA19GqkLIm1iDSxXpf74=; b=qc0qrYJoqtBwOksWMGWFgyVAOwUqEJ7xmCWLUMh8PdbNwPbx/3NSDaAbyYBHWR3dMZ RS8ySRiywBN4jRlQQvH0cy0HOj2E9FaYMKaIANu3au0ZB8PHWcBsIaIY48HbIh6v/CTQ aLJRymGXtP0itlzgQ6gS5+KepeaTc1T4oOvt116Ez0jK4O4gRkAvcxi2ijhBRRwwceGz CmJDE6sbozerIyzPN/iPOxpyaZla8R8+5diwbwFQRUkDerBY4alpXtGthkeubSPv+yvt T17AQQQhzSlxag19lsB6pu04qY863Xvvi19MXKQMZqu+E6d0plsgpy/KU11pnWDrI3lR /zHw== X-Forwarded-Encrypted: i=1; AJvYcCUeoGjxoGgYBqtN5tMD6MxCOzoDLRMrau/ll/j8Bmk3+n69GImG7b/ABI4hgqBv4D9OTikgyzws@vger.kernel.org, AJvYcCXe/zEwasU8GlgpfMvik7RT/Ha1Jm/RML0nLBJ0p8vr9ePiZXVEVR7j2Vjl93p1jVJXc1FQI+KbQdp3Mzc=@vger.kernel.org X-Gm-Message-State: AOJu0YxCavXfx6HQNG8iaUknC0iaOkpnHOCkLjdB1bObS/pNApZ/v20o 7ADokNgrChKldPtzlItCJoqeukbWK+NgX8yjd/hy/owYYmu9RkTD X-Google-Smtp-Source: AGHT+IEN8L3F+2UOnnf6YIXnuEGWgGPfecKEnJlHK6uTQIVyKYblzyxlvKNGAeKYZY3Du56J3b42Qw== X-Received: by 2002:a17:903:2283:b0:20c:92ce:359d with SMTP id d9443c01a7336-20cbb2845b9mr353494695ad.45.1729191403573; Thu, 17 Oct 2024 11:56:43 -0700 (PDT) Received: from ubuntu.worldlink.com.np ([27.34.65.170]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20d1806b5ebsm47546335ad.293.2024.10.17.11.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 11:56:43 -0700 (PDT) From: Dipendra Khadka To: Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Dipendra Khadka , horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Date: Thu, 17 Oct 2024 18:56:33 +0000 Message-ID: <20241017185636.32583-1-kdipendra88@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017185116.32491-1-kdipendra88@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add error pointer check after calling otx2_mbox_get_rsp(). Fixes: ab58a416c93f ("octeontx2-pf: cn10k: Get max mtu supported from admin= function") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman --- v4: - Sent for patch version consistency. v3:https://lore.kernel.org/all/20241006164018.1820-1-kdipendra88@gmail.com/ - Included in the patch set - Changed the patch subject v2: https://lore.kernel.org/all/20240923161738.4988-1-kdipendra88@gmail.com/ - Added Fixes: tag. - Changed the return logic to follow the existing return path. v1: https://lore.kernel.org/all/20240923110633.3782-1-kdipendra88@gmail.com/ drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/dri= vers/net/ethernet/marvell/octeontx2/nic/otx2_common.c index 87d5776e3b88..7510a918d942 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -1837,6 +1837,10 @@ u16 otx2_get_max_mtu(struct otx2_nic *pfvf) if (!rc) { rsp =3D (struct nix_hw_info *) otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + rc =3D PTR_ERR(rsp); + goto out; + } =20 /* HW counts VLAN insertion bytes (8 for double tag) * irrespective of whether SQE is requesting to insert VLAN --=20 2.43.0 From nobody Tue Nov 26 12:29:00 2024 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2EFF21C17C; Thu, 17 Oct 2024 19:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729191760; cv=none; b=TOZaoZ6bmSfKVFQUtL3e1uy0BWyQQbZi+EqdVQ34j4sbbK+1KiqKery6q9LDJqp4qc7UT1ZuF7F4EXjtUhb1cB0xXCUnI9lBKQ+dGIu5OnRH/W5LVaYMqiMylkMTtx+UbGCzWRLdujDkbNMB7vhYJi3jAcnmwvl89t5NvklH1F0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729191760; c=relaxed/simple; bh=8Xm49cYq79t70wGbob1EFfMthRU3wGFZiDD8Zmuw+wY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ccYF+7VIlJps2xTzVB8H3eUok5RjF3TNRBZ8/XFBB6fkzMQ7huo3ngd8q66K8UojfcZD9pSEGpjtHMCWcmyrNCVT0BlnaVyr9G+5ir5E0/s0EbwHnQJ+CCpuj/TordvJuvsVrYjdv3qqYaZGyE79d5FMWcO7HvLzPcalcl8lWug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aZW3DxGG; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aZW3DxGG" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20cdb889222so13984815ad.3; Thu, 17 Oct 2024 12:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729191758; x=1729796558; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GC/gKkJk9hC2ZN6gsa1BgR5QAlv+EhRRSXqtQaRP8SI=; b=aZW3DxGGcKxXN5VQXcZ21BBYGPOiGoQYafnPyN7b4Yi+eXLrJl3VgNKhlCtgOEcizq X2iU3Yk758s8dePR7HgnLB5ZWVG0Ehjn1JMyovo1Uotg454Sg9SVWwSyw+zJhSSouXyW jRPkTIzKJVMHPw7l3LxiDk9SWqC1bMyW8lptpCnYnUNhbOClB2zxEEYgfPvaLtPNwqBq dHqHJMpsfnxhg9RI+gW+a+PHOSWkRvbUdrRBQjh7xf6Oj3V2AKnTAWYckAzk4Kl+bLTI AAKhQc+L5Y9/IfdsLXPc+tr9v+nkYddd2DNCwJ6yn6kAZl+ZTeGBp+Vs3XRRMkNfgL+F dt2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729191758; x=1729796558; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GC/gKkJk9hC2ZN6gsa1BgR5QAlv+EhRRSXqtQaRP8SI=; b=ssS6C+UVSuGhGui0GGwXZRl1Lvhjq7pnEJS5U93B3XXEDL+zXiHXmAGMFNfV3WVp3H GJpPAY9/r8zMh7FPvsC/D5a2q3Y0GJ1+RbIL85uPFRMBzAJY7uyiBeXaRFXsDaZOEb0c YhE+ttE4zdz9dPtTrtIu8Pe+ib9MvxMxu2zKI9KAUPEdfj+luRC3Y+h7o6KWcvk/y35c I9FCiS+fJwfcQDxHkASo2wpgncczUHjjwhm7N5A0NMkx9EkPRxFrg2R0yPHJI5RF54FA FFYAunWOjjJM8DcqQst95IO51NTwfW569bl7l571DSDxKKLuF37N60rue4QjL+xa8oy8 wBnA== X-Forwarded-Encrypted: i=1; AJvYcCUFXGdk/abLJaEtH4Iq3GpBjnHzsGpNeiVhr44yoA7s5BarpkpSRkane6/Rj2ielldw95vH9Oeo@vger.kernel.org, AJvYcCXOzgfLCHJfnDGbPZjHhjFlah2QcPioA5hpt/zxDsEirEihVXONK+5RldFDAkqyKJWWdJGiTd2xjkJN5qo=@vger.kernel.org X-Gm-Message-State: AOJu0YxLGd6Ti6MX8amacpwpkvCo8YZWQcTD+2oT+qoTH1CDf1HSojCK vLK7Isqk1x6wOS9JH5lmFZRspWQQNepj4PxsyL20Y0273u+B4Eov X-Google-Smtp-Source: AGHT+IFxY9RHtPWYtiLYxs1vE+ZHCnyS5DOSUEKiLiK3G1hM2Ct0AWcdyiyvq6jKcQ839l247tfxuw== X-Received: by 2002:a17:903:120a:b0:205:3e6d:9949 with SMTP id d9443c01a7336-20ca16be7demr326442175ad.52.1729191757703; Thu, 17 Oct 2024 12:02:37 -0700 (PDT) Received: from ubuntu.worldlink.com.np ([27.34.65.170]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e55da3bc5esm206054a91.39.2024.10.17.12.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 12:02:37 -0700 (PDT) From: Dipendra Khadka To: Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Dipendra Khadka , horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c Date: Thu, 17 Oct 2024 19:02:29 +0000 Message-ID: <20241017190230.32674-1-kdipendra88@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017185116.32491-1-kdipendra88@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add error pointer check after calling otx2_mbox_get_rsp(). Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames = via ethtool") Fixes: d0cf9503e908 ("octeontx2-pf: ethtool fec mode support") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman --- v4:=20 - Sent for patch version consistenct. v3: https://lore.kernel.org/all/20241006164210.1961-1-kdipendra88@gmail.com/ - Included in the patch set - Changed the patch subject - Added Fixes: tag v2: Skipped for consitency in the patch set v1: https://lore.kernel.org/all/20240923113135.4366-1-kdipendra88@gmail.com/ .../net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/dr= ivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c index 32468c663605..5197ce816581 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c @@ -343,6 +343,11 @@ static void otx2_get_pauseparam(struct net_device *net= dev, if (!otx2_sync_mbox_msg(&pfvf->mbox)) { rsp =3D (struct cgx_pause_frm_cfg *) otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + mutex_unlock(&pfvf->mbox.lock); + return; + } + pause->rx_pause =3D rsp->rx_pause; pause->tx_pause =3D rsp->tx_pause; } @@ -1072,6 +1077,11 @@ static int otx2_set_fecparam(struct net_device *netd= ev, =20 rsp =3D (struct fec_mode *)otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + err =3D PTR_ERR(rsp); + goto end; + } + if (rsp->fec >=3D 0) pfvf->linfo.fec =3D rsp->fec; else --=20 2.43.0 From nobody Tue Nov 26 12:29:00 2024 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28E4921BAF3; Thu, 17 Oct 2024 19:08:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192135; cv=none; b=TwGGwWj7mgAtYXgiGkGW3pnXzlaRoy9DjQysxuNN1rFSrxMbTrPnTIczr3T++T62Pa9iSjmBFpZ2Naa1SNdDONbU+AJZWygNB7JsHCOuegcmqQONkE+gh5hB6mC5w+/O6bkzEl3pfXrkZKPnZOqHWcAQvL2EgQapSBhBOV5pDg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192135; c=relaxed/simple; bh=s7U0icbK7FENRImx1tbz0XdY3NYXf6UP4UcAkP83OCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GypwjKGfOtPLSaT1nwvxs5Y+jKXjFC0CRQsP07N/wiaZADAslMmYE4FxcUnBngYeJOrltRpPzneqPk8BRWuqKNFd2tfTaeYboxHShkUnTLJ28fHqHw2AGlHvkAeZuZfS3Ep/zvbHL8BkRa60WU5t6W/NjynPKGh++jLPlwEd0jE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GMi1f/bC; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GMi1f/bC" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20cb47387ceso11406135ad.1; Thu, 17 Oct 2024 12:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729192133; x=1729796933; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S2o9SjO3DgGlhTD4DQ2cq3Udc0mM0ErlixCRYYej+Hw=; b=GMi1f/bC9l+mAenVJzAKw/ZGElDtGrYPU9jQ6aUsQPpPG6kGCrYeWKU67ZtoNIxUi7 5lH0Sl0Jti7cP8/EH+dZRH4z1P+WI/6l0isfG6lFZc8TOqXwH9Ce3Kd99G3tAaQSNf4E DYD62UGrcRd92tnjhuVvz+ymzE1y5lTXb4H/1mXJJw5LRlXcE5aJLfQv1qIChXGkqsJK 4BL8VvGcAFFWMuygbrto8Xxs0N+/efh72mdBdmDvztoO+ApaQ+GEfD3lxNFjE7mas9ul ahgTYkrFrZX347j88xdi7ezyKF6E1yGnbOKxZ//i1UKR1P68upgERXiyM230ZwEu2+jl Mklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729192133; x=1729796933; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S2o9SjO3DgGlhTD4DQ2cq3Udc0mM0ErlixCRYYej+Hw=; b=TrjbuqC6hNWSQIuJfuWFIU9JsEsKjCS6dIWZglw3Vq+ite7hrfTtdCcOBS29xn4iM1 rns8SBEoWEQd2SRM+fE25QYgQPIkIE+lhKuNdvITwRhgMTl957e0CVAhLG532tyK//ip uTfn3TkDbzo1tonz8BnafZGSnrrA9XiA2amMchcEuwnOycKRAn7nsBg9bbnMJplkIxbD 9y9vSKmCL2JcCeiGXIaFThS0dZ5vFovNs/LWGhpReYA/yNdwwFjkkEy2stytuBLQLIQ8 4OK4yISnpX+I3nt6h6S4FLpVsYwP6dLTKGZ35Z6rsOFbO8FOivUCTMLwGvABGzUxVO5h 7SGA== X-Forwarded-Encrypted: i=1; AJvYcCWlEEszpeT5ixk8MccqYVj6ul5bxMpqR06SfA5d56/GBOp8CZYq/l+pcKa/oboebYR6VncLlj+u@vger.kernel.org, AJvYcCXRmBMipm6wwGdYtPBvnvEC+7hb6H2swk9yJeAGyxU/CKhJjf+fSbF+2rnGrC1FpZ8C+VgB6CKF9/YkK0w=@vger.kernel.org X-Gm-Message-State: AOJu0YwNg8OZ+JAk8M4ymiPFfmwHATLu03AfGpm+pw3hZZD/sa8ajonV AA2NBYSq9E0JY8n94JI6LKayRsmSEMJOeX+Rp2eFHaZBHLHDLx4I X-Google-Smtp-Source: AGHT+IEM0k8ZiOeY14Pp43NqAoSKS90Nlmf+JIqLSYjbZzH5X+8zlLg8hxHFM6roJOB/MeNcYJkLeg== X-Received: by 2002:a17:903:1cd:b0:20c:7a0b:74a5 with SMTP id d9443c01a7336-20d27f1c789mr129133675ad.39.1729192133287; Thu, 17 Oct 2024 12:08:53 -0700 (PDT) Received: from ubuntu.worldlink.com.np ([27.34.65.170]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20d17f8b4e1sm47210085ad.49.2024.10.17.12.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 12:08:53 -0700 (PDT) From: Dipendra Khadka To: Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Naveen Mamindlapalli , Suman Ghosh Cc: Dipendra Khadka , horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c Date: Thu, 17 Oct 2024 19:08:44 +0000 Message-ID: <20241017190845.32832-1-kdipendra88@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017185116.32491-1-kdipendra88@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Adding error pointer check after calling otx2_mbox_get_rsp(). Fixes: 9917060fc30a ("octeontx2-pf: Cleanup flow rule management") Fixes: f0a1913f8a6f ("octeontx2-pf: Add support for ethtool ntuple filters") Fixes: 674b3e164238 ("octeontx2-pf: Add additional checks while configuring= ucast/bcast/mcast rules") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman --- v4: - removed unnecessary line "allocated =3D PTR_ERR(rsp);" v3: https://lore.kernel.org/all/20241006164322.2015-1-kdipendra88@gmail.com/ - Included in the patch set - Changed patch subject - Added Fixes: tag v2: https://lore.kernel.org/all/20240923063323.1935-1-kdipendra88@gmail.com/ - Changed the subject to net - Changed the typo of the variable from bfvp to pfvf v1: https://lore.kernel.org/all/20240922185235.50413-1-kdipendra88@gmail.co= m/ .../net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/driv= ers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c index 98c31a16c70b..58720a161ee2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c @@ -119,6 +119,8 @@ int otx2_alloc_mcam_entries(struct otx2_nic *pfvf, u16 = count) =20 rsp =3D (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp (&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) + goto exit; =20 for (ent =3D 0; ent < rsp->count; ent++) flow_cfg->flow_ent[ent + allocated] =3D rsp->entry_list[ent]; @@ -197,6 +199,10 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf) =20 rsp =3D (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp (&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + mutex_unlock(&pfvf->mbox.lock); + return PTR_ERR(rsp); + } =20 if (rsp->count !=3D req->count) { netdev_info(pfvf->netdev, @@ -232,6 +238,10 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf) =20 frsp =3D (struct npc_get_field_status_rsp *)otx2_mbox_get_rsp (&pfvf->mbox.mbox, 0, &freq->hdr); + if (IS_ERR(frsp)) { + mutex_unlock(&pfvf->mbox.lock); + return PTR_ERR(frsp); + } =20 if (frsp->enable) { pfvf->flags |=3D OTX2_FLAG_RX_VLAN_SUPPORT; --=20 2.43.0 From nobody Tue Nov 26 12:29:00 2024 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 846D01E0DC3; Thu, 17 Oct 2024 19:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192248; cv=none; b=RIQ/ZTBegs0TKlP+B+NPHP1pbauJZYtfHfkdYWGuPZvHRsIZ1YLHYCHOxRT6IpfbfMOspJpt577YbHfnn/0iFBm6PXHu1Og9fvtCmEX32YPoVIEs2xeDLOdfiiV2Td/4nf83+LdRLEaflpBZrv0GeRwpesk065JrR+9UK8e1rgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192248; c=relaxed/simple; bh=oCKDw78LrAsv8hrtp90tMl9gQsFT8ys/qO6FDSn/vEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lUPIalWH5ynsDnVxf8BV3ukK9FbxR54pd3YQXHHn/093nYd/CjOP+aTqpQ5JHmTxpGcUpZRhhV0rkmxkIiYzfv8BJfZ8J5Fv+mTlgk4b9QfDKfgObYoDIZM6UUoKpkLh3QXENrXKMmyQh7s4M5AV0GXJcZIaksTsLWzCfu3qH9U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iqp/ECDd; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iqp/ECDd" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-71e4c2e36daso1805791b3a.0; Thu, 17 Oct 2024 12:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729192246; x=1729797046; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gDSXLjvpLxqWxXHVbrKPpR5QLgHr8pG6IHSrQY1XA8c=; b=iqp/ECDd9Cl6nNN+CcDnCJal47DRp7BI47LpSf0pXSvqsEFxDlGm09bLJLOUywIGRG s2eG2LSjDEoYcu8RcwCP4Vhpehr9uH+JH2qS1egp4uY2xf2i2l9hGOs+TqBX23qkXqHk hWka8TceQSoGpFkDChuDqeOV4nyEfVJZ2tPen/EPoaeEOKgN/yiNvAITiPFnqDmApJoU AHZ+xH1vYL7a9I1sk3JF7+hMrl7B2qNBpSVYm4BGrvkEvud001XHG/cTHJYfaW17lbYP cdkSvpVbLQdxXZs1+IBdrQ9H/tCAGumKalDf1JKivqOvzMSSItaAPI4FIF3tgsem6XEU vRWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729192246; x=1729797046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gDSXLjvpLxqWxXHVbrKPpR5QLgHr8pG6IHSrQY1XA8c=; b=KNpxHzOElH/wpmCoDVWXISgCZDY5gmdXi1TGn2Ab6MakVdQmOZQ5t3faz4XPOCKEtH W/6aAm0tkaevA4V3eAtQ2HSfq7UB3cmdClH1uRuGqe0mLXTwFdC98V8BkUEKugB3TgXF xvhbhHejZkJ2jzmOcqxXwGE1VSgV6V8dZ1FrLKsGHROlPXYuZ5xRepNFc+ifWlHwUF1a fKiK8z+/6bzZDhUu8KEm5WMXaj7pqGPd1SxHPZriEFmp4EVSqK58qRiUPiKJAsCE/sUz xLm6ArHjJfmCYOtcqblHTF/sNbUub8+lf4JR5lsN8x9ygfDK2qC7XoVkTOXfWnLw9Laq 7vxw== X-Forwarded-Encrypted: i=1; AJvYcCUxOuYl9MRlpBYgpu3WSuT/YsI2+1eo2uX9SPFMjxjYDXwh1dy/oV/f/cZqHddiuggLi7WX9s7Z@vger.kernel.org, AJvYcCWPnMOwOEJUSSrIWEdxvOFHRGqbi8rzc0fzm816nK0HuKeJ3I/b0POJbOFiGaGp2coxQt+xAgfk/hnxEDo=@vger.kernel.org X-Gm-Message-State: AOJu0YyGfIWArmYaoNyK5TNHdHSzsD/jHSzIWKxGYwSa7jdjumypbIPp FshaihqF/Y9SgJrK9CUysHLMESWMyynqrscGmKJp0nXnAtYIjB/w X-Google-Smtp-Source: AGHT+IE+lmXYD1lA4neFPxR805oIpg0QWSGDEfq0rF0jsi9ai/gClkbvdKd5J2eifnTP/ui9M6VBXQ== X-Received: by 2002:a05:6a20:b598:b0:1d8:aa1d:b30c with SMTP id adf61e73a8af0-1d92b64713cmr323401637.1.1729192245699; Thu, 17 Oct 2024 12:10:45 -0700 (PDT) Received: from ubuntu.worldlink.com.np ([27.34.65.170]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774a41a2sm5061081b3a.124.2024.10.17.12.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 12:10:45 -0700 (PDT) From: Dipendra Khadka To: Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Dipendra Khadka , horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c Date: Thu, 17 Oct 2024 19:10:36 +0000 Message-ID: <20241017191037.32901-1-kdipendra88@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017185116.32491-1-kdipendra88@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add error pointer check after calling otx2_mbox_get_rsp(). Fixes: 2ca89a2c3752 ("octeontx2-pf: TC_MATCHALL ingress ratelimiting offloa= d") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman --- drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c b/drivers/n= et/ethernet/marvell/octeontx2/nic/cn10k.c index c1c99d7054f8..7417087b6db5 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c @@ -203,6 +203,11 @@ int cn10k_alloc_leaf_profile(struct otx2_nic *pfvf, u1= 6 *leaf) =20 rsp =3D (struct nix_bandprof_alloc_rsp *) otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + rc =3D PTR_ERR(rsp); + goto out; + } + if (!rsp->prof_count[BAND_PROF_LEAF_LAYER]) { rc =3D -EIO; goto out; --=20 2.43.0 From nobody Tue Nov 26 12:29:00 2024 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6CFC218D72; Thu, 17 Oct 2024 19:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192445; cv=none; b=P5F9tj+tWhodLkxjXE8OBQn3NCFvPW0BdhuZ+uMcsxTlFRpx4GsF02CUVIYhRhAv/JUDsWXbKBIcx+vU0TkL+dFYFSOlaC04K5TH8mTmuzwNaKqD7rgnM9ykyUA48xkfz6xOrqt8neRO7jhFMVel3vtStHvxnVYbbmPw5vQnO5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192445; c=relaxed/simple; bh=oKEev3EugVk+ubV7v2vIKE/rUvjLm33hhOkJwHMkBmo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ru10U5XBWLpgTCG1lhv7np34oFwK4QDjoMWRuIKoPAxxwxo2KJeiBkm0fs66LBAXQMawaLd6y2s0zKOqz/ULTlSEDhE7uMMhcDsouy4LzGQexgLHDmUGeMCTCtx83NcUgDFwlVzczuF6wKR5mrC8yF8XmmrwuHQdCx+nydag8t0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XNJcGZ/Q; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XNJcGZ/Q" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2e2dcf4b153so1019127a91.1; Thu, 17 Oct 2024 12:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729192443; x=1729797243; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ahFaJ8/guc7ie3rJ77irjN+5zBFR5O3hZmCpg9MelLo=; b=XNJcGZ/Qe+enJV8uc9kCfjPpC8/LqxMtbhy5OrrP/tUp9tZPdvDhnv0hhy6RBBL1Zc nB5sm127zSLnK/jiEkDXRhQXRP3tr4t2WpO7SbyZ4HIjzWBXuTblmMqlc6d7Pxoyh29w 9ESNScYNJPFYgxNr53u/vtv1kKUjgbpfUjjY3QOab0WoDC60zj1KtIIG8K2tSGGdZJ+c CE3IlJ1ekQlj8fBigWVV6WJRNsyGE/KopPxDIuOpPIW1GVpkyJwj83ZFoAkO27WUbkNn ERZV0tt3Z1mRJgM6cvbEmr41kUF/qJ+aI4ollwuZxxDBmBHmHaj4ZeEPvl1eKrXkZ/Lq rKMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729192443; x=1729797243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ahFaJ8/guc7ie3rJ77irjN+5zBFR5O3hZmCpg9MelLo=; b=h0Bte+KLbag1cy4MW/l2srTxGqUPAJQwPaLrRcXJooDdt0/hUXaHsjSXDKfE7OYuQ9 LqiX1wBtd76yeRQyiJjuCYX7LGLchaMsgJNhbfKf92cEZHIiq5N2l1A7qcOCDR2rLR2v HLSt1m8bUF7bHu3aJJud2Lg8DoY4BuuEcctGuPtUEpi1tOVw5nKiXSyvXHWee8qFeuIL fZZwUu3pkq68MaavVlXCYKY74NZPsHoNV/45/4POTDSn3w162udRKxj2CTomj5IlHl1S h6rdOUvsHujQzPXBHKhP7ieUV4j/+cF6utk5ItagfQXa6v5w4mxoaLcLOns3PBWMgZPj Dn4g== X-Forwarded-Encrypted: i=1; AJvYcCVNrgTNCmREezxfq6LxnU+k6jSTjym/h/9WGEDbmMkG+AD0XIxGGYCOwYOELCLFulALVZF19JFq@vger.kernel.org, AJvYcCX4qea4JlKjeRIR4HjyigDmhNwQaLGTrY9MqeJGewj4geUQxMNGS1GUHoWrougMIyw/yBFL+JxRBi/0FXY=@vger.kernel.org X-Gm-Message-State: AOJu0Ywo4+yQLG1TNvpKGD66ESZd3eEk/vB0TiBkZWrc9jE8c1esMu7l dZ0ZiissonebxNvjUPovic96rUXgZi1t4O7OFIVacYzLmEsBfiYv X-Google-Smtp-Source: AGHT+IE1ac8B1kfyldFHM6YNOqOwjVQl7fWMYlyKMet9lF4khqCUNozyRY2HtHkWLcCXgAt2tZxsPA== X-Received: by 2002:a17:90b:180a:b0:2e1:d5c9:1bc4 with SMTP id 98e67ed59e1d1-2e5616db895mr34808a91.7.1729192442934; Thu, 17 Oct 2024 12:14:02 -0700 (PDT) Received: from ubuntu.worldlink.com.np ([27.34.65.170]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e5610af81fsm61572a91.5.2024.10.17.12.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 12:14:02 -0700 (PDT) From: Dipendra Khadka To: Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ratheesh Kannoth Cc: Dipendra Khadka , horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c Date: Thu, 17 Oct 2024 19:13:54 +0000 Message-ID: <20241017191355.32988-1-kdipendra88@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017185116.32491-1-kdipendra88@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add error pointer checks after calling otx2_mbox_get_rsp(). Fixes: 79d2be385e9e ("octeontx2-pf: offload DMAC filters to CGX/RPM block") Fixes: fa5e0ccb8f3a ("octeontx2-pf: Add support for exact match table.") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman --- v4: - Sent for patch series consistency. v3: https://lore.kernel.org/all/20241006164617.2134-1-kdipendra88@gmail.com/ .../net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c b/d= rivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c index 80d853b343f9..2046dd0da00d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c @@ -28,6 +28,11 @@ static int otx2_dmacflt_do_add(struct otx2_nic *pf, cons= t u8 *mac, if (!err) { rsp =3D (struct cgx_mac_addr_add_rsp *) otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + mutex_unlock(&pf->mbox.lock); + return PTR_ERR(rsp); + } + *dmac_index =3D rsp->index; } =20 @@ -200,6 +205,10 @@ int otx2_dmacflt_update(struct otx2_nic *pf, u8 *mac, = u32 bit_pos) =20 rsp =3D (struct cgx_mac_addr_update_rsp *) otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + rc =3D PTR_ERR(rsp); + goto out; + } =20 pf->flow_cfg->bmap_to_dmacindex[bit_pos] =3D rsp->index; =20 --=20 2.43.0 From nobody Tue Nov 26 12:29:00 2024 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C3FA17D366; Thu, 17 Oct 2024 19:16:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192592; cv=none; b=LFzl/kkZ7fo7eP64gfFG9Vnr+VRXM7o4CK5eJH7Q89QlVgsy+Q/ZX6ql3a4xj2GavfBBjxybLdWB33LzDSQqP/YisOdn76uCeYXAwFN7aTIMQyuX6Pajpgxh8vvV35HPN5b7cv3dJvDJavzoJvZMPHutsHxs/XLfPTwAsh7s/Sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729192592; c=relaxed/simple; bh=Zy0KeOH3rfx0NRa+0mQP3NWmpLl47s0dJOyjL7Tjpkg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kqs+f+kx/FIeBBkstKGnkSbdbuqajZwQcDkVgeuLJVEmx4i0u8mCiUp/f7qKbD5TLWQ3E27OtdqaTnj46er2Nc1DZ3sZAKjwR2P/JgAsggyKZhP1W6fISU1ugcQij56OugRebXGq/CbvkXBO7ojzb2Nr6b629gZi+sXaYbBY07Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lsInjQeD; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lsInjQeD" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2e28b75dbd6so982602a91.0; Thu, 17 Oct 2024 12:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729192590; x=1729797390; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DyFF8AVZvYcYdFwhR+QVeVGuJ37N0O1GZiqzyAabKk4=; b=lsInjQeDvPI9O/34jLSJIr2ud6Fjqi0PzxBnSBcRwFc1polSh5zRs1xPf4bqkK58z7 02Sd9wqMoBXbn4K+BQrpkmQeMQEjzBqkZR9Q8xAjFSE+d/T2rSiQDJOKGuViJvoTAdNn 4M3v+GKto3Vv/YkAA9n/FVzJORUtd6c5ERqrApvw9xYfPlUQyIz0vSPtTyjFx7XddlfA KELcoyN3CcHlSkI74AYd3B8v/pOkEbpceyzC64YV10sLzGoIKjyecmMT2T8nCsjIt571 GFNROPWgh5vqc6p25q5xdnxk49Yr9Llt7uGDVk3vO2jansg9EiiZ8yz5izCr4LXy3Bzh qXUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729192590; x=1729797390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DyFF8AVZvYcYdFwhR+QVeVGuJ37N0O1GZiqzyAabKk4=; b=Vi7+opQoRfPDdXTIOG1XvIZXIkhYysmcOY40bYwsnD5VvAcRkTdlekxtM3/cBREkXp /eLlVb3xv1NhBiHKxuArpbxEMEQaRnnKAP2bGgOlicViInaKOUQW2EeizZLeNTctQ3a8 wJqaiunAgLVReWbzqd8HR8W0yrnsc6o+03Wc+T8Na9k7gmry63LvGgpQS8BzqWCvfva7 Bc/KFWPgG4BB5+AH2QU+Aoy7wjTHp7GrlYd+TNOOcl6HG+7LtHqklkr+7WUT1cONdFeB lvKAVeKvV4sbIJMZdLnIqSwoW1FOCg4oq0mpguUlSya6PoFoOlDUD228nVP0cTS5ROuk oqjA== X-Forwarded-Encrypted: i=1; AJvYcCV/TuyNzfYvzFwbOzfF0GqtSJrqfD+5x2APc/1Jn9oF8EXqn/SIkHbnDvPqSADHV1QxuqaavNGPXqDHJWs=@vger.kernel.org, AJvYcCV4diOAZ3ErJ43esHaGG78YqSltn4wXK2G+vLDXr9hVkb18QXxIYN0rhjGwi0dKb2Jp12zDq2Hg@vger.kernel.org X-Gm-Message-State: AOJu0YzHR4183ys+9RBFZTJFKEToI6y02gtBXua9k18NW3bfdrYE0OA9 MVPprcXl257ooBANEOsZq9FD5wzJp+WFJ6ZmmXON8WgZD7SseAyp X-Google-Smtp-Source: AGHT+IHDnFUtJu9IEcK0BaHoH2ChfojrCgVLmLF5pqkq/68tai2SKRJRr1qbAC75er/m5ilFpnZ4gg== X-Received: by 2002:a17:90a:a897:b0:2e2:b64e:f506 with SMTP id 98e67ed59e1d1-2e5616e6fb2mr47298a91.13.1729192590517; Thu, 17 Oct 2024 12:16:30 -0700 (PDT) Received: from ubuntu.worldlink.com.np ([27.34.65.170]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e55da3d512sm228127a91.41.2024.10.17.12.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 12:16:30 -0700 (PDT) From: Dipendra Khadka To: Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Dipendra Khadka , horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c Date: Thu, 17 Oct 2024 19:16:16 +0000 Message-ID: <20241017191620.33047-1-kdipendra88@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017185116.32491-1-kdipendra88@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add error pointer check after calling otx2_mbox_get_rsp(). Fixes: 8e67558177f8 ("octeontx2-pf: PFC config support with DCBx") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman --- v4: - Changed Fixes commit has to 12 count. v3: https://lore.kernel.org/all/20241006164703.2177-1-kdipendra88@gmail.com/ drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c b/driv= ers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c index aa01110f04a3..294fba58b670 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c @@ -315,6 +315,11 @@ int otx2_config_priority_flow_ctrl(struct otx2_nic *pf= vf) if (!otx2_sync_mbox_msg(&pfvf->mbox)) { rsp =3D (struct cgx_pfc_rsp *) otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + err =3D PTR_ERR(rsp); + goto unlock; + } + if (req->rx_pause !=3D rsp->rx_pause || req->tx_pause !=3D rsp->tx_pause= ) { dev_warn(pfvf->dev, "Failed to config PFC\n"); --=20 2.43.0