From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by dpdk.org (Postfix) with ESMTP id 8F7C85952 for ; Sun, 4 Jan 2015 09:45:17 +0100 (CET) Received: by mail-we0-f182.google.com with SMTP id w62so6284862wes.13 for ; Sun, 04 Jan 2015 00:45:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=b7A9TZDjO/+E3zGNpWKY9Ldgcdkqapsn+1ADF4aHKCg=; b=KNS+aHtQhddKFCopizi8Y7YXUqQ6ZDe5QlGRJZEgy54kAOQgKIkcrEJoq4HVcggZxg WkXpC3qWAX8OEc+ru22LhjVmkqO5Ib5rqL6f3OxMpJksGUD+bHc2smcOOQp6pCW/MAHb x9ycrWQIrCe+0G5uTeBb0hx2exMlL0NOUrvJl+toSULsZOongqtuWdAB4XFeTh2iGTPT 2PNQbbwID+v9oHezejtLdSWzGpel6PzyDyB8fAuAEq69zdte010c95BHpu5bsdKa3+yj eNiUo2088bPVswI5wRyA9k03mgw36/Dw9i5LuH2Vx8nhdVqE1Yy5rKo8QeHfLmoHXDgW comA== X-Gm-Message-State: ALoCoQnzoZeDswEMDJvViI19yqcpu5OPBvrXcqEBqB/gZ49z6lrG/XdY+RVBbWz/9+9LFt0uGfRc X-Received: by 10.194.187.79 with SMTP id fq15mr147714578wjc.2.1420361117212; Sun, 04 Jan 2015 00:45:17 -0800 (PST) Received: from [10.0.0.3] (bzq-79-179-0-199.red.bezeqint.net. [79.179.0.199]) by mx.google.com with ESMTPSA id r3sm5276480wic.10.2015.01.04.00.45.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jan 2015 00:45:16 -0800 (PST) Message-ID: <54A8FD9A.8040701@cloudius-systems.com> Date: Sun, 04 Jan 2015 10:45:14 +0200 From: Vlad Zolotarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Ouyang Changchun , dev@dpdk.org References: <1419398584-19520-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-5-git-send-email-changchun.ouyang@intel.com> In-Reply-To: <1420355937-18484-5-git-send-email-changchun.ouyang@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 4/6] ether: Check VMDq RSS mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2015 08:45:17 -0000 On 01/04/15 09:18, Ouyang Changchun wrote: > Check mq mode for VMDq RSS, handle it correctly instead of returning an error; > Also remove the limitation of per pool queue number has max value of 1, because > the per pool queue number could be 2 or 4 if it is VMDq RSS mode; > > The number of rxq specified in config will determine the mq mode for VMDq RSS. > > Signed-off-by: Changchun Ouyang > --- > lib/librte_ether/rte_ethdev.c | 39 ++++++++++++++++++++++++++++++++++----- > 1 file changed, 34 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 95f2ceb..59ff325 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -510,8 +510,7 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, > > if (RTE_ETH_DEV_SRIOV(dev).active != 0) { > /* check multi-queue mode */ > - if ((dev_conf->rxmode.mq_mode == ETH_MQ_RX_RSS) || > - (dev_conf->rxmode.mq_mode == ETH_MQ_RX_DCB) || > + if ((dev_conf->rxmode.mq_mode == ETH_MQ_RX_DCB) || > (dev_conf->rxmode.mq_mode == ETH_MQ_RX_DCB_RSS) || > (dev_conf->txmode.mq_mode == ETH_MQ_TX_DCB)) { > /* SRIOV only works in VMDq enable mode */ > @@ -525,7 +524,6 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, > } > > switch (dev_conf->rxmode.mq_mode) { > - case ETH_MQ_RX_VMDQ_RSS: > case ETH_MQ_RX_VMDQ_DCB: > case ETH_MQ_RX_VMDQ_DCB_RSS: > /* DCB/RSS VMDQ in SRIOV mode, not implement yet */ > @@ -534,6 +532,39 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, > "unsupported VMDQ mq_mode rx %u\n", > port_id, dev_conf->rxmode.mq_mode); > return (-EINVAL); > + case ETH_MQ_RX_RSS: > + PMD_DEBUG_TRACE("ethdev port_id=%" PRIu8 > + " SRIOV active, " > + "Rx mq mode is changed from:" > + "mq_mode %u into VMDQ mq_mode %u\n", > + port_id, > + dev_conf->rxmode.mq_mode, > + dev->data->dev_conf.rxmode.mq_mode); > + case ETH_MQ_RX_VMDQ_RSS: > + dev->data->dev_conf.rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS; > + if (nb_rx_q < RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool) { > + switch (nb_rx_q) { > + case 1: > + case 2: > + RTE_ETH_DEV_SRIOV(dev).active = > + ETH_64_POOLS; > + break; > + case 4: > + RTE_ETH_DEV_SRIOV(dev).active = > + ETH_32_POOLS; > + break; > + default: > + PMD_DEBUG_TRACE("ethdev port_id=%d" > + " SRIOV active, " > + "queue number invalid\n", > + port_id); > + return -EINVAL; > + } > + RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q; > + RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = > + dev->pci_dev->max_vfs * nb_rx_q; > + } Don't u need to return an error in the "else" here? > + break; > default: /* ETH_MQ_RX_VMDQ_ONLY or ETH_MQ_RX_NONE */ > /* if nothing mq mode configure, use default scheme */ > dev->data->dev_conf.rxmode.mq_mode = ETH_MQ_RX_VMDQ_ONLY; > @@ -553,8 +584,6 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, > default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */ > /* if nothing mq mode configure, use default scheme */ > dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY; > - if (RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool > 1) > - RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 1; > break; > } >