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 6B869A0032; Thu, 12 May 2022 12:57:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DC6240E64; Thu, 12 May 2022 12:57:44 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id D00244014F for ; Thu, 12 May 2022 12:57:42 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (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 305D082; Thu, 12 May 2022 13:57:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 305D082 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1652353062; bh=7NoL11QolhRxU670ekqPq4cmXRbrHOzhH2tZDMghy50=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=E+aDKxuUsP/kU0M6AXdEizcvUPaoJh88m1t1VlnBSh9GAGpAasl+szFcYMZIJXH3Y 9xm6kd/MQ1GN+1nhzVzusBqkxu5i1Vi2jbj+n4cEbiCwnwXG9xLk4XHBExaK1vH8Wx qsqE02iTWTGsoY7eDrnguyEw9aT6FV/hUWtwtUrw= Message-ID: <372e46ce-5cde-ba0e-835b-cec7d2557b3e@oktetlabs.ru> Date: Thu, 12 May 2022 13:57:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v4 5/8] net/vmxnet3: version 6 Content-Language: en-US To: Pankaj Gupta , jbehrens@vmware.com, yongwang@vmware.com Cc: dev@dpdk.org References: <20220505220019.31166-1-pagupta@vmware.com> <20220505220019.31166-6-pagupta@vmware.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20220505220019.31166-6-pagupta@vmware.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 5/6/22 01:00, Pankaj Gupta wrote: > vmxnet3 version 6 supports some new features, including but > not limited to: > - Increased max MTU up to 9190 > - Increased max number of queues, both for Rx and Tx > - Removes power-of-two limitations > - Extended interrupt structures, required implementation for > additional number of queues > > Tested, using testpmd, for different hardware version on > ESXi 7.0 Update 2. > > Signed-off-by: Pankaj Gupta > Reviewed-by: Jochen Behrens [snip] > @@ -1377,9 +1428,30 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > struct vmxnet3_hw *hw = dev->data->dev_private; > + int queues = 0; > + > + if (VMXNET3_VERSION_GE_6(hw)) { > + VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, > + VMXNET3_CMD_GET_MAX_QUEUES_CONF); > + queues = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD); > + > + if (queues > 0) { > +#ifndef MIN > +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) > +#endif checkpatches.sh produces a warning here. Can we use RTE_MIN() instead below? > + dev_info->max_rx_queues = > + MIN(VMXNET3_EXT_MAX_RX_QUEUES, ((queues >> 8) & 0xff)); > + dev_info->max_tx_queues = > + MIN(VMXNET3_EXT_MAX_TX_QUEUES, (queues & 0xff)); > + } else { > + dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES; > + dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES; > + } > + } else { > + dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES; > + dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES; > + } > > - dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES; > - dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES; > dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM; > dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */ > dev_info->min_mtu = VMXNET3_MIN_MTU; [snip]