DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Wiles, Keith" <keith.wiles@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/tap: driver closing tx interface on queue setup
Date: Mon, 30 Jan 2017 17:42:24 +0000	[thread overview]
Message-ID: <eb7f6a2b-fef0-780c-9d30-5f0d33782ec5@intel.com> (raw)
In-Reply-To: <6B37A978-0F89-4299-86E1-5697392EDC49@intel.com>

On 1/30/2017 2:34 PM, Wiles, Keith wrote:
> 
>> On Jan 30, 2017, at 5:00 AM, Yigit, Ferruh <ferruh.yigit@intel.com> wrote:
>>
>> On 1/29/2017 2:12 AM, Keith Wiles wrote:
>>> The tap driver setup both rx and tx file descriptors when the
>>> rte_eth_rx_queue_setup() causing the tx to be closed when tx setup
>>> was called.
>>
>> Can you please describe the problem more.
>> Without this patch rx->fd == tx->fd, with this patch rx and tx has
>> different file descriptors.
> 
> Let me look at this more, I am getting the same FD for both. Must be something else going on.

After patch, tun_alloc() called twice, one for Rx_q and other for Tx_q.
And tun_alloc does open() to "/dev/net/tun", I expect they get different
file descriptors.

And if they have same FD, won't this cause same problem,
rx_queue_setup() will close the FD, if Tx_q has same FD it will have
invalid descriptor.

> 
>>
>> What was the wrong with rx and tx having same fd?
>>
>> As far as I can see, rte_eth_rx_queue_setup() won't close tx->fd, that
>> function will do nothing if rx or tx has valid fd.
> 
> The rte_eth_rx_queue_setup() look at line 1146 if rxq has a value then release it, which happens on both Rx/Tx code
> 
> 	rxq = dev->data->rx_queues;
> 	if (rxq[rx_queue_id]) {
> 		RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_release,
> 					-ENOTSUP);
> 		(*dev->dev_ops->rx_queue_release)(rxq[rx_queue_id]);
> 		rxq[rx_queue_id] = NULL;
> 	}

Got it thanks, I missed (relatively new) above code piece.

> 
> 	if (rx_conf == NULL)
> 		rx_conf = &dev_info.default_rxconf;
> 
> 	ret = (*dev->dev_ops->rx_queue_setup)(dev, rx_queue_id, nb_rx_desc,
> 					      socket_id, rx_conf, mp);
> 
>>
>>>
>>> Signed-off-by: Keith Wiles <keith.wiles@intel.com>
>>
>> <...>
> 
> Regards,
> Keith
> 

  reply	other threads:[~2017-01-30 17:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-29  2:12 Keith Wiles
2017-01-30 11:00 ` Ferruh Yigit
2017-01-30 14:34   ` Wiles, Keith
2017-01-30 17:42     ` Ferruh Yigit [this message]
2017-01-30 18:20       ` Wiles, Keith
2017-01-30 19:31         ` Ferruh Yigit
2017-01-30 14:38   ` Pascal Mazon
2017-01-30 15:04     ` Wiles, Keith
2017-01-30 17:19     ` Ferruh Yigit
2017-01-30 20:54 ` [dpdk-dev] [PATCH v2] net/tap: fix invalid queue file descriptor Ferruh Yigit
2017-01-30 20:57   ` Wiles, Keith
2017-01-30 21:23     ` Ferruh Yigit

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=eb7f6a2b-fef0-780c-9d30-5f0d33782ec5@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.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).