From owner-svn-src-head@freebsd.org Fri Feb 26 09:45:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B060AB5A5B; Fri, 26 Feb 2016 09:45:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 008FFC47; Fri, 26 Feb 2016 09:45:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9jnum009689; Fri, 26 Feb 2016 09:45:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9jmXv009687; Fri, 26 Feb 2016 09:45:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260945.u1Q9jmXv009687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296088 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:45:50 -0000 Author: sephe Date: Fri Feb 26 09:45:48 2016 New Revision: 296088 URL: https://svnweb.freebsd.org/changeset/base/296088 Log: hyperv/hn: Remove the useless num_outstanding_sends We rely on taskqueue draining now. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5456 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:41:00 2016 (r296087) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:45:48 2016 (r296088) @@ -117,7 +117,7 @@ hv_nv_get_inbound_net_device(struct hv_d * permit incoming packets if and only if there * are outstanding sends. */ - if (net_dev->destroy && net_dev->num_outstanding_sends == 0) { + if (net_dev->destroy) { return (NULL); } @@ -723,11 +723,6 @@ hv_nv_on_device_remove(struct hv_device /* Stop outbound traffic ie sends and receives completions */ net_dev->destroy = TRUE; - /* Wait for all send completions */ - while (net_dev->num_outstanding_sends) { - DELAY(100); - } - hv_nv_disconnect_from_vsp(net_dev); /* At this point, no one should be accessing net_dev except in here */ @@ -805,8 +800,6 @@ hv_nv_on_send_completion(netvsc_dev *net net_vsc_pkt->compl.send.send_completion_context); } - - atomic_subtract_int(&net_dev->num_outstanding_sends, 1); } } @@ -818,14 +811,9 @@ hv_nv_on_send_completion(netvsc_dev *net int hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt) { - netvsc_dev *net_dev; nvsp_msg send_msg; int ret; - net_dev = hv_nv_get_outbound_net_device(device); - if (!net_dev) - return (ENODEV); - send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt; if (pkt->is_data_pkt) { /* 0 is RMC_DATA */ @@ -851,10 +839,6 @@ hv_nv_on_send(struct hv_device *device, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } - /* Record outstanding send only if send_packet() succeeded */ - if (ret == 0) - atomic_add_int(&net_dev->num_outstanding_sends, 1); - return (ret); } Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:41:00 2016 (r296087) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:45:48 2016 (r296088) @@ -893,7 +893,6 @@ typedef struct nvsp_msg_ { */ typedef struct netvsc_dev_ { struct hv_device *dev; - int num_outstanding_sends; /* Send buffer allocated by us but manages by NetVSP */ void *send_buf;