DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx2: add Rx/Tx burst mode get callbacks
@ 2019-09-30  6:59 Sunil Kumar Kori
  2019-10-15 14:26 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Sunil Kumar Kori @ 2019-09-30  6:59 UTC (permalink / raw)
  To: Jerin Jacob, Nithin Dabilpuram, Kiran Kumar K; +Cc: dev, Sunil Kumar Kori

Retrieve burst mode options according to the selected Rx/Tx burst
function.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---

Below implementation is based on following patchset
http://patches.dpdk.org/patch/59907/

 drivers/net/octeontx2/otx2_ethdev.c     |  2 ++
 drivers/net/octeontx2/otx2_ethdev.h     |  4 +++
 drivers/net/octeontx2/otx2_ethdev_ops.c | 45 +++++++++++++++++++++++++
 3 files changed, 51 insertions(+)

diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..558ad92f1 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -1643,6 +1643,8 @@ static const struct eth_dev_ops otx2_eth_dev_ops = {
 	.xstats_get_names_by_id   = otx2_nix_xstats_get_names_by_id,
 	.rxq_info_get             = otx2_nix_rxq_info_get,
 	.txq_info_get             = otx2_nix_txq_info_get,
+	.rx_burst_mode_get        = otx2_rx_burst_mode_get,
+	.tx_burst_mode_get        = otx2_tx_burst_mode_get,
 	.rx_queue_count           = otx2_nix_rx_queue_count,
 	.rx_descriptor_done       = otx2_nix_rx_descriptor_done,
 	.rx_descriptor_status     = otx2_nix_rx_descriptor_status,
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..c1de1522b 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -373,6 +373,10 @@ void otx2_nix_rxq_info_get(struct rte_eth_dev *eth_dev, uint16_t queue_id,
 			   struct rte_eth_rxq_info *qinfo);
 void otx2_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t queue_id,
 			   struct rte_eth_txq_info *qinfo);
+int otx2_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			   struct rte_eth_burst_mode *mode);
+int otx2_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			   struct rte_eth_burst_mode *mode);
 uint32_t otx2_nix_rx_queue_count(struct rte_eth_dev *eth_dev, uint16_t qidx);
 int otx2_nix_tx_done_cleanup(void *txq, uint32_t free_cnt);
 int otx2_nix_rx_descriptor_done(void *rxq, uint16_t offset);
diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c
index 7c6532b6f..530ded7fe 100644
--- a/drivers/net/octeontx2/otx2_ethdev_ops.c
+++ b/drivers/net/octeontx2/otx2_ethdev_ops.c
@@ -2,6 +2,7 @@
  * Copyright(C) 2019 Marvell International Ltd.
  */
 
+#include <rte_ethdev.h>
 #include <rte_mbuf_pool_ops.h>
 
 #include "otx2_ethdev.h"
@@ -213,6 +214,50 @@ otx2_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t queue_id,
 	qinfo->conf.tx_deferred_start = 0;
 }
 
+int
+otx2_rx_burst_mode_get(struct rte_eth_dev *eth_dev,
+		       __rte_unused uint16_t queue_id,
+		       struct rte_eth_burst_mode *mode)
+{
+	struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+	uint64_t options;
+
+	if (dev->scalar_ena || dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP)
+		options = RTE_ETH_BURST_SCALAR;
+	else
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON;
+
+	if (dev->rx_offloads & DEV_RX_OFFLOAD_SCATTER)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED;
+
+	mode->options = options;
+
+	return 0;
+}
+
+int
+otx2_tx_burst_mode_get(struct rte_eth_dev *eth_dev,
+		       __rte_unused uint16_t queue_id,
+		       struct rte_eth_burst_mode *mode)
+{
+	struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+	uint64_t options;
+
+	if (dev->scalar_ena ||
+		(dev->tx_offload_flags &
+		 (NIX_TX_OFFLOAD_VLAN_QINQ_F | NIX_TX_OFFLOAD_TSTAMP_F)))
+		options = RTE_ETH_BURST_SCALAR;
+	else
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON;
+
+	if (dev->tx_offloads & DEV_TX_OFFLOAD_MULTI_SEGS)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED;
+
+	mode->options = options;
+
+	return 0;
+}
+
 static void
 nix_rx_head_tail_get(struct otx2_eth_dev *dev,
 		     uint32_t *head, uint32_t *tail, uint16_t queue_idx)
-- 
2.17.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/octeontx2: add Rx/Tx burst mode get callbacks
  2019-09-30  6:59 [dpdk-dev] [PATCH] net/octeontx2: add Rx/Tx burst mode get callbacks Sunil Kumar Kori
@ 2019-10-15 14:26 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2019-10-15 14:26 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: Jerin Jacob, Nithin Dabilpuram, Kiran Kumar K, dpdk-dev

On Mon, Sep 30, 2019 at 12:29 PM Sunil Kumar Kori <skori@marvell.com> wrote:
>
> Retrieve burst mode options according to the selected Rx/Tx burst
> function.
>
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
> ---
>
> Below implementation is based on following patchset
> http://patches.dpdk.org/patch/59907/

Depend patch got merged into next-net tree.
Please rebase this patch add update the feature matrix.
See https://git.dpdk.org/next/dpdk-next-net/commit/?id=846452547945b112d71ab2f0be390b4622b81759
"net/i40e: add Rx/Tx burst mode get callbacks" for details for feature
matrix update.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-15 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30  6:59 [dpdk-dev] [PATCH] net/octeontx2: add Rx/Tx burst mode get callbacks Sunil Kumar Kori
2019-10-15 14:26 ` Jerin Jacob

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).