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 81EC2A0C43; Thu, 23 Sep 2021 10:16:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B5AE4122B; Thu, 23 Sep 2021 10:16:03 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id B5ED44122B for ; Thu, 23 Sep 2021 10:16:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632384962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8GmPT3n4YHl8TTTfG1bY3ZAZwzhXsEVwOhRRcwwNmxw=; b=VEO8Sc7TwQFaIHBQHw+NfjDmbRN3LkjufuSmS3bZ4rE+qcr7FtH0i8ESNq8g7jROjoghoz YOj8l+bUmRR2Rb7XTArUqsmlUgADxjFaGH1pambv+o36ml+lwuYlEn8S1fMetFc8n56O/e 7jMOkb/Tch4y4kAQL4SOEzmUwXZWpPE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-uHB32hhnM_GnNeBgqupf-A-1; Thu, 23 Sep 2021 04:15:59 -0400 X-MC-Unique: uHB32hhnM_GnNeBgqupf-A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B7FA100C661; Thu, 23 Sep 2021 08:15:57 +0000 (UTC) Received: from [10.39.208.17] (unknown [10.39.208.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24806171FF; Thu, 23 Sep 2021 08:15:55 +0000 (UTC) Message-ID: <38c47e02-408f-d06d-5d96-26824239fa30@redhat.com> Date: Thu, 23 Sep 2021 10:15:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 To: Xuan Ding , chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yinan.wang@intel.com, stable@dpdk.org, yong.liu@intel.com References: <20210819053518.106296-1-xuan.ding@intel.com> From: Maxime Coquelin In-Reply-To: <20210819053518.106296-1-xuan.ding@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix indirect descriptors reconnection 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 Sender: "dev" Hi Xuan, On 8/19/21 07:35, Xuan Ding wrote: > Since packed indirect descriptors are added and initialized when > initializing vring, the reconnection path also needs to be considered. > > Fixes: 381f39ebb78a ("net/virtio: fix packed ring indirect descricptors setup") > Cc: stable@dpdk.org > Cc: yong.liu@intel.com > > Signed-off-by: Xuan Ding > --- > drivers/net/virtio/virtqueue.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c > index 1f9af3c31b..47229f35c4 100644 > --- a/drivers/net/virtio/virtqueue.c > +++ b/drivers/net/virtio/virtqueue.c > @@ -208,6 +208,20 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq) > rte_pktmbuf_free(dxp->cookie); > dxp->cookie = NULL; > } It makes me think we might save quite some bytes by not allocating indirect descriptors when feature is not negotiated, but it might have a cost in term of performance. > + > + struct virtio_tx_region *txr; Don't mix declarations within code. > + txr = txvq->virtio_net_hdr_mz->addr; > + /* first indirect descriptor is always the tx header */ > + struct vring_packed_desc *start_dp = > + txr[desc_idx].tx_packed_indir; Ditto. > + vring_desc_init_indirect_packed(start_dp, > + RTE_DIM(txr[desc_idx].tx_packed_indir)); > + start_dp->addr = txvq->virtio_net_hdr_mem > + + desc_idx * sizeof(*txr) > + + offsetof(struct virtio_tx_region, > + tx_hdr); > + start_dp->len = vq->hw->vtnet_hdr_size; > + > } > > vring_desc_init_packed(vq, size); > Thanks, Maxime