[v2,2/2] net/ixgbe: remove rte_panic

Message ID 20201020100248.761693-3-conor.walsh@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/ixgbe fix unchecked return value and rte_panic |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Conor Walsh Oct. 20, 2020, 10:02 a.m. UTC
  Remove the usage of rte_panic() within ixgbe_pf_host_init()

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 drivers/net/ixgbe/ixgbe_pf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Comments

Wang, Haiyue Oct. 20, 2020, 5:06 p.m. UTC | #1
> -----Original Message-----
> From: Walsh, Conor <conor.walsh@intel.com>
> Sent: Tuesday, October 20, 2020 18:03
> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Awal, Mohammad Abdul <mohammad.abdul.awal@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; stable@dpdk.org
> Cc: dev@dpdk.org; Walsh, Conor <conor.walsh@intel.com>
> Subject: [PATCH v2 2/2] net/ixgbe: remove rte_panic
> 
> Remove the usage of rte_panic() within ixgbe_pf_host_init()
> 
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_pf.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 

Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> --
> 2.25.1
  
Qi Zhang Oct. 23, 2020, 12:59 a.m. UTC | #2
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wang, Haiyue
> Sent: Wednesday, October 21, 2020 1:06 AM
> To: Walsh, Conor <conor.walsh@intel.com>; Guo, Jia <jia.guo@intel.com>;
> Yigit, Ferruh <ferruh.yigit@intel.com>; Awal, Mohammad Abdul
> <mohammad.abdul.awal@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; stable@dpdk.org
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 2/2] net/ixgbe: remove rte_panic
> 
> > -----Original Message-----
> > From: Walsh, Conor <conor.walsh@intel.com>
> > Sent: Tuesday, October 20, 2020 18:03
> > To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> > <haiyue.wang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Awal,
> > Mohammad Abdul <mohammad.abdul.awal@intel.com>; Doherty, Declan
> > <declan.doherty@intel.com>; stable@dpdk.org
> > Cc: dev@dpdk.org; Walsh, Conor <conor.walsh@intel.com>
> > Subject: [PATCH v2 2/2] net/ixgbe: remove rte_panic
> >
> > Remove the usage of rte_panic() within ixgbe_pf_host_init()
> >
> > Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_pf.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> 
> Acked-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> > --
> > 2.25.1
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 4e25b1e72e..833863af5a 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -88,8 +88,11 @@  int ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
 		return ret;
 
 	*vfinfo = rte_zmalloc("vf_info", sizeof(struct ixgbe_vf_info) * vf_num, 0);
-	if (*vfinfo == NULL)
-		rte_panic("Cannot allocate memory for private VF data\n");
+	if (*vfinfo == NULL) {
+		PMD_INIT_LOG(ERR,
+			"Cannot allocate memory for private VF data");
+		return -ENOMEM;
+	}
 
 	ret = rte_eth_switch_domain_alloc(&(*vfinfo)->switch_domain_id);
 	if (ret) {