From: Kamil Rytarowski <krytarowski@caviumnetworks.com>
To: <dev@dpdk.org>
Cc: <maciej.czekaj@caviumnetworks.com>, <zyta.szpak@semihalf.com>,
<slawomir.rosek@semihalf.com>, <rad@semihalf.com>,
<jerin.jacob@caviumnetworks.com>,
Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 08/13] net/thunderx: add helper utils for secondary qset support
Date: Fri, 26 Aug 2016 18:54:03 +0200 [thread overview]
Message-ID: <1472230448-17490-9-git-send-email-krytarowski@caviumnetworks.com> (raw)
In-Reply-To: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com>
From: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
drivers/net/thunderx/nicvf_ethdev.h | 39 +++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 34447e0..e162364 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -87,6 +87,17 @@ nicvf_mbuff_meta_length(struct rte_mbuf *mbuf)
return (uint16_t)((uintptr_t)mbuf->buf_addr - (uintptr_t)mbuf);
}
+static inline uint16_t
+nicvf_netdev_qidx(struct nicvf *nic, uint8_t local_qidx)
+{
+ uint16_t global_qidx = local_qidx;
+
+ if (nic->sqs_mode)
+ global_qidx += ((nic->sqs_id + 1) * MAX_CMP_QUEUES_PER_QS);
+
+ return global_qidx;
+}
+
/*
* Simple phy2virt functions assuming mbufs are in a single huge page
* V = P + offset
@@ -104,4 +115,32 @@ nicvf_mbuff_virt2phy(uintptr_t virt, uint64_t mbuf_phys_off)
return (phys_addr_t)(virt - mbuf_phys_off);
}
+static inline void
+nicvf_tx_range(struct rte_eth_dev *dev, struct nicvf *nic, uint16_t *tx_start,
+ uint16_t *tx_end)
+{
+ uint16_t tmp;
+
+ *tx_start = RTE_ALIGN_FLOOR(nicvf_netdev_qidx(nic, 0),
+ MAX_SND_QUEUES_PER_QS);
+ tmp = RTE_ALIGN_CEIL(nicvf_netdev_qidx(nic, 0) + 1,
+ MAX_SND_QUEUES_PER_QS) - 1;
+ *tx_end = dev->data->nb_tx_queues ?
+ RTE_MIN(tmp, dev->data->nb_tx_queues - 1) : 0;
+}
+
+static inline void
+nicvf_rx_range(struct rte_eth_dev *dev, struct nicvf *nic, uint16_t *rx_start,
+ uint16_t *rx_end)
+{
+ uint16_t tmp;
+
+ *rx_start = RTE_ALIGN_FLOOR(nicvf_netdev_qidx(nic, 0),
+ MAX_RCV_QUEUES_PER_QS);
+ tmp = RTE_ALIGN_CEIL(nicvf_netdev_qidx(nic, 0) + 1,
+ MAX_RCV_QUEUES_PER_QS) - 1;
+ *rx_end = dev->data->nb_rx_queues ?
+ RTE_MIN(tmp, dev->data->nb_rx_queues - 1) : 0;
+}
+
#endif /* __THUNDERX_NICVF_ETHDEV_H__ */
--
1.9.1
next prev parent reply other threads:[~2016-08-26 16:55 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 16:53 [dpdk-dev] [PATCH 00/13] Add support for secondary queue set in nicvf thunderx driver Kamil Rytarowski
2016-08-26 16:53 ` [dpdk-dev] [PATCH 01/13] net/thunderx: cleanup the driver before adding new features Kamil Rytarowski
2016-09-20 13:48 ` Ferruh Yigit
2016-09-29 14:21 ` Maciej Czekaj
2016-08-26 16:53 ` [dpdk-dev] [PATCH 02/13] net/thunderx: correct transmit checksum handling Kamil Rytarowski
2016-08-26 16:53 ` [dpdk-dev] [PATCH 03/13] net/thunderx/base: add family of functions to store qsets Kamil Rytarowski
2016-08-26 16:53 ` [dpdk-dev] [PATCH 04/13] net/thunderx/base: add secondary queue set support Kamil Rytarowski
2016-09-20 13:48 ` Ferruh Yigit
2016-09-29 14:22 ` Maciej Czekaj
2016-08-26 16:54 ` [dpdk-dev] [PATCH 05/13] net/thunderx: add family of functions to store DPDK qsets Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 06/13] net/thunderx: add secondary queue set in interrupt functions Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 07/13] net/thunderx: fix multiprocess support in stats Kamil Rytarowski
2016-09-20 13:48 ` Ferruh Yigit
2016-09-29 14:35 ` Maciej Czekaj
2016-08-26 16:54 ` Kamil Rytarowski [this message]
2016-08-26 16:54 ` [dpdk-dev] [PATCH 09/13] net/thunderx: add secondary qset support in dev stop/close Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 10/13] net/thunderx: add secondary qset support in device start Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 11/13] net/thunderx: add secondary qset support in device configure Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 12/13] net/thunderx: add final bits for secondary queue support Kamil Rytarowski
2016-09-20 13:49 ` Ferruh Yigit
2016-09-29 14:37 ` Maciej Czekaj
2016-08-26 16:54 ` [dpdk-dev] [PATCH 13/13] net/thunderx: document secondary queue set support Kamil Rytarowski
2016-09-26 20:17 ` Mcnamara, John
2016-09-29 14:38 ` Maciej Czekaj
2016-09-12 10:59 ` [dpdk-dev] [PATCH 00/13] Add support for secondary queue set in nicvf thunderx driver Kamil Rytarowski
2016-09-19 12:23 ` Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 00/15] " Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 01/15] net/thunderx: cleanup the driver before adding new features Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 02/15] net/thunderx: correct transmit checksum handling Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 03/15] net/thunderx/base: add family of functions to store qsets Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 04/15] net/thunderx/base: add secondary queue set support Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 05/15] net/thunderx: add family of functions to store DPDK qsets Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 06/15] net/thunderx: add secondary queue set in interrupt functions Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 07/15] net/thunderx: remove problematic private_data->eth_dev link Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 08/15] net/thunderx: add helper utils for secondary qset support Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 09/15] net/thunderx: add secondary qset support in dev stop/close Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 10/15] net/thunderx: add secondary qset support in device start Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 11/15] net/thunderx: add secondary qset support in device configure Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 12/15] net/thunderx: add final bits for secondary queue support Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 13/15] net/thunderx: document secondary queue set support Kamil Rytarowski
2016-09-30 15:12 ` Mcnamara, John
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 14/15] ethdev: Support VFs on the different PCI domains Kamil Rytarowski
2016-10-10 10:19 ` Ferruh Yigit
2016-10-10 13:01 ` Kamil Rytarowski
2016-10-10 13:27 ` Ferruh Yigit
2016-10-11 13:52 ` Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 15/15] net/thunderx: Bump driver version to 2.0 Kamil Rytarowski
2016-10-12 15:59 ` [dpdk-dev] [PATCH v2 00/15] Add support for secondary queue set in nicvf thunderx driver Bruce Richardson
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=1472230448-17490-9-git-send-email-krytarowski@caviumnetworks.com \
--to=krytarowski@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=jerin.jacob@caviumnetworks.com \
--cc=kamil.rytarowski@caviumnetworks.com \
--cc=maciej.czekaj@caviumnetworks.com \
--cc=rad@semihalf.com \
--cc=slawomir.rosek@semihalf.com \
--cc=zyta.szpak@semihalf.com \
/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).