From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id A9D5C1E31E for ; Tue, 12 Jun 2018 15:20:49 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id k16-v6so24098502wro.0 for ; Tue, 12 Jun 2018 06:20:49 -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=GGfw6HnUnInfOpyKbHeWEah1UoVtLQuxaIexiye7Fpk=; b=xef2JA2E99N62iibY4ua9Xl0L8hw9SMAmGunOClKd5ORnZCoNTd5B32JvvoyGXl0v8 apXC1V/yS0tdWnqZvL8E/3V8OxqdSbe2Yh3fUl/m19czZQYk4uo6uz3U24240vF0Gljj J6wmmUEKRlpRAnnhcv7pnbDHezDcjuWGvj65Sfp+xP21bRuKyjJAcRp1dL3K4JnIhSXi ClJAMFJ/AlUGT++q9ikkE0d6RdgGBkWrFOvg3p8/DtFs4qhlXM5juDrSX4A6+OMpPZuF yRMtq9atmEMUd2isgahroSyYkyxRWPa0CsIhyVwWJUVfIh5Ei15CG2lrZUKM35bS7wMD meqQ== 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=GGfw6HnUnInfOpyKbHeWEah1UoVtLQuxaIexiye7Fpk=; b=UeEpdlySQugnJJlyJC55Q0WSYk0OPQKUFmHH/+sXz0lQsYBOU3Btr4dAQgmIyaTAs9 UQG9/npZuNKiFPpPtDORoAU/dY9KycqiZAf/MgnlvbFrfXmTQJvLNjARL0KRIdp+7Vpf enGI9bloAf0VyknP8IR5QzkRuM3qEFqOxfJeQRBccyr4Ui3ByzsnRyZWz8/ww1n3TS6W 5NXWAwqUamzsqPCo11mvv1o2X+kAqR8hjbl3M7U4JfAuZaOYbJ/9eU9GMAeFbG3jSKO+ roGOGOD31rKNRvAdJBdn3k6xGib84YMuZiR04yde8NiABihPATmkcO86fL6/Oq2mBk4T kJpw== X-Gm-Message-State: APt69E0HoR9i8ROxZTxvnF2ABEeJoSWV3ESCskoL9kcnLDhF/QirMVLs obJqjf2yu0r0PFF1k3kcUTuucQ== X-Google-Smtp-Source: ADUXVKKOKfSmaL+HniDsgNS+48Kmj8J51Ui1IMmbN/FPI4geQAUohGBmQEvUk+JY9kyndsseaMIHUg== X-Received: by 2002:adf:f246:: with SMTP id b6-v6mr271328wrp.235.1528809649502; Tue, 12 Jun 2018 06:20:49 -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 b190-v6sm756774wma.24.2018.06.12.06.20.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 06:20:48 -0700 (PDT) Date: Tue, 12 Jun 2018 15:20:33 +0200 From: Adrien Mazarguil To: "Xueming(Steven) Li" Cc: Shahaf Shuler , "dev@dpdk.org" Message-ID: <20180612132033.GY4025@6wind.com> References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180525161814.13873-7-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH 6/7] net/mlx5: probe all 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: , X-List-Received-Date: Tue, 12 Jun 2018 13:20:49 -0000 On Tue, Jun 12, 2018 at 06:42:38AM +0000, Xueming(Steven) Li wrote: > Hi Adrien, > > > -----Original Message----- > > From: dev On Behalf Of Adrien Mazarguil > > Sent: Saturday, May 26, 2018 12:35 AM > > To: Shahaf Shuler > > Cc: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH 6/7] net/mlx5: probe all port representors > > > > Probe existing port representors in addition to their master device and associate them automatically. > > > > To avoid name collision between Ethernet devices, their names use the same convention as ixgbe and > > i40e PMDs, that is, instead of only a PCI address in DBDF notation: > > > > - "net_{DBDF}_0" for master/switch devices. > > - "net_{DBDF}_representor_{rep}" with "rep" starting from 0 for port > > representors. > > > > Both optionally suffixed with "_port_{num}" instead of " port {num}" for devices that expose several > > Verbs ports (note this is never the case on mlx5, but kept for historical reasons for the time being). > > > > (Patch based on prior work from Yuanhan Liu) > > > > Signed-off-by: Adrien Mazarguil > > + /* > > + * Allocate a switch domain for master devices and share it with > > + * port representors. > > + */ > > + if (!master) { > > + priv->representor = 0; > > + priv->domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID; > > + priv->rep_id = 0; > > + err = rte_eth_switch_domain_alloc(&priv->domain_id); > > So domain_id is used to identify relation between PF and representor port? Right, as described by the API [1]. What's missing in this patch is that this information is not reported through dev_infos_get(). I'll add it for v2. [1] https://www.dpdk.org/doc/guides/prog_guide/switch_representation.html#port-representors > > + DRV_LOG(INFO, "%u port(s) detected on \"%s\"", > > + attr.orig_attr.phys_port_cnt, ibv_dev[j]->name); > > + tmp = realloc(eth_list, sizeof(*eth_list) * > > + (n + attr.orig_attr.phys_port_cnt + 1)); > > + if (!tmp) { > > rte_errno = errno; > > - return NULL; > > + goto error; > > } > > + eth_list = tmp; > > for (i = 0; i < attr.orig_attr.phys_port_cnt; ++i) { > > Is there any mlx5 device that support more than physical ports on same PCI id? > I remember this is major difference between mlx5 and mlx4. Unlike mlx4, no known mlx5 adapter exposes more than a single port per PCI address. This is kept for historical reasons (i.e. because it's always been there) and the fact that since Verbs exposes it, phys_port_cnt should at least be checked, if only to return an error when somehow multiple ports are detected. This series just makes easier to drop this intermediate loop if deemed necessary later, simply by calling mlx5_dev_spawn_one() directly. In the meantime, separation of low-level PCI from Verbs device instantiation means there is an extra step to iterate on all possible IB ports. Same behavior as usual, modifying it is not the purpose of this series. -- Adrien Mazarguil 6WIND