summaryrefslogtreecommitdiff
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorIgor Romanov <igor.romanov@oktetlabs.ru>2019-02-07 16:29:16 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-02-08 11:35:41 +0100
commitd5371f3dfa595951899ffc2f41dcd6711675d5b5 (patch)
tree34e2d9d36830dcaf881a6cf586e26681a112d871 /drivers/net/sfc
parent048a0d1a81b64f003d08468c5b18ac3a0406e819 (diff)
downloaddpdk-next-eventdev-d5371f3dfa595951899ffc2f41dcd6711675d5b5.zip
dpdk-next-eventdev-d5371f3dfa595951899ffc2f41dcd6711675d5b5.tar.gz
dpdk-next-eventdev-d5371f3dfa595951899ffc2f41dcd6711675d5b5.tar.xz
net/sfc: use NIC EVQ descs limits instead of defines
Descriptor limits are not common for all NIC families. Use the variables from NIC configuration instead of deprecated defines. Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/sfc.c6
-rw-r--r--drivers/net/sfc/sfc.h3
-rw-r--r--drivers/net/sfc/sfc_dp_rx.h2
-rw-r--r--drivers/net/sfc/sfc_ef10_essb_rx.c4
-rw-r--r--drivers/net/sfc/sfc_ev.c2
-rw-r--r--drivers/net/sfc/sfc_ev.h3
-rw-r--r--drivers/net/sfc/sfc_rx.c2
7 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 26c7c32..8986038 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -756,6 +756,12 @@ sfc_attach(struct sfc_adapter *sa)
if (rc != 0)
goto fail_estimate_rsrc_limits;
+ sa->evq_max_entries = encp->enc_evq_max_nevs;
+ SFC_ASSERT(rte_is_power_of_2(sa->evq_max_entries));
+
+ sa->evq_min_entries = encp->enc_evq_min_nevs;
+ SFC_ASSERT(rte_is_power_of_2(sa->evq_min_entries));
+
sa->rxq_max_entries = encp->enc_rxq_max_ndescs;
SFC_ASSERT(rte_is_power_of_2(sa->rxq_max_entries));
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 6c99e9e..a4b9a3f 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -250,6 +250,9 @@ struct sfc_adapter {
unsigned int txq_max_entries;
unsigned int txq_min_entries;
+ unsigned int evq_max_entries;
+ unsigned int evq_min_entries;
+
uint32_t evq_flags;
unsigned int evq_count;
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index c3cc4ff..042c014 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -32,6 +32,8 @@ struct sfc_dp_rxq {
struct sfc_dp_rx_hw_limits {
unsigned int rxq_max_entries;
unsigned int rxq_min_entries;
+ unsigned int evq_max_entries;
+ unsigned int evq_min_entries;
};
/**
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index fee7a8b..ccb6aea 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -528,8 +528,8 @@ sfc_ef10_essb_rx_qsize_up_rings(uint16_t nb_rx_desc,
1 /* Rx error */ + 1 /* flush */ + 1 /* head-tail space */;
*evq_entries = rte_align32pow2(max_events);
- *evq_entries = RTE_MAX(*evq_entries, (unsigned int)EFX_EVQ_MINNEVS);
- *evq_entries = RTE_MIN(*evq_entries, (unsigned int)EFX_EVQ_MAXNEVS);
+ *evq_entries = RTE_MAX(*evq_entries, limits->evq_min_entries);
+ *evq_entries = RTE_MIN(*evq_entries, limits->evq_max_entries);
/*
* May be even maximum event queue size is insufficient to handle
diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index 0ca502e..939766d 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -897,7 +897,7 @@ sfc_ev_attach(struct sfc_adapter *sa)
sa->mgmt_evq_index = 0;
rte_spinlock_init(&sa->mgmt_evq_lock);
- rc = sfc_ev_qinit(sa, SFC_EVQ_TYPE_MGMT, 0, SFC_MGMT_EVQ_ENTRIES,
+ rc = sfc_ev_qinit(sa, SFC_EVQ_TYPE_MGMT, 0, sa->evq_min_entries,
sa->socket_id, &sa->mgmt_evq);
if (rc != 0)
goto fail_mgmt_evq_init;
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index 872f79b..5d070b1 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -20,9 +20,6 @@
extern "C" {
#endif
-/* Number of entries in the management event queue */
-#define SFC_MGMT_EVQ_ENTRIES (EFX_EVQ_MINNEVS)
-
struct sfc_adapter;
struct sfc_dp_rxq;
struct sfc_dp_txq;
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index c8dec8d..faa9758 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -977,6 +977,8 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
memset(&hw_limits, 0, sizeof(hw_limits));
hw_limits.rxq_max_entries = sa->rxq_max_entries;
hw_limits.rxq_min_entries = sa->rxq_min_entries;
+ hw_limits.evq_max_entries = sa->evq_max_entries;
+ hw_limits.evq_min_entries = sa->evq_min_entries;
rc = sa->priv.dp_rx->qsize_up_rings(nb_rx_desc, &hw_limits, mb_pool,
&rxq_entries, &evq_entries,