From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 875C81B05B for ; Tue, 10 Jul 2018 11:37:40 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id w16-v6so23813676wmc.2 for ; Tue, 10 Jul 2018 02:37:40 -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=a0cpZDa/V/+C9OvWwVas4q/L2MhKETJH3L3ZjgcnXFM=; b=wgyTqbhyc5DBmpUdBzqjIYculGggRSQQJ4j4h52kEGyeaepDDoZFecrFotHW2APe7Y S5uxiM7jnomJvcjkq1h211oBu5TGKjbvATggqXWc0wDKpCnviIomRQQBedQ+UXoI4pan fDtqDZ75QcU6keAgA+6BxmwIugInr17QPQH1lB+wGsCW9R2aeGRiqIcwI5p5jCc8vCUK WIUo6Qk1/v6P4ob/tFv7Oslofn1peBVgLwhrYBX7/eO24zni+JvGyIbGrdiooR4Xm1mu ts4M4jYrL250kCVga8H/vlMM7EcPprqLE2RHlRLr/U0O2/yu+wUe97KExeIEbY5cAqTU DuVQ== 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=a0cpZDa/V/+C9OvWwVas4q/L2MhKETJH3L3ZjgcnXFM=; b=EmvJmskoM3yZhw+XoD7ZTGDTWXiodm0xW61F938/sXEohqPovp7lT1bZgzFyZw4Slo lOumz0zu1K7dI07kokXeq+tr2/V34MVNLBe/a9o6jWCXBHCLt6I8iHVAZbWETLgPVAOm cHBVvWdGvkInrcN27LlVoJvHGTThpB2oB/HrFq3m+tQnCHM/E0jTcmky0I9ZDyyU5bO/ J9OMVrAjBvd0UXsYZzsGbJngaSHeqweSguGxOb0HVE+DYw1fod50EygJRrNvhwhPle+u sBReeg4kwYgM7b8kJbMwcVmie3W3U4DrS7+cQCGi5NsbVWGjkew++76MoJlfq7ppMPmg u/lw== X-Gm-Message-State: APt69E1k5bJAZrIBSf4+YgIuEjQLO89qDM6NDhdzyQov9Fueb2Q8sPXd dpt286HpnllPFd7NLH1ej/gG2B9g X-Google-Smtp-Source: AAOMgpd5WTYoBK43fyGJSqsFmiKKXWdfUpjzQyWsz3XoAjJP0M1B1ABO8y9i4lRmXe4KsY9G0cAIMQ== X-Received: by 2002:a1c:5d0e:: with SMTP id r14-v6mr13518015wmb.152.1531215460299; Tue, 10 Jul 2018 02:37:40 -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 m17-v6sm25838335wrg.65.2018.07.10.02.37.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 02:37:39 -0700 (PDT) Date: Tue, 10 Jul 2018 11:37:23 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: "dev@dpdk.org" Message-ID: <20180710093723.GI5211@6wind.com> References: <20180704172322.22571-1-adrien.mazarguil@6wind.com> <20180705083934.5535-1-adrien.mazarguil@6wind.com> <20180705083934.5535-10-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 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 09:37:40 -0000 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? -- Adrien Mazarguil 6WIND