From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B66D4A00C5; Mon, 6 Jul 2020 16:14:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0721F1D93C; Mon, 6 Jul 2020 16:14:20 +0200 (CEST) Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) by dpdk.org (Postfix) with ESMTP id 445A21D908 for ; Mon, 6 Jul 2020 16:14:19 +0200 (CEST) Received: by mail-ot1-f67.google.com with SMTP id 72so31758091otc.3 for ; Mon, 06 Jul 2020 07:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vnS8lCavDGqLDIILcQykc9qPZa/Flaauu+qQxDsnzrk=; b=XB55UeBI94g7jtBer71TjP1HA/iJfZwx+dth6+rc82CC6Mh2qJKQuRxUQTuHTo/2D1 qA/LSov1/lWD2MiVIaKFvZnCUwvRkZTSNj+BaESImKaRkG3Hckv8ImqPrBC0S+6h/HmX 4zNE4oTfWTYf1ppHB7pPpdbqaBGM/6etBrJW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vnS8lCavDGqLDIILcQykc9qPZa/Flaauu+qQxDsnzrk=; b=hWOVmMBEX8B7vEbu5T09HcN0tFQoZplBsBG5RR96/m12glZEVAKdlF+BTikrPp3UIr G9L2sEKW8yZHEzz61Z94ykhPmDp2+owmM8SyHrWVQ8ULZCQg5Z2EzniQczT5ibUPjs4Z xKY6PK8E1KA2pZksxtXAfVEh/MGsLdy1ha5hzuNmWzsCcl2/iQwWE40mEyw7f5QqRwRR HiUmGQ0p7Rghlsr/MLaxVB3ULurhmLWfBAB3YSHz7oeLR2db+yRDvlmQbDSNFq28CW1V 48vFgcRwlD1TLoeQYJnzDte0suia9foKJ7hgAzm9tr1oaC2xehWOnFOlZcHlaCQ28qwZ bJxw== X-Gm-Message-State: AOAM5311bNKaAHGxGpoiIhZxboRPFkFOH46ajz/FP6dKxEq5fyRvkO1k As05MK3/11D0OaMMj6ZgT5zqg8J13HGQh8nDIjpcdQ== X-Google-Smtp-Source: ABdhPJzFBeIqKuEtbzulktFvkgadwg5b90G9ZYoYxFOOt9vKLZOzeGq9a7n1KL0p/OBlMA5GZS8eAu1M6XK8Z9QgB7c= X-Received: by 2002:a9d:3b1:: with SMTP id f46mr38964846otf.154.1594044858366; Mon, 06 Jul 2020 07:14:18 -0700 (PDT) MIME-Version: 1.0 References: <1f5421dc-0453-6dc8-09c2-ddfff6eb4888@intel.com> <20200703210210.40568-1-ajit.khaparde@broadcom.com> <20200703210210.40568-2-ajit.khaparde@broadcom.com> <6b41ef2b-4203-78f6-dcd9-013f770c7d88@intel.com> In-Reply-To: From: Ajit Khaparde Date: Mon, 6 Jul 2020 07:14:01 -0700 Message-ID: To: Somnath Kotur Cc: Ferruh Yigit , dev , Venkat Duvvuru , Kalesh AP Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v5 01/51] net/bnxt: add basic infrastructure for VF reps 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" On Mon, Jul 6, 2020 at 7:05 AM Somnath Kotur wrote: > On Mon, Jul 6, 2020 at 3:37 PM Ferruh Yigit > wrote: > > > > On 7/3/2020 10:01 PM, Ajit Khaparde wrote: > > > From: Somnath Kotur > > > > > > Defines data structures and code to init/uninit > > > VF representors during pci_probe and pci_remove > > > respectively. > > > Most of the dev_ops for the VF representor are just > > > stubs for now and will be will be filled out in next patch. > > > > > > To create a representor using testpmd: > > > testpmd -c 0xff -wB:D.F,representor=1 -- -i > > > testpmd -c 0xff -w05:02.0,representor=[1] -- -i > > > > > > To create a representor using ovs-dpdk: > > > 1. Firt add the trusted VF port to a bridge > > > ovs-vsctl add-port ovsbr0 vf_rep1 -- set Interface vf_rep1 type=dpdk > > > options:dpdk-devargs=0000:06:02.0 > > > 2. Add the representor port to the bridge > > > ovs-vsctl add-port ovsbr0 vf_rep1 -- set Interface vf_rep1 type=dpdk > > > options:dpdk-devargs=0000:06:02.0,representor=1 > > > > > > Signed-off-by: Somnath Kotur > > > Signed-off-by: Venkat Duvvuru > > > Reviewed-by: Kalesh AP > > > Reviewed-by: Ajit Khaparde > > > > <...> > > > > > static int bnxt_pci_remove(struct rte_pci_device *pci_dev) > > > { > > > - if (rte_eal_process_type() == RTE_PROC_PRIMARY) > > > - return rte_eth_dev_pci_generic_remove(pci_dev, > > > - bnxt_dev_uninit); > > > - else > > > + struct rte_eth_dev *eth_dev; > > > + > > > + eth_dev = rte_eth_dev_allocated(pci_dev->device.name); > > > + if (!eth_dev) > > > + return ENODEV; /* Invoked typically only by OVS-DPDK, by > the > > > + * time it comes here the eth_dev is > already > > > + * deleted by rte_eth_dev_close(), so > returning > > > + * +ve value will atleast help in proper > cleanup > > > + */ > > > > Why returning a positive error value? It hides the error since the > caller of the > > function does a "< 0" check. > > Better to be more explicit and return '0' if an error is not intendent > in this case. > > > Sure, makes sense Ferruh > Ferruh, Do you want Som to send a fresh patchset? Or send a fix just this with a new patch?