From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 25 Jul 2016 06:33:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,419,1464678000"; d="scan'208";a="739437138" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.43]) ([10.237.220.43]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jul 2016 06:33:47 -0700 To: Zoltan Kiss , dev@dpdk.org References: <1469452240-1204-1-git-send-email-zoltan.kiss@schaman.hu> Cc: Nicolas Pernas Maradei From: Ferruh Yigit Message-ID: <5796153A.1070007@intel.com> Date: Mon, 25 Jul 2016 14:33:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1469452240-1204-1-git-send-email-zoltan.kiss@schaman.hu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] net/pcap: set rte_errno on TX error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 13:33:51 -0000 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. > > Signed-off-by: Zoltan Kiss > > 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 > > #include > > @@ -360,8 +361,10 @@ eth_pcap_tx(void *queue, > } > } > > - if (unlikely(ret != 0)) > + if (unlikely(ret != 0)) { > + rte_errno = ret; > break; > + } > num_tx++; > tx_bytes += mbuf->pkt_len; > rte_pktmbuf_free(mbuf); >