netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors
@ 2024-10-17 18:51 Dipendra Khadka
  2024-10-17 18:56 ` [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Dipendra Khadka
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 18:51 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Dipendra Khadka, horms, netdev, linux-kernel

This patch series improves error handling in the Marvell OcteonTX2
NIC driver. Specifically, it adds error pointer checks after
otx2_mbox_get_rsp() to ensure the driver handles error cases more
gracefully.

Changes in v4:
- Patch series thrading fixed.
- Error handling changed in otx2_flows.c.
- Used correct To: and CC:

Changes in v3:
- Created a patch-set as per the feedback
- Corrected patch subject
- Added error handling in the new files

Dipendra Khadka (6):
  octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c
  octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c
  octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c
  octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c
  octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c
  octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c

 drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c     |  5 +++++
 .../net/ethernet/marvell/octeontx2/nic/otx2_common.c   |  4 ++++
 .../net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c    |  5 +++++
 .../net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c |  9 +++++++++
 .../net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c  | 10 ++++++++++
 .../net/ethernet/marvell/octeontx2/nic/otx2_flows.c    | 10 ++++++++++
 6 files changed, 43 insertions(+)

--
2.43.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
@ 2024-10-17 18:56 ` Dipendra Khadka
  2024-10-17 18:58   ` Dipendra Khadka
  2024-10-18 19:08   ` Simon Horman
  2024-10-17 19:02 ` [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c Dipendra Khadka
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 18:56 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Dipendra Khadka, horms, netdev, linux-kernel

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 <kdipendra88@gmail.com>
---
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/drivers/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 = (struct nix_hw_info *)
 		       otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
+		if (IS_ERR(rsp)) {
+			rc = PTR_ERR(rsp);
+			goto out;
+		}
 
 		/* HW counts VLAN insertion bytes (8 for double tag)
 		 * irrespective of whether SQE is requesting to insert VLAN
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c
  2024-10-17 18:56 ` [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Dipendra Khadka
@ 2024-10-17 18:58   ` Dipendra Khadka
  2024-10-18 19:08   ` Simon Horman
  1 sibling, 0 replies; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 18:58 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, pabeni
  Cc: horms, netdev, linux-kernel

+pabeni@redhat.com

On Fri, 18 Oct 2024 at 00:41, Dipendra Khadka <kdipendra88@gmail.com> wrote:
>
> 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 <kdipendra88@gmail.com>
> ---
> 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/drivers/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 = (struct nix_hw_info *)
>                        otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
> +               if (IS_ERR(rsp)) {
> +                       rc = PTR_ERR(rsp);
> +                       goto out;
> +               }
>
>                 /* HW counts VLAN insertion bytes (8 for double tag)
>                  * irrespective of whether SQE is requesting to insert VLAN
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
  2024-10-17 18:56 ` [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Dipendra Khadka
@ 2024-10-17 19:02 ` Dipendra Khadka
  2024-10-18 19:09   ` Simon Horman
  2024-10-17 19:08 ` [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c Dipendra Khadka
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 19:02 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Dipendra Khadka, horms, netdev, linux-kernel

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 <kdipendra88@gmail.com>
---
v4: 
 - 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/drivers/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 *netdev,
 	if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
 		rsp = (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 = rsp->rx_pause;
 		pause->tx_pause = rsp->tx_pause;
 	}
@@ -1072,6 +1077,11 @@ static int otx2_set_fecparam(struct net_device *netdev,
 
 	rsp = (struct fec_mode *)otx2_mbox_get_rsp(&pfvf->mbox.mbox,
 						   0, &req->hdr);
+	if (IS_ERR(rsp)) {
+		err = PTR_ERR(rsp);
+		goto end;
+	}
+
 	if (rsp->fec >= 0)
 		pfvf->linfo.fec = rsp->fec;
 	else
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
  2024-10-17 18:56 ` [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Dipendra Khadka
  2024-10-17 19:02 ` [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c Dipendra Khadka
@ 2024-10-17 19:08 ` Dipendra Khadka
  2024-10-18 19:09   ` Simon Horman
  2024-10-17 19:10 ` [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c Dipendra Khadka
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 19:08 UTC (permalink / raw)
  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, netdev, linux-kernel

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 <kdipendra88@gmail.com>
---
v4:
 - removed unnecessary line "allocated = 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.com/
 .../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/drivers/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)
 
 		rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp
 			(&pfvf->mbox.mbox, 0, &req->hdr);
+		if (IS_ERR(rsp))
+			goto exit;
 
 		for (ent = 0; ent < rsp->count; ent++)
 			flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];
@@ -197,6 +199,10 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf)
 
 	rsp = (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);
+	}
 
 	if (rsp->count != req->count) {
 		netdev_info(pfvf->netdev,
@@ -232,6 +238,10 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf)
 
 	frsp = (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);
+	}
 
 	if (frsp->enable) {
 		pfvf->flags |= OTX2_FLAG_RX_VLAN_SUPPORT;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
                   ` (2 preceding siblings ...)
  2024-10-17 19:08 ` [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c Dipendra Khadka
@ 2024-10-17 19:10 ` Dipendra Khadka
  2024-10-18 19:09   ` Simon Horman
  2024-10-17 19:13 ` [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c Dipendra Khadka
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 19:10 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Dipendra Khadka, horms, netdev, linux-kernel

Add error pointer check after calling otx2_mbox_get_rsp().

Fixes: 2ca89a2c3752 ("octeontx2-pf: TC_MATCHALL ingress ratelimiting offload")
Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
---
 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/net/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, u16 *leaf)
 
 	rsp = (struct  nix_bandprof_alloc_rsp *)
 	       otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
+	if (IS_ERR(rsp)) {
+		rc = PTR_ERR(rsp);
+		goto out;
+	}
+
 	if (!rsp->prof_count[BAND_PROF_LEAF_LAYER]) {
 		rc = -EIO;
 		goto out;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
                   ` (3 preceding siblings ...)
  2024-10-17 19:10 ` [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c Dipendra Khadka
@ 2024-10-17 19:13 ` Dipendra Khadka
  2024-10-18 19:10   ` Simon Horman
  2024-10-17 19:16 ` [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c Dipendra Khadka
  2024-10-22 23:10 ` [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors patchwork-bot+netdevbpf
  6 siblings, 1 reply; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 19:13 UTC (permalink / raw)
  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, netdev, linux-kernel

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 <kdipendra88@gmail.com>
---
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/drivers/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, const u8 *mac,
 	if (!err) {
 		rsp = (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 = rsp->index;
 	}
 
@@ -200,6 +205,10 @@ int otx2_dmacflt_update(struct otx2_nic *pf, u8 *mac, u32 bit_pos)
 
 	rsp = (struct cgx_mac_addr_update_rsp *)
 		otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr);
+	if (IS_ERR(rsp)) {
+		rc = PTR_ERR(rsp);
+		goto out;
+	}
 
 	pf->flow_cfg->bmap_to_dmacindex[bit_pos] = rsp->index;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
                   ` (4 preceding siblings ...)
  2024-10-17 19:13 ` [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c Dipendra Khadka
@ 2024-10-17 19:16 ` Dipendra Khadka
  2024-10-18 19:10   ` Simon Horman
  2024-10-22 23:10 ` [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors patchwork-bot+netdevbpf
  6 siblings, 1 reply; 15+ messages in thread
From: Dipendra Khadka @ 2024-10-17 19:16 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Dipendra Khadka, horms, netdev, linux-kernel

Add error pointer check after calling otx2_mbox_get_rsp().

Fixes: 8e67558177f8 ("octeontx2-pf: PFC config support with DCBx")
Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
---
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/drivers/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 *pfvf)
 	if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
 		rsp = (struct cgx_pfc_rsp *)
 		       otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
+		if (IS_ERR(rsp)) {
+			err = PTR_ERR(rsp);
+			goto unlock;
+		}
+
 		if (req->rx_pause != rsp->rx_pause || req->tx_pause != rsp->tx_pause) {
 			dev_warn(pfvf->dev,
 				 "Failed to config PFC\n");
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c
  2024-10-17 18:56 ` [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Dipendra Khadka
  2024-10-17 18:58   ` Dipendra Khadka
@ 2024-10-18 19:08   ` Simon Horman
  1 sibling, 0 replies; 15+ messages in thread
From: Simon Horman @ 2024-10-18 19:08 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Thu, Oct 17, 2024 at 06:56:33PM +0000, Dipendra Khadka wrote:
> 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 <kdipendra88@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c
  2024-10-17 19:02 ` [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c Dipendra Khadka
@ 2024-10-18 19:09   ` Simon Horman
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2024-10-18 19:09 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Thu, Oct 17, 2024 at 07:02:29PM +0000, Dipendra Khadka wrote:
> 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 <kdipendra88@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c
  2024-10-17 19:08 ` [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c Dipendra Khadka
@ 2024-10-18 19:09   ` Simon Horman
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2024-10-18 19:09 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Naveen Mamindlapalli, Suman Ghosh, netdev,
	linux-kernel

On Thu, Oct 17, 2024 at 07:08:44PM +0000, Dipendra Khadka wrote:
> 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 <kdipendra88@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c
  2024-10-17 19:10 ` [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c Dipendra Khadka
@ 2024-10-18 19:09   ` Simon Horman
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2024-10-18 19:09 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Thu, Oct 17, 2024 at 07:10:36PM +0000, Dipendra Khadka wrote:
> Add error pointer check after calling otx2_mbox_get_rsp().
> 
> Fixes: 2ca89a2c3752 ("octeontx2-pf: TC_MATCHALL ingress ratelimiting offload")
> Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c
  2024-10-17 19:13 ` [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c Dipendra Khadka
@ 2024-10-18 19:10   ` Simon Horman
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2024-10-18 19:10 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ratheesh Kannoth, netdev, linux-kernel

On Thu, Oct 17, 2024 at 07:13:54PM +0000, Dipendra Khadka wrote:
> 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 <kdipendra88@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c
  2024-10-17 19:16 ` [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c Dipendra Khadka
@ 2024-10-18 19:10   ` Simon Horman
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2024-10-18 19:10 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Thu, Oct 17, 2024 at 07:16:16PM +0000, Dipendra Khadka wrote:
> Add error pointer check after calling otx2_mbox_get_rsp().
> 
> Fixes: 8e67558177f8 ("octeontx2-pf: PFC config support with DCBx")
> Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors
  2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
                   ` (5 preceding siblings ...)
  2024-10-17 19:16 ` [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c Dipendra Khadka
@ 2024-10-22 23:10 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 15+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-22 23:10 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: sgoutham, gakula, sbhatta, hkelam, andrew+netdev, davem, edumazet,
	kuba, pabeni, horms, netdev, linux-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by Andrew Lunn <andrew@lunn.ch>:

On Thu, 17 Oct 2024 18:51:15 +0000 you wrote:
> This patch series improves error handling in the Marvell OcteonTX2
> NIC driver. Specifically, it adds error pointer checks after
> otx2_mbox_get_rsp() to ensure the driver handles error cases more
> gracefully.
> 
> Changes in v4:
> - Patch series thrading fixed.
> - Error handling changed in otx2_flows.c.
> - Used correct To: and CC:
> 
> [...]

Here is the summary with links:
  - [v4,1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c
    https://git.kernel.org/netdev/net-next/c/0fbc7a5027c6
  - [v4,2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c
    https://git.kernel.org/netdev/net-next/c/e26f8eac6bb2
  - [v4,3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c
    https://git.kernel.org/netdev/net-next/c/bd3110bc102a
  - [v4,4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c
    https://git.kernel.org/netdev/net-next/c/ac9183023b6a
  - [v4,5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c
    https://git.kernel.org/netdev/net-next/c/f5b942e6c54b
  - [v4,6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c
    https://git.kernel.org/netdev/net-next/c/69297b0d3369

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-10-22 23:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17 18:51 [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors Dipendra Khadka
2024-10-17 18:56 ` [PATCH v4 1/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c Dipendra Khadka
2024-10-17 18:58   ` Dipendra Khadka
2024-10-18 19:08   ` Simon Horman
2024-10-17 19:02 ` [PATCH v4 2/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_ethtool.c Dipendra Khadka
2024-10-18 19:09   ` Simon Horman
2024-10-17 19:08 ` [PATCH v4 3/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c Dipendra Khadka
2024-10-18 19:09   ` Simon Horman
2024-10-17 19:10 ` [PATCH v4 4/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in cn10k.c Dipendra Khadka
2024-10-18 19:09   ` Simon Horman
2024-10-17 19:13 ` [PATCH v4 5/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c Dipendra Khadka
2024-10-18 19:10   ` Simon Horman
2024-10-17 19:16 ` [PATCH v4 6/6] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c Dipendra Khadka
2024-10-18 19:10   ` Simon Horman
2024-10-22 23:10 ` [PATCH v4 0/6] octeontx2-pf: handle otx2_mbox_get_rsp errors patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).