From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id B2EF32B9C for ; Thu, 5 Jan 2017 03:32:34 +0100 (CET) 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=YXfBPHg5OLahui5X9HRREvRqfuqZ7d+Vq7BryLtmy/4=; b=ubQNHzr04EpyaieRZRKtyvmXznQomZ53mExj2l+1tHsBj6A0PHnfgRc6TntIz4aUDs/iXTXjsjcz9bbvHuL9Uu1LMwAWY/9J3s3o7jtFEBQAqvB6iY7FCnl/hy+5Y7IvXCI5ENyPOg2X68TvvwTJYgTWffaTrVyUlth6sdIwNO8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (12.250.235.110) by DB6PR0501MB2455.eurprd05.prod.outlook.com (10.168.73.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.817.10; Thu, 5 Jan 2017 02:32:30 +0000 From: Yongseok Koh To: CC: , , Yongseok Koh Date: Wed, 4 Jan 2017 18:32:19 -0800 Message-ID: <20170105023219.10146-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [12.250.235.110] X-ClientProxiedBy: BN6PR16CA0003.namprd16.prod.outlook.com (10.172.212.141) To DB6PR0501MB2455.eurprd05.prod.outlook.com (10.168.73.136) X-MS-Office365-Filtering-Correlation-Id: e431f8f9-9b31-4d32-dc4b-08d4351319b5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB6PR0501MB2455; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2455; 3:n9EAAQDW24rOUZuwG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JatETJhufatUkekCiflyLjq8hoKnmvrFH1rPWaYAUCLa0EMLD6G0r22TNzifQEwQsRMaFT6D4HCybSsmmm1rC6CyeioLDVeipQELCKyDqqnN+94d1MkI5I/ZSYC8ZmDRchaVnm6QH0tViSKYRg0/iSteQDtcfk9mYxi+2bmzCpefaH/m8tXs2LVPcxtAfHiiPtKgeLhcvercEg62kIcrNSDjC98w7Sv2lteLsOO9ZKDORJfegmkGSRPBYYw2dbsZyEzw+8pYZUnZCWhACctScZwGxf8hyV66wUrsOvoeyYpxy7NCIyxy05OqfTFkP94DdPkIFkyDNlmo3LEoMUsLgUEy+mBRwQqxigaGhg6BIAg9NzrpjZcGC+71iA8iJodLRsUmCJpv+svSKhz1rUVomlQtuM+rUlDY7ZTZX1izMUu4qn23G9oF1hxLmOethcNoeVSqEWxD+/Yl/8ynv/rvL3ULrGEphqe6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:DB6PR0501MB2455; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2455; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2455; 4:p9AoaJU4jAz8mqgDD6z6/HfOAgia4KQ41YA9msBkPPNHTKDgbOHDDIopqLcMabM1TpDpQ5cpKlul5OgQrgzVCERcWQuQGoMZk/b7O4MpchJki19vks72gy3GoQnJElvIuVfDiKeW9asYebMEYmi3xwZ9LDu0kpfDMqet3EmBX6G7vrPJs9PQ972hXuFZ9LjcEFeRW5b8RDQW0pu/uDCk9NJt9AlFUYNR1OcWMCC/5lJWz8Ekn/gv7wNG13BFnQVXXDqGD1l5Ca6XjQu0FrEOqQElyv2X2CU2yNgMNx069dUAzYK3O474KBtqtZh7KVzrnWfmAtaze5DT/RovH8adFb3iyoOXhsyp/V9QCW0DgKqYul9TcWFDDNVou1+y/C0P9+//ak+IUwjhDz6C/7TrBuxLZHCAof7nKQ4V8iYQkXeVCy716oQlGIeWa9Brl1IDdnYDP72Rp267oqc+/08lRyNQX0AjJdTV6Xc5VBDMvHaZzkQ32viTCxjt8edsdSwRN14H09+AW7c4akRBT/FN6Y3N6TSs7snTAioNcpbfXJzIffk1ynGWzs5VKQ3ex9v6RQUHNIFY0K5CAzl0GcqxPg== X-Forefront-PRVS: 0178184651 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39860400002)(39850400002)(39840400002)(39450400003)(39410400002)(199003)(189002)(107886002)(6666003)(106356001)(42186005)(69596002)(36756003)(54906002)(38730400001)(25786008)(5003940100001)(5660300001)(81156014)(21086003)(81166006)(305945005)(8676002)(50986999)(50466002)(68736007)(48376002)(6916009)(2906002)(33646002)(4326007)(92566002)(50226002)(55016002)(33026002)(101416001)(2351001)(1076002)(110136003)(97736004)(7736002)(105586002)(3846002)(6116002)(47776003)(86362001)(4001430100002)(189998001)(66066001)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2455; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2455; 23:BAUfKSuopLPtNvLilOkt2DeivEB15umzLg6JJMb?= =?us-ascii?Q?gqlig74EGL9EcF2bzGaOIcWe6OHUPhvivVNMVslMRGfE+kgP9sFp1a5AdYOv?= =?us-ascii?Q?5Y8Hxf7bRngLmnKiSBHfsXF2+dq1yi1FllEd2gBfsyDE4WYoXDVasqZ1dGPJ?= =?us-ascii?Q?HbTpGXB6HY25wBmVmvXPc2LG4xE0wiHd+rhqwBIGYPHqMx3GksCtdyQyxgAf?= =?us-ascii?Q?RlsNUZVRQvZH+ADf5kLCtFeDDGNPTdvi/+6Nnk8zhAtZ3WQIRh5311G3ZX/u?= =?us-ascii?Q?TMPJyIPKz/uYrEnCVSkFNpzg7JlNArfRO8t3Z2txujDC+O/JlcKhxIqhwLLV?= =?us-ascii?Q?yvZYvtOQ31ah30nf0kimXubx5ayjiPrKhs0frlWFpcIxnsPzqgQmAAyw0/0t?= =?us-ascii?Q?9Ncywg462jwbtfcwaJ4ATM0sNJmk3MCSdYk0LSkulBi7eKUubxXkuOSez2SY?= =?us-ascii?Q?HbZMg0Q7+Zb2L+j8jEaDMJKtnrNEdh6v6oGnDzpSSF1B6h+Djvz9hYONvJNc?= =?us-ascii?Q?ZFT793ESI12nx98fEAzaB9reXU4wFzBipJfEJwuVW9SJdpCFLr6RdADkzSQY?= =?us-ascii?Q?wjy51FhrlfhPX+wsCJJdenxeDbjJSSIb9WxGlt/qfRD1TsIkrP+WNTLcty/J?= =?us-ascii?Q?IvBVSpq03fwhUCVDh61mnjZibmIz0yhpV25CFRqqtitgwO0pesBNAXuvsQIO?= =?us-ascii?Q?vLgMjeAjB1RrZgE0R79ohS8KffgqsJedZqUCZOPzhRRpugoekVymFPIf85Yi?= =?us-ascii?Q?fDXygCKZrrevOE7mwhNtJdDDgmctMKGsLuHr8FIMIeD/WS3Ou/ClHWjaWqu/?= =?us-ascii?Q?66fcAEAb8DHUiAU/aZOhAcWyZYn4azUoP4nxY/PuqAQch3JTpQcWRY9fLCUe?= =?us-ascii?Q?7JP5C0+JOxxzGjWK+hA0BDikMCrFN9K184ITBnTrZhyIOuOKO7ebACoOPHGK?= =?us-ascii?Q?9o7beEMVMxUBOOvUTmV9n9StXshWjlsoh0UEF3PXQtffboAfCEWXDtR589eA?= =?us-ascii?Q?YsdS3rzWUIJxIwPtJayC/Asw2+cpjutafknZdVJhDAKGyl6pXnonC14n7Yo/?= =?us-ascii?Q?7s5WeRcYELN94z55f7vJN0SvOXyDhqPPWLABWojl8Y2/lH52abBKBFmwFaTr?= =?us-ascii?Q?drX5INwXlZIHOuc+jQrwjtQoBQG8sgau683yI04jkw0kHW6QcQHl2h2e24z+?= =?us-ascii?Q?svlhVLlRIJss9yo9kAn7XqMLqEeFwJhxWP6PulWMnRbS+suPwG6rv09an3gx?= =?us-ascii?Q?olshU1pTiX4zkUtb0MbcUVoVNA3gYg2SvThF899niDPchOmOMQc4Wpi+MlCo?= =?us-ascii?Q?eT1I21r7T++K7ikjf4DLwXOA=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2455; 6:CH4Yhps+JKus26oJy1aQ+X0MOtEQYNHMETvZow7dGPQRvPEACDA2zBRcNHIZZ6ngEF7zau/wKYK8zWc4bmT/5OuJ0Y1i0PKfcmAbW+qAnFNMacyNJJkoOMhLyQu3bw072dzIDjhY6l2G8w8wcXGds2qwsKHGJVsRLMUE/RAPkyud3vejIkOUiir5k5w3cIsU9NosA5Cp0wKyc6UjCmrB2rGCc74y0ZA8Des+fNkPlaX+vR3hUuG0JKp//HjOZdj3FRIZ9R+vkbH2HdqenCqZDDEjqcnzEQz0vV2M1ldqm/xgyLjE1yQ0g4g1Iu0qHlDgN4GokE1on9q3XXdl4RT6EKHvFUJOeMvB2MMbV/ZmtgUpMCAwpZ7jQzdZUw9Q4ZI4yRtW4wsr5y6TzJ1mGowh55AgwRECbBKww6hCshu1Jjm26xkTrBV7Iz7MFFm+5d+7wBTwcamnFKFEXrygI6f66w==; 5:xX5bV9wWK6nx1NlSIjypRUUYz9LDXctSntZwnQKSXlIalli24NBtEZ6836Q0HYy7fXinAsuQ7U//ZlWGVGsfcCMoctbSYadT/3TXFa8cGSU6DIe2Azg8h4xBbDXMBM+Ki+imeCIapoFb5/iCdRNoZw==; 24:4u9H/xaHh6cOeHNEDcOegrLdOiwZEwkQRgTJMykHjqhCOKqTuD+N5kr67LeEpPXvU9fd2yrM5rL4ICqZdzusdVTWe2P1hP/yBiZIlQ7jkqU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2455; 7:FLQuikoIiaY8AbgDQk304JjOiKL9FW7nbtzm69Sif0q2iOQsD54yX+XhiuDORATPDxtM8XlawuUxReOPsYKnTicessbvAqrz3A48DexXaZWzI5YcrKw9nEQK3oAqDvK5nGPV4MvZ3t5adZeKTMXVnSU5OLfSCpmgwhLMIp2B+eVgdUanIziFBJ1vJi3kLIwyvhsJja+34rJ0aunEQrMQtT5/582xLx6cECB3Ixo0ZA9qEa+ABNRzXWZAsdGyeRLcBIHfVbf0alEKPrv6FoxL1t4GJtXB3FjqztODGRlErY5FotkA+IeEiM+wkAvoyq9U5Y2VoYPw6nubx5kv+F0+8vUOW5rCFKlgq7ZRGTIET9h48YuSDolnZK6mNAN2w1cFJoz9tVpdhftXg4cDgPN72TxNF/DQFFChBFZTVxGjG7E+z1NX2/09Y9aSrEGdO/yk1OOKZZwTFSAbwSlAmip2kg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2017 02:32:30.7593 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2455 Subject: [dpdk-dev] [PATCH] net/mlx5: add support for ConnectX-5 NICs 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: Thu, 05 Jan 2017 02:32:35 -0000 Add PCI device ID for ConnectX-5 and enable multi-packet send for PF and VF. Signed-off-by: Yongseok Koh --- ConnectX-5 is a newly announced NIC of Mellanox. This patch includes basic enablement of ConnectX-5. drivers/net/mlx5/mlx5.c | 42 +++++++++++++++++++++++++++++++++++++----- drivers/net/mlx5/mlx5.h | 4 ++++ drivers/net/mlx5/mlx5_ethdev.c | 7 ++----- drivers/net/mlx5/mlx5_txq.c | 2 +- 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index b97b6d16a..6293c1fda 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -286,7 +286,7 @@ mlx5_args_check(const char *key, const char *val, void *opaque) } else if (strcmp(MLX5_TXQS_MIN_INLINE, key) == 0) { priv->txqs_inline = tmp; } else if (strcmp(MLX5_TXQ_MPW_EN, key) == 0) { - priv->mps = !!tmp; + priv->mps &= !!tmp; /* Enable MPW only if HW supports */ } else { WARN("%s: unknown parameter", key); return -EINVAL; @@ -408,10 +408,26 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) sriov = ((pci_dev->id.device_id == PCI_DEVICE_ID_MELLANOX_CONNECTX4VF) || (pci_dev->id.device_id == - PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF)); - /* Multi-packet send is only supported by ConnectX-4 Lx PF. */ - mps = (pci_dev->id.device_id == - PCI_DEVICE_ID_MELLANOX_CONNECTX4LX); + PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF) || + (pci_dev->id.device_id == + PCI_DEVICE_ID_MELLANOX_CONNECTX5VF) || + (pci_dev->id.device_id == + PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF)); + /* + * Multi-packet send is supported by ConnectX-4 Lx PF as well + * as all ConnectX-5 devices. + */ + switch (pci_dev->id.device_id) { + case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX: + case PCI_DEVICE_ID_MELLANOX_CONNECTX5: + case PCI_DEVICE_ID_MELLANOX_CONNECTX5VF: + case PCI_DEVICE_ID_MELLANOX_CONNECTX5EX: + case PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF: + mps = 1; + break; + default: + mps = 0; + } INFO("PCI information matches, using device \"%s\"" " (SR-IOV: %s, MPS: %s)", list[i]->name, @@ -719,6 +735,22 @@ static const struct rte_pci_id mlx5_pci_id_map[] = { PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF) }, { + RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX, + PCI_DEVICE_ID_MELLANOX_CONNECTX5) + }, + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX, + PCI_DEVICE_ID_MELLANOX_CONNECTX5VF) + }, + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX, + PCI_DEVICE_ID_MELLANOX_CONNECTX5EX) + }, + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX, + PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF) + }, + { .vendor_id = 0 } }; diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index c415ce32c..ee62e044e 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -83,6 +83,10 @@ enum { PCI_DEVICE_ID_MELLANOX_CONNECTX4VF = 0x1014, PCI_DEVICE_ID_MELLANOX_CONNECTX4LX = 0x1015, PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF = 0x1016, + PCI_DEVICE_ID_MELLANOX_CONNECTX5 = 0x1017, + PCI_DEVICE_ID_MELLANOX_CONNECTX5VF = 0x1018, + PCI_DEVICE_ID_MELLANOX_CONNECTX5EX = 0x1019, + PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF = 0x101a, }; struct priv { diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 65228d5f9..fbb1b6566 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -1517,14 +1517,11 @@ void priv_select_tx_function(struct priv *priv) { priv->dev->tx_pkt_burst = mlx5_tx_burst; - /* Display warning for unsupported configurations. */ - if (priv->sriov && priv->mps) - WARN("multi-packet send WQE cannot be used on a SR-IOV setup"); /* Select appropriate TX function. */ - if ((priv->sriov == 0) && priv->mps && priv->txq_inline) { + if (priv->mps && priv->txq_inline) { priv->dev->tx_pkt_burst = mlx5_tx_burst_mpw_inline; DEBUG("selected MPW inline TX function"); - } else if ((priv->sriov == 0) && priv->mps) { + } else if (priv->mps) { priv->dev->tx_pkt_burst = mlx5_tx_burst_mpw; DEBUG("selected MPW TX function"); } diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 053665d55..4f36402eb 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -412,7 +412,7 @@ txq_ctrl_setup(struct rte_eth_dev *dev, struct txq_ctrl *txq_ctrl, .obj = tmpl.qp, /* Enable multi-packet send if supported. */ .family_flags = - ((priv->mps && !priv->sriov) ? + (priv->mps ? IBV_EXP_QP_BURST_CREATE_ENABLE_MULTI_PACKET_SEND_WR : 0), }; -- 2.11.0