DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 09/14] fm10k: add function to decide best RX function
Date: Tue, 29 Sep 2015 21:03:39 +0800	[thread overview]
Message-ID: <1443531824-22767-10-git-send-email-jing.d.chen@intel.com> (raw)
In-Reply-To: <1443531824-22767-1-git-send-email-jing.d.chen@intel.com>

From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>

Add func fm10k_set_rx_function to decide best RX func in
fm10k_dev_rx_init

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
---
 drivers/net/fm10k/fm10k.h        |    1 +
 drivers/net/fm10k/fm10k_ethdev.c |   36 ++++++++++++++++++++++++++++++++----
 2 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h
index 744e8d0..d22debe 100644
--- a/drivers/net/fm10k/fm10k.h
+++ b/drivers/net/fm10k/fm10k.h
@@ -187,6 +187,7 @@ struct fm10k_rx_queue {
 	/* Below 2 fields only valid in case vPMD is applied. */
 	uint16_t rxrearm_nb;     /* number of remaining to be re-armed */
 	uint16_t rxrearm_start;  /* the idx we start the re-arming from */
+	uint16_t rx_using_sse; /* indicates that vector RX is in use */
 	uint8_t port_id;
 	uint8_t drop_en;
 	uint8_t rx_deferred_start; /* don't start this queue in dev start. */
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 24f936a..53c4ef1 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -67,6 +67,7 @@ static void
 fm10k_MACVLAN_remove_all(struct rte_eth_dev *dev);
 static void fm10k_tx_queue_release(void *queue);
 static void fm10k_rx_queue_release(void *queue);
+static void fm10k_set_rx_function(struct rte_eth_dev *dev);
 
 static void
 fm10k_mbx_initlock(struct fm10k_hw *hw)
@@ -462,7 +463,6 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
 			dev->data->dev_conf.rxmode.enable_scatter) {
 			uint32_t reg;
 			dev->data->scattered_rx = 1;
-			dev->rx_pkt_burst = fm10k_recv_scattered_pkts;
 			reg = FM10K_READ_REG(hw, FM10K_SRRCTL(i));
 			reg |= FM10K_SRRCTL_BUFFER_CHAINING_EN;
 			FM10K_WRITE_REG(hw, FM10K_SRRCTL(i), reg);
@@ -478,6 +478,9 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
 
 	/* Configure RSS if applicable */
 	fm10k_dev_mq_rx_configure(dev);
+
+	/* Decide the best RX function */
+	fm10k_set_rx_function(dev);
 	return 0;
 }
 
@@ -2069,6 +2072,34 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = {
 	.rss_hash_conf_get	= fm10k_rss_hash_conf_get,
 };
 
+static void __attribute__((cold))
+fm10k_set_rx_function(struct rte_eth_dev *dev)
+{
+	struct fm10k_dev_info *dev_info = FM10K_DEV_PRIVATE_TO_INFO(dev);
+	uint16_t i, rx_using_sse;
+
+	/* In order to allow Vector Rx there are a few configuration
+	 * conditions to be met.
+	 */
+	if (!fm10k_rx_vec_condition_check(dev) && dev_info->rx_vec_allowed) {
+		if (dev->data->scattered_rx)
+			dev->rx_pkt_burst = fm10k_recv_scattered_pkts_vec;
+		else
+			dev->rx_pkt_burst = fm10k_recv_pkts_vec;
+	} else if (dev->data->scattered_rx)
+		dev->rx_pkt_burst = fm10k_recv_scattered_pkts;
+
+	rx_using_sse =
+		(dev->rx_pkt_burst == fm10k_recv_scattered_pkts_vec ||
+		dev->rx_pkt_burst == fm10k_recv_pkts_vec);
+
+	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		struct fm10k_rx_queue *rxq = dev->data->rx_queues[i];
+		rxq->rx_using_sse = rx_using_sse;
+	}
+
+}
+
 static void
 fm10k_params_init(struct rte_eth_dev *dev)
 {
@@ -2102,9 +2133,6 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	dev->rx_pkt_burst = &fm10k_recv_pkts;
 	dev->tx_pkt_burst = &fm10k_xmit_pkts;
 
-	if (dev->data->scattered_rx)
-		dev->rx_pkt_burst = &fm10k_recv_scattered_pkts;
-
 	/* only initialize in the primary process */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
-- 
1.7.7.6

  parent reply	other threads:[~2015-09-29 13:05 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 13:03 [dpdk-dev] [PATCH 00/14] Vector Rx/Tx PMD implementation for fm10k Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 01/14] fm10k: add new vPMD file Chen Jing D(Mark)
2015-10-22  9:44   ` [dpdk-dev] [PATCH v2 00/16] Vector Rx/Tx PMD implementation for fm10k Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 01/16] fm10k: add new vPMD file Chen Jing D(Mark)
2015-10-22 15:58       ` Stephen Hemminger
2015-10-23  8:39         ` Chen, Jing D
2015-10-23 10:01           ` Bruce Richardson
2015-10-27  5:26             ` Chen, Jing D
2015-10-27  9:46       ` [dpdk-dev] [PATCH v3 00/16] Vector Rx/Tx PMD implementation for fm10k Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 01/16] fm10k: add new vPMD file Chen Jing D(Mark)
2015-10-29  9:15           ` [dpdk-dev] [PATCH v4 00/16] Vector Rx/Tx PMD implementation for fm10k Chen Jing D(Mark)
2015-10-29  9:15             ` [dpdk-dev] [PATCH v4 01/16] fm10k: add new vPMD file Chen Jing D(Mark)
2015-10-30  8:02               ` [dpdk-dev] [PATCH v5 00/14] Vector Rx/Tx PMD implementation for fm10k Chen Jing D(Mark)
2015-10-30  8:02                 ` [dpdk-dev] [PATCH v5 01/14] fm10k: add new vPMD file Chen Jing D(Mark)
2015-10-30  8:02                 ` [dpdk-dev] [PATCH v5 02/14] fm10k: add vPMD pre-condition check for each RX queue Chen Jing D(Mark)
2015-10-30  8:02                 ` [dpdk-dev] [PATCH v5 03/14] fm10k: Add a new func to initialize all parameters Chen Jing D(Mark)
2015-10-30  8:02                 ` [dpdk-dev] [PATCH v5 04/14] fm10k: add Vector RX function Chen Jing D(Mark)
2015-10-30  8:02                 ` [dpdk-dev] [PATCH v5 05/14] fm10k: add func to do Vector RX condition check Chen Jing D(Mark)
2015-10-30  8:02                 ` [dpdk-dev] [PATCH v5 06/14] fm10k: add Vector RX scatter function Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 07/14] fm10k: add function to decide best RX function Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 08/14] fm10k: add func to release mbuf in case Vector RX applied Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 09/14] fm10k: add Vector TX function Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 10/14] fm10k: use func pointer to reset TX queue and mbuf release Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 11/14] fm10k: introduce 2 funcs " Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 12/14] fm10k: Add function to decide best TX func Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 13/14] fm10k: fix a crash issue in vector RX func Chen Jing D(Mark)
2015-10-30  8:03                 ` [dpdk-dev] [PATCH v5 14/14] doc: release notes update for fm10k Vector PMD Chen Jing D(Mark)
2015-11-02  8:36                   ` Thomas Monjalon
2015-10-30  8:26                 ` [dpdk-dev] [PATCH v5 00/14] Vector Rx/Tx PMD implementation for fm10k Liang, Cunming
2015-11-02  8:38                   ` Thomas Monjalon
2015-10-29  9:15             ` [dpdk-dev] [PATCH v4 02/16] fm10k: add vPMD pre-condition check for each RX queue Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 03/16] fm10k: Add a new func to initialize all parameters Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 04/16] fm10k: add func to re-allocate mbuf for RX ring Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 05/16] fm10k: add 2 functions to parse pkt_type and offload flag Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 06/16] fm10k: add Vector RX function Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 07/16] fm10k: add func to do Vector RX condition check Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 08/16] fm10k: add Vector RX scatter function Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 09/16] fm10k: add function to decide best RX function Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 10/16] fm10k: add func to release mbuf in case Vector RX applied Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 11/16] fm10k: add Vector TX function Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 12/16] fm10k: use func pointer to reset TX queue and mbuf release Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 13/16] fm10k: introduce 2 funcs " Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 14/16] fm10k: Add function to decide best TX func Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 15/16] fm10k: fix a crash issue in vector RX func Chen Jing D(Mark)
2015-10-29  9:16             ` [dpdk-dev] [PATCH v4 16/16] doc: release notes update for fm10k Vector PMD Chen Jing D(Mark)
2015-10-29 10:22             ` [dpdk-dev] [PATCH v4 00/16] Vector Rx/Tx PMD implementation for fm10k Liang, Cunming
2015-10-29 23:12               ` Thomas Monjalon
2015-10-30  3:09                 ` Chen, Jing D
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 02/16] fm10k: add vPMD pre-condition check for each RX queue Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 03/16] fm10k: Add a new func to initialize all parameters Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 04/16] fm10k: add func to re-allocate mbuf for RX ring Chen Jing D(Mark)
2015-10-28 13:58           ` Liang, Cunming
2015-10-29  5:24             ` Chen, Jing D
2015-10-29  8:14               ` Liang, Cunming
2015-10-29  8:37                 ` Chen, Jing D
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 05/16] fm10k: add 2 functions to parse pkt_type and offload flag Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 06/16] fm10k: add Vector RX function Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 07/16] fm10k: add func to do Vector RX condition check Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 08/16] fm10k: add Vector RX scatter function Chen Jing D(Mark)
2015-10-28 14:30           ` Liang, Cunming
2015-10-29  5:27             ` Chen, Jing D
2015-10-29  8:06               ` Liang, Cunming
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 09/16] fm10k: add function to decide best RX function Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 10/16] fm10k: add func to release mbuf in case Vector RX applied Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 11/16] fm10k: add Vector TX function Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 12/16] fm10k: use func pointer to reset TX queue and mbuf release Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 13/16] fm10k: introduce 2 funcs " Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 14/16] fm10k: Add function to decide best TX func Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 15/16] fm10k: fix a crash issue in vector RX func Chen Jing D(Mark)
2015-10-27  9:46         ` [dpdk-dev] [PATCH v3 16/16] doc: release notes update for fm10k Vector PMD Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 02/16] fm10k: add vPMD pre-condition check for each RX queue Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 03/16] fm10k: Add a new func to initialize all parameters Chen Jing D(Mark)
2015-10-22 15:57       ` Stephen Hemminger
2015-10-23  8:27         ` Chen, Jing D
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 04/16] fm10k: add func to re-allocate mbuf for RX ring Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 05/16] fm10k: add 2 functions to parse pkt_type and offload flag Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 06/16] fm10k: add Vector RX function Chen Jing D(Mark)
2015-10-27  5:24       ` Liang, Cunming
2015-10-27  5:32         ` Chen, Jing D
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 07/16] fm10k: add func to do Vector RX condition check Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 08/16] fm10k: add Vector RX scatter function Chen Jing D(Mark)
2015-10-27  5:27       ` Liang, Cunming
2015-10-27  5:43         ` Chen, Jing D
2015-10-27  5:55           ` Chen, Jing D
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 09/16] fm10k: add function to decide best RX function Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 10/16] fm10k: add func to release mbuf in case Vector RX applied Chen Jing D(Mark)
2015-10-22  9:44     ` [dpdk-dev] [PATCH v2 11/16] fm10k: add Vector TX function Chen Jing D(Mark)
2015-10-22  9:45     ` [dpdk-dev] [PATCH v2 12/16] fm10k: use func pointer to reset TX queue and mbuf release Chen Jing D(Mark)
2015-10-22  9:45     ` [dpdk-dev] [PATCH v2 13/16] fm10k: introduce 2 funcs " Chen Jing D(Mark)
2015-10-22  9:45     ` [dpdk-dev] [PATCH v2 14/16] fm10k: Add function to decide best TX func Chen Jing D(Mark)
2015-10-22  9:45     ` [dpdk-dev] [PATCH v2 15/16] fm10k: fix a crash issue in vector RX func Chen Jing D(Mark)
2015-10-22  9:45     ` [dpdk-dev] [PATCH v2 16/16] doc: release notes update for fm10k Vector PMD Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 02/14] fm10k: add vPMD pre-condition check for each RX queue Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 03/14] fm10k: Add a new func to initialize all parameters Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 04/14] fm10k: add func to re-allocate mbuf for RX ring Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 05/14] fm10k: add 2 functions to parse pkt_type and offload flag Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 06/14] fm10k: add Vector RX function Chen Jing D(Mark)
2015-09-29 13:14   ` Ananyev, Konstantin
2015-09-29 14:22     ` Bruce Richardson
2015-09-30 13:23       ` Chen, Jing D
2015-09-30 13:18     ` Chen, Jing D
2015-09-29 13:03 ` [dpdk-dev] [PATCH 07/14] fm10k: add func to do Vector RX condition check Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 08/14] fm10k: add Vector RX scatter function Chen Jing D(Mark)
2015-09-29 13:03 ` Chen Jing D(Mark) [this message]
2015-09-29 13:03 ` [dpdk-dev] [PATCH 10/14] fm10k: add func to release mbuf in case Vector RX applied Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 11/14] fm10k: add Vector TX function Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 12/14] fm10k: use func pointer to reset TX queue and mbuf release Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 13/14] fm10k: introduce 2 funcs " Chen Jing D(Mark)
2015-09-29 13:03 ` [dpdk-dev] [PATCH 14/14] fm10k: Add function to decide best TX func Chen Jing D(Mark)

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=1443531824-22767-10-git-send-email-jing.d.chen@intel.com \
    --to=jing.d.chen@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).