From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1F470A046B for ; Tue, 25 Jun 2019 10:23:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E5B751BBE2; Tue, 25 Jun 2019 10:23:47 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 35E301BB9D; Tue, 25 Jun 2019 10:23:46 +0200 (CEST) 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 mx1.redhat.com (Postfix) with ESMTPS id A190E30842CE; Tue, 25 Jun 2019 08:23:45 +0000 (UTC) Received: from [10.36.112.46] (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8257C5C232; Tue, 25 Jun 2019 08:23:44 +0000 (UTC) To: Noa Ezra Cc: Matan Azrad , "dev@dpdk.org" , "stable@dpdk.org" References: <1560924960-221163-1-git-send-email-noae@mellanox.com> From: Maxime Coquelin Message-ID: <45aa59ca-c4fd-dbc7-c158-0220c1494c55@redhat.com> Date: Tue, 25 Jun 2019 10:23:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 25 Jun 2019 08:23:45 +0000 (UTC) Subject: Re: [dpdk-dev] [Suspected-Phishing][PATCH] net/vhost: fix redundant queue state event X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 6/25/19 9:04 AM, Noa Ezra wrote: > Hi, > What do you think about this patch? > > Thanks, > Noa. > >> -----Original Message----- >> From: Noa Ezra [mailto:noae@mellanox.com] >> Sent: Wednesday, June 19, 2019 9:16 AM >> To: maxime.coquelin@redhat.com >> Cc: Matan Azrad ; dev@dpdk.org; Noa Ezra >> ; stable@dpdk.org >> Subject: [Suspected-Phishing][PATCH] net/vhost: fix redundant queue state >> event >> >> In some situations, when a virtual machine is starting, vring_state_changed >> can be called while there was no change in the queue state. This fix makes >> sure that there was really a change in the queue state before calling the >> callback for EVENT_QUEUE_STATE. >> >> Fixes: ee584e9710b9 ("vhost: add driver on top of the library") >> Cc: stable@dpdk.org >> Reviewed-by: Matan Azrad >> --- >> drivers/net/vhost/rte_eth_vhost.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/net/vhost/rte_eth_vhost.c >> b/drivers/net/vhost/rte_eth_vhost.c >> index cad1e5c..fbe7a37 100644 >> --- a/drivers/net/vhost/rte_eth_vhost.c >> +++ b/drivers/net/vhost/rte_eth_vhost.c >> @@ -855,6 +855,10 @@ struct vhost_xstats_name_off { >> /* won't be NULL */ >> state = vring_states[eth_dev->data->port_id]; >> rte_spinlock_lock(&state->lock); >> + if (state->cur[vring] == enable) { >> + rte_spinlock_unlock(&state->lock); >> + return 0; >> + } >> >> state->cur[vring] = enable; >> state->max_vring = RTE_MAX(vring, state->max_vring); Maybe the application would want to be notified a new queue is available, even if it is disabled? >> -- >> 1.8.3.1 >