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 6BBABA0032; Mon, 11 Jul 2022 10:36:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD9C240DF6; Mon, 11 Jul 2022 10:36:30 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id E32DD4021F; Mon, 11 Jul 2022 10:36:28 +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 4250BA5; Mon, 11 Jul 2022 11:36:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 4250BA5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1657528587; bh=7tEtdPmPtmeaNGII9WHP2uUoQzlVUEPcz4XRvIy0SkQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=j4Mq/FOBgBHfQ2vA6Kg1g7q/gnfTkPFo5UtzwrdPZDzvh1PDfWx3MlKt9RNxuD7tJ 3f0n4g2aBe1RBGyF3IG/j8kcO3zBLKnbPpETkgejOfn9cYiT4cii9Pu/6UqSXfOU+B PdVdAHtDZ3ucvqdnDs2ZD3Phqzn3uOV5hal7G+m8= Message-ID: <422a7c97-056d-56cb-8510-efaf5257b6e2@oktetlabs.ru> Date: Mon, 11 Jul 2022 11:36:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] common/sfc_efx/base: remove VQ index check during VQ start Content-Language: en-US To: abhimanyu.saini@xilinx.com, dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, Abhimanyu Saini , stable@dpdk.org, Vijay Kumar Srivastava References: <20220708073702.29391-1-asaini@xilinx.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20220708073702.29391-1-asaini@xilinx.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 7/8/22 10:37, abhimanyu.saini@xilinx.com wrote: > From: Abhimanyu Saini > > The used/avail queue indexes are not bound by queue > size, because the descriptor entry index is calculated > by a simple modulo between queue index and queue_size "is calculated" is a bit vague since looking at the code I've failed to find the place where modulo operation is done. Don't we need to apply it these values are put into MCDI message? > > So, do not check initial used and avail queue indexes > against queue size because it is possible for these > indexes to be greater than queue size in the > following cases: > 1) The queue is created to be migrated into, or > 2) The client issues a qstop/qstart after running datapath > > Fixes: 4dda72dbdeab3 ("common/sfc_efx/base: add base virtio support for vDPA") > Cc: stable@dpdk.org > > Signed-off-by: Abhimanyu Saini > --- > drivers/common/sfc_efx/base/rhead_virtio.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/common/sfc_efx/base/rhead_virtio.c b/drivers/common/sfc_efx/base/rhead_virtio.c > index 335cb74..7f08717 100644 > --- a/drivers/common/sfc_efx/base/rhead_virtio.c > +++ b/drivers/common/sfc_efx/base/rhead_virtio.c > @@ -47,14 +47,6 @@ > goto fail2; > } > > - if (evvdp != NULL) { > - if ((evvdp->evvd_vq_cidx > evvcp->evvc_vq_size) || > - (evvdp->evvd_vq_pidx > evvcp->evvc_vq_size)) { > - rc = EINVAL; > - goto fail3; > - } > - } > - > req.emr_cmd = MC_CMD_VIRTIO_INIT_QUEUE; > req.emr_in_buf = payload; > req.emr_in_length = MC_CMD_VIRTIO_INIT_QUEUE_REQ_LEN; > @@ -116,15 +108,13 @@ > > if (req.emr_rc != 0) { > rc = req.emr_rc; > - goto fail4; > + goto fail3; > } > > evvp->evv_vi_index = vi_index; > > return (0); > > -fail4: > - EFSYS_PROBE(fail4); > fail3: > EFSYS_PROBE(fail3); > fail2: