From patchwork Wed Jul 4 17:27:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 42265 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 2815E1BF8B; Wed, 4 Jul 2018 19:28:22 +0200 (CEST) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 0D4451BF35 for ; Wed, 4 Jul 2018 19:28:09 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id v16-v6so7128147wmv.5 for ; Wed, 04 Jul 2018 10:28:09 -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=UYsTeFfmplZ7XjtM2kW7mPPIoZxfncWw0NFhC9lq9dI=; b=vOewRUclPKVC29zZrsvX5SoCf36qtPu1YlCOIimWKiHc9UG4kO0pniOjHvTPFdQnaF gi11Og4lLu8JcRhs8oI9W6y35Q8/WE2BOk9aw0LrGTZlMNaebLIFqBUK9/GICDklNLCb Bru0Pup/1VRLgtZ6IYgrC1xAtz433El/NNJHsLTbHGvjwNhL97yCs02jy5HGla5DWJ1G Usmmtr57lvT3X+fZAQjITTOL7j9RG0itdLaueOO1wSRFnM9Kh7T6/aBIWRfmxFVx3xTn voK0Vt2OiHFV+y7k+7OywpgXHr2i8HwGv5Dvo906DOgnh07d6/m/h1rT7s3+pMlArDxY 4ifQ== 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=UYsTeFfmplZ7XjtM2kW7mPPIoZxfncWw0NFhC9lq9dI=; b=lZ1HSfgtEMcSqCDXC4tGKV9F6zYQheYVikbBLNmnQeppBI9MkG0UsmoIc1uTZ8E3+Z y7Xc4qTuKZCmlTCrLyrZD9eOY8PEfFi4/jx1nooAax9lIzkOcVost1GKUORecsYaNrVY nnkbp8W8uLOd/vHPfPyC2TYDtcByTyL9P++176Wz1Sb/nTCpms5njhn0+jZE5Uu9l7uv zmOqvGysL3iYpqBd7N7266VDDgVce0TN9EJXUT1aBi23nhsMEt1N0UujNGmn11NsfB5s sX0TISPJ6CkXXt5Y7iBJWUcBYvzxs/x7cNvtW9kZIZF/DL/3KR0nvw8mLwavJTOQkB2s IYTA== X-Gm-Message-State: APt69E1FlsH6YcRamV/7KZXxcRPm9OG6UeJTnnhyTkB+hqFWuiMKwUFE u/a3tjwo+r5GQ0V5TKtYCFCpZw== X-Google-Smtp-Source: AAOMgpfbBiLbbC+E9D8U5MtD8bgmU2lYs3OPYdX0wlrk+M1cpsPnv0KwJVXklG/3qy+2bRP7WCwCdg== X-Received: by 2002:a5d:4643:: with SMTP id j3-v6mr2203720wrs.52.1530725288886; Wed, 04 Jul 2018 10:28:08 -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 s200-v6sm9391913wmb.44.2018.07.04.10.28.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jul 2018 10:28:08 -0700 (PDT) Date: Wed, 4 Jul 2018 19:27:51 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: dev@dpdk.org Message-ID: <20180704172322.22571-11-adrien.mazarguil@6wind.com> References: <20180614083047.10812-1-adrien.mazarguil@6wind.com> <20180704172322.22571-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180704172322.22571-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v3 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 7e757274a..d2031c633 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1305,6 +1305,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);