From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50073.outbound.protection.outlook.com [40.107.5.73]) by dpdk.org (Postfix) with ESMTP id 972ED23A for ; Sun, 6 May 2018 08:06:39 +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=SarojEL0Hog0HbXp6KT1iJn5Mi4Vo36tNn64nFzr1lk=; b=Kf7M6+DarDws/ZIrK/Y+2rZSOadIIrzcWsmB0tOBkNp/xx+MRvY7qw2JxWfScUSnKIfoHy90MOpvbHlMimrAEiMRH56w/p7sPiJzdrDv8uO8QKLoXL8GsaXEd7k34akT7IsdpLNVukOrEIJ7t3u5wy/lbl1/M4YcPjMJ2xYOXiQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (141.226.120.58) by AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.16; Sun, 6 May 2018 06:06:37 +0000 From: Shahaf Shuler To: bluca@debian.org Cc: stable@dpdk.org, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Date: Sun, 6 May 2018 09:05:35 +0300 Message-Id: X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: LO2P265CA0008.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::20) To AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4422; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 3:UjHA160HLmQZju8Gp25lb1v6LnD8dBgn/IRvwE6CRa3PnOly5+O7d3sVCMQ6QS0aD6k/8q0UTanvPULajzhDy0Qbsoo4eqE1xnoija/V7kTq97kI0X8mZEKyaf+1zvHN0GbeFrHHe4vgP9hkNUeca6LhfywFtfBjGGz5QyPzr8N53v7+++Pey4LDkNYNdgwdpoehgSLJIiFStc0SNB81darEB5McDkJnZFgqRYnqZdnDg3Po3I3H5BoxEITAw0ki; 25:ugDaWZNt73y5oJi2rSu9rL6Y73pWBiYoy4VLxXDQ/lv33tthwybLVKeOfFToqdKOrSDvqEkIQPPywBKuPuDN3lu5xS5ry/FWyw9+38DFdq0mtxqoyDXp23nsGs+Ay9EjcijAcn9QQP/SyhSWdi0DVTRHgh9U1/R0zXwPfEoKrquDbRIHsY4CnHfMhSQtRu1VKgytp6fbab2XIXpaXtnnCsVq+dEm+4AXC4m35Aax/d81lyJWNTTgj3YNLNR/LAh2oP4C0JHcTMAlAnp5bvRlME1Pq4s7hDk0bYD58qL5bcXZgIPzmHgCArRWeUJdqfU2+gTUJFgx1PZmDHcIoLdGzQ==; 31:Qy7XdEcUcvkmN+DoHfJOmp0/qaoXTT10JjdcfzPFqWU+gUR3E7nkLNf0IWWhuIS1Z6wuVpvnAd28mgtfou5TOssSdY5N7+pvDqivE4ZYgts3XXvKi7ePIzPKvopnAdUhMH//LTozk/pXri3XQpTq2Z4onXbuaTcnxrHRy+uMHIBXdVo5tRiwZVcseXyeGhfjY0BhWGBwxQNbf0pCOC9cpxn1Fgz/0QaqA+/PjG1RBSM= X-MS-TrafficTypeDiagnostic: AM6PR05MB4422: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 20:vSuevQnH/uvCC3r4tbCMxZlwflHWLlVPGHr7QFk7WUTUQVtYPva3jHlW/jGHvXK6lBVssh992fOMYBXRpbw5KhyOmijN0r47JAJwpsPvNhq51iU49egdOK1LpO9A0Xs2FDvSuQZz2TRT0MRYDazzg3iP4IMrCKZC5/HIUh3b/1lXVfBWZGEjv+P5KlJRkoTU34n1HFOO8Kp877+2A9g70eSWgX1qZk88qe1C9PxPKSzETp4LKZoZbE56Spq+kv9fQPPGEQOpU/mVPblfqKCYJbzivRlS9qY75lv+u2EjBQBQTPz0qN4zj12voZchpwMFWh/9Qi4G8z23/VdDsu9HXR92VWAWoR/8nCxJrqtGlxzBYJYU8vYeMtLuAbHIIvkmeJcc4Zn8tpRxaUAwR9jdjeA1LeK4ipEY1CuegznZ9hvwbIWxWrDfIaj12/bUkPJ9yZ9z6eE9uGS2HYHUI4OBSTQkdqxsJiFImYDSLr5cwhUl0xa/RrSsaWlJh67J1YQW; 4:mzCdLORwhGu0VXR/RTUCAOgrWR+LjA5GDabnmIAF7B036SvNWmnlEbmlplG4sPSn1pVPa+S9OUxNAPP90gOYniOD9Ets2UJu53LknomA7FCFo3KzUu40UedJIE5oR7wg+Jp2SvGaJFuvO9j4vn4aTH58iAQCO4CJCktubOvVxZCESNX7TSX0E2Y8JTq1dr5E3mcfvumxv4f5GgUDEa3aPpoQq7iS5QRHAD6JZqsYWiUN7lwbDwxbeNIffq2Jy3cDFt5erMGxiyU4EFVzQN/aUg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM6PR05MB4422; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4422; X-Forefront-PRVS: 06640999CA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(396003)(346002)(39860400002)(189003)(199004)(105586002)(8676002)(8936002)(316002)(2351001)(53936002)(86362001)(2361001)(6116002)(3846002)(106356001)(118296001)(66066001)(36756003)(47776003)(81156014)(55016002)(2906002)(2870700001)(50226002)(4326008)(68736007)(305945005)(7736002)(81166006)(50466002)(25786009)(486006)(5660300001)(476003)(2616005)(69596002)(16526019)(26005)(59450400001)(386003)(97736004)(956004)(186003)(478600001)(7696005)(52116002)(23676004)(6916009)(21086003)(446003)(11346002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4422; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTZQUjA1TUI0NDIyOzIzOlBuSHVCNytCeTBtQ0V1MHhjVzkwWS9YWXc0?= =?utf-8?B?VkwyUko2STF5Y2ZNeFRaN1pTSmZKYWRselVnWnJZa2tBYWRsbVRaYzArbmtr?= =?utf-8?B?dmVZcDJuQzB6ZHVBZUxvcTludkZoQjhIc2t6b3I1VUx1ckxhYTZ0ZVpCUVpa?= =?utf-8?B?UTZEL0VabFJlbVhtZTdOMU1FdTMwNjBEQytYZXN3TmhwbU5Va2xBRjd6MThC?= =?utf-8?B?Q1FweDhQUjJaVzU5VGJsWkczdlZNN0JEcnlhamk3ZUh6UktMcEsrNWwwRlA4?= =?utf-8?B?REZYbGNLNUJSN2VSR0hDb29Vekw1QmlKSWxRb1VrRDRLUTJFSU5LQkFrN3FK?= =?utf-8?B?alI0WmhOWFQ2UWJVZXgxMXBEeUFQVVFLMm55ZityUlVEbFNLM1JLQ0xUOE1J?= =?utf-8?B?L2lTOWpIQ0RhRXU0ZXg5ZE1xaFdCSjk2YVRFTGlsUUY2RTFGSk11cVhCR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ZFnlrMLwyT5FiaRKA7EiYI8rHcEpQWnP/Kfi7h6zLy67LfsKSmSzUqKrUoD9UTrOBNsKOA==; 5:tEMgeNc8G33QicdLqkEB6uH6ZZ5dRzUMTHh9A2Gu8kFbVbcxZR6A+pPGwSDHGMf0dIzbnMxYClVbp2DruanX0dJH6mdyaS+W0e9MrQvKleMno+E1ddlAjaY8IcQTjZ9vb+vgUTTJMV5tVQF/v5Ln5aSRVWAOS0elo86W9s3NjvY=; 24:MOnwSVzb4hb+RmDFrLtJn80wr2doDOHGt85JJjc1ikqQLoftO5LPyVNOe5ZkSO7lcefpOdKVjUhrACpF7UgoDKmXOoZYKNI53FxqV+mdJLk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 7:7oG7qna9uL5C7Sn7MD78ybGDx5gJjwO9CvJkFr/UDHl8XPQqJKSrnAj7h0S2xcmYnkrJtlyn6/8iQWo1H3Xs4e3tGtF1DPywaXc6vtInXsdEEe9qlC4bm6fBuG/56JRVWqpwLBQTt9gCKEzTS6y3NuBOVrDK75py//oZUCq/+XUgjIWli6rOqmr1zzO4Oh2pvNBWA7Eo6Ai69PFcY9GZ6aloScvShB7wsXzHgpDj3wg0SG4D9guIjUW4xYHviGAR X-MS-Office365-Filtering-Correlation-Id: 232a8c85-dc60-4192-676d-08d5b31787a4 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2018 06:06:37.8642 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 232a8c85-dc60-4192-676d-08d5b31787a4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4422 Subject: [dpdk-stable] [PATCH 06/33] net/mlx5: fix sriov flag X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2018 06:06:39 -0000 From: NĂ©lio Laranjeiro [ upstream commit a61888c8f297eac7e917850e2a4f66601bb715c1 ] priv_get_num_vfs() was used to help the PMD in prefetching the mbuf in datapath when the PMD was behaving in VF mode. This knowledge is no more used. Fixes: 528a9fbec6de ("net/mlx5: support ConnectX-5 devices") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5.c | 18 ++---------------- drivers/net/mlx5/mlx5.h | 2 -- drivers/net/mlx5/mlx5_ethdev.c | 37 ------------------------------------- 3 files changed, 2 insertions(+), 55 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 0ca16d11d7..03a6a05dee 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -578,7 +578,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) int err = 0; struct ibv_context *attr_ctx = NULL; struct ibv_device_attr_ex device_attr; - unsigned int sriov; unsigned int mps; unsigned int cqe_comp; unsigned int tunnel_en = 0; @@ -625,18 +624,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) (pci_dev->addr.devid != pci_addr.devid) || (pci_dev->addr.function != pci_addr.function)) continue; - sriov = ((pci_dev->id.device_id == - PCI_DEVICE_ID_MELLANOX_CONNECTX4VF) || - (pci_dev->id.device_id == - 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)); - INFO("PCI information matches, using device \"%s\"" - " (SR-IOV: %s)", - list[i]->name, - sriov ? "true" : "false"); + INFO("PCI information matches, using device \"%s\"", + list[i]->name); attr_ctx = mlx5_glue->open_device(list[i]); err = errno; break; @@ -709,7 +698,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) struct rte_eth_dev *eth_dev; struct ibv_device_attr_ex device_attr_ex; struct ether_addr mac; - uint16_t num_vfs = 0; struct ibv_device_attr_ex device_attr; struct mlx5_dev_config config = { .cqe_comp = cqe_comp, @@ -870,8 +858,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) DEBUG("hardware RX end alignment padding is %ssupported", (config.hw_padding ? "" : "not ")); - priv_get_num_vfs(priv, &num_vfs); - config.sriov = (num_vfs || sriov); config.tso = ((device_attr_ex.tso_caps.max_tso > 0) && (device_attr_ex.tso_caps.supported_qpts & (1 << IBV_QPT_RAW_PACKET))); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 9ad0533fcd..5e90d99cc0 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -78,7 +78,6 @@ struct mlx5_dev_config { unsigned int hw_vlan_strip:1; /* VLAN stripping is supported. */ unsigned int hw_fcs_strip:1; /* FCS stripping is supported. */ unsigned int hw_padding:1; /* End alignment padding is supported. */ - unsigned int sriov:1; /* This is a VF or PF with VF devices. */ unsigned int mps:2; /* Multi-packet send supported mode. */ unsigned int tunnel_en:1; /* Whether tunnel stateless offloads are supported. */ @@ -209,7 +208,6 @@ struct priv *mlx5_get_priv(struct rte_eth_dev *dev); int mlx5_is_secondary(void); int priv_get_ifname(const struct priv *, char (*)[IF_NAMESIZE]); int priv_ifreq(const struct priv *, int req, struct ifreq *); -int priv_get_num_vfs(struct priv *, uint16_t *); int priv_get_mtu(struct priv *, uint16_t *); int priv_set_flags(struct priv *, unsigned int, unsigned int); int mlx5_dev_configure(struct rte_eth_dev *); diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index b73cb53df0..f98fc4c3b0 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -201,43 +201,6 @@ priv_ifreq(const struct priv *priv, int req, struct ifreq *ifr) } /** - * Return the number of active VFs for the current device. - * - * @param[in] priv - * Pointer to private structure. - * @param[out] num_vfs - * Number of active VFs. - * - * @return - * 0 on success, -1 on failure and errno is set. - */ -int -priv_get_num_vfs(struct priv *priv, uint16_t *num_vfs) -{ - /* The sysfs entry name depends on the operating system. */ - const char **name = (const char *[]){ - "sriov_numvfs", - "mlx5_num_vfs", - NULL, - }; - - do { - int n; - FILE *file; - MKSTR(path, "%s/device/%s", priv->ibdev_path, *name); - - file = fopen(path, "rb"); - if (!file) - continue; - n = fscanf(file, "%" SCNu16, num_vfs); - fclose(file); - if (n == 1) - return 0; - } while (*(++name)); - return -1; -} - -/** * Get device MTU. * * @param priv -- 2.12.0