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 DFA91A0C47; Tue, 12 Oct 2021 10:48:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48A3240E0F; Tue, 12 Oct 2021 10:48:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 49DAE40150 for ; Tue, 12 Oct 2021 10:48:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634028491; 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=PDL3B87Cqj0V9vQEB59c8bBK/JoDxSvfyvL7DBLWws8=; b=E5rA8c3hPtxAAciHqMeHhYN3093oEXc+sWcyaUdi8nACX0prCr+dQypUqIpT1clsaeF171 cdSTRJPKnLfZbIfZPPmAp8oMjoounUFDXJAYXEdYnoprPloGJqj8aHUKOZEOb5N4tatbS0 0/PHhnqxJUNMCnjVKXe2s0Vg057Xfm8= 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-40-x0i7nAOMNUKdH1SkhtZhNw-1; Tue, 12 Oct 2021 04:48:07 -0400 X-MC-Unique: x0i7nAOMNUKdH1SkhtZhNw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A47E218125C1; Tue, 12 Oct 2021 08:48:05 +0000 (UTC) Received: from [10.39.208.25] (unknown [10.39.208.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E1275D9C6; Tue, 12 Oct 2021 08:48:03 +0000 (UTC) Message-ID: Date: Tue, 12 Oct 2021 10:48:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 To: "Ding, Xuan" , "Xia, Chenbo" Cc: "dev@dpdk.org" , "Hu, Jiayu" , "Wang, Yinan" , "stable@dpdk.org" , "Liu, Yong" References: <20210819053518.106296-1-xuan.ding@intel.com> <38c47e02-408f-d06d-5d96-26824239fa30@redhat.com> From: Maxime Coquelin In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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" On 9/23/21 11:21, Ding, Xuan wrote: > Hi Maxime, > >> -----Original Message----- >> From: Ding, Xuan >> Sent: Thursday, September 23, 2021 4:36 PM >> To: Maxime Coquelin ; Xia, Chenbo >> >> Cc: dev@dpdk.org; Hu, Jiayu ; Wang, Yinan >> ; stable@dpdk.org; Liu, Yong >> Subject: RE: [PATCH] net/virtio: fix indirect descriptors reconnection >> >> Hi Maxime, >> >>> -----Original Message----- >>> From: Maxime Coquelin >>> Sent: Thursday, September 23, 2021 4:16 PM >>> To: Ding, Xuan ; Xia, Chenbo >>> Cc: dev@dpdk.org; Hu, Jiayu ; Wang, Yinan >>> ; stable@dpdk.org; Liu, Yong >>> Subject: Re: [PATCH] net/virtio: fix indirect descriptors reconnection >>> >>> 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. >> >> Do you mean we allocate the indirect descriptors after checking the indirect >> feature in virtio TX queue, >> instead of allocating it at initialization? >> If so, that makes sense, and hence we don't to initialize it in two places. > > Sorry for replying myself, as for performance, I can have a try and test the > impact on performance. Thanks for looking at this, but maybe that could be done later, after having the fix merged first if you don't have the bandwidth? Maxime > Thanks, > Xuan > >> >>> >>>> + >>>> + 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. >> >> Thanks, will update in next version. >> >> Regards, >> Xuan >> >>> >>>> + 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 >