From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by dpdk.org (Postfix) with ESMTP id 507FD1B4A8 for ; Thu, 13 Dec 2018 09:26:41 +0100 (CET) Received: by mail-vs1-f54.google.com with SMTP id b74so672626vsd.9 for ; Thu, 13 Dec 2018 00:26:41 -0800 (PST) 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=2DFDpUt7gG2kW1XgpJ82YjFgiYsxUzT3EllrzJyk9W0=; b=NDdifPMM5u1jLnpBbkqibRdeM4fsbValPQYrVtdt9JKL1vp42En3oHVvZgNnMDMql4 QFvNTZvkAkzHO8onLHfd/hWvE9QsC/nnogmuqJOh1dpdI3zYMtUBFCpWOSATpeZxqFS7 E1/j1fI9IaA4JqcucgJfJ2zPPJHS63798YO+xUh3JmtRxnN1SP5CCMI1kCbqlHzQA8pZ tnpHj3NGzO1O/Re1uC3wr2Qz/WYtAPLzwaqHak/dLI4WraFEkMWeL2fd6myCGJxjwRbr w36JFqClV+oxNVfmGqHvpw10ZriZMK7bI6J8TbFaINXoytB47ddzUPMaOztKYWkKhlN7 87Bg== X-Gm-Message-State: AA+aEWaAuNY+nUjHsDe8DYo7WeoibclY1B+X3PFtJYWIcjIDORCRGsKi cdKshlQoCyRifLb+mH6GNSULGRsUXc4cF4QbpCLO+Q== X-Google-Smtp-Source: AFSGD/WW+bxfpvCEqT4kK9qxxK6e5rpk8zByquQMT4sqpr+0VpOYKoR07IH1kqGwtV3olw+rP9fupBk0nQtUJRUEMvk= X-Received: by 2002:a67:32c6:: with SMTP id y189mr10859954vsy.105.1544689600127; Thu, 13 Dec 2018 00:26:40 -0800 (PST) MIME-Version: 1.0 References: <20181128165806.78934-1-zhirun.yan@intel.com> <20181213140505.14578-1-zhirun.yan@intel.com> <20181213140505.14578-2-zhirun.yan@intel.com> In-Reply-To: <20181213140505.14578-2-zhirun.yan@intel.com> From: David Marchand Date: Thu, 13 Dec 2018 09:26:28 +0100 Message-ID: To: zhirun.yan@intel.com Cc: dev@dpdk.org, qi.z.zhang@intel.com, haiyue.wang@intel.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 1/2] net/i40e: support VF request more queues 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: Thu, 13 Dec 2018 08:26:41 -0000 Hello, Zhirun, On Thu, Dec 13, 2018 at 7:28 AM Zhirun Yan wrote: > @@ -1515,8 +1545,12 @@ RTE_PMD_REGISTER_KMOD_DEP(net_i40e_vf, "* igb_uio | > vfio-pci"); > static int > i40evf_dev_configure(struct rte_eth_dev *dev) > { > + struct i40e_vf *vf = > I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > struct i40e_adapter *ad = > I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > + uint16_t num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues, > + dev->data->nb_tx_queues); > + int ret = 0; > > /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk > * allocation or vector Rx preconditions we will reset it. > @@ -1526,7 +1560,21 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > ad->tx_simple_allowed = true; > ad->tx_vec_allowed = true; > > - return i40evf_init_vlan(dev); > + if (num_queue_pairs != vf->vsi_res->num_queue_pairs) { > + PMD_DRV_LOG(INFO, "change queue pairs from %u to %u", > + vf->vsi_res->num_queue_pairs, > num_queue_pairs); > + ret = i40evf_request_queues(dev, num_queue_pairs); > + if (ret != 0) > + return ret; > + > + ret = i40evf_dev_reset(dev); > + if (ret != 0) > + return ret; > + } > + > + i40evf_init_vlan(dev); > + > + return ret; > } > > static int > Did not look too much into this code, but I noticed that with this change, you always return 0, whatever happened with i40evf_init_vlan(). I would have put the "int ret" declaration in the new block and left the return i40evf_init_vlan(dev); as is. Do you have a rationale not to do so ? -- David Marchand