From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A3095A00C4; Fri, 28 Oct 2022 17:45:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8414340151; Fri, 28 Oct 2022 17:45:27 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 415C740146 for ; Fri, 28 Oct 2022 17:45:26 +0200 (CEST) Received: from [192.168.1.39] (unknown [188.170.73.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id F1C2B5E; Fri, 28 Oct 2022 18:45:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru F1C2B5E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1666971925; bh=Kbi7UcfD80Amr0Jsjt5y6HaQQVK9LsKUWXR2fLgrtDw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=StJ6dVwPaZQLarxcxK48Oc9ErcQru+S4H4FRzc9Q6lH0fUH3j/XzlWGntW3mre5VB 6vYfoIdYPoysRmbxIGAOn2u5x98LMlOFrFU3lKyK27HrBpeSIpxXU9gB4rHpp/lItV iPdWJ/35ssSCNzmA8Nbc6IEAbMoEXtz3DurzGjGw= Message-ID: <5cf3ff20-bc7b-50ff-f3d4-ba5bf48f4a30@oktetlabs.ru> Date: Fri, 28 Oct 2022 18:45:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v14 05/18] net/idpf: add support for device start and stop Content-Language: en-US To: Junfeng Guo , qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, Xiaoyun Li References: <20221027054505.1369248-2-junfeng.guo@intel.com> <20221027074729.1494529-1-junfeng.guo@intel.com> <20221027074729.1494529-6-junfeng.guo@intel.com> From: Andrew Rybchenko In-Reply-To: <20221027074729.1494529-6-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 10/27/22 10:47, Junfeng Guo wrote: > Add dev ops dev_start, dev_stop and link_update. > > Signed-off-by: Beilei Xing > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo [snip] > @@ -284,6 +305,40 @@ idpf_dev_configure(struct rte_eth_dev *dev) > return 0; > } > > +static int > +idpf_dev_start(struct rte_eth_dev *dev) > +{ > + struct idpf_vport *vport = dev->data->dev_private; > + > + if (dev->data->mtu > vport->max_mtu) { > + PMD_DRV_LOG(ERR, "MTU should be less than %d", vport->max_mtu); > + return -1; Negative errno must be returned. > + } > + > + vport->max_pkt_len = dev->data->mtu + IDPF_ETH_OVERHEAD; > + > + /* TODO: start queues */ > + > + if (idpf_vc_ena_dis_vport(vport, true) != 0) { > + PMD_DRV_LOG(ERR, "Failed to enable vport"); > + return -1; same here > + } > + > + return 0; > +} [snip]