From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC PATCH 11/14] ixgbe: make mbuf_initializer queue variable global
Date: Mon, 11 Aug 2014 21:44:47 +0100 [thread overview]
Message-ID: <1407789890-17355-12-git-send-email-bruce.richardson@intel.com> (raw)
In-Reply-To: <1407789890-17355-1-git-send-email-bruce.richardson@intel.com>
On descriptor rearm, the mbuf_initializer variable can be used to do a
single-shot write to an mbuf to initialize all variables that can be
set. This is currently used only by vector PMD function, but now allow
it to be generally used by other RX code paths.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 25 +++++++++++++++++++++++--
lib/librte_pmd_ixgbe/ixgbe_rxtx.h | 9 ++++++---
lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 25 +------------------------
3 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index f9cc352..fadb9a0 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -90,6 +90,27 @@
ETH_RSS_IPV6_UDP | \
ETH_RSS_IPV6_UDP_EX)
+int
+ixgbe_set_mbuf_initializer(struct igb_rx_queue *rxq)
+{
+ static struct rte_mbuf mb_def = {
+ .buf_len = 0,
+ .data_len = 0,
+
+ .data_off = RTE_PKTMBUF_HEADROOM,
+#ifdef RTE_MBUF_REFCNT
+ .refcnt = 1,
+#endif
+ .nb_segs = 1,
+ .port = 0
+ };
+
+ mb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);
+ mb_def.port = rxq->port_id;
+ rxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data);
+ return 0;
+}
+
static inline struct rte_mbuf *
rte_rxmbuf_alloc(struct rte_mempool *mp)
{
@@ -1878,7 +1899,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
PMD_INIT_LOG(INFO, "Using simple tx code path\n");
#ifdef RTE_IXGBE_INC_VECTOR
if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ &&
- ixgbe_txq_vec_setup(txq, socket_id) == 0) {
+ ixgbe_txq_vec_setup(txq) == 0) {
PMD_INIT_LOG(INFO, "Vector tx enabled.\n");
dev->tx_pkt_burst = ixgbe_xmit_pkts_vec;
}
@@ -2169,7 +2190,6 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
if (!ixgbe_rx_vec_condition_check(dev)) {
PMD_INIT_LOG(INFO, "Vector rx enabled, please make "
"sure RX burst size no less than 32.\n");
- ixgbe_rxq_vec_setup(rxq, socket_id);
dev->rx_pkt_burst = ixgbe_recv_pkts_vec;
}
#endif
@@ -2183,6 +2203,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
}
dev->data->rx_queues[queue_idx] = rxq;
+ ixgbe_set_mbuf_initializer(rxq);
ixgbe_reset_rx_queue(rxq);
return 0;
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
index d9889d9..76db3ca 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
@@ -107,6 +107,7 @@ struct igb_rx_queue {
struct igb_rx_entry *sw_ring; /**< address of RX software ring. */
struct rte_mbuf *pkt_first_seg; /**< First segment of current packet. */
struct rte_mbuf *pkt_last_seg; /**< Last segment of current packet. */
+ uint64_t mbuf_initializer; /**< value to init mbufs */
uint16_t nb_rx_desc; /**< number of RX descriptors. */
uint16_t rx_tail; /**< current value of RDT register. */
uint16_t nb_rx_hold; /**< number of held free RX desc. */
@@ -118,7 +119,6 @@ struct igb_rx_queue {
#ifdef RTE_IXGBE_INC_VECTOR
uint16_t rxrearm_nb; /**< the idx we start the re-arming from */
uint16_t rxrearm_start; /**< number of remaining to be re-armed */
- uint64_t mbuf_initializer; /**< value to init mbufs */
#endif
uint16_t rx_free_thresh; /**< max free RX desc to hold. */
uint16_t queue_id; /**< RX queue index. */
@@ -226,9 +226,12 @@ struct ixgbe_txq_ops {
#ifdef RTE_IXGBE_INC_VECTOR
uint16_t ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
uint16_t ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
-int ixgbe_txq_vec_setup(struct igb_tx_queue *txq, unsigned int socket_id);
-int ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq, unsigned int socket_id);
+int ixgbe_txq_vec_setup(struct igb_tx_queue *txq);
int ixgbe_rx_vec_condition_check(struct rte_eth_dev *dev);
#endif
+int
+ixgbe_set_mbuf_initializer(struct igb_rx_queue *rxq);
+
+
#endif
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
index c98356e..39c06e2 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
@@ -45,28 +45,6 @@
#endif
-int
-ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq,
- __rte_unused unsigned int socket_id)
-{
- static struct rte_mbuf mb_def = {
- .buf_len = 0,
- .data_len = 0,
-
- .data_off = RTE_PKTMBUF_HEADROOM,
-#ifdef RTE_MBUF_REFCNT
- .refcnt = 1,
-#endif
- .nb_segs = 1,
- .port = 0
- };
-
- mb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);
- mb_def.port = rxq->port_id;
- rxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data);
- return 0;
-}
-
static inline void
ixgbe_rxq_rearm(struct igb_rx_queue *rxq)
{
@@ -586,8 +564,7 @@ static struct ixgbe_txq_ops vec_txq_ops = {
.reset = ixgbe_reset_tx_queue,
};
-int ixgbe_txq_vec_setup(struct igb_tx_queue *txq,
- unsigned int socket_id __rte_unused)
+int ixgbe_txq_vec_setup(struct igb_tx_queue *txq)
{
if (txq->sw_ring == NULL)
return -1;
--
1.9.3
next prev parent reply other threads:[~2014-08-11 20:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-11 20:44 [dpdk-dev] [RFC PATCH 00/14] Extend the mbuf structure Bruce Richardson
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 01/14] mbuf: rename RTE_MBUF_SCATTER_GATHER into RTE_MBUF_REFCNT Bruce Richardson
2014-08-11 21:45 ` Stephen Hemminger
2014-08-12 7:59 ` Olivier MATZ
2014-08-12 16:25 ` Richardson, Bruce
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 02/14] mbuf: remove rte_ctrlmbuf Bruce Richardson
2014-08-12 8:27 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 03/14] mbuf: remove the rte_pktmbuf structure Bruce Richardson
2014-08-12 8:38 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 04/14] mbuf: replace data pointer by an offset Bruce Richardson
2014-08-12 8:55 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 05/14] mbuf: rename in_port to just port Bruce Richardson
2014-08-12 9:00 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 06/14] mbuf: reorder fields by time-of-use Bruce Richardson
2014-08-12 10:03 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 07/14] ixgbe: rework vector pmd following mbuf changes Bruce Richardson
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 08/14] mbuf: split mbuf across two cache lines Bruce Richardson
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 09/14] Fix performance regression due to moved pool ptr Bruce Richardson
2014-08-12 11:28 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 10/14] mbuf: set next pointer to NULL on mbuf free Bruce Richardson
2014-08-11 20:44 ` Bruce Richardson [this message]
2014-08-11 21:47 ` [dpdk-dev] [RFC PATCH 11/14] ixgbe: make mbuf_initializer queue variable global Stephen Hemminger
2014-08-11 22:03 ` Richardson, Bruce
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 12/14] ixgbe: Make vector stores unaligned Bruce Richardson
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 13/14] mbuf: cleanup + added in additional mbuf fields Bruce Richardson
2014-08-12 14:18 ` Olivier MATZ
2014-08-11 20:44 ` [dpdk-dev] [RFC PATCH 14/14] ixgbe: Allow vector RX of scattered packets Bruce Richardson
2014-08-12 14:43 ` [dpdk-dev] [RFC PATCH 00/14] Extend the mbuf structure Olivier MATZ
2014-08-20 12:22 ` Richardson, Bruce
2014-08-20 7:08 ` Cao, Min
2014-08-20 11:11 ` Richardson, Bruce
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=1407789890-17355-12-git-send-email-bruce.richardson@intel.com \
--to=bruce.richardson@intel.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 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).