From patchwork Sat Sep 16 10:52:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112801 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1617218qgf; Sat, 16 Sep 2017 03:57:37 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7+ocRtFbdiW4Hx0ph3QrJb9wbKnNpna6b2GqpPh6DXOHUETXLEwHOqaLXmG4qj94Sk993T X-Received: by 10.223.136.119 with SMTP id e52mr21788836wre.225.1505559457616; Sat, 16 Sep 2017 03:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505559457; cv=none; d=google.com; s=arc-20160816; b=LjsU4Av+scnhLkxWxklzJRF9bxzzVI6Lov9VJeW+osIrqmErFmpOB33lRYGt75Ty4C zVdNePz5guCaVsjnZtVuwix+TzTuTPqgZj6UCtU04/qtuzWtHhQs5GpgEs1Z5tSRjkcA +5S9Kk5vTG2Lg8jPLirHjZrQAy+rRrrs+O5bY46znejgddVa3rv9Utx3evjAUTROUaii 3UBVcRSX4/a7qcGVbUVeOO878R8NJx1JzT8pBqoWa6//N7M62/nOnWKO67nqigcD2B6b oD8Ah9b5tOf8SQs9G6a4Uo8rT/vOHKHzrPtgjnWgFCin5N6lkKwiV9xw0ZfYGcNwUZfO w6+Q== 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=xdugiRPXNGCciVDlOn8WZ1zBilO9raE8k0na215L79Y=; b=yI4qB5+AydlNjsb5vsQHoa+GhGmpJN9dvaE77UIZw+b/sj03KLcAuzVAjyKhkYz/6X TSj4QAxRIkfTRk19bw2RYKmPJcYyUQYAihUv+UCxfixSHCaLqxX8BiOrugIaMIbPmkJc f7yT+PlMLIPXn92xnxH3HwwWttyViX7vT0BWW78s3l9OIkcYivY/AXsDWr8DKZWWtnDy pYahoe/ybYsxKTgKzaaqxPigSG74rKzL4B+ZEhmkJxpPZCRpDuQxYORO/JBTBldTKmrk dpB39/urk+KvkZoJFafbhSRS57W5bB06c1EE7l91NzemH0tRT1qrl5+XFbX8rfjs7kNm Eh4A== ARC-Authentication-Results: i=1; mx.google.com; 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 b19si2464860wra.169.2017.09.16.03.57.37; Sat, 16 Sep 2017 03:57:37 -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; 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 BB1EA1B20D; Sat, 16 Sep 2017 12:54:08 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0071.outbound.protection.outlook.com [104.47.34.71]) by dpdk.org (Postfix) with ESMTP id 0E41E1B219 for ; Sat, 16 Sep 2017 12:53:48 +0200 (CEST) Received: from BN6PR03CA0053.namprd03.prod.outlook.com (10.173.137.15) by DM5PR03MB2698.namprd03.prod.outlook.com (10.168.197.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Sat, 16 Sep 2017 10:53:46 +0000 Received: from BN1AFFO11FD006.protection.gbl (2a01:111:f400:7c10::181) by BN6PR03CA0053.outlook.office365.com (2603:10b6:404:4c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Sat, 16 Sep 2017 10:53:46 +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 BN1AFFO11FD006.mail.protection.outlook.com (10.58.52.66) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Sat, 16 Sep 2017 10:53:45 +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 v8GAr6v7028328; Sat, 16 Sep 2017 03:53:43 -0700 From: Hemant Agrawal To: CC: , Date: Sat, 16 Sep 2017 16:22:34 +0530 Message-ID: <1505559161-29222-21-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> References: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131500328258690076; (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)(39860400002)(376002)(346002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(498600001)(50466002)(48376002)(106466001)(105606002)(305945005)(8676002)(16586007)(6666003)(81156014)(68736007)(81166006)(36756003)(8656003)(5003940100001)(97736004)(6916009)(356003)(316002)(5660300001)(4326008)(110136004)(50226002)(53936002)(2950100002)(54906002)(86362001)(2906002)(33646002)(77096006)(50986999)(76176999)(85426001)(8936002)(189998001)(2351001)(47776003)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2698; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD006; 1:cvCVCzU3E0c47l2iSyR1BheK/Jlm3rETBl6vaDhBC78TuxozOAoA/606QyNUP9so7AQDySndCQrmUW8M/rDpWBLyUoAvA3R7KhfZ3KzlPH2Gpbm2Ba3tMlwOX0UVQt1A MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9279162a-6097-4101-7abb-08d4fcf13429 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:DM5PR03MB2698; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 3:TVgK5NMqCMa0EGsAanv6bkGb8tZfjd+LY//fGjhX42tX6S8y2PWnrdkU4xxzxuj8cgzJeZtFxPdEdwNjj8l9/CeFw7ev9kLYEfhplbhwy4fAWemEts0mE5z19LXIw4PagH/3v0gppT5sc6AfyaUjKZZsT4lrb1XohvQPBq0TLWoADqTrIporHBvb2DymtBLMhEhSgjZ+Yh0gY4obsKP7wBVMe3jrDeBgHlszn/RnT5byJRXm4OKa+Q31a5Bn83poXfY6KI5dq/2QnVtpsq+YobB/ByRB2Bz4FFBApKd1k6b4fcoCDYfkvg7qancRFwAiZaF0nheeLy2Uu5m37kf8XODPfCq27CDb4uiOxX4xByE=; 25:hh2ryZUR20cAwVllAno/WD7TSaXM5agi1YB8kWuVc+r1tgBJJ6vtYWm9rg0VZhftG81fh4739+ND/pGwp8cZdwREdRWio30x5qCQN/P5PCancw+mMWLlWZi1suMsH6HKsExWxyr8xBlUW4lz0AiKOm4hlchFnTIPoUnlsskB9q3rcQyNa0rrVtqAcBlX/DRxBE+v9eDh0y2RMbxNPrYDoavAyBBjwPkNUc3lM0QKslLY5p0esHyhvg1gb49aF7il5QR9ohUPdhlnR9TOFq2XICuK5p/rS+65lc4IJdQ9K2WEbuEDO+R2K/bAPhNktAi5lh/RaRqKBSV5dFUsPguYRA== X-MS-TrafficTypeDiagnostic: DM5PR03MB2698: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 31:Ewg8eaQvNE2QycDY1PkopdRK964hM7dsMN1xbzzVqKFo4+a8EiqKHNb6fkA+vdHZqVANxXMLXl8MCyT2BJlVoyFvAv4AZKZWcCS90BGGFE8LQU7uSDBHpvwpdaCMSkYNVUHtdHDCA4xJ3svxELceGQToheA3pW50dUU9uKb3gp0pNcYGMgqbjUc3T8vnzjnUm5ZVWra8PL479q+xr4frVJuTo4kShQ4q7TSflo2R9lE=; 4:arAmAIFusP8BSw6KQDrOhU87TWYU3Bta1pm+AeFH/dI8OPcLIT0BTRzL2K2xel2hKv65/YCH5QRLYvz+leI1HOm1Cbl3BJ/fs+Ks9jNlJ/Q6FootIMhynGO7u24hlzlj/ZSWb+fBqMsP1iB4u77cDkmNU9St0lPrZnBe2k0nnFtx/aZ81EhtVSj3CFcfIwBgYuyvQjB2SH33/KRwlONFhgenwse21I35EG9F/cMVBTHaWJhvs6xKy4AL5aFYpSmQNT3MkzMEftEl6eMe9SACMw5K6zKCLDmVIh0zsLiT6JA= 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)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123559100)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB2698; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB2698; X-Forefront-PRVS: 0432A04947 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2698; 23:HKlGKClOvdGz4MpJk0cHnpiIige74rbFB1zNXtoml?= L/t42DfAD6obKUFb9t0CaJx9TuKp6utDY25wiVWhrSHVHK8ZrFdyysjgJJg5+fkUVLzN+0VqpTiesp409w6yJt4oMRoXAQCgGAvronW++OxbcA6be76v7fHyYKuG0EuBsvKckXzUt1UNH4qgO7vuoMbiJan25ntaIKzG5S9iC1jGS+4hWKerfOjISFL649HAWhjBUUl6Zr0Us7rkGIn+1koYX0iq3615SemOejByKe6nKp0YFkY0qZwMNt4MSczwbAdLullCaLTcxmNetQ99278k5nZDiYkmlYEMLX/mHlEeA0UuKLH9EwiqJ6lWy4zXzS7IpbvieRcRbM/+1vRLjNOdJsqRrypbIWnqAPCIw3G++PCIP/IpCq5kYBvJgOO47AT+5dAr9tB3GTMh+K01epD/fQrqtissM0Cu1ECP6doiDhr+5olmDMGsJkvSC48r6vZinpQaFvQAoetNu+X0lpuRt5I5aisYeR1xAvKcP6OvlLTNB19fObVvn5Lw74Sr5bXqP2388ACs+RVIQVqlPVxHkPa8PmUYEFH+rSw+tGw71fDE7qgKYWHd0UNi4mHpUb6SuJwDXtQ9dutJOChi4KFt28fNvoSMPZ1wpvbvIk3MaYdTZN4PaopicsOTgyJz7WDJvFy+tjXvyM4w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iqDc8QeBykiNHbHeJRTdvJKX27vFlfMEoR7UE81A1/TfX6jNG5DQ+jE9mJTo/2qDX3SgqOxUbwjdvYhPG8=; 7:6OeKGvDA+DAvJ+3nq7bo1CXi9vymWDIlSsEjdeAIBThyVDbCIwYHJ5oqbmxQr4I881SDE4Vd2p/Pnfp+nJFaLc3UkdmI6Dr7FsRa/CD0ZrV+a+javalYk5j3WmskeZN/j4aBFvxXa1Obxkp/WNiT4H/McgutneoWS3wdS1N9VYmsX8o7TzSwc4GO6U9n30crzEfkPcuieSU21+ED+5yIH6BdgtXc1rUyr9kqHYueJMU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2017 10:53:45.6818 (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: DM5PR03MB2698 Subject: [dpdk-dev] [PATCH v3 20/27] 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 dc24bed..643d882 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