DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Ilya Matveychikov <matvejchikov@gmail.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] net/pcap: remove single interface constraint (v2)
Date: Mon, 6 Nov 2017 14:57:59 -0800	[thread overview]
Message-ID: <4c209d9c-3109-8f75-c866-ef6bddd5dae8@intel.com> (raw)
In-Reply-To: <BFDB638E-C70B-4709-8C8D-5E7153D60AFA@gmail.com>

On 11/5/2017 2:15 AM, Ilya Matveychikov wrote:
> Hello folks,
> 
> This patch removes single interface constraint from the libpcap-based PMD.
> The problem it solves is to allow PCAP device consists of more than single
> device:
> 
>  # testpmd --vdev net_pcap0,iface=vethA,iface=vethB,iface=vethC and so..
> 
> I found the issue when performed RSS emulation based on PCAP PMD. For my
> task I had to create multi-queue PCAP device based on a number of veth
> devices which in turn was combined in bonding device.

Hi Ilya,

Overall patch looks good.

But patch does two things,
1- remove "single_iface" variable and replace it with
  "internals->tx_queue[0].pcap == internals->rx_queue[0].pcap" checks.

  perhaps variable name is misleading but it is to say Rx and Tx are not
different, but single interface, which is still valid.

2- Add multi-queue support. For this case, replace hardcoded queue 0 to variable
length.


Would you mind keeping "single_iface" as it is but add multi-queue support?

Also, multi-queue support for other types seems broken, if you have time can you
please send a patch to fix them as well, see below [1] for detail.


Thanks,
ferruh

> 
> Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>

<...>

> @@ -737,9 +744,14 @@ open_rx_tx_iface(const char *key, const char *value, void *extra_args)
> 	if (open_single_iface(iface, &pcap) < 0)
> 		return -1;
> 
> -	tx->queue[0].pcap = pcap;
> -	tx->queue[0].name = iface;
> -	tx->queue[0].type = key;
> +	for (i = 0; i < tx->num_of_queue; i++) {
> +		if (tx->queue[i].pcap == NULL) {

[1]: This check is missing for open_rx_iface, open_tx_iface, open_rx_pcap and
open_tx_pcap.

It is possible to implement as:

for (i = 0; i < rx->num_of_queue; i++) {
  if (rx->queue[i].name)
	continue;

  <this part is same old code>

  break;
}

> +			tx->queue[i].pcap = pcap;
> +			tx->queue[i].name = iface;
> +			tx->queue[i].type = key;
> +			break;
> +		}
> +	}
> 
> 	return 0;
> }

<...>

> @@ -953,19 +960,21 @@ pmd_pcap_probe(struct rte_vdev_device *dev)
> 	 * If iface argument is passed we open the NICs and use them for
> 	 * reading / writing
> 	 */
> -	if (rte_kvargs_count(kvlist, ETH_PCAP_IFACE_ARG) == 1) {
> +	if (rte_kvargs_count(kvlist, ETH_PCAP_IFACE_ARG)) {
> +		int i, queues = rte_kvargs_count(kvlist, ETH_PCAP_IFACE_ARG);

Can prevent duplicate call of rte_kvargs_count() by moving queues above if.

<...>

      reply	other threads:[~2017-11-06 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05  7:41 [dpdk-dev] net/pcap: remove single interface constraint Ilya Matveychikov
2017-11-05 10:15 ` [dpdk-dev] net/pcap: remove single interface constraint (v2) Ilya Matveychikov
2017-11-06 22:57   ` Ferruh Yigit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c209d9c-3109-8f75-c866-ef6bddd5dae8@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=matvejchikov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).