DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching
@ 2015-10-30 19:00 Adrien Mazarguil
  2015-10-30 19:00 ` [dpdk-dev] [PATCH 2/3] mlx4: do not complain about port state Adrien Mazarguil
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Adrien Mazarguil @ 2015-10-30 19:00 UTC (permalink / raw)
  To: dev

From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Prefetching initial bytes of mbuf structures earlier and in two cache lines
instead of one improves performance of mlx4_rx_burst(), which accesses the
mbuf->next field not present in the first 128 bytes.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx4/mlx4.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index cb08ee8..4cf2f7d 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -2824,6 +2824,12 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		assert(wr->num_sge == 1);
 		assert(elts_head < rxq->elts_n);
 		assert(rxq->elts_head < rxq->elts_n);
+		/*
+		 * Fetch initial bytes of packet descriptor into a
+		 * cacheline while allocating rep.
+		 */
+		rte_prefetch0(seg);
+		rte_prefetch0(&seg->cacheline1);
 		ret = rxq->if_cq->poll_length_flags(rxq->cq, NULL, NULL,
 						    &flags);
 		if (unlikely(ret < 0)) {
@@ -2861,11 +2867,6 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		if (ret == 0)
 			break;
 		len = ret;
-		/*
-		 * Fetch initial bytes of packet descriptor into a
-		 * cacheline while allocating rep.
-		 */
-		rte_prefetch0(seg);
 		rep = __rte_mbuf_raw_alloc(rxq->mp);
 		if (unlikely(rep == NULL)) {
 			/*
-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/3] mlx4: do not complain about port state
  2015-10-30 19:00 [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Adrien Mazarguil
@ 2015-10-30 19:00 ` Adrien Mazarguil
  2015-10-30 19:00 ` [dpdk-dev] [PATCH 3/3] mlx4: fix missing unlock in case of error Adrien Mazarguil
  2015-10-30 23:22 ` [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Adrien Mazarguil @ 2015-10-30 19:00 UTC (permalink / raw)
  To: dev

Port is considering inactive when the related netdevice is down. There is no
reason to warn about it (and confuse users) since it's automatically brought
up later by the PMD.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 4cf2f7d..3b25492 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -4985,9 +4985,9 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 			goto port_error;
 		}
 		if (port_attr.state != IBV_PORT_ACTIVE)
-			WARN("bad state for port %d: \"%s\" (%d)",
-			     port, ibv_port_state_str(port_attr.state),
-			     port_attr.state);
+			DEBUG("port %d is not active: \"%s\" (%d)",
+			      port, ibv_port_state_str(port_attr.state),
+			      port_attr.state);
 
 		/* Allocate protection domain. */
 		pd = ibv_alloc_pd(ctx);
-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 3/3] mlx4: fix missing unlock in case of error
  2015-10-30 19:00 [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Adrien Mazarguil
  2015-10-30 19:00 ` [dpdk-dev] [PATCH 2/3] mlx4: do not complain about port state Adrien Mazarguil
@ 2015-10-30 19:00 ` Adrien Mazarguil
  2015-10-30 23:22 ` [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Adrien Mazarguil @ 2015-10-30 19:00 UTC (permalink / raw)
  To: dev

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 3b25492..691e0e5 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -3652,6 +3652,7 @@ mlx4_dev_start(struct rte_eth_dev *dev)
 			}
 		}
 		priv->started = 0;
+		priv_unlock(priv);
 		return -ret;
 	} while ((--r) && ((rxq = (*priv->rxqs)[++i]), i));
 	priv_dev_interrupt_handler_install(priv, dev);
-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching
  2015-10-30 19:00 [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Adrien Mazarguil
  2015-10-30 19:00 ` [dpdk-dev] [PATCH 2/3] mlx4: do not complain about port state Adrien Mazarguil
  2015-10-30 19:00 ` [dpdk-dev] [PATCH 3/3] mlx4: fix missing unlock in case of error Adrien Mazarguil
@ 2015-10-30 23:22 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2015-10-30 23:22 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: dev

Series applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-30 23:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30 19:00 [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Adrien Mazarguil
2015-10-30 19:00 ` [dpdk-dev] [PATCH 2/3] mlx4: do not complain about port state Adrien Mazarguil
2015-10-30 19:00 ` [dpdk-dev] [PATCH 3/3] mlx4: fix missing unlock in case of error Adrien Mazarguil
2015-10-30 23:22 ` [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching Thomas Monjalon

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).