diff mbox series

net/af_xdp: change return value from Rx to unsigned

Message ID 20200807093248.4295-1-ciara.loftus@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series net/af_xdp: change return value from Rx to unsigned | expand

Checks

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

Commit Message

Ciara Loftus Aug. 7, 2020, 9:32 a.m. UTC
The af_xdp rx function was returning a negative value on error, when an
unsigned value is expected. Fix this.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ferruh Yigit Aug. 7, 2020, 10:07 a.m. UTC | #1
On 8/7/2020 10:32 AM, Ciara Loftus wrote:
> The af_xdp rx function was returning a negative value on error, when an
> unsigned value is expected. Fix this.
> 
> Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 936d4a7d5f..7ce4ad04af 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -236,7 +236,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>  	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
>  		AF_XDP_LOG(DEBUG,
>  			"Failed to get enough buffers for fq.\n");
> -		return -1;
> +		return 0;
>  	}
>  
>  	rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
> 

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ferruh Yigit Sept. 1, 2020, 3:10 p.m. UTC | #2
On 8/7/2020 11:07 AM, Ferruh Yigit wrote:
> On 8/7/2020 10:32 AM, Ciara Loftus wrote:
>> The af_xdp rx function was returning a negative value on error, when an
>> unsigned value is expected. Fix this.
>>
>> Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
>> ---
>>  drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
>> index 936d4a7d5f..7ce4ad04af 100644
>> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
>> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
>> @@ -236,7 +236,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>>  	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
>>  		AF_XDP_LOG(DEBUG,
>>  			"Failed to get enough buffers for fq.\n");
>> -		return -1;
>> +		return 0;
>>  	}
>>  
>>  	rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
>>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 

Applied to dpdk-next-net/main, thanks.
diff mbox series

Patch

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 936d4a7d5f..7ce4ad04af 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -236,7 +236,7 @@  af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
 		AF_XDP_LOG(DEBUG,
 			"Failed to get enough buffers for fq.\n");
-		return -1;
+		return 0;
 	}
 
 	rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);