All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Mazon <pascal.mazon@6wind.com>
To: Keith Wiles <keith.wiles@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH 3/5] net/tap: remove redundant fds array
Date: Fri, 3 Feb 2017 10:38:42 +0100	[thread overview]
Message-ID: <20170203103842.2af1e8e9@paques.dev.6wind.com> (raw)
In-Reply-To: <20170202223330.39240-3-keith.wiles@intel.com>

On Thu,  2 Feb 2017 16:33:28 -0600
Keith Wiles <keith.wiles@intel.com> wrote:

> Signed-off-by: Keith Wiles <keith.wiles@intel.com>
> ---
>  drivers/net/tap/rte_eth_tap.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index 9ed7a87..6673182 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -103,7 +103,6 @@ struct pmd_internals {
>  	struct ether_addr eth_addr;	/* Mac address of the device port
> */ 
>  	int if_index;			/* IF_INDEX for the port */
> -	int fds[RTE_PMD_TAP_MAX_QUEUES]; /* List of all file descriptors */
>  
>  	struct rx_queue rxq[RTE_PMD_TAP_MAX_QUEUES];	/* List of RX
> queues */ struct tx_queue txq[RTE_PMD_TAP_MAX_QUEUES];	/* List of TX
> queues */ @@ -350,8 +349,8 @@ tap_dev_stop(struct rte_eth_dev *dev)
>  	struct pmd_internals *internals = dev->data->dev_private;
>  
>  	for (i = 0; i < internals->nb_queues; i++)
> -		if (internals->fds[i] != -1)
> -			close(internals->fds[i]);
> +		if (internals->rxq[i].fd != -1)
> +			close(internals->rxq[i].fd);
>  	tap_link_set_down(dev);
>  }
>  
> @@ -583,7 +582,6 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
>  	if (fd == -1)
>  		return -1;
>  
> -	internals->fds[rx_queue_id] = fd;
>  	RTE_LOG(INFO, PMD, "RX TAP device name %s, qid %d on fd %d\n",
>  		internals->name, rx_queue_id,
> internals->rxq[rx_queue_id].fd); 
> @@ -720,7 +718,6 @@ eth_dev_tap_create(const char *name, char *tap_name)
>  
>  	/* Presetup the fds to -1 as being not working */
>  	for (i = 1; i < RTE_PMD_TAP_MAX_QUEUES; i++) {
> -		pmd->fds[i] = -1;
>  		pmd->rxq[i].fd = -1;
>  		pmd->txq[i].fd = -1;
>  	}
> @@ -728,7 +725,6 @@ eth_dev_tap_create(const char *name, char *tap_name)
>  	/* Take the TUN/TAP fd and place in the first location */
>  	pmd->rxq[0].fd = fd;
>  	pmd->txq[0].fd = fd;
> -	pmd->fds[0] = fd;
>  
>  	if (pmd_mac_address(fd, dev, &pmd->eth_addr) < 0) {
>  		RTE_LOG(ERR, PMD, "Unable to get MAC address\n");
> @@ -851,8 +847,8 @@ rte_pmd_tap_remove(const char *name)
>  
>  	internals = eth_dev->data->dev_private;
>  	for (i = 0; i < internals->nb_queues; i++)
> -		if (internals->fds[i] != -1)
> -			close(internals->fds[i]);
> +		if (internals->rxq[i].fd != -1)
> +			close(internals->rxq[i].fd);
>  
>  	rte_free(eth_dev->data->dev_private);
>  	rte_free(eth_dev->data);

Acked-by: Pascal Mazon <pascal.mazon@6wind.com>

  reply	other threads:[~2017-02-03  9:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 22:33 [PATCH 1/5] nic/tap: fix tap docs for device name Keith Wiles
2017-02-02 22:33 ` [PATCH 2/5] net/tap: fix multi-queue support Keith Wiles
2017-02-03  9:37   ` Pascal Mazon
2017-02-03 20:32     ` Wiles, Keith
2017-02-02 22:33 ` [PATCH 3/5] net/tap: remove redundant fds array Keith Wiles
2017-02-03  9:38   ` Pascal Mazon [this message]
2017-02-02 22:33 ` [PATCH 4/5] net/tap: fix up log message to correct channel Keith Wiles
2017-02-03  9:45   ` Pascal Mazon
2017-02-02 22:33 ` [PATCH 5/5] net/tap: remove unused variable and minor cleanup Keith Wiles
2017-02-03  9:47   ` Pascal Mazon
2017-02-03  9:32 ` [PATCH 1/5] nic/tap: fix tap docs for device name Pascal Mazon
2017-02-03 11:48   ` Ferruh Yigit
2017-02-05 16:05 ` [PATCH v2 1/6] net/tap: " Keith Wiles
2017-02-05 16:05 ` [PATCH v2 2/6] net/tap: remove redundant fds array Keith Wiles
2017-02-05 16:05 ` [PATCH v2 3/6] net/tap: remove unused variable and minor cleanup Keith Wiles
2017-02-05 16:05 ` [PATCH v2 4/6] net/tap: fix multi-queue support Keith Wiles
2017-02-06 15:45   ` Pascal Mazon
2017-02-06 15:57     ` Wiles, Keith
2017-02-05 16:05 ` [PATCH v2 5/6] net/tap: cleanup log messages Keith Wiles
2017-02-05 16:05 ` [PATCH v2 6/6] net/tap: link set down must be before close Keith Wiles
2017-02-06 15:57   ` Pascal Mazon
2017-02-06 16:03     ` Wiles, Keith
2017-02-06 19:40 ` [PATCH v3 1/7] net/tap: fix tap docs for device name Keith Wiles
2017-02-06 19:40 ` [PATCH v3 2/7] net/tap: remove redundant fds array Keith Wiles
2017-02-06 19:40 ` [PATCH v3 3/7] net/tap: remove unused variable and minor cleanup Keith Wiles
2017-02-06 19:40 ` [PATCH v3 4/7] net/tap: fix multi-queue support Keith Wiles
2017-02-06 19:40 ` [PATCH v3 5/7] net/tap: cleanup log messages Keith Wiles
2017-02-06 19:40 ` [PATCH v3 6/7] net/tap: link set down must be done before close Keith Wiles
2017-02-06 19:40 ` [PATCH v3 7/7] net/tap: move closing fds to pmd close from pmd stop Keith Wiles
2017-02-07  8:51   ` Pascal Mazon
2017-02-07 14:06     ` 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=20170203103842.2af1e8e9@paques.dev.6wind.com \
    --to=pascal.mazon@6wind.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.