From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 09F46548B for ; Mon, 5 Mar 2018 13:21:40 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id k9so17006479wre.9 for ; Mon, 05 Mar 2018 04:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=/bNTamYzcRL+ZC1Cq/LXvvDj1jRblUPNpCpTWHm1wqw=; b=z7z0RQFH1OW4vCjMc10U/Kgl+eZ6p7tyRsi6g9bMGpQUmIe9BkEdv0Qrlg/w6Fh7Zq xvn41eJTGebjRJafCO0A6xUNYWNZPfdOBecKC9fkqi9Y00P3KErJivaK271dTNpKKKJB lq9EjhSr03xPRIpv5qEiSQx2Y9rGRVKREjPBiEbLxQ5tNgTGQAmdQ2HRsXUAhwa9hpOc wn4rmU//Yo/0U8/lkWj+66buRyw3wc1/A80zTPtLhvVRgfRv7jYsCdFver/Kw5UmIwq0 cINPONL1JpMMWwX2KsqOQ+rQabw+iMAjpcBoXexW8qjtdqPlx19OKK7GSnWi7HGGOnZY dE4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=/bNTamYzcRL+ZC1Cq/LXvvDj1jRblUPNpCpTWHm1wqw=; b=fgjxpn0Zt1fxkHI1VnybjmktznY7FnJMxDOB0ScLjO4kqpQwb/wdx4H8e3RAMNOZqQ dPqROfZ3yQm2YKuedhnPdqPINs8ioL1tIUZNVDnUgvjORWk0KwAoWMf90B0BIIKkCfd1 zBoIlt3l+TbjhS2ccfFLRx3JZtSvtIzpunjhTbXfy30ctXmnhe8c1BS+rFI6gZ0YMwwH eOu0ViPIiAjwlXRHgB296C4X8qk/sHd2yaonTaq1gYxqcuR5+uXWTZVrGSa2kWwLwsic L2ZazRA9dWy6icLEuKnRzv1rp0n2RpH+amCcqg/LBde6+KzNh545IqM5sLU9ypKExtmt CkhQ== X-Gm-Message-State: APf1xPBX5ETkVzXhbGITpzKg66Qqr9Pyp+hRjU0OLvwY+s/01FooHpr4 x7MI8UesBwl7bgZglR8WfEHw2IMPgQ== X-Google-Smtp-Source: AG47ELtZKQ6ZY7XCFX0gp4q82SSD0BEuY+d2szSk1VKWrjIOYaVAcYbxcs7mR89E+F3YBCa1wO+3kA== X-Received: by 10.223.135.114 with SMTP id 47mr12109317wrz.238.1520252499428; Mon, 05 Mar 2018 04:21:39 -0800 (PST) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id w31sm13828232wrc.49.2018.03.05.04.21.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 04:21:38 -0800 (PST) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil , Yongseok Koh Date: Mon, 5 Mar 2018 13:20:57 +0100 Message-Id: <71c4fc2546adbf52c940337f53f0ce266aad418a.1520252354.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 01/10] net/mlx5: fix sriov flag 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: Mon, 05 Mar 2018 12:21:40 -0000 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: yskoh@mellanox.com 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 61cb93101..7e8a214ce 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 9ad0533fc..5e90d99cc 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 b73cb53df..f98fc4c3b 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.11.0