Skip to content

Commit

Permalink
net/vmxnet3: fix return code in initializing
Browse files Browse the repository at this point in the history
Improve error handling and code style

Bugzilla ID: 1239

Fixes: dfaff37 ("vmxnet3: import new vmxnet3 poll mode driver implementation")
Cc: stable@dpdk.org

Signed-off-by: Kaijun Zeng <corezeng@gmail.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
Zeng-Kai-Jun authored and ovsrobot committed Jun 7, 2023
1 parent 2054f31 commit ec83e86
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/net/vmxnet3/vmxnet3_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,11 +1311,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 ec83e86

Please sign in to comment.