All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH 1/2] net/tap: remove redundant syscall on Tx
Date: Tue, 14 Mar 2017 13:52:22 +0000	[thread overview]
Message-ID: <BA5B46C0-CB25-4102-B062-046D08C1BA7A@intel.com> (raw)
In-Reply-To: <f8b03c0556b9d7adad14058b5f8c4af26be6d504.1489495663.git.adrien.mazarguil@6wind.com>


> On Mar 14, 2017, at 8:51 PM, Adrien Mazarguil <adrien.mazarguil@6wind.com> wrote:
> 
> Polling the Tx queue file descriptor before writing to it is not mandatory
> since it is configured as non-blocking.
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Acked-by: Pascal Mazon <pascal.mazon@6wind.com>

Acked-by: Keith Wiles <keith.wiles@intel.com>

> ---
> drivers/net/tap/rte_eth_tap.c | 26 ++++++++------------------
> 1 file changed, 8 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index efc4426..c757a7c 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -43,7 +43,6 @@
> #include <sys/ioctl.h>
> #include <sys/mman.h>
> #include <unistd.h>
> -#include <poll.h>
> #include <arpa/inet.h>
> #include <linux/if.h>
> #include <linux/if_tun.h>
> @@ -242,7 +241,6 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
> {
> 	struct rte_mbuf *mbuf;
> 	struct tx_queue *txq = queue;
> -	struct pollfd pfd;
> 	uint16_t num_tx = 0;
> 	unsigned long num_tx_bytes = 0;
> 	int i, n;
> @@ -250,26 +248,18 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
> 	if (unlikely(nb_pkts == 0))
> 		return 0;
> 
> -	pfd.events = POLLOUT;
> -	pfd.fd = txq->fd;
> 	for (i = 0; i < nb_pkts; i++) {
> -		n = poll(&pfd, 1, 0);
> -
> +		/* copy the tx frame data */
> +		mbuf = bufs[num_tx];
> +		n = write(txq->fd,
> +			  rte_pktmbuf_mtod(mbuf, void *),
> +			  rte_pktmbuf_pkt_len(mbuf));
> 		if (n <= 0)
> 			break;
> 
> -		if (pfd.revents & POLLOUT) {
> -			/* copy the tx frame data */
> -			mbuf = bufs[num_tx];
> -			n = write(pfd.fd, rte_pktmbuf_mtod(mbuf, void*),
> -				  rte_pktmbuf_pkt_len(mbuf));
> -			if (n <= 0)
> -				break;
> -
> -			num_tx++;
> -			num_tx_bytes += mbuf->pkt_len;
> -			rte_pktmbuf_free(mbuf);
> -		}
> +		num_tx++;
> +		num_tx_bytes += mbuf->pkt_len;
> +		rte_pktmbuf_free(mbuf);
> 	}
> 
> 	txq->stats.opackets += num_tx;
> -- 
> 2.1.4
> 

Regards,
Keith

  parent reply	other threads:[~2017-03-14 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 12:51 [PATCH 1/2] net/tap: remove redundant syscall on Tx Adrien Mazarguil
2017-03-14 12:51 ` [PATCH 2/2] net/tap: add Rx trigger Adrien Mazarguil
2017-03-14 13:57   ` Wiles, Keith
2017-03-14 13:52 ` Wiles, Keith [this message]
2017-03-14 17:04   ` [PATCH 1/2] net/tap: remove redundant syscall on Tx 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=BA5B46C0-CB25-4102-B062-046D08C1BA7A@intel.com \
    --to=keith.wiles@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    /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.