From patchwork Thu Jul 5 08:45:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 42311 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 48C441C3B5; Thu, 5 Jul 2018 10:46:02 +0200 (CEST) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 463361C3AD for ; Thu, 5 Jul 2018 10:46:00 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id p11-v6so9431718wmc.4 for ; Thu, 05 Jul 2018 01:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AtLQ1t/HSGgaM2vxggtceXSTF01jOlclzYI1rcVg0bU=; b=yN+xLqqCMVVLa1WZNpHV/7EyVX4ym/UHz/vRxcL1/FMUVyPvNRIwOD2JxWLuX4Ogoj 5VzIq6U+doclOPCUigHw4CFK+eogQ0hQE70bP/OB31TKcGREa0u+KsxsmTdFLi1qaDHF 34dg7fSwPBMBo9bvWAuzaclxRrbg0WidJAdrlz03G91gBOTVLnUGekRztnxPzc9UNjdR ZFJjCxvt09AWL0Tr6aMzRPHZMME8NzPub3+iIuRPxQArt6BC0Hj7ztdMDEUgYd5cihJy hBP1PtEKik2XTLzojjP7DLJsW1DQ1ZUfqkM20qWPNVbMk5UOHIvQLrowp2nTvYHOyW8b 4dlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AtLQ1t/HSGgaM2vxggtceXSTF01jOlclzYI1rcVg0bU=; b=IZznycbuFwbDveZKOO8NeluBrlqZoJOEVlw1CaSY54id2y+HyKrZ+yyqvU60i2i50B yLCzqecjiWFK2+2a3pOf6YzNs8FftO2QFXXgzl5nwKMrt6yrYCRy36GsHptbLW3PZgRm BhmuRCj2SgBtNVAXEcXf158NkNkekmwn6pqu0m4aVvjDUygUtAI3S81IF3daLNJvXqmG 86+z7wfbHUG4f6GhFYCDPeybAOgBd7xVWOMf7iwZc8JSfEDh4dGLFX6GjKnn/GKcOuEJ 11+nt1o6qcHWPecRgQu0uQd9IMbSvPg5PBs2iePxxJtxIIkPXZC4ltDhFvf1pCtk5Vax W7kw== X-Gm-Message-State: APt69E2nPX/9gbfPxHWv+hRtBa3tjHctGSuX7XDXhZvmJ/w2r/9+yoNJ UAoxy/vwazMfFEPCSmh2PForZQ== X-Google-Smtp-Source: AAOMgpcdr/FdX6ulxwZBsou/08yiVD8WGN+SYPkVarapA6RGYVK8zxI2ULL07hGAitCK9DVMJwD3GQ== X-Received: by 2002:a1c:c241:: with SMTP id s62-v6mr3713859wmf.146.1530780360109; Thu, 05 Jul 2018 01:46:00 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 24-v6sm14879448wrz.94.2018.07.05.01.45.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 01:45:59 -0700 (PDT) Date: Thu, 5 Jul 2018 10:45:43 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: dev@dpdk.org Message-ID: <20180705083934.5535-11-adrien.mazarguil@6wind.com> References: <20180704172322.22571-1-adrien.mazarguil@6wind.com> <20180705083934.5535-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180705083934.5535-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v4 10/10] net/mlx5: support negative identifiers for port representors 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" This patch brings support for BlueField representors. Signed-off-by: Adrien Mazarguil Cc: Shahaf Shuler --- v3 changes: - This patch was not present in prior revisions. --- drivers/net/mlx5/mlx5.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 12a77afa8..df7f39844 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1330,6 +1330,14 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, memset(&list[i].info, 0, sizeof(list[i].info)); continue; } + /* + * Port representors not associated with any VFs (e.g. on + * BlueField devices) report -1 as a port identifier. + * Quietly set it to zero since DPDK only supports positive + * values. + */ + if (list[i].info.representor && list[i].info.port_name == -1) + list[i].info.port_name = 0; } if (nl_rdma >= 0) close(nl_rdma);