DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sunil Kumar Kori <sunil.kori@nxp.com>
To: <dev@dpdk.org>
Cc: <sunil.kori@nxp.com>, <hemant.agrawal@nxp.com>, <shreyansh.jain@nxp.com>
Subject: [dpdk-dev] [PATCH v2 2/2] net/dpaa2: non supported offloads are ignored with warning
Date: Mon, 23 Apr 2018 18:03:37 +0530	[thread overview]
Message-ID: <20180423123337.5653-3-sunil.kori@nxp.com> (raw)
In-Reply-To: <20180423123337.5653-1-sunil.kori@nxp.com>

Fixes: 0ebce6129bc6 ("net/dpaa2: support new ethdev offload APIs")
Cc: shreyansh.jain@nxp.com

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 54ab9eb..a47c723 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -27,6 +27,25 @@
 #include "dpaa2_ethdev.h"
 #include <fsl_qbman_debug.h>
 
+/* Non-Supported Rx offloads */
+static uint64_t dev_rx_offloads_not_supported =
+		DEV_RX_OFFLOAD_TCP_LRO |
+		DEV_RX_OFFLOAD_MACSEC_STRIP |
+		DEV_RX_OFFLOAD_HEADER_SPLIT |
+		DEV_RX_OFFLOAD_VLAN_EXTEND |
+		DEV_RX_OFFLOAD_SECURITY;
+
+/* Non-Supported Tx offloads */
+static uint64_t dev_tx_offloads_not_supported =
+		DEV_TX_OFFLOAD_TCP_TSO |
+		DEV_TX_OFFLOAD_UDP_TSO |
+		DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
+		DEV_TX_OFFLOAD_GRE_TNL_TSO |
+		DEV_TX_OFFLOAD_IPIP_TNL_TSO |
+		DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
+		DEV_TX_OFFLOAD_MACSEC_INSERT |
+		DEV_TX_OFFLOAD_SECURITY;
+
 struct rte_dpaa2_xstats_name_off {
 	char name[RTE_ETH_XSTATS_NAME_SIZE];
 	uint8_t page_id; /* dpni statistics page id */
@@ -289,18 +308,20 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_FUNC_TRACE();
 
 	dpaa2_dev_info_get(dev, &dev_info);
-	if ((~(dev_info.rx_offload_capa) & rx_offloads) != 0) {
-		DPAA2_PMD_ERR("Some Rx offloads are not supported "
-			"requested 0x%" PRIx64 " supported 0x%" PRIx64,
+	/* Rx offloads validation */
+	if (dev_rx_offloads_not_supported & rx_offloads) {
+		DPAA2_PMD_ERR(
+		"Rx offloads not supported - Requested 0x%" PRIx64 " supported 0x%" PRIx64,
 			rx_offloads, dev_info.rx_offload_capa);
-		return -ENOTSUP;
+			return -ENOTSUP;
 	}
 
-	if ((~(dev_info.tx_offload_capa) & tx_offloads) != 0) {
-		DPAA2_PMD_ERR("Some Tx offloads are not supported "
-			"requested 0x%" PRIx64 " supported 0x%" PRIx64,
+	/* Tx offloads validation */
+	if (dev_tx_offloads_not_supported & tx_offloads) {
+		DPAA2_PMD_ERR(
+		"Tx offloads not supported - Requested 0x%" PRIx64 " Supported 0x%" PRIx64,
 			tx_offloads, dev_info.tx_offload_capa);
-		return -ENOTSUP;
+			return -ENOTSUP;
 	}
 
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
-- 
2.9.3

      parent reply	other threads:[~2018-04-23 12:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 10:45 [dpdk-dev] [PATCH 0/2] Non-supported offloads are ignored Sunil Kumar Kori
2018-04-20 10:45 ` [dpdk-dev] [PATCH 1/2] net/dpaa: non supported offloads are ignored with warning Sunil Kumar Kori
2018-04-20 15:20   ` Stephen Hemminger
2018-04-20 10:45 ` [dpdk-dev] [PATCH 2/2] net/dpaa2: " Sunil Kumar Kori
2018-04-20 12:27 ` [dpdk-dev] [PATCH 0/2] Non-supported offloads are ignored Ferruh Yigit
2018-04-23 12:33 ` [dpdk-dev] [PATCH v2 " Sunil Kumar Kori
2018-04-23 12:33   ` [dpdk-dev] [PATCH v2 1/2] net/dpaa: non supported offloads are ignored with warning Sunil Kumar Kori
2018-04-23 14:57     ` Ferruh Yigit
2018-04-23 12:33   ` Sunil Kumar Kori [this message]

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=20180423123337.5653-3-sunil.kori@nxp.com \
    --to=sunil.kori@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=shreyansh.jain@nxp.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).