From: Sunil Kumar Kori Subject: [PATCH v2 1/2] net/dpaa: non supported offloads are ignored with warning Date: Mon, 23 Apr 2018 18:03:36 +0530 Message-ID: <20180423123337.5653-2-sunil.kori@nxp.com> References: <20180420104541.21987-1-sunil.kori@nxp.com> <20180423123337.5653-1-sunil.kori@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , To: Return-path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0126.outbound.protection.outlook.com [104.47.40.126]) by dpdk.org (Postfix) with ESMTP id DA4684CC7 for ; Mon, 23 Apr 2018 14:33:51 +0200 (CEST) In-Reply-To: <20180423123337.5653-1-sunil.kori@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes: 16e2c27f4fc7 ("net/dpaa: support new ethdev offload APIs") Cc: shreyansh.jain@nxp.com Signed-off-by: Sunil Kumar Kori --- drivers/net/dpaa/dpaa_ethdev.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index b2740b4..81001cb 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -45,6 +45,25 @@ #include #include +/* 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; + /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; /* At present we only allow up to 4 push mode queues - as each of this queue @@ -150,16 +169,17 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); dpaa_eth_dev_info(dev, &dev_info); - if (((~(dev_info.rx_offload_capa) & rx_offloads) != 0)) { - DPAA_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) { + DPAA_PMD_ERR( + "Rx offloads not supported - Requested 0x%" PRIx64 " supported 0x%" PRIx64, rx_offloads, dev_info.rx_offload_capa); return -ENOTSUP; } - - if (((~(dev_info.tx_offload_capa) & tx_offloads) != 0)) { - DPAA_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) { + DPAA_PMD_ERR( + "Tx offloads not supported - Requested 0x%" PRIx64 " Supported 0x%" PRIx64, tx_offloads, dev_info.tx_offload_capa); return -ENOTSUP; } -- 2.9.3