From patchwork Fri Sep 8 08:45:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112045 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1248192ybm; Fri, 8 Sep 2017 01:51:17 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Tl8RviTgZXpmIiuf3/XV2b615cQVw7eTVIDU//abROeR3Iu60qNiIJyC5sD8m+oOErLyB X-Received: by 10.223.195.108 with SMTP id e41mr1614801wrg.51.1504860676987; Fri, 08 Sep 2017 01:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860676; cv=none; d=google.com; s=arc-20160816; b=uDzzStH/NDDJelGrml4f4Q1ZlfVVE1yQXrPZaNpHvWHxgIZdfHJjbPAnHxKdCR1Pk4 4n0R0LDR31tsi5Hx38qgoSlqmBVGUU1SBTwdOyrNR+V8XJ3fdWucL2u0n6MNtZBPKizf t1DsKbRFMGM/CHA8gYeIF31FDz8z61SSGlTY+Y9n86WxzNDO/HH9Dw0E1EIN8d7i6FRf d8FwnKD+DgO/5nLCxk5XjtctX04TFQ5yXwQ1wF1nQYUFYuvZnyRkWtFtF+6joAU1AIKq I2AyPLcd0B8DPIGBZRiGUsBGHkqqFpwC2lWQyC4NxpRyrKLQwfuQPza9evw4U4MQrZhb 7opw== 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:arc-authentication-results; bh=8m6aFAzclzjtobpr5THOWwT/wVmuyd1bEHEeTiUgnnc=; b=UXftjA+6JLUxMxWqDX2b3QPKkkEpwadb8STbvSkQIMWZ11ur9TRTcAh3fPFpQMKTNV R9Vh9oHZsNnz4lwwXVr4p1p1gkqpcgg9E8ozV4nvwOxC/cCuWngozNZ3E88xFHpS2RbT i8b7zBJCtCQyr8l/h7SUiVZKhGAUm06UhSt0cjv8k1fjPl/t6fJjwTMsXIULEA/jS332 IaJmjd6fFGMuJlEz1+UGxszluDPZNgAMFmU8g9J4dY32nd9QlQn75UqjoxMdPPxNFW3m hAE/bxHQDnEV15S8szjfyNBFvq2ULvwAoTWb59QDWF+78SjGQjznRx0xTD3SNbIEOAK7 NQNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id g126si1016567wme.50.2017.09.08.01.51.16; Fri, 08 Sep 2017 01:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8F0DD19A52; Fri, 8 Sep 2017 10:46:38 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0059.outbound.protection.outlook.com [104.47.37.59]) by dpdk.org (Postfix) with ESMTP id 47B1519A4B for ; Fri, 8 Sep 2017 10:46:36 +0200 (CEST) Received: from BN6PR03CA0068.namprd03.prod.outlook.com (10.173.137.30) by SN2PR03MB2270.namprd03.prod.outlook.com (10.166.210.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:35 +0000 Received: from BN1BFFO11FD048.protection.gbl (2a01:111:f400:7c10::1:139) by BN6PR03CA0068.outlook.office365.com (2603:10b6:404:4c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12 via Frontend Transport; Fri, 8 Sep 2017 08:46:34 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD048.mail.protection.outlook.com (10.58.145.3) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Fri, 8 Sep 2017 08:46:34 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v888jmot023063; Fri, 8 Sep 2017 01:46:32 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:20 +0530 Message-ID: <1504860327-18451-24-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131493339946516661; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(189998001)(2950100002)(97736004)(6916009)(48376002)(6666003)(2906002)(356003)(104016004)(86362001)(77096006)(8656003)(305945005)(85426001)(81156014)(53936002)(2351001)(5003940100001)(5660300001)(68736007)(106466001)(54906002)(47776003)(33646002)(8936002)(81166006)(498600001)(8676002)(50986999)(36756003)(50466002)(110136004)(76176999)(50226002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2270; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD048; 1:GbBqFdfhypjDH2q7szHHvXBstIyLrWTONw57OgMgXzIBcx9OxbCPYfof9vcrWvPuUh7tzgZw/FxbVR9ubkDsn8a/yQsZLULEVExywc419/RTRA8Alhx/3fRv/I/x/1Mt MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8bf60953-0364-490a-80b5-08d4f6961c4e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR03MB2270; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 3:IDxJoIjggMO9aLPqN7rhG/pBkyQXBP9D0vTUhYVg/B+N3Yb6/BMWzdp+aBC+0OOxTg7QD3FKb4JcgDjtQqjOgQM8AeFbT06AQLsEjgEHsjfkxz1PmsvAUP/uUNQvspS0ohvde37DoX+2hIJ5NgdKC7R88d8IE/1UuBCjB4AlWXVsLtiDyIKtof9yt9GI7lLkBm/7xoQXEo6bbOJuM5LbaIxb3qSPPgTzB/X5VY0Bva9T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JhgB9vzGhk= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2270; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2270; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2270; 23:tIwyZYq+FsHtAsmOMRN3IBBx11TfkHFsnoGcGCPyA?= 1IAghCHOa7eQxKMzrCB117TmYVvK7vty65+XxPRWH6qkt1zswqxwNGCy0CClAdgq/DnPbTqJ6jLTYRw/xZ1aAZr63zMUENw72XroBcmmFe2nRTcXtzKeeIV1730OFoOdNZNmR44xlwYVpyHGm3IVzxXp4K0P8bMSLr2zsP+QS5a4IL75rHwLZq4Oj92nuSxTZ+XwwEqjbsOw5hxUOki2WpDHNVHWv6rd6PpWpNSkLs4HjvWQk3hVG762SEC/Q7pJ279rrlLAk9GIixDWhxeZUaJpN5xzeFncH55K2XVFBQFF8i+0NEJsU9qY9+XHR0fpzN1tqSdlehdrEDOaXrScM+EwmHDPJuaqQn50hKAg8euhk/R+g4KT2AFsWhoL4gHb5jmVefUgEW47seeuV8a+FEZ7injUrW58FlMVQe6c2wZz9BrdQhdUu4HvVF0ekDT4ND+fb8JK9lt0UsyyKVlRYCCyIvUAR3yYl+FbUOWGrFjcgyVara2YGCHLqirxhiWvUNp1oG7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LJYnUPxPN7SrT9vQ09Xbd0AWBATg==; 24:rc4tXMbFjJsM2Ia9EJVlsC+rgDbCKC+KJ0dW0m8FcTQ9bSAVr1rveyjFcCsAzMX1ADu7xXDk5THb/C02qb1NfEgCScmpbxpH4AFXbbKUQFE=; 7:49A6StGTKUg/P8iIpvMAHYKCuLkvKA+7g26IPI17i33HwLOaRs/kImaxUbj2EMrSe5hdaAwMbtmfG3BF4SHUMaUuO9TcOsS/AKf4xcxIlAWRcPwY/ruNSl/vgsdQF321tZTEWpCbJ8wiZo+C3TMtj/GNKy8YQcOYFLCBi13fvFsqz8v1aTwXDPTpiMdO+DlzDBdHI92jNs7+O1H4ciFRLhgQ54pTjJXJ5cRD+DCzm1Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:34.4800 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2270 Subject: [dpdk-dev] [PATCH v2 23/30] net/dpaa2: add support for RSS hash update and get 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" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 0fe7a13..aebcc71 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1418,6 +1418,46 @@ dpaa2_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) return ret; } +static int +dpaa2_dev_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct rte_eth_dev_data *data = dev->data; + struct rte_eth_conf *eth_conf = &data->dev_conf; + int ret; + + PMD_INIT_FUNC_TRACE(); + + if (rss_conf->rss_hf) { + ret = dpaa2_setup_flow_dist(dev, rss_conf->rss_hf); + if (ret) { + PMD_INIT_LOG(ERR, "unable to set flow dist"); + return ret; + } + } else { + ret = dpaa2_remove_flow_dist(dev, 0); + if (ret) { + PMD_INIT_LOG(ERR, "unable to remove flow dist"); + return ret; + } + } + eth_conf->rx_adv_conf.rss_conf.rss_hf = rss_conf->rss_hf; + return 0; +} + +static int +dpaa2_dev_rss_hash_conf_get(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct rte_eth_dev_data *data = dev->data; + struct rte_eth_conf *eth_conf = &data->dev_conf; + + /* dpaa2 does not support rss_key, so length should be 0*/ + rss_conf->rss_key_len = 0; + rss_conf->rss_hf = eth_conf->rx_adv_conf.rss_conf.rss_hf; + return 0; +} + static struct eth_dev_ops dpaa2_ethdev_ops = { .dev_configure = dpaa2_eth_dev_configure, .dev_start = dpaa2_dev_start, @@ -1447,6 +1487,8 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .mac_addr_add = dpaa2_dev_add_mac_addr, .mac_addr_remove = dpaa2_dev_remove_mac_addr, .mac_addr_set = dpaa2_dev_set_mac_addr, + .rss_hash_update = dpaa2_dev_rss_hash_update, + .rss_hash_conf_get = dpaa2_dev_rss_hash_conf_get, }; static int