From patchwork Tue Mar 13 12:50:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?N=C3=A9lio_Laranjeiro?= X-Patchwork-Id: 36054 X-Patchwork-Delegate: shahafs@mellanox.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 54D957CBA; Tue, 13 Mar 2018 13:52:00 +0100 (CET) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id C21902A66 for ; Tue, 13 Mar 2018 13:51:58 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id v65so22324121wrc.11 for ; Tue, 13 Mar 2018 05:51:58 -0700 (PDT) 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=BooxrHiry8JjYpIWWzFcaxc3pO6ya6JGhbYXZzcyZOQ=; b=PpY49NPueEVmCEWRo9GR+1+GQTmN5aK4HKz21wrgJcVAzQ1LBz7RV/4uMveOnt0Ymq ojGlB2aoblPqUTbF7+gJOdLAGPj/Pl9V1LVG582A5zx6ZJCyTEnpv1hTK/tcZpys/HeY wIyaRJ29Bx77IOkXzUG9HrZoqQ1nTU9ZZjiBpwCYAVdKanhIWxTL/HZcdK3ZRcQzvTRm QseLUq9XLW9MndhDEVZq4A/mxqEdQcppfgjemK8R1YOmL2T3RCPZERDqPLv/zVAnHY0s zYkQ4KPq/1rJk9JiIP6i+pbfln9Iw0bcTNN2etDnnTFc6oNua/NS3E5sbDFjeGllfAcY ADhA== 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=BooxrHiry8JjYpIWWzFcaxc3pO6ya6JGhbYXZzcyZOQ=; b=Tl5w5VCJGo5jO2XYw5r/fV1zExLG66m74Szmj6NMty5onNGgvIajjQr43bE/6nqHfE jhqx5tqef70TyYJJOQYjGhE3UiRpi3M658fjSmnO68etaWiInU23J2O2dEPH76VsECxQ /CSvIlk9a08eqwvhKSBH2DN/1bGLTBbxGQRvyIzXlOS7/nLe2pM1NBclWjqMSXbRup8L +SFwcdhQLEUiCvBXYnLsiAjiZK/YO33Zeomi8DHdVGjOEk4Iw9TNhPNEtzoVIF4mIInn ruWcI6DU+wcg3b3KlZhy0XNcFigHT/Fa+mgR0O0oBQZyxpJ/Jy21ga+v/JpYIq6Vq/Y1 VxYg== X-Gm-Message-State: AElRT7GS6d+QRpp9rWtvkjMegmw8trsysUKPuDpwKBXRsEhEm/QZnGRk CkQ8W3lR4b5FCn5jBFbIzZsn X-Google-Smtp-Source: AG47ELsU1uqemTy+ey5dVEVJY04MdpJYV2lmVo4GZNiqEVCvD677xxVOEiLj/xHSC5+QuyjPQ1PITA== X-Received: by 10.28.150.138 with SMTP id y132mr717169wmd.104.1520945518546; Tue, 13 Mar 2018 05:51:58 -0700 (PDT) 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 f8sm202350wmc.1.2018.03.13.05.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 05:51:58 -0700 (PDT) From: Nelio Laranjeiro To: Adrien Mazarguil , Yongseok Koh Cc: dev@dpdk.org Date: Tue, 13 Mar 2018 13:50:35 +0100 Message-Id: <753252b906fbabad7095a1b2e18e035a59f51594.1520944256.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 1/5] net/mlx5: add VF information in configuration 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: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5.c | 10 ++++++++++ drivers/net/mlx5/mlx5.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 95dd49420..d5cc85d19 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -597,6 +597,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, int err = 0; struct ibv_context *attr_ctx = NULL; struct ibv_device_attr_ex device_attr; + unsigned int vf; unsigned int mps; unsigned int cqe_comp; unsigned int tunnel_en = 0; @@ -646,6 +647,14 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, continue; DRV_LOG(INFO, "PCI information matches, using device \"%s\"", list[i]->name); + vf = ((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)); attr_ctx = mlx5_glue->open_device(list[i]); rte_errno = errno; err = rte_errno; @@ -871,6 +880,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, DRV_LOG(DEBUG, "hardware Rx end alignment padding is %ssupported", (config.hw_padding ? "" : "not ")); + config.vf = vf; 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 faacfd9d6..9191b2949 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -78,6 +78,7 @@ 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 vf:1; /* This is a VF. */ unsigned int mps:2; /* Multi-packet send supported mode. */ unsigned int tunnel_en:1; /* Whether tunnel stateless offloads are supported. */