From patchwork Thu Sep 15 06:14:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Fleytman X-Patchwork-Id: 9332839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9F956077A for ; Thu, 15 Sep 2016 06:21:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB2BC29293 for ; Thu, 15 Sep 2016 06:21:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF6192929D; Thu, 15 Sep 2016 06:21:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3444B29293 for ; Thu, 15 Sep 2016 06:21:32 +0000 (UTC) Received: from localhost ([::1]:60085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkQ38-0007YK-Dg for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Sep 2016 02:21:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkPy0-0003l7-Ah for qemu-devel@nongnu.org; Thu, 15 Sep 2016 02:16:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkPxv-0001BB-V0 for qemu-devel@nongnu.org; Thu, 15 Sep 2016 02:16:11 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkPxv-00017B-ON for qemu-devel@nongnu.org; Thu, 15 Sep 2016 02:16:07 -0400 Received: by mail-wm0-f67.google.com with SMTP id 133so3447089wmq.2 for ; Wed, 14 Sep 2016 23:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NyPj3j+tZS4Is0LSQOzePJncHSK1nmgCkiiK09LgHWo=; b=pEGkmkHnNK2Nc9ve5BOq5GlgHKFcrrMINcJTYWaj2AQlVouyyR5JajRZ4QjwEOHAch YjcF2bLk26J+yVLXO9juuqAAAY8YvJMolJ4NcBxLkG2ifbzdp8M7wgcUPP55POws3gFT +r9tJlSi3bffghVn4IGNZZtpxG/zDqDcteoeMvqAH0h2QupkNfCiBNjeG4rZGvdsk05X /E6HAQ+xZ2lhTAu6CUXvRUTAflw1a7tPTgKXfNyharhWydAo6Ms2ZkWT8Tu7lwMDjgYt 5Gml7mdiKc62tGrRRqq+b5fbTBdvsT+PkaqXQb0Hje2FZGCvMona61rZNQboBI3+7NfT F1Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NyPj3j+tZS4Is0LSQOzePJncHSK1nmgCkiiK09LgHWo=; b=LFXaGJfhiRv3jhnmV9WcCIe7zp7FLV1f+OXKEsprqVJu5MqctM3E3/e1OkwnK8jNDA +9OCEFlyLsY26Xb2J0ZXbLOfDSouT3Io5YqRbC00oqmn0lHbYLA/jaVtrXBhrfcsT6Jp DDiPhh9bKTbXm8d/xYDDsHxJJUNH4iNmL9qkEpEwXNgJgre8DsbwPAi1ixSVgScGpdl5 GiSVcpYYUo58uR4Au+sK7rFUgdSqsBpS9Fp+rYsae54cJNpytQRIyZk9G+3BBVINNDck 2NXyeSKeIOJUQYKdpS8ZHfbAfz3cvdqKl/uNOoJH+/8z2CkrWbp78MTxCY64vg9r855m BEcQ== X-Gm-Message-State: AE9vXwOkCH5JZjqn1mbwBT81cvsCXTaC2hpctIndLxiriS1rN1amcI+4PK/ZZIc5BoRfCQ== X-Received: by 10.28.129.68 with SMTP id c65mr1120799wmd.79.1473920085934; Wed, 14 Sep 2016 23:14:45 -0700 (PDT) Received: from bark.daynix ([141.226.163.133]) by smtp.gmail.com with ESMTPSA id jd4sm1732011wjb.6.2016.09.14.23.14.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 23:14:45 -0700 (PDT) From: Dmitry Fleytman To: qemu-devel@nongnu.org Date: Thu, 15 Sep 2016 09:14:24 +0300 Message-Id: <1473920070-21938-2-git-send-email-dmitry@daynix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473920070-21938-1-git-send-email-dmitry@daynix.com> References: <1473920070-21938-1-git-send-email-dmitry@daynix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.67 Subject: [Qemu-devel] [PATCH 1/7] e1000e: Flush all receive queues on receive enable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yan Vugenfirer , Jason Wang , Shmulik Ladkani Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Before this patch first netdev queue only was flushed. Signed-off-by: Dmitry Fleytman --- hw/net/e1000e.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/net/e1000e_core.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index bad43f4..4994e1c 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -400,7 +400,7 @@ static void e1000e_write_config(PCIDevice *pci_dev, uint32_t address, if (range_covers_byte(address, len, PCI_COMMAND) && (pci_dev->config[PCI_COMMAND] & PCI_COMMAND_MASTER)) { - qemu_flush_queued_packets(qemu_get_queue(s->nic)); + e1000e_start_recv(&s->core); } } diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index badb1fe..ade4d25 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -953,7 +953,7 @@ e1000e_has_rxbufs(E1000ECore *core, const E1000E_RingInfo *r, core->rx_desc_buf_size; } -static inline void +void e1000e_start_recv(E1000ECore *core) { int i; diff --git a/hw/net/e1000e_core.h b/hw/net/e1000e_core.h index 5f413a9..1ff6978 100644 --- a/hw/net/e1000e_core.h +++ b/hw/net/e1000e_core.h @@ -144,3 +144,6 @@ e1000e_receive(E1000ECore *core, const uint8_t *buf, size_t size); ssize_t e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt); + +void +e1000e_start_recv(E1000ECore *core);