Received: by 10.213.65.68 with SMTP id h4csp844216imn; Wed, 14 Mar 2018 01:34:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELtU9g+3TRT2QxOE7o8EM4RCHxPzoL/gl5WCYP9WkkAhAZS/ZDwcOsHfR8cJIiEwUtEYybPa X-Received: by 10.101.67.73 with SMTP id k9mr2975610pgq.244.1521016455560; Wed, 14 Mar 2018 01:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521016455; cv=none; d=google.com; s=arc-20160816; b=SO2Y2Paqq+CYPgFVsoWndLGhawvsHoQ+SqE3I3kLztz3XeJIZ/mtipWozHG74idGXm wYussYayQlpKPqmH2X97H9AQ6K4+wFOPQ6O6z4ODwr0Si2IbHLFO0TQEasJc1J76ta+H Ysq7e40fDrjyGYhlUsmtc8ymyAd/+CkW+oJfZqNgdjTew4dlZEpAxJDSmjWYRzV93KLB +SevXnwI12loAsST+Vo1steE3QXPL+TMo+I6boOoxjaAkqEf/r+OFjDT0YewgecQJpN2 9ToaW3+Gp7KXRG3l8Vfu/W0r/jbd8WLB83pjUgQX86vmSsjVxIgaZ+qLsWFJ0+QeVNLZ goxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=LgHIxCQ29iFHnksrl0w6mfqU7wXzQUmnv2PTLksr5sc=; b=BXqvnb5pVMeUAclwR1Zl9TCamJdy5sL1ILVA7M2uyjg3Vg7qXCNvilMJAVVwnakLJz 4WvxgaVcFXVAtz5WWDCWRLoGH4iKuQ1XGT5d9aZ0X3+6K095D58aP4hkllsGtypxV1c0 XzIKbNL2TxJhuZxbOa9KB3GDMH9pMS1T4SoMe7TzQbtch9rhOZ1iSOqZcZmEjKKlq+jM LjbYaOhfw/r3nbG+S+BVVUd41YrlxLHWi676CpQLErr5JL6wlzfipNvy2nSyKBxD6KKW a+RUElqATVH6VNmvFm+oeS4fF3edA6kHI3su4LxPBk6DtaOz8FeMZ5WZskVaejUC175k JWLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ZFdOGIrO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si1642934plh.192.2018.03.14.01.34.01; Wed, 14 Mar 2018 01:34:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ZFdOGIrO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426AbeCNIcV (ORCPT + 99 others); Wed, 14 Mar 2018 04:32:21 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:33258 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752716AbeCNIcT (ORCPT ); Wed, 14 Mar 2018 04:32:19 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2E8Vo8p137419; Wed, 14 Mar 2018 08:32:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=LgHIxCQ29iFHnksrl0w6mfqU7wXzQUmnv2PTLksr5sc=; b=ZFdOGIrOeCCOYad36dKsFUOF6CyfS00B9tWBMXkNr1KU4JPcD5tbtl63JaS/rjpWhb0d PfFCHxUssf/LymeuHmt+44yNbcIUMqIY03wnAkxJOLG+G/VieL1rLhmb84nyhMZUq64d sxOJkT3JnWrVXTfQ4rwvZbtcIcbgFlILsx0rqZPTrmEariRHdYGnnCcAd/xKwXW4mnIp OA2LPTkNelFNA2QxRZRmss3JdVoZ8rnzgVv86+khHikiEmUIfr2V49YnmSK5taKUJhsk kNFMkS9odF3LjtrP0WE7SRxtsdCXSVJA3dHfOu3NhH0YiAkIL8gq2/X2u9APLjuLuirT cA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2gpyg0088p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 08:32:13 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2E8RBD4028947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 08:27:11 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2E8RAkJ017409; Wed, 14 Mar 2018 08:27:10 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Mar 2018 01:27:10 -0700 Date: Wed, 14 Mar 2018 11:27:01 +0300 From: Dan Carpenter To: Mohammed Gamal Cc: netdev@vger.kernel.org, sthemmin@microsoft.com, otubo@redhat.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, vkuznets@redhat.com, davem@davemloft.net Subject: Re: [PATCH] hv_netvsc: Make sure out channel is fully opened on send Message-ID: <20180314082701.2inzz2etg67r3zry@mwanda> References: <1520968010-20733-1-git-send-email-mgamal@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520968010-20733-1-git-send-email-mgamal@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8831 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=848 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803140100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 08:06:50PM +0100, Mohammed Gamal wrote: > @@ -791,6 +791,7 @@ static inline int netvsc_send_pkt( > VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); > } > > + ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound); > if (ret == 0) { > atomic_inc_return(&nvchan->queue_sends); > Could you move the assignment inside the "ret == 0" path closer to where it's used? regards, dan carpenter