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 F2E32A0C51; Tue, 13 Jul 2021 15:36:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1A2541263; Tue, 13 Jul 2021 15:36:27 +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 47210406FF for ; Tue, 13 Jul 2021 15:36:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626183385; 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=m7QhaWaFuhVndbLcV2BVdFo7iQlxWrR9mz05j+/zx7Y=; b=RidWSYmjO1PCWZdA1FkYn0/o4kO+hEBYIDxGCK3SYxCcXFYaCkx5PbSBp2CgmDPXj3e8s9 oStcWl8x9mwp85P1ijt9DxWfTdpfAaP4xBCqnZOWicTEokGw1WyiLQDGQ2MqcbzEZQVjty i3m6e2W04Dqm7a0SH1MTSfMnFs9X2wk= 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-285--QGRmHUDNCe3vG4_fCtD_g-1; Tue, 13 Jul 2021 09:36:22 -0400 X-MC-Unique: -QGRmHUDNCe3vG4_fCtD_g-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 C54178B4A43; Tue, 13 Jul 2021 13:36:20 +0000 (UTC) Received: from [10.36.110.39] (unknown [10.36.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 782795D9DD; Tue, 13 Jul 2021 13:36:19 +0000 (UTC) To: Wenwu Ma , dev@dpdk.org Cc: chenbo.xia@intel.com, cheng1.jiang@intel.com, jiayu.hu@intel.com References: <20210602083110.5530-1-yuanx.wang@intel.com> <20210705181151.141752-1-wenwux.ma@intel.com> <20210705181151.141752-3-wenwux.ma@intel.com> From: Maxime Coquelin Message-ID: Date: Tue, 13 Jul 2021 15:36:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210705181151.141752-3-wenwux.ma@intel.com> 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 2/4] examples/vhost: use a new API to query remaining ring space 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 7/5/21 8:11 PM, Wenwu Ma wrote: > A new API for querying the remaining descriptor ring capacity > is available, so we use the new one instead of the old one. > > Signed-off-by: Wenwu Ma > --- > examples/vhost/ioat.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c > index 2a2c2d7202..bf4e033bdb 100644 > --- a/examples/vhost/ioat.c > +++ b/examples/vhost/ioat.c > @@ -17,7 +17,6 @@ struct packet_tracker { > unsigned short next_read; > unsigned short next_write; > unsigned short last_remain; > - unsigned short ioat_space; > }; > > struct packet_tracker cb_tracker[MAX_VHOST_DEVICE]; > @@ -113,7 +112,6 @@ open_ioat(const char *value) > goto out; > } > rte_rawdev_start(dev_id); > - cb_tracker[dev_id].ioat_space = IOAT_RING_SIZE - 1; > dma_info->nr++; > i++; > } > @@ -140,7 +138,7 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id, > src = descs[i_desc].src; > dst = descs[i_desc].dst; > i_seg = 0; > - if (cb_tracker[dev_id].ioat_space < src->nr_segs) > + if (rte_ioat_burst_capacity(dev_id) < src->nr_segs) > break; > while (i_seg < src->nr_segs) { > rte_ioat_enqueue_copy(dev_id, > @@ -155,7 +153,6 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id, > } > write &= mask; > cb_tracker[dev_id].size_track[write] = src->nr_segs; > - cb_tracker[dev_id].ioat_space -= src->nr_segs; > write++; > } > } else { > @@ -194,7 +191,6 @@ ioat_check_completed_copies_cb(int vid, uint16_t queue_id, > if (n_seg == 0) > return 0; > > - cb_tracker[dev_id].ioat_space += n_seg; > n_seg += cb_tracker[dev_id].last_remain; > > read = cb_tracker[dev_id].next_read; > Reviewed-by: Maxime Coquelin Thanks, Maxime