Skip to content

Commit

Permalink
net/vmxnet3: fix return code in initializing
Browse files Browse the repository at this point in the history
[ upstream commit 8a2de735318b38ba93a041cb2f209889bde02689 ]

Improve error handling

Bugzilla ID: 1239
Fixes: dfaff37 ("vmxnet3: import new vmxnet3 poll mode driver implementation")

Signed-off-by: Kaijun Zeng <corezeng@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
Zeng-Kai-Jun authored and kevintraynor committed Jul 11, 2023
1 parent 1fa656b commit f68f4b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ Jun Yang <jun.yang@nxp.com>
Junyu Jiang <junyux.jiang@intel.com>
Juraj Linkeš <juraj.linkes@pantheon.tech>
Kai Ji <kai.ji@intel.com>
Kaijun Zeng <corezeng@gmail.com>
Kaiwen Deng <kaiwenx.deng@intel.com>
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Kamalakannan R <kamalakannan.r@intel.com>
Expand Down
15 changes: 11 additions & 4 deletions drivers/net/vmxnet3/vmxnet3_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,11 +1269,18 @@ vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev)
for (j = 0; j < VMXNET3_RX_CMDRING_SIZE; j++) {
/* Passing 0 as alloc_num will allocate full ring */
ret = vmxnet3_post_rx_bufs(rxq, j);
if (ret <= 0) {

/* Zero number of descriptors in the configuration of the RX queue */
if (ret == 0) {
PMD_INIT_LOG(ERR,
"ERROR: Posting Rxq: %d buffers ring: %d",
i, j);
return -ret;
"Invalid configuration in Rx queue: %d, buffers ring: %d\n",
i, j);
return -EINVAL;
}
/* Return the error number */
if (ret < 0) {
PMD_INIT_LOG(ERR, "Posting Rxq: %d buffers ring: %d", i, j);
return ret;
}
/*
* Updating device with the index:next2fill to fill the
Expand Down

0 comments on commit f68f4b2

Please sign in to comment.