net/pcap: fix input only Rx
diff mbox series

Message ID 20201008113425.241010-1-ferruh.yigit@intel.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • net/pcap: fix input only Rx
Related show

Checks

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

Commit Message

Ferruh Yigit Oct. 8, 2020, 11:34 a.m. UTC
When input only Rx interface argument 'rx_iface_in' provided, current
code assigns 'eth_null_rx' burst function by mistake and no packet
received as a result.
Like in following usage no packets received from physical interface:
"--vdev net_pcap0,rx_iface_in=eth0,tx_iface=eth0"

Fixing the burst function assignment when 'rx_iface_in' argument is used

Fixes: f14a94591504 ("net/pcap: remove Rx queue argument necessity")
Cc: stable@dpdk.org

Reported-by: Muthurajan Jayakumar <muthurajan.jayakumar@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: aideen.mcloughlin@intel.com
---
 drivers/net/pcap/rte_eth_pcap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ferruh Yigit Oct. 9, 2020, 2:39 p.m. UTC | #1
On 10/8/2020 12:34 PM, Ferruh Yigit wrote:
> When input only Rx interface argument 'rx_iface_in' provided, current
> code assigns 'eth_null_rx' burst function by mistake and no packet
> received as a result.
> Like in following usage no packets received from physical interface:
> "--vdev net_pcap0,rx_iface_in=eth0,tx_iface=eth0"
> 
> Fixing the burst function assignment when 'rx_iface_in' argument is used
> 
> Fixes: f14a94591504 ("net/pcap: remove Rx queue argument necessity")
> Cc: stable@dpdk.org
> 
> Reported-by: Muthurajan Jayakumar <muthurajan.jayakumar@intel.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.

Patch
diff mbox series

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index da4988064a..057aa9dbfc 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1416,7 +1416,8 @@  pmd_pcap_probe(struct rte_vdev_device *dev)
 	devargs_all.is_rx_pcap =
 		rte_kvargs_count(kvlist, ETH_PCAP_RX_PCAP_ARG) ? 1 : 0;
 	devargs_all.is_rx_iface =
-		rte_kvargs_count(kvlist, ETH_PCAP_RX_IFACE_ARG) ? 1 : 0;
+		(rte_kvargs_count(kvlist, ETH_PCAP_RX_IFACE_ARG) +
+		 rte_kvargs_count(kvlist, ETH_PCAP_RX_IFACE_IN_ARG)) ? 1 : 0;
 	pcaps.num_of_queue = 0;
 
 	devargs_all.is_tx_pcap =