From patchwork Tue Apr 24 17:16:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 134161 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2492970lji; Tue, 24 Apr 2018 10:18:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Zf4EgLsf+c3BDYygSuYonPsfRVdfmkWFunUfib+rzL2BIZUz0iEDJAEZJZ32yVjq8QmcG X-Received: by 2002:adf:8628:: with SMTP id 37-v6mr21270322wrv.255.1524590304096; Tue, 24 Apr 2018 10:18:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524590304; cv=none; d=google.com; s=arc-20160816; b=M6H30CPf9Ggz0otSMQx+GsCchyAUNHfhj8s3TWPnVFz6NV9ajG1CtvxqLshbQkOgCh l0+eoWcl6XPc+0NBiTPi1337oBMBlLbeFtFAgZId8p05W2ejOVSCgunK5TFTJQ+sgBpc Fq8tjaErLIgMDuiMnKeL+R3Q7eKynnB9S9HF2OuF4VOP4L41LgygI+kZPjzI2jeursmC icyVPQdpmR+aaE3uo3vQCRYoz5wHgJ9RnaHBEL52QiUTJsUHCaFPm1viLh1nUrsJ1WZT O4aAVt2nHQjI2JKIU7V1RjgcMjhjLV+z/gF8yVeTOUXXYILCC5d4jSM435bLVKTbThSL 0rwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature:arc-authentication-results; bh=M5zQA9brZO+EYmDRoAk/IBox5UBZKfLOoMvorAUOO3g=; b=AiUnWzsZORPXSdQPDy6ozOqZGfx3COGZnyNtpsu6UJXUdX5kwbBTIhAKGVQlB9Ymzx n+Fwt3eZcmDXNRK6PYGNxu6cffjsFFSDPwlM/iEY+hs4cQArxKMFAmo+ZfEbJ9Z65hR0 rcfN9y4FS1EpLs0UWDbqLWBh8AosRpQJm4eR9h7RfA1xbAm2lJbmkDHC4ChRC4ydqudi MSaCJLtkfWsLFvzIV6AFwk/TCzVJcKUqkOFErEVeQJ3vJfaQUR8hnS+VDzsjO4OvcZHB 6kMAzySbq5lsiHkPRlEnTsGeTUHOzDAjznncrG+sYz1TMwPYQ/4/k458wB0Di/wu9tCY f1OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=kmNkn9rm; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id g184si7385080wmg.138.2018.04.24.10.18.23; Tue, 24 Apr 2018 10:18:24 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=kmNkn9rm; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C42849E2; Tue, 24 Apr 2018 19:18:22 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0072.outbound.protection.outlook.com [104.47.0.72]) by dpdk.org (Postfix) with ESMTP id 419CE2F4F for ; Tue, 24 Apr 2018 19:18:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=M5zQA9brZO+EYmDRoAk/IBox5UBZKfLOoMvorAUOO3g=; b=kmNkn9rmRSC8FDYkEOGNDchEqgTJ/yLOWeKq0+Za4VPUmlJlk7AKW2flpAT2VBBnbueGYKo7B/Ksi5lVhBCglxmD9Gset9FVEx0x0eTTy7Pzc1kXnDhss+u+p6g0vvXiLbLNLiuDK978uZsr1CFOwJ5noIO/Q5DtEawQscFMvVU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM3PR04MB0758.eurprd04.prod.outlook.com (2a01:111:e400:883c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Tue, 24 Apr 2018 17:18:18 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, shreyansh.jain@nxp.com, Sunil Kumar Kori Date: Tue, 24 Apr 2018 22:46:13 +0530 Message-Id: <1524590174-5951-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524582401-14696-1-git-send-email-hemant.agrawal@nxp.com> References: <1524582401-14696-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0021.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::31) To AM3PR04MB0758.eurprd04.prod.outlook.com (2a01:111:e400:883c::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM3PR04MB0758; X-Microsoft-Exchange-Diagnostics: 1; AM3PR04MB0758; 3:olXorJ0v/WUP8rHUsybr3fl2lvE1zc/rx1iGLzsCSgeIzBQw8QEwqtm4Wj0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SE187z+ob5IZS3DulNh5z+G9MKVGBRXFLZqVKkx99iM2NTZOq7KLKpgXtCrhgiLm1YCf3i/+UoF6qT8EOIM+GrTon4jeMrnKrOiO2GS0p6iRvfLlmNzLOLA/pfqZ+djR7WIXvz4aKZKNdnpqXIDiMM6Wp8NgH+KC150t1VsWNiXTbGZk9FyyFy/8yLrofKnxML322ekNDZ4V0j5s7rGzfCgzrrOnlxCR6U0AtEb4POC1byUqq03lwFIFb4i3PAy/H1hTlcupojsd3hoSHwcVE; 4:Mhmumogp9ugHSUa/GNwZItEJXZP64OJxTRzvLRqg+lp5xsrx8rL3MC1o27Ub+6QjtkFu3vTQuXdooiNMbbTrXAFV9ud3kgsJqHZgzgpsrdhO06W+hUfsnpbNfG28VrCfQeAr/lWn2DxFue5w6y2QXx0s6gs4THCYhLaL6zYP5A7Bn6if2/RkNsruBjIFJ6BWoHqZ4x4QpsXOxtXxjROmrqpQXhZiqycRLX6+zS7XeEfohUMzdCAoGcz+nwGe7Xw/a8lYWZ/JoVfxTS8urElpzkAUeWVuts5OCZUleJvjk7vAOMLC+M/KvnIGAFDYXrJ7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:AM3PR04MB0758; BCL:0; PCL:0; RULEID:; SRVR:AM3PR04MB0758; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(39380400002)(346002)(366004)(199004)(189003)(476003)(86362001)(446003)(956004)(11346002)(26005)(2616005)(386003)(16526019)(5009440100003)(6506007)(47776003)(76176011)(105586002)(6512007)(2906002)(8936002)(6666003)(36756003)(59450400001)(486006)(55236004)(44832011)(6916009)(25786009)(2361001)(66066001)(81156014)(6486002)(478600001)(50466002)(48376002)(8676002)(68736007)(5660300001)(7736002)(6116002)(2351001)(16586007)(51416003)(4326008)(3846002)(106356001)(316002)(305945005)(81166006)(50226002)(186003)(52116002)(97736004)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR04MB0758; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR04MB0758; 23:OUv4YxnQ4AxEYNcXiib9B+a3Bjha9Q4oUnaeSNLyu?= Q54RihuBn+7np0nkIOeJuaDWkKdJmIi2++Qh2oYSlAZvI+7m/FHYjkr7azVDKUU/CEm+yupybmNNpL90Oj211GOtNzmFr02byqG1nsyvKJ1oh6Aj7yobChmKqj8PPpBEKALZ4HGd31I8zUlgzPA+B9xxrODEGGHyuWYy7IJjsk5khI5tmkBaSadLPUK6X52YFAZMBym1ehREVFrTMsgNJL8yK51nOAQA3BLi57hJGrnKXNuA6XEStwNnDjgSvs7Rkg7gXwAj952hO64EkvRWzdkd2+5uETyaEoWfrcAzHH2a9RPhCWqMClwZk+9M429F+9mPqxz+bt3YP2dqerN3YPc/u1moMYv06YU04iDkv7PYyz5L8UCHDW+fB7KLfGrD/l2ctSBamWp3Bc3kP4Jxq8oN17pXHHzEsxgdcsRC9snULlJoG6WJNqPmzgL8nHuXzQG60bWcSP8L3wc1nxi7v+T+AU7zNB/m1sUBFDxj5IUovaUN43Vk3xz8VtFXpa68vt7OJWMUOs2QZlbZwphTUZb2s+jRo+9/rVeW0vLSApLcGblB9fyyCYMWckGy1Qaw1LPNKVYTiH9MFcDzfAXqX+SxzQpex+aFxTCkF5577KyNYEbjb+akj3/BfEIj7bwl0Cr4i77Mr3T3q+spvfS32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3gxX+Scj9P/Sc7Ps8gKbDSifXbr74YMJA8CgUfmCyqWNlHrT29d+c/e5c7WiEs09CT6MA+D4ESUxuyIB87ttVe4ut9Pg53L4BtanoELusM4MQojgfxariJR7Yf2cswd14YYkZj5enfSfuOmi1ZwHfOYixQfMp7Kd1eDu+nTQgu2jBC0T1OTo2VkAooR4v8jEpTamhqYr5f5mwMXDiNnKocko5+jz0CNGQfA8bOO2FsD42vYVJjhixbr90wteBHa/dn23X6vK1VO52G78KHhCLdmQYYjnwvJO8Q==; 5:NOVwNKoxFCZlJH0edSE4b+E74L2RFS+gnzlV2+V3JK4346o/20Pbwt1tEwUQ8/vEdM4HEMoxAbIKQo9vogqE7rdKjZCuL1U592Srj5IPMZFTgMVgV8Np239gdkww9zpob4HJQTiATGn0d8BlTH82nxVBRrjfG7xNsSnOCau1eBI=; 24:AT2fzIodzDXMGsIRPUy2veL0MPFsskuIBsX/oeizB28xB+ze6ARYl5w3KgOA+tvHoVF+s3pxDO3AUYTgFMVYEJoinGiqCXY+MZSZ3Bes368= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM3PR04MB0758; 7:rs/u5pPA5Z/znhH6FcykCzd9AGMYvmW4iIgF4v/avSKBNASTvVXBjGvDqM3+V/LRIr/4jhWfoNxHA449s15d5ia5lP4U13q0fFMe8c8VrDSF7yDMjSK89OB45ok/x9CfGZqmYrAS6QjWoXb8LuGo6FBE0Nma9NNcOama6aH1k4o4eLx4T2e0/Sq7kn5ifOsMj/fE3RFELTlldaYa5RIrVosVSuuhf/Kt7sUgnZ2WZN5bUtK3bfYMxsgvW/EDsy/J X-MS-Office365-Filtering-Correlation-Id: 486ac68d-274e-4b86-0319-08d5aa075fc0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 17:18:18.0080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 486ac68d-274e-4b86-0319-08d5aa075fc0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB0758 Subject: [dpdk-dev] [PATCH v4 1/2] net/dpaa: fix the ethdev offload checks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sunil Kumar Kori Fixes: 16e2c27f4fc7 ("net/dpaa: support new ethdev offload APIs") Signed-off-by: Sunil Kumar Kori --- drivers/net/dpaa/dpaa_ethdev.c | 87 +++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 31 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index b2740b4..6bf8c15 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -45,6 +45,33 @@ #include #include +/* Supported Rx offloads */ +static uint64_t dev_rx_offloads_sup = + DEV_RX_OFFLOAD_JUMBO_FRAME; + +/* Rx offloads which cannot be disabled */ +static uint64_t dev_rx_offloads_nodis = + DEV_RX_OFFLOAD_IPV4_CKSUM | + DEV_RX_OFFLOAD_UDP_CKSUM | + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | + DEV_RX_OFFLOAD_CRC_STRIP | + DEV_RX_OFFLOAD_SCATTER; + +/* Supported Tx offloads */ +static uint64_t dev_tx_offloads_sup; + +/* Tx offloads which cannot be disabled */ +static uint64_t dev_tx_offloads_nodis = + DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_SCTP_CKSUM | + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | + DEV_TX_OFFLOAD_MULTI_SEGS | + DEV_TX_OFFLOAD_MT_LOCKFREE | + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + /* 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 @@ -143,35 +170,41 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) { struct dpaa_if *dpaa_intf = dev->data->dev_private; struct rte_eth_conf *eth_conf = &dev->data->dev_conf; - struct rte_eth_dev_info dev_info; uint64_t rx_offloads = eth_conf->rxmode.offloads; uint64_t tx_offloads = eth_conf->txmode.offloads; 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, dev_info.rx_offload_capa); + /* Rx offloads validation */ + if (~(dev_rx_offloads_sup | dev_rx_offloads_nodis) & rx_offloads) { + DPAA_PMD_ERR( + "Rx offloads non supported - requested 0x%" PRIx64 + " supported 0x%" PRIx64, + rx_offloads, + dev_rx_offloads_sup | dev_rx_offloads_nodis); return -ENOTSUP; } + if (dev_rx_offloads_nodis & ~rx_offloads) { + DPAA_PMD_WARN( + "Rx offloads non configurable - requested 0x%" PRIx64 + " ignored 0x%" PRIx64, + rx_offloads, dev_rx_offloads_nodis); + } - 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, dev_info.tx_offload_capa); + /* Tx offloads validation */ + if (~(dev_tx_offloads_sup | dev_tx_offloads_nodis) & tx_offloads) { + DPAA_PMD_ERR( + "Tx offloads non supported - requested 0x%" PRIx64 + " supported 0x%" PRIx64, + tx_offloads, + dev_tx_offloads_sup | dev_tx_offloads_nodis); return -ENOTSUP; } - - if (((rx_offloads & DEV_RX_OFFLOAD_IPV4_CKSUM) == 0) || - ((rx_offloads & DEV_RX_OFFLOAD_UDP_CKSUM) == 0) || - ((rx_offloads & DEV_RX_OFFLOAD_TCP_CKSUM) == 0) || - ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) || - ((tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM) == 0) || - ((tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) == 0)) { - DPAA_PMD_ERR(" Cksum offloading is enabled by default " - " Cannot be disabled. So ignoring this configuration "); + if (dev_tx_offloads_nodis & ~tx_offloads) { + DPAA_PMD_WARN( + "Tx offloads non configurable - requested 0x%" PRIx64 + " ignored 0x%" PRIx64, + tx_offloads, dev_tx_offloads_nodis); } if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { @@ -290,18 +323,10 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->flow_type_rss_offloads = DPAA_RSS_OFFLOAD_ALL; dev_info->speed_capa = (ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G); - dev_info->rx_offload_capa = - (DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM) | - DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_SCATTER; - dev_info->tx_offload_capa = - (DEV_TX_OFFLOAD_IPV4_CKSUM | - DEV_TX_OFFLOAD_UDP_CKSUM | - DEV_TX_OFFLOAD_TCP_CKSUM) | - DEV_TX_OFFLOAD_MBUF_FAST_FREE | - DEV_TX_OFFLOAD_MULTI_SEGS; + dev_info->rx_offload_capa = dev_rx_offloads_sup | + dev_rx_offloads_nodis; + dev_info->tx_offload_capa = dev_tx_offloads_sup | + dev_tx_offloads_nodis; } static int dpaa_eth_link_update(struct rte_eth_dev *dev, From patchwork Tue Apr 24 17:16:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 134162 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2493146lji; Tue, 24 Apr 2018 10:18:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48yjLkjZYYIJNXOTEk7XUa6aXmU6cWDNJ+uDFj99ZbiBUQBy61n/1ffwCl6hIL83WIYOISK X-Received: by 2002:adf:afce:: with SMTP id y14-v6mr21836728wrd.249.1524590312277; Tue, 24 Apr 2018 10:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524590312; cv=none; d=google.com; s=arc-20160816; b=IcmB8WtIkPC9b8cBYGwehdeFMVOZC4UoeVtufmmbiBXC4X2MYbbwB3hpbTogtR+YKo g/d+/iuM+sjiplXgqP+KkqZPaL2peq0+QJLcAwSdHUs6ReVYNxKEdBb+Urjb2jiaCBb+ ozK+DSGs96FnFbxqxk3nTBJ2aVNmZN3GQIxubKI0xTcnSie4ngDhr4HV60hRDB6PlNVZ a5gI86Xj14rUyc9AFNxpL1hLt8CwYu/2ZAcb6pZATuOT6UE7svuB4PWTqACYs1V2UIiA ZSCXY+wWD7wIHcLf/rQqZzHzG+j5Ea0WQTyLTv0rKuJID+3//hmzjJVWG84+KCkvZNHK TVYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature:arc-authentication-results; bh=w2xN6fjcZoY43TbeZ58uWDSGZrHt9gqOeK55BQtwOXg=; b=niyetY1p3jh8S2UBd4z6KChLEfLiHHvfCXPbJk72MQ0W9ezY5EGG1MOiY77QdIuy9n 3gWf0uUmps4gaFZB9s7XjZY+1aC9I4zmbnu31CGdJwvwbMW+7DcqL6RiWD/WlYVFTV1Y 9bi14/oKzyTI31mmuuy42hoNN95PMeVG18sYKdq4x788VC66bdIK0kY4A9euRGN43x7Q 99Vbouy378QT+Qdau5x4cMqwWyQuCqy+C9Z5nFFssIwLEQ09wfigE+W+oK073VN5+xG9 /skAr1l9ZZVi/fzN2nS7pR2PaJ27MY2qn8PcHZIINBc4nKNZGWjyU11l3v4NT8SvLvLk 8vCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=W9Am3SCH; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id d11-v6si11023637wre.53.2018.04.24.10.18.32; Tue, 24 Apr 2018 10:18:32 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=W9Am3SCH; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F4E64CA6; Tue, 24 Apr 2018 19:18:30 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0057.outbound.protection.outlook.com [104.47.0.57]) by dpdk.org (Postfix) with ESMTP id 49F4849CF for ; Tue, 24 Apr 2018 19:18:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=w2xN6fjcZoY43TbeZ58uWDSGZrHt9gqOeK55BQtwOXg=; b=W9Am3SCHmeCZDI5+8W4toRw+WhzvNToW20JPD0tT2CX4aphkcjQEjPmjSk0ytsAdg4BLCrXXF65hrRZ1z130HJn134uGQivP2pWkNoTAnynmZ3WDUz1GZgpSiMLrM2rh0lK7NzgI00ApyXe1M1jJTw4VMWI/roaBHKV0mbhfAAQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM3PR04MB0758.eurprd04.prod.outlook.com (2a01:111:e400:883c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Tue, 24 Apr 2018 17:18:19 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, shreyansh.jain@nxp.com, Sunil Kumar Kori Date: Tue, 24 Apr 2018 22:46:14 +0530 Message-Id: <1524590174-5951-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524590174-5951-1-git-send-email-hemant.agrawal@nxp.com> References: <1524582401-14696-1-git-send-email-hemant.agrawal@nxp.com> <1524590174-5951-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0021.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::31) To AM3PR04MB0758.eurprd04.prod.outlook.com (2a01:111:e400:883c::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM3PR04MB0758; X-Microsoft-Exchange-Diagnostics: 1; AM3PR04MB0758; 3:QtlMoYuIJuHyBYE1pBmYqyrZxEa2IOD8lBM3u0UlqlAU2ecP5qpZLwdjorVYaiHwYnXdgbCfYfxbumuH2j4k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BuWUutCffncCH4sfdLMcpTrru704Uv9MFfezXmmPReShzVflUGC+ooh7Xl7Zcfif/Q4buLLcZLtoDMTh1q/ZKjigCDG6i/ouiWBQTNxeG5CxM3zIjp5guB5NwQbDkXrI82WpqEOXNGPJZ3oMkgmv6mtJoMLDh9IZVIsXBN/d970JarmtQ9tI3JIfVeGrrcuzEjPTuqdiBSh/xR13ZblDmpfXT6ei25JOYD/dCNIIExKSdKqea1WubShxd/MT9o/ab6TmA+EvwQRk2A3NL2; 4:eGMia67z2NxR/BSlBUGZZNxnAQeNS+zREO+SPRFKwiJo1JW2IJ+NdDLoyZZTc92Jpz2uj9MBcVsFVz8FzMgt3fOHQfzE+sg8RJE+JhbFK0BcfmnXDf2AWFdaNHR6fU5r5AIeQkBI0DsxGI5Dv5tV9Lp6iHLBXFOOfj7ZC3hXdgYC/gflb5DWfcOH8Cd96ZkAwjY4Y9+2b7bSIlTEuhpYU1aXkhhA+9DMeBd1hpGwlk9kvvAAh64mDvewDqFPRpeCtKPrxUthhhhQ1nIwJgfY/d/2ZuXLZCnepDm99fTmvj3y2qpVtZXHBlmhaJITAY5C X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:AM3PR04MB0758; BCL:0; PCL:0; RULEID:; SRVR:AM3PR04MB0758; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(39380400002)(346002)(366004)(199004)(189003)(476003)(86362001)(446003)(956004)(11346002)(26005)(2616005)(386003)(16526019)(5009440100003)(6506007)(47776003)(76176011)(105586002)(6512007)(2906002)(8936002)(6666003)(36756003)(59450400001)(486006)(55236004)(44832011)(6916009)(25786009)(2361001)(66066001)(81156014)(6486002)(478600001)(50466002)(48376002)(8676002)(68736007)(5660300001)(7736002)(6116002)(2351001)(16586007)(51416003)(4326008)(3846002)(106356001)(316002)(305945005)(81166006)(50226002)(186003)(52116002)(97736004)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR04MB0758; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR04MB0758; 23:FhMb61hdKeG2/VDi7zqhn6wGrXb0X99+U/NqumRua?= PNspiA1aOx5KPSYHuauBlw/uedohnT2tXEFkgz2TyiL7YM+7SwLt08ET2TyTgLxfv/NSY6zZnFgYDvYAbWa+7PxHKketSdWoEpe7NDECoFlOndqCuNb4xaMKXMt73y49hLYSyJ5PPO1xy31MbSX/injO3s8A9maUN8z03eSvc91wfHHwoF4XXObd6l8NFbcOKyCiUlGiDUdwiMrJY2PsVrzVMgfkMOUFUXo+3N79pdNc88BmPMqT7zhlRf8MG5puIbwaKfG+dhozcJtAdBUQZrnIF03fdBsUXRCs9a32XXXRwllUnBQKJYcFqAF5askd0hG0INFP7HzIs2UrYTKIRyoWJ6THs1gKSlsJzqO9TMxHvqsd17KgKxb33QZVANA9rbvQRcG3fhpOYXT1Bfv8Ns/Gvh6hsrJs4hYiqt00hbu6i0LFzn8J2yBR65pdqdTIBNrgn8YkX+yMtf54PKzqbQlxbLdtbcAip6LOJgQUJxIR8q03v6K39lYWPJr/yaWQxEkG1iDgSo7vzJe/T5sCmGnyw6Wy/00CIgrFPLCuOIBohuLQVv3qC12hvin9uLMVIVkYDYSEVu7n0KLfKNUr8TD7yjwcWa2igVmcXjVbDBBptLw43j/Qw5QA6btMbKX83lafYP3p+YjS2Aw+Sga5rW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9g45eLnvLwKNAf7SBqTjlXaRE10aldkMZRg6/cL4uoVExdf/ThD4alJWzEaheIEg7qYjqeUzudqfwx6V7CW8r3o7geyvuVXanTGhfx25OodTLjXGAkHAUhXL6U5TJx/959nrCcqAuz+VNfkTNQUR8Cgb5RmmKHwsquq59E6c6PraOpRCztrh2EGmC9Fy+mWPVbNOtd+6GtnPEbmzZtQl3nuXvjC9peDQH5stKzG6EBpZLiz/KhGys/wGUekF2akA9x94vPR4BKMJY/qgHgFoTMkw==; 5:XEQXggqXE5sSXFwR+g76fdmjef/X0UpA7iYBRDG7+7co0zJQ+X+dh0S1vUHDucX+FdV4pSUM2uw1/ESoC+Cf3YJAbUd5+Lh4zPNLNIISB6XDpX/VH94TL06qCi3TWiCoEyXy+s27aZTHfl4QsLt4NFcH4w9/XNDJVwRSX5bDvpI=; 24:VU3EHPJ/QtQPsDBRVABJ2DV2hb6AT9rdiaEzzSqQfTR5AxvV6X/3qDxJMB4kUcECN2R9zrlX8Azg/v5xVnUJnk3nRpeT8CYrTXVlQdvneIo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM3PR04MB0758; 7:PxtpdiE5HCK8AFv4uzdHa8/8iRC2+IpnNCiXFJaSLXv7b7YQp5U4VwuBB5emDjuuCHUXXi6ohsUbHi3g3RvVOqmZgFyWeNpw2Dm9eP+ZpcdCkL2DOVuR1fqxpfdQ1MSXbYTavF8yxc13/sWRXwyT1YzwWF5tFvQw8BjAtPHYRAGmiuezhdyamdu/jVOoVdyo2L/zUe2nSWjluLs2U5lgAgBdwKOfX3hF8dCETP1PiO4+U21Bd9hy+6SDtYGdmw2R X-MS-Office365-Filtering-Correlation-Id: cfa103cf-fbc5-44ff-972d-08d5aa076096 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 17:18:19.3986 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfa103cf-fbc5-44ff-972d-08d5aa076096 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB0758 Subject: [dpdk-dev] [PATCH v4 2/2] net/dpaa2: fix the ethdev offload checks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sunil Kumar Kori Fixes: 0ebce6129bc6 ("net/dpaa2: support new ethdev offload APIs") Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 88 +++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 28 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 54ab9eb..2f34022 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -27,6 +27,36 @@ #include "dpaa2_ethdev.h" #include +/* Supported Rx offloads */ +static uint64_t dev_rx_offloads_sup = + DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_IPV4_CKSUM | + DEV_RX_OFFLOAD_UDP_CKSUM | + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | + DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_JUMBO_FRAME; + +/* Rx offloads which cannot be disabled */ +static uint64_t dev_rx_offloads_nodis = + DEV_RX_OFFLOAD_CRC_STRIP | + DEV_RX_OFFLOAD_SCATTER; + +/* Supported Tx offloads */ +static uint64_t dev_tx_offloads_sup = + DEV_TX_OFFLOAD_VLAN_INSERT | + DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_SCTP_CKSUM | + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; + +/* Tx offloads which cannot be disabled */ +static uint64_t dev_tx_offloads_nodis = + DEV_TX_OFFLOAD_MULTI_SEGS | + DEV_TX_OFFLOAD_MT_LOCKFREE | + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + struct rte_dpaa2_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; uint8_t page_id; /* dpni statistics page id */ @@ -170,24 +200,10 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->min_rx_bufsize = DPAA2_MIN_RX_BUF_SIZE; dev_info->max_rx_queues = (uint16_t)priv->nb_rx_queues; dev_info->max_tx_queues = (uint16_t)priv->nb_tx_queues; - dev_info->rx_offload_capa = - DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM | - DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP | - DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_SCATTER; - dev_info->tx_offload_capa = - DEV_TX_OFFLOAD_IPV4_CKSUM | - DEV_TX_OFFLOAD_UDP_CKSUM | - DEV_TX_OFFLOAD_TCP_CKSUM | - DEV_TX_OFFLOAD_SCTP_CKSUM | - DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_TX_OFFLOAD_VLAN_INSERT | - DEV_TX_OFFLOAD_MBUF_FAST_FREE | - DEV_TX_OFFLOAD_MULTI_SEGS; + dev_info->rx_offload_capa = dev_rx_offloads_sup | + dev_rx_offloads_nodis; + dev_info->tx_offload_capa = dev_tx_offloads_sup | + dev_tx_offloads_nodis; dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G | ETH_LINK_SPEED_10G; @@ -277,7 +293,6 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = priv->hw; struct rte_eth_conf *eth_conf = &dev->data->dev_conf; - struct rte_eth_dev_info dev_info; uint64_t rx_offloads = eth_conf->rxmode.offloads; uint64_t tx_offloads = eth_conf->txmode.offloads; int rx_l3_csum_offload = false; @@ -288,20 +303,37 @@ 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, dev_info.rx_offload_capa); + /* Rx offloads validation */ + if (~(dev_rx_offloads_sup | dev_rx_offloads_nodis) & rx_offloads) { + DPAA2_PMD_ERR( + "Rx offloads non supported - requested 0x%" PRIx64 + " supported 0x%" PRIx64, + rx_offloads, + dev_rx_offloads_sup | dev_rx_offloads_nodis); return -ENOTSUP; } + if (dev_rx_offloads_nodis & ~rx_offloads) { + DPAA2_PMD_WARN( + "Rx offloads non configurable - requested 0x%" PRIx64 + " ignored 0x%" PRIx64, + rx_offloads, dev_rx_offloads_nodis); + } - 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, dev_info.tx_offload_capa); + /* Tx offloads validation */ + if (~(dev_tx_offloads_sup | dev_tx_offloads_nodis) & tx_offloads) { + DPAA2_PMD_ERR( + "Tx offloads non supported - requested 0x%" PRIx64 + " supported 0x%" PRIx64, + tx_offloads, + dev_tx_offloads_sup | dev_tx_offloads_nodis); return -ENOTSUP; } + if (dev_tx_offloads_nodis & ~tx_offloads) { + DPAA2_PMD_WARN( + "Tx offloads non configurable - requested 0x%" PRIx64 + " ignored 0x%" PRIx64, + tx_offloads, dev_tx_offloads_nodis); + } if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { if (eth_conf->rxmode.max_rx_pkt_len <= DPAA2_MAX_RX_PKT_LEN) {