From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id CE9191B009 for ; Tue, 10 Jul 2018 12:58:39 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id 69-v6so23710545wmf.3 for ; Tue, 10 Jul 2018 03:58:39 -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=So9ggrg+bd8e8SBHlU4K2Gx8jGR80F85O0aTYq4519Y=; b=KdpP3dNBSFpIeMXO6vBJ6H+M3GgySsQl3v1eQIU2cz5SOxXWjUidTE5kpV0oROP+43 nMgcKP0JGEgEhNbEorMa3oDP1zhx50K3c6EKLzRyOIVlzpSHkr7E/taMmNsRQ67/5/6d 5PWVCnLF4pc2B12mTBs84QVFMvys55BpIyh/JUgiwJAie/1mSR4UwEKOUxU87mwjM0fh TXwti7VmpipwEUZ0LEl4DDVg99pznrUgwWGmmij4GcrjFZLiT/8DaI2jD9GbzHzwG3MA sEma8zw2RR4OQiiosBFF9HBI8KxXDYBphy1U59x5//ACOFfTl+kdlykn13wv1bEMNe8L bKWw== 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=So9ggrg+bd8e8SBHlU4K2Gx8jGR80F85O0aTYq4519Y=; b=CLmmQQan5RxJwRlrN828+2NTzIuDKr7U1XrxRud0LYIrlyEn4qQFXnVFqTBRHbkT54 Fd55yQ+lFG5gbSIjWd2HtVE62NMN6HjUA7pAq+3WY8LpU9A2+LfZMjVTkwiygSnFwUdI NebK8oOJHH6Uc+O98+N8Ck03bkusPSAWw0oupb8unN0mG7LQCOu5Stl1yY3z88v9zuEP fhUDPi6gHi63ppRh/VCPKCQctFnyhBS2DYLJR86/NqOamfCM47AluAX65HWy+P3JCaYQ FJIxkAizpCXCoCoLWUbX+ErSfaK9a/3EwPDbdU08fFS08iqvpQnFA+k4+V5e6j9FPdOn c5Xw== X-Gm-Message-State: APt69E3sHMafwwXzbf0oMBM931z0rU9qNfIHVR1kJ6nX1F7qLftNEj7h uT26a3LC+D0upNYQjtEUceT1W93Q X-Google-Smtp-Source: AAOMgpf5UK+O0Pq/Ep5PR21NmX5pfWEDXcuHmhBbazXRJ+WPwPq5MULBqxujMPOQnwFtmlwwrYAemQ== X-Received: by 2002:a1c:8c08:: with SMTP id o8-v6mr13346239wmd.60.1531220319625; Tue, 10 Jul 2018 03:58:39 -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 g15-v6sm2707854wrh.48.2018.07.10.03.58.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 03:58:38 -0700 (PDT) Date: Tue, 10 Jul 2018 12:58:23 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: "dev@dpdk.org" Message-ID: <20180710105823.GM5211@6wind.com> References: <20180704172322.22571-1-adrien.mazarguil@6wind.com> <20180705083934.5535-1-adrien.mazarguil@6wind.com> <20180705083934.5535-10-adrien.mazarguil@6wind.com> <20180710093723.GI5211@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v4 09/10] net/mlx5: add parameter 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: , X-List-Received-Date: Tue, 10 Jul 2018 10:58:40 -0000 On Tue, Jul 10, 2018 at 10:16:03AM +0000, Shahaf Shuler wrote: > Tuesday, July 10, 2018 12:37 PM, Adrien Mazarguil: > > Subject: Re: [PATCH v4 09/10] net/mlx5: add parameter for port > > representors > > > > On Mon, Jul 09, 2018 at 11:57:37AM +0000, Shahaf Shuler wrote: > > > Thursday, July 5, 2018 11:46 AM, Adrien Mazarguil: > > > > Subject: [PATCH v4 09/10] net/mlx5: add parameter for port > > > > representors > > > > > > > > Prior to this patch, all port representors detected on a given > > > > device were probed and Ethernet devices instantiated for each of them. > > > > > > > > This patch adds support for the standard "representor" parameter, > > > > which implies that port representors are not probed by default > > > > anymore, except for the list provided through device arguments. > > > > > > > > (Patch based on prior work from Yuanhan Liu) > > > > > > > > Signed-off-by: Adrien Mazarguil > > > > Reviewed-by: Xueming Li > > > > -- > > > > v3 changes: > > > > > > > > - Adapted representor detection to the reworked mlx5_dev_spawn(). > > > > > > @@ -672,7 +679,9 @@ mlx5_uar_init_secondary(struct rte_eth_dev > > *dev) > > > > * > > > > * @return > > > > * A valid Ethernet device object on success, NULL otherwise and > > rte_errno > > > > - * is set. > > > > + * is set. The following error is defined: > > > > + * > > > > + * EBUSY: device is not supposed to be spawned. > > > > */ > > > > static struct rte_eth_dev * > > > > mlx5_dev_spawn(struct rte_device *dpdk_dev, @@ -723,6 +732,26 @@ > > > > mlx5_dev_spawn(struct rte_device *dpdk_dev, > > > > int own_domain_id = 0; > > > > unsigned int i; > > > > > > > > + /* Determine if this port representor is supposed to be spawned. */ > > > > + if (switch_info->representor && dpdk_dev->devargs) { > > > > + struct rte_eth_devargs eth_da; > > > > + > > > > + err = rte_eth_devargs_parse(dpdk_dev->devargs->args, > > > > ð_da); > > > > + if (err) { > > > > + rte_errno = -err; > > > > + DRV_LOG(ERR, "failed to process device arguments: > > > > %s", > > > > + strerror(rte_errno)); > > > > + return NULL; > > > > + } > > > > + for (i = 0; i < eth_da.nb_representor_ports; ++i) > > > > + if (eth_da.representor_ports[i] == > > > > + (uint16_t)switch_info->port_name) > > > > + break; > > > > + if (i == eth_da.nb_representor_ports) { > > > > + rte_errno = EBUSY; > > > > > > Why EBUSY is the correct errno? Will another attempts to probe the device > > can be successful? > > > > That's the definition of EAGAIN :) > > > > I thought EBUSY in the sense of "don't disturb" would be appropriate. This > > value was also chosen because it is not likely to be returned by any > > intermediate function calls. I've defined EBUSY along with the return value of > > this function for clarity (see above). Any suggestion? > > How about ENODEV ? Already used by many internal functions, typically returned if the associated netdevice doesn't exist (e.g. sent to another netns; a fatal error when probing representors). We need a unique error code that says "OK, no problem, just not this one". -- Adrien Mazarguil 6WIND