From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: net/pcap: set rte_errno on TX error Date: Mon, 25 Jul 2016 14:33:46 +0100 Message-ID: <5796153A.1070007@intel.com> References: <1469452240-1204-1-git-send-email-zoltan.kiss@schaman.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: Nicolas Pernas Maradei To: Zoltan Kiss , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0F2CF5596 for ; Mon, 25 Jul 2016 15:33:49 +0200 (CEST) In-Reply-To: <1469452240-1204-1-git-send-email-zoltan.kiss@schaman.hu> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 7/25/2016 2:10 PM, Zoltan Kiss wrote: > This returns the error code provided by pcap_sendpacket() Although this is good idea, this adds undocumented side effect to rte_eth_tx_burst(). I am not able to find any information in rte_eth_tx_burst() that it can alter rte_errno. Since rte_errno is shared resource, it shouldn't be updated without documented. >=20 > Signed-off-by: Zoltan Kiss >=20 > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth= _pcap.c > index 7e213eb..0899bac 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -41,6 +41,7 @@ > #include > #include > #include > +#include > =20 > #include > =20 > @@ -360,8 +361,10 @@ eth_pcap_tx(void *queue, > } > } > =20 > - if (unlikely(ret !=3D 0)) > + if (unlikely(ret !=3D 0)) { > + rte_errno =3D ret; > break; > + } > num_tx++; > tx_bytes +=3D mbuf->pkt_len; > rte_pktmbuf_free(mbuf); >=20