From patchwork Tue Apr 4 23:40:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 9662747 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 124C9602B9 for ; Tue, 4 Apr 2017 23:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 021A12094F for ; Tue, 4 Apr 2017 23:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9931212E8; Tue, 4 Apr 2017 23:59:28 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, 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 5AC492094F for ; Tue, 4 Apr 2017 23:59:28 +0000 (UTC) Received: from localhost ([::1]:38107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvYMB-0008PI-I4 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Apr 2017 19:59:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvYLK-0008NQ-M7 for qemu-devel@nongnu.org; Tue, 04 Apr 2017 19:58:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvYLF-0006dq-OP for qemu-devel@nongnu.org; Tue, 04 Apr 2017 19:58:34 -0400 Received: from mail-dm3nam03on0082.outbound.protection.outlook.com ([104.47.41.82]:1440 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cvYLF-0006cm-Fp for qemu-devel@nongnu.org; Tue, 04 Apr 2017 19:58:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lGqyCMfH/CEouyeFeZjz6hjqq1tjYFVEHOz6GYPsyBI=; b=UzKKxsiVqV5f5QTxAdew3hyfxAgw0kifJSHM6U8hmnXftTaV4NYItzaNIp66Oc7g+7jsjXjkl2mZzqUcGG7GrGNv1Xtixdp4ulBhYPAm1GhJITmbT5hClv33xVxfY/bmlQ6oCopKBdtOVoc91XrDCff/GgA+VTyZ0W+s4x1pRK8= Received: from CY4PR02CA0026.namprd02.prod.outlook.com (10.175.57.140) by MWHPR02MB2589.namprd02.prod.outlook.com (10.168.205.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Tue, 4 Apr 2017 23:42:37 +0000 Received: from CY1NAM02FT052.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::200) by CY4PR02CA0026.outlook.office365.com (2603:10b6:903:117::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Tue, 4 Apr 2017 23:42:36 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT052.mail.protection.outlook.com (10.152.74.123) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1005.5 via Frontend Transport; Tue, 4 Apr 2017 23:42:35 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1cvY5q-0004mQ-WE; Tue, 04 Apr 2017 16:42:35 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cvY5q-0000fv-Tc; Tue, 04 Apr 2017 16:42:34 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v34NgWi4002013; Tue, 4 Apr 2017 16:42:33 -0700 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cvY5o-0000fK-Pm; Tue, 04 Apr 2017 16:42:32 -0700 From: Alistair Francis To: , Date: Tue, 4 Apr 2017 16:40:07 -0700 Message-ID: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-22984.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39840400002)(39450400003)(39400400002)(39850400002)(39860400002)(39410400002)(2980300002)(438002)(189002)(199003)(9170700003)(9786002)(2906002)(76176999)(50986999)(8936002)(36386004)(5003940100001)(50226002)(305945005)(36756003)(6666003)(2950100002)(77096006)(54906002)(118296001)(33646002)(81166006)(8676002)(63266004)(356003)(47776003)(50466002)(189998001)(38730400002)(48376002)(106466001)(4326008)(5660300001)(39060400002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2589; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:ovrnspm; MX:1; A:1; PTR:unknown-60-83.xilinx.com; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT052; 1:owPaiIt0GRnb0Tkd7hWAk/Z+EP9vp0t7CFpPwV1uP7AEAJVUiNexNQPK6sVYbfgoU3neZgMfTB71vwguCC0m/9tiimqWO6MNlfHM9uNjOHqLZSMrWwcoKoqGHft2BC3RjX2yzt3LXwA4gk5hUHwGUbVbh6LPQ7suOPfRIfDOY2Yq2bcMrolf19XR5gZ00uIGai51k5EV0Ur/i3kRnHhjkU5NJoktYlG7pBAgsgl5TgYyPhoGYFK6uJookuUCi7LCMsDGhvlF7OdIDEpTZhdg1K2cYOwvj4y6T26FHJj48Xl4adDiXIETdZfwnOvKR1Zg83suTKRDGNJcaOHS0Kx13cgZT7VvwTmixT45WePVbxkPBR7uv7gJVrbhxht2XE3nMSiyvjZkM7g9cLBV96Qs1eCNr37YUkBzPr3BJ7R9sml+FtfK9zN/VSW8XZadD4rDt1TkJvopA6VbXKs7j56o5LL7sBwQbB8xTC7t/YRK/IkMSVSOHxxgKAMPpa5vL6p5ySQKwDl4ZJJGi2ZfczQPSfD7vfHxlEy5BF4pXYNYu9QO8Yq7IQDuInQ7odq4WjGY7RSiTHfdTQXKRtLqJEgAsUfbivHuNl7ng142scKAxaw= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ff476994-a28b-4481-03c4-08d47bb445a4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:MWHPR02MB2589; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB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V7CWiqC/qOJGYKpAH7wZCwFGSZeu+zrV27HHJEs2lejGQAWFpH94JLsx1cK+HtYCOg3LM16vXOzPQr2Je+G3otszkqgq2HUUFKb5DVTPNN/3MPK3XjjA5g8/nRVg9V2JuSdSYA1TSqQ9T1U2N5y1TuseJgJ/cnhrb6idvgbK8jR4sC+vWfxYZp51xVZdFx8dk+DxVmxJYKxOplkVwAt2cP6hOdcihfcpBlqerGSKZyg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2589; 20:Jhy3jWrRmudOPGzIunHUtuRAZbXmCpvYL7rF5qkdU6CtJSmesJX9lGXyDY4kl+ZZEWIUFBJr4Ge7F54qfc3jGZW97Qn2g91fbgQv0Z7SREovjhF852M1DGpxia0QMgxsQbc60TAHx1TrjE1Ar2di/233zMVVrV3jd7heaqZhBfsCzrJmCzwNK2szHkAwalfoMCJT259EFV23oj4LraNtjP5RGxiRfT2p/C4bvQ4Di7ewCVE2G3uB0h1LL4b4dbOj5QDnoAjL4k4HUIJS+MMW72O9Wy6HSjJLGUUwfySEKOG93A9qujD1UuqukCI94/NIP9ytNaSgUdqvYL+b6xv8HkWzn7OxnZrAJWeCShI/GyrQfgIOAG5uXR2XIqu0nVlWGXZcHgwa5XtHPJg1znVb/0SNx98XHBrYyifbaBG4EugOrVpzwSRe/wbJBrJzC8xzCLoFDa18Gcr87bhtI2/n8QBOnFF8u+NMXQSq9UMzIJA3HeHFeb6lPYIdkFwOZJcR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13015025)(13017025)(13023025)(13018025)(13024025)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:MWHPR02MB2589; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB2589; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2589; 4:JKkAx6UYXCfcyDR7fPxGfzSSR4BWcnZJQ0hM8BYMul3MOpc8Y3SzwqRw4ByVt3OdD2hZqnoFp8mMb6yHt4qxLBqVJdMrXho3IXUDdGJ1H2IDEhPWIG11qaW/guss5TFsxqE92f5QubVkb2PlHqMT3SBJhs8NhCLgPzn4gioP8pCssc5vohWR4hEpGIeIP3P3j4UNX5IV9POAUSWowSsCCrxHcI5ZLFnRUeUvJfiImut9c3GDQYS4Cx59s9vk2ADaR1z5QGiHaxuen8AhhS+r1YveRVzDK+v0dBMS/9Ev3ACmb8lxWGir3mS4qruxwLS2B/0D+IESXVlrLBUhnIEgBW1Sgg8nuR9xYziTzjfxCaYNoeHs90DVh7r4CKFQDyuJjGC1dzEVXouMVcC1cuImckd28nzZXKv/FDgK+21R7hQzmffDduwuvxUpRP5qVg6FvT4vS5/xVyxnw7cN6m971yeuYs/fbn0KMpDotJM4KaR+J0fb0dpZU7jYvnZPuP81BWKOQ+odyraIo/73BYybyVAJvexPPyWoUBQNpmxL365ozE3tTHAqU8CMb6llThvgl2ftojfPq0WGtvefqxZ2ODYTXuVacvGdrxIgVjxoFjiRKYJRYAYBRm2+MGcIRKfLwZMCBSe+gYwiCpLyb5N+V3EejSjWaCQA9mELEStEe/iNgv3XysOinj4hOOOt5KJG4FhJN9EOHoGoz3DTD8ptUBLvZPh2bUqEC9giO/cz1JGD+UjlG9SwgG3K1DabcvFhE6JFtwfH6zTN6fxL4eiPuQTAy0pIlZc+qymH7A8OTQ8L1wFSMhvlhMeg/CqOkT2YDBU6vCt9TrS46/osoasgrejwv4HcHoTOUAiAhOleEN6OSDTcLwCdIcPdJYG6eDBy X-Forefront-PRVS: 0267E514F9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB2589; 23:ah97/b4xhWP1JpBXpCMzjiq6cxDmpSKCvD2KINYey?= =?us-ascii?Q?ArpF9S5umpfknF2c8sedvLi8od6z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SUiZqC/XUj+rwTlBlHGALcmwknMHQ/hILLt/GCy+GNSiOluTIiaGDqYxy8wq5mSAiLlKCRjAggmEcwLZYsvwT/qnE527DQdQlclEBNHH+asUKRZhbBGtWxRNbWEwuknRXmGgxQ2tpitWzVTBRibKKtqLEGNBJyMArPPTjynWipHgtToMiE01AyEmsunXAF3yNW81gkW/VocrH3u+sTJMwmu/SK6YE4F7etfUZRMiawp3mR5GKm42vHduA060OjnpZS2j9OQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2017 23:42:35.6288 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2589 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.82 Subject: [Qemu-devel] [PATCH v1 2/5] cadence_gem: Correct the multi-queue can rx logic 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: alistair23@gmail.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Correct the buffer descriptor busy logic to work correctly when using multiple queues. Signed-off-by: Alistair Francis --- hw/net/cadence_gem.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 17c229d..3e37665 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -481,14 +481,18 @@ static int gem_can_receive(NetClientState *nc) } for (i = 0; i < s->num_priority_queues; i++) { - if (rx_desc_get_ownership(s->rx_desc[i]) == 1) { - if (s->can_rx_state != 2) { - s->can_rx_state = 2; - DB_PRINT("can't receive - busy buffer descriptor (q%d) 0x%x\n", - i, s->rx_desc_addr[i]); - } - return 0; + if (rx_desc_get_ownership(s->rx_desc[i]) != 1) { + break; + } + }; + + if (i == s->num_priority_queues) { + if (s->can_rx_state != 2) { + s->can_rx_state = 2; + DB_PRINT("can't receive - busy buffer descriptor (q%d) 0x%x\n", + i, s->rx_desc_addr[i]); } + return 0; } if (s->can_rx_state != 0) {