From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00070.outbound.protection.outlook.com [40.107.0.70]) by dpdk.org (Postfix) with ESMTP id 80DBDD0C9 for ; Tue, 8 May 2018 17:43:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=EGeu2JP8jZe0u3aRlsZKE8ysQObk0eUg7ZjlbdPvZ44=; b=Fewdjm/m/G337frUYjiS+/HsVBf7j6lDjqtqWQjXdEsHHjVWpB15YkdpRDrdWkwDLfCJujhRiJKOEl7fmtGSfZeuvu8xGwqubApR0J3wlN88nwVJeO1PIRFJQRrJgi0C/IdpE/Ko8DZXZ3nLZ/qv+tsNa3O+aICaZTcYivxc8Og= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM4PR0501MB2308.eurprd05.prod.outlook.com (2603:10a6:200:53::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.735.17; Tue, 8 May 2018 15:43:24 +0000 From: Ophir Munk To: dev@dpdk.org, Adrien Mazarguil Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Tue, 8 May 2018 15:43:15 +0000 Message-Id: <1525794195-25082-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR07CA0182.eurprd07.prod.outlook.com (2603:10a6:802:3e::30) To AM4PR0501MB2308.eurprd05.prod.outlook.com (2603:10a6:200:53::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB2308; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 3:CWweBlyPqSlMO/2eY8Ada0NxsCaoYEA1UyUXw9bRt+nGAD/rfsNPPnTOQ9rWUqBqPH/FuyMj87BjV1JmfjX/2raH9Ft4HH0cqriZE/rU591hf0NvQR2XuuZk5IKOjJfuwX0iUsQAdzlDVSwldKiqNOoKl+XiaiDk4aaWBPkbj4GnNInVIdsgeQN7hw7NjQABANik6G9HtjjGll1NbDlkf6jCeNaFkWBqNEPa5VGZWUcuzjPXKKjnRu+dYxcZlrdE; 25:Euqyj1Eg4kSBNT25DX16+YpYSGANi08Gkn+1Gu4psdC+roX1lc8FkuSQQBAjbZzbeW3LH9A757AVyYaMFxdjXQwGSQ97IQLb3ST3ImRMOE3CZgW0T9H1+eiI11A6K3T7uEjbWkclItgbjkv1j1JZcfMPiVi7kT5DrPKXDa7b/aLV6OldLSSWWPhXOmi25o86VtiIHVBScN332xwCUrhW4VBn6cyfX+Y8wxUGYeUErjTwC3YxriWXVPkoWKWbsEQyKLLOgK11foBb0Ak2jCrTspkPJ36IuqUax3bASJIAkZsW60DJpSdk0hIdUZ7AHfjmngfGJwNuyfGsQ+Kz2V8NDw==; 31:W49njlwZAj7V0+Vr2PSykGD+i2bRQHjBy+taM5Cr9cRwQ3MEhyc+kR9pUYNOGaxfYCGWsnypb4uDMbA8j5lPWEAZjdvcH737JrGH1JSK0GiVXt8OPTPal8FYdnI0eUWkJTR6gv3B6Xz3l55BVATwJ8rVfdPKiufq9O9e6asY8ce/O1ueVInnfU3RYZlNk3UxBA7SMIryEFdy7UVbbgsmEIj5vp/skE3m9mRNJ2Vxowc= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2308: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 20:QeIhwfCnBSOdpMt7sSAnnPkOQX8LsXST377pEVvtcp0qT3kcEruLgaA2JZbJcHmaZ+8tmcc/42UN/TD//GC3wr3OrqlUiRNPzagIi+qTJdxC+N3wFBR4q5a0g/5hf/RQlTHYjCzXVPru4KvLlUdWgTT2kPypzVKAQI+fM5vMQqHz40nIWkHu/BN1PzjeklB07x7oWDjkAcSsAxpWx4/wpYEBFjazHL8ZAZmyCc6ru81u+omNHp53BtI/s2kNmXPca61qFm6Ja0xpeX1Hq55y8GJh5PSKw33yqlgkPrLY9I74I7DNitrrmt2xZdpHw9wfwNG90K059sbF1529PhbO82TTFAXacPwfkPpH+cjk1NAiCz/BHTkhBnBKC5vDwlMnnQLsdFY87lfUQwiTl3Pii+FOuxbxGCsX0uqvr+9a3Ef+ZLDJaPHdF02/r0KMrB/VQd9A90+7pvl1/TvIRcoams0hDfeX1bbB+X8DP3+57dPIFS6k4t9QG8jSVqMW9vz4; 4:h91dTVVa/GN+TB5NgkSZ5E4a+g68DJTVzlxvjyn+YH/UmxhA3+/yVBuqXyvDM0J1OD4Jg4DnYDClNW0EExVdSf0ImypJzYel4jHcHmlM0G7ElVTj/VcoyLUs2WE5ogT8IffWcg4kWmx3iMKHBvjWAZ63se0PDNQh6HbaWE3CRqtU1m+uIG70A85Eu6KQ3UkTNBLtxWSzVUc730NUI6Qgfm+cSrRSwzFt+ZSTmvx0uyVok+kYUevVJF+CVkr2vRkqw5ApuosoIBiTUjfgWVUCCQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR0501MB2308; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2308; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(39860400002)(376002)(396003)(346002)(199004)(189003)(8936002)(7736002)(305945005)(956004)(47776003)(2616005)(107886003)(50226002)(7696005)(486006)(51416003)(52116002)(81166006)(386003)(8676002)(66066001)(476003)(5660300001)(4326008)(81156014)(36756003)(106356001)(21086003)(478600001)(105586002)(316002)(69596002)(53936002)(6666003)(54906003)(6916009)(25786009)(55016002)(3846002)(50466002)(6116002)(2906002)(4720700003)(16586007)(48376002)(97736004)(26005)(16526019)(186003)(86362001)(68736007)(33026002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2308; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0501MB2308; 23:2J+wcwOX5mZi/7NSBkiVHQ4yWbxc9n5e5iab7PW?= =?us-ascii?Q?qqgGLPT8RWomwlp/0XFIbsVAqI/ean0Gc6zjwqYOxorihnOvy2nWrySwsiXN?= =?us-ascii?Q?Y+G8epua8Axs6pQdwb/dYAYuNheZFkWFnybpU96YgW3RZxflt79CgvgFpjRm?= =?us-ascii?Q?rQoGo2OPMhpfjylfgR/VJuA4rs83erItX7f7rharz3xk1rz/2Y/9oQXEP2KE?= =?us-ascii?Q?Ss07YlXl4cwrpj4/JDA3aht9+TvnnWrV57OrFAwXbPab6FZGErVVa8dDCM1A?= =?us-ascii?Q?58vL2i6cN4I8ChF8BxhAHG+WRpMRB+Gt/Q7eXIlToXbVhABSb0/z4H77tXZ8?= =?us-ascii?Q?xsymvVvVmvjlAwNhqZ7Wv4KSgcYo1S//2mIq4Ik/DJTyLDiK84KJCCGdgh52?= =?us-ascii?Q?4ID5oUupR2rXmt0irYhe9Kj8Tl2THGQHggkOS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aKGFieJkBJ7H8Gv5+5uB/BPyFEn4v0J6I6tryU1krPLwsUCNo9IuSjJsp6g+NO4vrL7bpclKbQP5IhpR1oykH9pqVTbpP7oQRrd+nmiH70e8x8RON23R++m4w5YZaUSaidua3rhxkzOTTO+DMta9+yH3hrQai7Tgc4fqhlLRv X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 6:ZtalSSsFK2sRNYBBdU+ff3Axb28mH4GkS7R15D1lAEyNJ3i8t6vUxcoU2pgE/er30W2XPKVzTsHzN1Ao4oqsHQ9o9TSNkAtoEu6nirqtrufwp03jPFvNxVwhc/XyO/P8oRU8cwxIZf1eUEWrrd/CAW0CMdNkWPgoB/A02c8++v8yARpqGR+5VaWCD7QYcBFzaJOXjOTYr24R/mYXGTW2Xvfp9UIFk9AIrodvVD460JMBnMMvRl6XRWGqDOtwZutz6mNTYNVRQ/7Q2mzlkVAj8XZn717ZEJYENoEnfvcXLmUp5uQGc9YuWANzvuTHZzqcvJHTwXi8PcOl1ZtSRCYL46bBPi0cuORdokIjsA8UClIjS15P+t2NQARfhAQOq6rHM2qH48UaIyE+yC/fjnkbmiCGCg5SCC3avhrdmzr3BycJWABz5DjVdWQG2P+46kQSzuW1oCIo/WG6ANONCMaCEg==; 5:eCcswBNeRbdeyDCcbl0KlGb8egSma9CKPdz8XW3L/BRae75IK4GAkBV7FWcTkVtv3rUAoVB+7SPi8Kw0x9c6DsqOU/cgqjfFi0V6Kvt+koArHlgL89L1fnBoXU5mTKV7t/wSmv8JJ8NQEEE3gthUDdpZeb0Yjcus15xyVsok+CM=; 24:AYXwi3Aq1FcVa/L01eq6E8brjm+n3CJ+L0JSXBCC+sNS7I9ebkN3ZXWwFhZbvednqUcibO/bMtbkE/xK8lnOe3RFHzuktZypqZ+44fn3brg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 7:RcNYjXNRQNHEWGkEHaQa70GtWiCQKbmFT3w8zt7kSH9avy/AfPYTMUlv/BY31X1dhquYcBHW6cAnA/rl746Iq0LyB3YkItjpJ1kuImFDSrZlIIa4PfXlOOi4DjbCL4s9z410ZBm6scyo2C9uXIJ7pTjvGxDs7XBn1Vih4KN/Pgfachw1rMObkwWPKNu0u4aiBaikbEu4ZFf8Day6L20nAw72drbv3jhEImOo70PABQqa3UwVBdnQXaGuZw/ll+P2 X-MS-Office365-Filtering-Correlation-Id: 87b4ece1-a66b-4ca6-4c3d-08d5b4fa6ff5 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 15:43:24.5064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87b4ece1-a66b-4ca6-4c3d-08d5b4fa6ff5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2308 Subject: [dpdk-dev] [PATCH v1] net/mlx4: report on supported RSS hash functions 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: , X-List-Received-Date: Tue, 08 May 2018 15:43:27 -0000 Report on mlx4 supported RSS functions as part of dev_infos_get callback. Previous to this commit RSS support was reported as none. Since the introduction of [1] it is required that all RSS configurations will be verified. [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check") Signed-off-by: Ophir Munk --- drivers/net/mlx4/mlx4_ethdev.c | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index 9a76670..2a1533c 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -545,6 +545,55 @@ mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) } /** + * Convert verbs RSS types to their DPDK equivalents. + * + * This function returns a group of RSS dpdk types given their equivalent group + * of verbs types. + * For example both source IPv4 and destination IPv4 verbs types are converted + * into their equivalent RSS group types. If each of these verbs types existed + * exclusively - no conversion would take place. + * + * @param types + * RSS hash types in verbs format + * + * @return + * A valid dpdk RSS hash fields supported by mlx4 (may return 0) + */ +static uint64_t +mlx4_ibv_to_dpdk_rss_types(uint64_t types) +{ + enum { IPV4, IPV6, TCP, UDP, }; + const uint64_t in[] = { + [IPV4] = IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4, + [IPV6] = IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6, + [TCP] = IBV_RX_HASH_SRC_PORT_TCP | IBV_RX_HASH_DST_PORT_TCP, + [UDP] = IBV_RX_HASH_SRC_PORT_UDP | IBV_RX_HASH_DST_PORT_UDP, + }; + const uint64_t out[RTE_DIM(in)] = { + [IPV4] = (ETH_RSS_IPV4 | + ETH_RSS_FRAG_IPV4 | + ETH_RSS_NONFRAG_IPV4_OTHER), + [IPV6] = (ETH_RSS_IPV6 | + ETH_RSS_FRAG_IPV6 | + ETH_RSS_NONFRAG_IPV6_OTHER | + ETH_RSS_IPV6_EX), + [TCP] = (ETH_RSS_NONFRAG_IPV4_TCP | + ETH_RSS_NONFRAG_IPV6_TCP | + ETH_RSS_IPV6_TCP_EX), + [UDP] = (ETH_RSS_NONFRAG_IPV4_UDP | + ETH_RSS_NONFRAG_IPV6_UDP | + ETH_RSS_IPV6_UDP_EX), + }; + uint64_t conv = 0; + unsigned int i; + + for (i = 0; i != RTE_DIM(in); ++i) + if ((types & in[i]) == in[i]) + conv |= out[i]; + return conv; +} + +/** * DPDK callback to get information about the device. * * @param dev @@ -587,6 +636,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) ETH_LINK_SPEED_20G | ETH_LINK_SPEED_40G | ETH_LINK_SPEED_56G; + info->flow_type_rss_offloads = mlx4_ibv_to_dpdk_rss_types( + priv->hw_rss_sup); } /** -- 2.7.4