From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id D93E0C0032E for ; Fri, 20 Oct 2023 19:23:10 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB250402A2; Fri, 20 Oct 2023 21:23:09 +0200 (CEST) Received: from outbound09.uzmanposta.com (outbound09.uzmanposta.com [159.146.44.138]) by mails.dpdk.org (Postfix) with ESMTP id 60DBA4027C for ; Fri, 20 Oct 2023 21:23:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=b-ulltech.com; h=from:subject:message-id:date:to; s=default; bh=14aYYfazYg8933 B1GJafPhhLxVQ69gSowfG7JHePimQ=; b=1yDXVYpi3+ugTGCN/gnuuwo7ZekSso XMaernCpaucdZdw+3gCscghDRy2xhd1CuZYGZtgHgIVAePCJjX07HlrEBCUdyugm 9eFBHBWANEy8IB3HZZi0oL2BdJ4cfUPpALv8dPrja1pdHAYbwa4qSKqExlJhAe7m wyrBcFns5cUQY= X-MXLAYER-out-id: 7253479a-8c94-4365-a8d4-7df3922fb9d5 Received: from pub01.uzmanposta.com (pub01 [10.60.81.162]) by outbound09.uzmanposta.com (Postfix) with ESMTP id 4SBvcp0yD4z6Q95; Fri, 20 Oct 2023 22:23:05 +0300 (+03) Date: Fri, 20 Oct 2023 22:23:05 +0300 (TRT) From: Volkan =?utf-8?B?QXRsxLE=?= To: "" Cc: "" Message-ID: <1652840288.2263678.1697829785378.JavaMail.zimbra@b-ulltech.com> Subject: =?utf-8?B?W1BBVENIXSBkaXN0cmlidXRvcjogZW5oYW5jZSBlcnJvciBoYW5kbGluZyBmb3IgY29uc2lzdGVuY3k=?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_1370472e-2cdf-47b5-854f-d33154f3549f" X-Originating-IP: [88.242.2.240] Thread-Index: upfvubC27UYMCDmKNAe81i5AWUOlhQ== Thread-Topic: distributor: enhance error handling for consistency X-Original-Sender: volkan.atli@b-ulltech.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --=_1370472e-2cdf-47b5-854f-d33154f3549f Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >From fe8850cb3b7c1051784e5587b9f79beeaf87a804 Mon Sep 17 00:00:00 2001From:= bullvolkan <volkan.atli@b-ulltech.com>Date: Fri, 20 Oct 2023 21:48:3= 0 +0300Subject: [PATCH] distributor: enhance error handling for consistency =C2=A0 This commit improves error handling in the distributor component to ensurec= onsistency and reliability. It addresses invalid 'num' values in 'lcore_wor= ker',corrects 'retptr64' initialization in 'rte_distributor_request_pkt', a= nd checksthe validity of 'num' in 'rte_distributor_return_pkt'. These chang= es enhanceerror handling and maintain code consistency. =C2=A0 Signed-off-by: Volkan Atli <volkan.atli@b-ulltech.com>---=C2=A0.mailm= ap =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0| =C2=A02 +-=C2=A0examples/distributor/main.c =C2=A0 = =C2=A0 =C2=A0 | =C2=A09 +++++++--=C2=A0lib/distributor/rte_distributor.c | = 24 ++++++++++++++----------=C2=A0lib/distributor/rte_distributor.h | 11 +++= +++++++-=C2=A04 files changed, 32 insertions(+), 14 deletions(-) =C2=A0 diff --git a/.mailmap b/.mailmapindex 3f5bab26a8..d0fe75fa8b 100644--- a/.m= ailmap+++ b/.mailmap@@ -63,7 +63,7 @@ Alfredo Cardigliano <cardigliano@n= top.org>=C2=A0Ali Alnubani <alialnu@nvidia.com> <alialnu@mellan= ox.com>=C2=A0Alice Michael <alice.michael@intel.com>=C2=A0Alin Rau= ta <alin.rauta@intel.com>-Ali Volkan Atli <volkan.atli@argela.com.= tr>+Ali Volkan Atli <volkan.atli@b-ulltech.com>=C2=A0Allain Legacy= <allain.legacy@windriver.com>=C2=A0Allen Hubbe <allen.hubbe@amd.c= om>=C2=A0Alok Makhariya <alok.makhariya@nxp.com>diff --git a/examp= les/distributor/main.c b/examples/distributor/main.cindex 21304d6618..58369= c3faa 100644--- a/examples/distributor/main.c+++ b/examples/distributor/mai= n.c@@ -634,8 +634,8 @@ lcore_worker(struct lcore_params *p)=C2=A0{=C2=A0 = =C2=A0 =C2=A0struct rte_distributor *d =3D p->d;=C2=A0 =C2=A0 =C2=A0cons= t unsigned id =3D p->worker_id;- =C2=A0 =C2=A0unsigned int num =3D 0;- = =C2=A0 =C2=A0unsigned int i;+ =C2=A0 =C2=A0int num =3D 0;+ =C2=A0 =C2=A0int= i;=C2=A0=C2=A0 =C2=A0 =C2=A0/*=C2=A0 =C2=A0 =C2=A0 * for single port, xor_= val will be zero so we won't modify the output@@ -652,6 +652,11 @@ lcore_wo= rker(struct lcore_params *p)=C2=A0 =C2=A0 =C2=A0printf("\nCore %u acting as= worker core.\n", rte_lcore_id());=C2=A0 =C2=A0 =C2=A0while (!quit_signal_w= ork) {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0num =3D rte_distributor_get_pkt(d, = id, buf, buf, num);++ =C2=A0 =C2=A0 =C2=A0 =C2=A0if (unlikely(num < 0 ||= num > 8)) {+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rte_exit(EXIT_FAI= LURE, "strange retcount %u\n", num);+ =C2=A0 =C2=A0 =C2=A0 =C2=A0}+=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Do a little bit of work for each packet */=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < num; i++) {=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint64_t t =3D rte_rdtsc()+100;diff -= -git a/lib/distributor/rte_distributor.c b/lib/distributor/rte_distributor.= cindex 5ca80dd44f..92653dd9ca 100644--- a/lib/distributor/rte_distributor.c= +++ b/lib/distributor/rte_distributor.c@@ -64,15 +64,16 @@ rte_distributor_= request_pkt(struct rte_distributor *d,=C2=A0 =C2=A0 =C2=A0 * handshake bits= . Populate the retptrs with returning packets.=C2=A0 =C2=A0 =C2=A0 */=C2=A0= - =C2=A0 =C2=A0for (i =3D count; i < RTE_DIST_BURST_SIZE; i++)- =C2=A0 = =C2=A0 =C2=A0 =C2=A0buf->retptr64[i] =3D 0;-=C2=A0 =C2=A0 =C2=A0/* Set V= ALID_BUF bit for each packet returned */- =C2=A0 =C2=A0for (i =3D count; i-= - > 0; )+ =C2=A0 =C2=A0size_t arr_len =3D sizeof(buf->retptr64) / siz= eof(buf->retptr64[0]);+ =C2=A0 =C2=A0for (i =3D 0; i < RTE_MIN(count,= arr_len); ++i)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0buf->retptr64[i] =3D=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(((int64_t)(uintptr_t)(oldpkt[= i])) <<=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_DISTRIB_FL= AG_BITS) | RTE_DISTRIB_VALID_BUF;=C2=A0+ =C2=A0 =C2=A0for (i =3D count; i &= lt; RTE_DIST_BURST_SIZE; i++)+ =C2=A0 =C2=A0 =C2=A0 =C2=A0buf->retptr64[= i] =3D 0;+=C2=A0 =C2=A0 =C2=A0/*=C2=A0 =C2=A0 =C2=A0 * Finally, set the GET= _BUF =C2=A0to signal to distributor that cache=C2=A0 =C2=A0 =C2=A0 * line i= s ready for processing@@ -161,7 +162,7 @@ rte_distributor_return_pkt(struct= rte_distributor *d,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int worker_i= d, struct rte_mbuf **oldpkt, int num)=C2=A0{=C2=A0 =C2=A0 =C2=A0struct rte_= distributor_buffer *buf =3D &d->bufs[worker_id];- =C2=A0 =C2=A0unsig= ned int i;+ =C2=A0 =C2=A0int i;=C2=A0=C2=A0 =C2=A0 =C2=A0if (unlikely(d->= ;alg_type =3D=3D RTE_DIST_ALG_SINGLE)) {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0i= f (num =3D=3D 1)@@ -186,16 +187,19 @@ rte_distributor_return_pkt(struct rte= _distributor *d,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rte_pause()= ;=C2=A0 =C2=A0 =C2=A0}=C2=A0+ =C2=A0 =C2=A0if (unlikely(num > RTE_DIST_B= URST_SIZE || num < 0)) {+ =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;+ = =C2=A0 =C2=A0}+=C2=A0 =C2=A0 =C2=A0/* Sync with distributor to acquire retp= trs */=C2=A0 =C2=A0 =C2=A0__atomic_thread_fence(__ATOMIC_ACQUIRE);- =C2=A0 = =C2=A0for (i =3D 0; i < RTE_DIST_BURST_SIZE; i++)- =C2=A0 =C2=A0 =C2=A0 = =C2=A0/* Switch off the return bit first */- =C2=A0 =C2=A0 =C2=A0 =C2=A0buf= ->retptr64[i] =3D 0;-- =C2=A0 =C2=A0for (i =3D num; i-- > 0; )+ =C2= =A0 =C2=A0for (i =3D 0; i < num; i++)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0b= uf->retptr64[i] =3D (((int64_t)(uintptr_t)oldpkt[i]) <<=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_DISTRIB_FLAG_BITS) | RTE_DISTRIB_= VALID_BUF;=C2=A0+ =C2=A0 =C2=A0for (i =3D num; i < RTE_DIST_BURST_SIZE; = i++)+ =C2=A0 =C2=A0 =C2=A0 =C2=A0buf->retptr64[i] =3D 0;+=C2=A0 =C2=A0 = =C2=A0/* Use RETURN_BUF on bufptr64 to notify distributor that=C2=A0 =C2=A0= =C2=A0 * we won't read any mbufs from there even if GET_BUF is set.=C2=A0 = =C2=A0 =C2=A0 * This allows distributor to retrieve in-flight already sent = packets.diff --git a/lib/distributor/rte_distributor.h b/lib/distributor/rt= e_distributor.hindex a073e64612..337ff8e0fe 100644--- a/lib/distributor/rte= _distributor.h+++ b/lib/distributor/rte_distributor.h@@ -160,7 +160,11 @@ r= te_distributor_clear_returns(struct rte_distributor *d);=C2=A0 * =C2=A0 The= number of packets being returned=C2=A0 *=C2=A0 * @return- * =C2=A0 The num= ber of packets in the pkts array+ * =C2=A0 The number of packets in the pkt= s array or+ * =C2=A0 -EINVAL if num is greater than 1 (RTE_DIST_ALG_SINGLE)= + * =C2=A0 -EINVAL if num is greater than RTE_DIST_BURST_SIZE or+ * =C2=A0 = =C2=A0less than zero (RTE_DIST_ALG_BURST)+=C2=A0 */=C2=A0int=C2=A0rte_distr= ibutor_get_pkt(struct rte_distributor *d,@@ -180,6 +184,11 @@ rte_distribut= or_get_pkt(struct rte_distributor *d,=C2=A0 * =C2=A0 The previous packets b= eing processed by the worker=C2=A0 * @param num=C2=A0 * =C2=A0 The number o= f packets in the oldpkt array+ *+ * @return+ * =C2=A0 The number of packets= in the pkts array or+ * =C2=A0 -EINVAL if retcount is greater than 1 (RTE_= DIST_ALG_SINGLE)+ * =C2=A0 -EINVAL if retcount is greater than RTE_DIST_BUR= ST_SIZE (RTE_DIST_ALG_BURST)=C2=A0 */=C2=A0int=C2=A0rte_distributor_return_= pkt(struct rte_distributor *d,--=C2=A02.41.0 --=_1370472e-2cdf-47b5-854f-d33154f3549f Content-Type: multipart/related; boundary="=_52a36fc6-63cc-476d-923e-07d5d46292e6" --=_52a36fc6-63cc-476d-923e-07d5d46292e6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
From fe8850cb3b7c= 1051784e5587b9f79beeaf87a804 Mon Sep 17 00:00:00 2001
From: bullvolkan <volkan.atl= i@b-ulltech.com>
Date: Fri, 20 Oct 2023 21:48:30 +0300
Subject: [PATCH] distributor: enhance= error handling for consistency
=C2=A0
This commit impro= ves error handling in the distributor component to ensure
consistency and reliability= . It addresses invalid 'num' values in 'lcore_worker',
corrects 'retptr64' initializa= tion in 'rte_distributor_request_pkt', and checks
the validity of 'num' in 'rte_dis= tributor_return_pkt'. These changes enhance
error handling and maintain code consiste= ncy.
=C2=A0
Signed-off-by: Vo= lkan Atli <volkan.atli@b-ulltech.com>
---
=C2=A0.mailmap =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A02 +-
=C2=A0example= s/distributor/main.c =C2=A0 =C2=A0 =C2=A0 | =C2=A09 +++++++--
<= span style=3D"font-family: 'courier new', courier;">=C2=A0lib/distributor/r= te_distributor.c | 24 ++++++++++++++----------

=C2=A0lib/distributor/rte_distributor.= h | 11 ++++++++++-
=C2=A04 files changed, 32 insertions(+), 14 deletions(-)
=C2=A0
diff --git a/.mai= lmap b/.mailmap
index 3f5bab26a8..d0fe75fa8b 100644
--- a/.mailmap
+++ b/.mailmap
@@ -63,7 +63,7 @@ Alfredo Cardigl= iano <cardigliano@ntop.org>
=C2=A0Ali Alnubani <alialnu@nvidia.com> <a= lialnu@mellanox.com>
=C2=A0Alice Michael <alice.michael@intel.com>=C2=A0Alin Rauta &l= t;alin.rauta@intel.com>
-Ali Volkan Atli <volkan.atli@argela.com.tr><= br />+Ali Volkan Atli = <volkan.atli@b-ulltech.com>
=C2=A0Allain Legacy <allain.legacy@windriver.com= >
=C2= =A0Allen Hubbe <allen.hubbe@amd.com>
=C2=A0Alok Makhariya <alok.makhariya@nx= p.com>
= diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 21304d66= 18..58369c3faa 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -634,8 +634,= 8 @@ lcore_worker(struct lcore_params *p)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0struct rte_distributor *d= =3D p->d;
=C2=A0 =C2=A0 =C2=A0const unsigned id =3D p->worker_id;
= - =C2=A0 =C2=A0unsigne= d int num =3D 0;
- =C2=A0 =C2=A0unsigned int i;
+ =C2=A0 =C2=A0int num =3D 0;
+ =C2=A0 =C2=A0int i;
=C2=A0=C2=A0 =C2=A0 =C2= =A0/*
=C2= =A0 =C2=A0 =C2=A0 * for single port, xor_val will be zero so we won't modif= y the output
@@ -652,6 +652,11 @@ lcore_worker(struct lcore_params *p)
=C2=A0 =C2=A0 =C2=A0prin= tf("\nCore %u acting as worker core.\n", rte_lcore_id());

=C2=A0 =C2=A0 =C2=A0while (= !quit_signal_work) {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0num =3D rte_distributor_get_pk= t(d, id, buf, buf, num);
+
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0if (unlikely(num < 0 || num > 8))= {
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rte_exit(EXIT_FAILURE, "strange retco= unt %u\n", num);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Do a little bit of= work for each packet */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < num; = i++) {
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint64_t t =3D rte_rdtsc()+100= ;
diff --g= it a/lib/distributor/rte_distributor.c b/lib/distributor/rte_distributor.c<= /span>
index 5ca8= 0dd44f..92653dd9ca 100644
--- a/lib/distributor/rte_distributor.c
+++ b/lib/distributor/rte_dis= tributor.c
@@ -64,15 +64,16 @@ rte_distributor_request_pkt(struct rte_distributor *d,=
=C2=A0 = =C2=A0 =C2=A0 * handshake bits. Populate the retptrs with returning packets= .
=C2=A0 = =C2=A0 =C2=A0 */
=C2=A0
- =C2=A0 =C2=A0for (i =3D count; i < RTE_DIST_BURST_SIZE; i++)
- =C2=A0 =C2=A0= =C2=A0 =C2=A0buf->retptr64[i] =3D 0;
-
=C2=A0 =C2=A0 =C2=A0/* Set VALID_BUF bit for each pa= cket returned */
- =C2=A0 =C2=A0for (i =3D count; i-- > 0; )
+ =C2=A0 =C2=A0size_t arr_len = =3D sizeof(buf->retptr64) / sizeof(buf->retptr64[0]);
+ =C2=A0 =C2=A0for (i =3D= 0; i < RTE_MIN(count, arr_len); ++i)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0buf->re= tptr64[i] =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(((int64_t)(uintptr_t)(= oldpkt[i])) <<
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_DISTRIB_FLAG= _BITS) | RTE_DISTRIB_VALID_BUF;
=C2=A0
+ =C2=A0 =C2=A0for (i =3D count; i < RTE_DIST_BURST_S= IZE; i++)
= + =C2=A0 =C2=A0 =C2=A0 =C2=A0buf->retptr64[i] =3D 0;
+
=C2=A0 =C2=A0 =C2=A0/*
=C2=A0 =C2=A0 =C2=A0 * F= inally, set the GET_BUF =C2=A0to signal to distributor that cache
=C2=A0 =C2=A0 =C2= =A0 * line is ready for processing
@@ -161,7 +162,7 @@ rte_distributor_return_pkt(str= uct rte_distributor *d,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int worker_id, str= uct rte_mbuf **oldpkt, int num)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0struct rte_distributor_buffer *buf = =3D &d->bufs[worker_id];
- =C2=A0 =C2=A0unsigned int i;
+ =C2=A0 =C2=A0int i;
=C2=A0
<= span style=3D"font-family: 'courier new', courier;">=C2=A0 =C2=A0 =C2=A0if = (unlikely(d->alg_type =3D=3D RTE_DIST_ALG_SINGLE)) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0if (num =3D=3D 1)
@@ -186,16 +187,19 @@ rte_distributor_return_pkt(struct rte_d= istributor *d,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rte_pause();=C2=A0 =C2=A0 =C2= =A0}
=C2= =A0
+ =C2= =A0 =C2=A0if (unlikely(num > RTE_DIST_BURST_SIZE || num < 0)) {
+ =C2=A0 =C2=A0= =C2=A0 =C2=A0return -EINVAL;
+ =C2=A0 =C2=A0}
+
=C2=A0 =C2=A0 =C2=A0/* Sync with distributor to acquire = retptrs */
=C2=A0 =C2=A0 =C2=A0__atomic_thread_fence(__ATOMIC_ACQUIRE);
<= span style=3D"font-family: 'courier new', courier;">- =C2=A0 =C2=A0for (i = =3D 0; i < RTE_DIST_BURST_SIZE; i++)

- =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Switch off th= e return bit first */
- =C2=A0 =C2=A0 =C2=A0 =C2=A0buf->retptr64[i] =3D 0;<= br />-
- =C2=A0 =C2=A0for (i =3D= num; i-- > 0; )
+ =C2=A0 =C2=A0for (i =3D 0; i < num; i++)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0buf->retptr64[i] =3D (((int64_t)(uintptr_t)oldpkt[i]) <<

=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_DISTRIB_FLAG_BITS) | RTE_DISTRIB_VAL= ID_BUF;
= =C2=A0
+ = =C2=A0 =C2=A0for (i =3D num; i < RTE_DIST_BURST_SIZE; i++)
<= span style=3D"font-family: 'courier new', courier;">+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0buf->retptr64[i] =3D 0;
+
=C2=A0 =C2=A0 =C2=A0/* Use RETURN_BUF on bufptr64 to notify = distributor that
=C2=A0 =C2=A0 =C2=A0 * we won't read any mbufs from there even if GE= T_BUF is set.
=C2=A0 =C2=A0 =C2=A0 * This allows distributor to retrieve in-flight al= ready sent packets.
diff --git a/lib/distributor/rte_distributor.h b/lib/distributor/= rte_distributor.h
index a073e64612..337ff8e0fe 100644
--- a/lib/distributor/rte_distributor.h
+++ b/lib/d= istributor/rte_distributor.h
@@ -160,7 +160,11 @@ rte_distributor_clear_returns(struc= t rte_distributor *d);
=C2=A0 *
=C2=A0 * @return
- * =C2=A0 Th= e number of packets in the pkts array
+ * =C2=A0 The number of packets in the pkts ar= ray or
+ *= =C2=A0 -EINVAL if num is greater than 1 (RTE_DIST_ALG_SINGLE)
= + * =C2=A0 -EINVAL if = num is greater than RTE_DIST_BURST_SIZE or
+ * =C2=A0 =C2=A0less than zero (RTE_DIST_= ALG_BURST)
+
=C2=A0 = */
=C2=A0i= nt
=C2=A0r= te_distributor_get_pkt(struct rte_distributor *d,
@@ -180,6 +184,11 @@ rte_distribu= tor_get_pkt(struct rte_distributor *d,
=C2=A0 * =C2=A0 The previous packets being pro= cessed by the worker
=C2=A0 * @param num
=C2=A0 * =C2=A0 The number of packets in the oldpkt ar= ray
+ *
+ * @return<= /span>
+ * =C2=A0= The number of packets in the pkts array or
+ * =C2=A0 -EINVAL if retcount is greater= than 1 (RTE_DIST_ALG_SINGLE)
+ * =C2=A0 -EINVAL if retcount is greater than RTE_DIST= _BURST_SIZE (RTE_DIST_ALG_BURST)
=C2=A0 */
=C2=A0int
=C2=A0rte_distributor_return_pkt(struct rte_distribu= tor *d,
--= =C2=A0
2.4= 1.0
--=_52a36fc6-63cc-476d-923e-07d5d46292e6-- --=_1370472e-2cdf-47b5-854f-d33154f3549f--