From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 02/31] net/sfc: support parameter to choose performance profile
Date: Fri, 2 Dec 2016 07:44:22 +0000 [thread overview]
Message-ID: <1480664691-26561-3-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1480664691-26561-1-git-send-email-arybchenko@solarflare.com>
Supported options are auto (based on NIC firmware variant and
installed licences), throughput, low-latency.
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
doc/guides/nics/sfc_efx.rst | 7 +++++++
drivers/net/sfc/sfc.h | 1 +
drivers/net/sfc/sfc_ethdev.c | 1 +
drivers/net/sfc/sfc_ev.c | 36 +++++++++++++++++++++++++++++++++---
drivers/net/sfc/sfc_ev.h | 2 ++
drivers/net/sfc/sfc_kvargs.c | 1 +
drivers/net/sfc/sfc_kvargs.h | 10 ++++++++++
7 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
index 2cca287..36d0974 100644
--- a/doc/guides/nics/sfc_efx.rst
+++ b/doc/guides/nics/sfc_efx.rst
@@ -152,6 +152,13 @@ whitelist option like "-w 02:00.0,arg1=value1,...".
Case-insensitive 1/y/yes/on or 0/n/no/off may be used to specify
boolean parameters value.
+- ``perf_profile`` [auto|throughput|low-latency] (default **throughput**)
+
+ Choose hardware tunning to be optimized for either throughput or
+ low-latency.
+ **auto** allows NIC firmware to make a choice based on
+ installed licences and firmware variant configured using **sfboot**.
+
- ``debug_init`` [bool] (default **n**)
Enable extra logging during device intialization and startup.
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 0064fcb..d0aafa3 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -152,6 +152,7 @@ struct sfc_adapter {
unsigned int txq_max_entries;
+ uint32_t evq_flags;
unsigned int evq_count;
struct sfc_evq_info *evq_info;
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 12309ee..1df227e 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -464,5 +464,6 @@ static struct eth_driver sfc_efx_pmd = {
RTE_PMD_REGISTER_PCI(net_sfc_efx, sfc_efx_pmd.pci_drv);
RTE_PMD_REGISTER_PCI_TABLE(net_sfc_efx, pci_id_sfc_efx_map);
RTE_PMD_REGISTER_PARAM_STRING(net_sfc_efx,
+ SFC_KVARG_PERF_PROFILE "=" SFC_KVARG_VALUES_PERF_PROFILE " "
SFC_KVARG_MCDI_LOGGING "=" SFC_KVARG_VALUES_BOOL " "
SFC_KVARG_DEBUG_INIT "=" SFC_KVARG_VALUES_BOOL);
diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index 96b95cc..34c1127 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -39,6 +39,7 @@
#include "sfc_ev.h"
#include "sfc_rx.h"
#include "sfc_tx.h"
+#include "sfc_kvargs.h"
/* Initial delay when waiting for event queue init complete event */
@@ -365,9 +366,7 @@ sfc_ev_qstart(struct sfc_adapter *sa, unsigned int sw_index)
/* Create the common code event queue */
rc = efx_ev_qcreate(sa->nic, sw_index, esmp, evq_info->entries,
- 0 /* unused on EF10 */, 0,
- EFX_EVQ_FLAGS_TYPE_THROUGHPUT |
- EFX_EVQ_FLAGS_NOTIFY_DISABLED,
+ 0 /* unused on EF10 */, 0, evq_info->flags,
&evq->common);
if (rc != 0)
goto fail_ev_qcreate;
@@ -600,6 +599,25 @@ sfc_ev_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
SFC_ASSERT(rte_is_power_of_2(max_entries));
evq_info->max_entries = max_entries;
+ evq_info->flags = sa->evq_flags | EFX_EVQ_FLAGS_NOTIFY_DISABLED;
+
+ return 0;
+}
+
+static int
+sfc_kvarg_perf_profile_handler(__rte_unused const char *key,
+ const char *value_str, void *opaque)
+{
+ uint64_t *value = opaque;
+
+ if (strcasecmp(value_str, SFC_KVARG_PERF_PROFILE_THROUGHPUT) == 0)
+ *value = EFX_EVQ_FLAGS_TYPE_THROUGHPUT;
+ else if (strcasecmp(value_str, SFC_KVARG_PERF_PROFILE_LOW_LATENCY) == 0)
+ *value = EFX_EVQ_FLAGS_TYPE_LOW_LATENCY;
+ else if (strcasecmp(value_str, SFC_KVARG_PERF_PROFILE_AUTO) == 0)
+ *value = EFX_EVQ_FLAGS_TYPE_AUTO;
+ else
+ return -EINVAL;
return 0;
}
@@ -620,6 +638,16 @@ sfc_ev_init(struct sfc_adapter *sa)
sfc_log_init(sa, "entry");
+ sa->evq_flags = EFX_EVQ_FLAGS_TYPE_THROUGHPUT;
+ rc = sfc_kvargs_process(sa, SFC_KVARG_PERF_PROFILE,
+ sfc_kvarg_perf_profile_handler,
+ &sa->evq_flags);
+ if (rc != 0) {
+ sfc_err(sa, "invalid %s parameter value",
+ SFC_KVARG_PERF_PROFILE);
+ goto fail_kvarg_perf_profile;
+ }
+
sa->evq_count = sfc_ev_qcount(sa);
sa->mgmt_evq_index = 0;
rte_spinlock_init(&sa->mgmt_evq_lock);
@@ -660,6 +688,8 @@ sfc_ev_init(struct sfc_adapter *sa)
fail_evqs_alloc:
sa->evq_count = 0;
+
+fail_kvarg_perf_profile:
sfc_log_init(sa, "failed %d", rc);
return rc;
}
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index 110f3b6..346e3ec 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -74,6 +74,8 @@ struct sfc_evq_info {
unsigned int max_entries;
/* Real number of EVQ entries, less or equal to max_entries */
unsigned int entries;
+ /* Event queue creation flags */
+ uint32_t flags;
/* NUMA-aware EVQ data structure used on datapath */
struct sfc_evq *evq;
};
diff --git a/drivers/net/sfc/sfc_kvargs.c b/drivers/net/sfc/sfc_kvargs.c
index bbbd026..2ced47c 100644
--- a/drivers/net/sfc/sfc_kvargs.c
+++ b/drivers/net/sfc/sfc_kvargs.c
@@ -43,6 +43,7 @@ sfc_kvargs_parse(struct sfc_adapter *sa)
const char **params = (const char *[]){
SFC_KVARG_DEBUG_INIT,
SFC_KVARG_MCDI_LOGGING,
+ SFC_KVARG_PERF_PROFILE,
NULL,
};
diff --git a/drivers/net/sfc/sfc_kvargs.h b/drivers/net/sfc/sfc_kvargs.h
index ffce851..2fea9c7 100644
--- a/drivers/net/sfc/sfc_kvargs.h
+++ b/drivers/net/sfc/sfc_kvargs.h
@@ -42,6 +42,16 @@ extern "C" {
#define SFC_KVARG_MCDI_LOGGING "mcdi_logging"
+#define SFC_KVARG_PERF_PROFILE "perf_profile"
+
+#define SFC_KVARG_PERF_PROFILE_AUTO "auto"
+#define SFC_KVARG_PERF_PROFILE_THROUGHPUT "throughput"
+#define SFC_KVARG_PERF_PROFILE_LOW_LATENCY "low-latency"
+#define SFC_KVARG_VALUES_PERF_PROFILE \
+ "[" SFC_KVARG_PERF_PROFILE_AUTO "|" \
+ SFC_KVARG_PERF_PROFILE_THROUGHPUT "|" \
+ SFC_KVARG_PERF_PROFILE_LOW_LATENCY "]"
+
struct sfc_adapter;
int sfc_kvargs_parse(struct sfc_adapter *sa);
--
2.5.5
next prev parent reply other threads:[~2016-12-02 7:45 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 7:44 [dpdk-dev] [PATCH 00/31] Support more features in Solarflare PMD Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 01/31] net/sfc: implement MCDI logging callback Andrew Rybchenko
2016-12-02 7:44 ` Andrew Rybchenko [this message]
2016-12-02 7:44 ` [dpdk-dev] [PATCH 03/31] net/sfc: implement ethdev hook to get basic statistics Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 04/31] net/sfc: support extended statistics Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 05/31] net/sfc: support flow control settings get/set Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 06/31] net/sfc: support link status change interrupt Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 07/31] net/sfc: implement device operation to change MTU Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 08/31] net/sfc: support link speed and duplex settings Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 09/31] net/sfc: support link up/down Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 10/31] net/sfc: support promiscuous and all-multicast control Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 11/31] net/sfc: support main (the first) MAC address change Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 12/31] net/sfc: support multicast addresses list controls Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 13/31] net/sfc: support checksum offloads on receive Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 14/31] net/sfc: handle received packet type info provided by HW Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 15/31] net/sfc: support callback to get receive queue information Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 16/31] net/sfc: support Rx free threshold Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 17/31] net/sfc: add callback to get RxQ pending descriptors count Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 18/31] net/sfc: add RxQ descriptor done callback Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 19/31] net/sfc: support scattered Rx DMA Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 20/31] net/sfc: support deferred start of receive queues Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 21/31] net/sfc: add callback to get transmit queue information Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 22/31] net/sfc: support Tx free threshold Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 23/31] net/sfc: support deferred start of transmit queues Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 24/31] net/sfc: support VLAN offload on transmit path Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 25/31] net/sfc: add basic stubs for RSS support on driver attach Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 26/31] net/sfc: support RSS hash offload Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 27/31] net/sfc: add callback to query RSS key and hash types config Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 28/31] net/sfc: add callback to set " Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 29/31] net/sfc: add callback to query RSS redirection table Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 30/31] net/sfc: add callback to update " Andrew Rybchenko
2016-12-02 7:44 ` [dpdk-dev] [PATCH 31/31] net/sfc: support firmware-assisted TSOv2 Andrew Rybchenko
2016-12-09 17:34 ` [dpdk-dev] [PATCH 00/31] Support more features in Solarflare PMD Ferruh Yigit
2016-12-15 12:50 ` Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 00/32] " Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 01/32] net/sfc: implement MCDI logging callback Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 02/32] net/sfc: support parameter to choose performance profile Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 03/32] net/sfc: implement ethdev hook to get basic statistics Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 04/32] net/sfc: support extended statistics Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 05/32] net/sfc: support flow control settings get/set Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 06/32] net/sfc: support link status change interrupt Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 07/32] net/sfc: implement device operation to change MTU Andrew Rybchenko
2016-12-15 12:50 ` [dpdk-dev] [PATCH v2 08/32] net/sfc: support link speed and duplex settings Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 09/32] net/sfc: support link up/down Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 10/32] net/sfc: support promiscuous and all-multicast control Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 11/32] net/sfc: support main (the first) MAC address change Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 12/32] net/sfc: support multicast addresses list controls Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 13/32] net/sfc: support checksum offloads on receive Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 14/32] net/sfc: handle received packet type info provided by HW Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 15/32] net/sfc: support callback to get receive queue information Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 16/32] net/sfc: support Rx free threshold Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 17/32] net/sfc: add callback to get RxQ pending descriptors count Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 18/32] net/sfc: add RxQ descriptor done callback Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 19/32] net/sfc: support scattered Rx DMA Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 20/32] net/sfc: support deferred start of receive queues Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 21/32] net/sfc: add callback to get transmit queue information Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 22/32] net/sfc: support Tx free threshold Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 23/32] net/sfc: support deferred start of transmit queues Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 24/32] net/sfc: support VLAN offload on transmit path Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 25/32] net/sfc/base: do not use enum type when values are bitmask Andrew Rybchenko
2017-01-18 11:30 ` Ferruh Yigit
2017-01-18 11:52 ` Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 26/32] net/sfc: add basic stubs for RSS support on driver attach Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 27/32] net/sfc: support RSS hash offload Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 28/32] net/sfc: add callback to query RSS key and hash types config Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 29/32] net/sfc: add callback to set " Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 30/32] net/sfc: add callback to query RSS redirection table Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 31/32] net/sfc: add callback to update " Andrew Rybchenko
2016-12-15 12:51 ` [dpdk-dev] [PATCH v2 32/32] net/sfc: support firmware-assisted TSOv2 Andrew Rybchenko
2016-12-16 9:57 ` [dpdk-dev] [PATCH v2 00/32] Support more features in Solarflare PMD 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=1480664691-26561-3-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.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).