From patchwork Sat Aug 17 18:54:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 11099289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C76F71395 for ; Sat, 17 Aug 2019 18:57:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4FE426E55 for ; Sat, 17 Aug 2019 18:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A884628421; Sat, 17 Aug 2019 18:57:27 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50CB526E55 for ; Sat, 17 Aug 2019 18:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=T1DtYGf/9mJFFqAJ8+HgGYQrO1xpn+JKTFjREPOWce4=; b=K9oapxoKFqfAkDVW2DnrAJE3Os MxhP2D7PVSuxYxshLe5GRk8HfyX6Q39Ctg4rNvY8VG+JRKXqDkHCU+Cylv/+VrwCjRMuQS0DqTsdi KZUGB+2xcw1PJzi4rILO+zRxxsADQ+wMlj5xdQJptdbVkuIGjqO6BHUOBco9fj2kDD6QvfFmpHFgu vIrI7CzQ8cvG5ZY6w2JV9R3vfByBAGxEO/M8HkXOlfeyZShuyqu294T6ihhH9ZcslSVy7RNV0Az3Q v3pNBrqPqWPTyBaY/9Qee60kGvxteDPvBEyiTOz0CKwKgvVpEA205OTaHZNyITRKItCCd484XsqwZ I6c4LTsg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hz3tG-0002QE-DW; Sat, 17 Aug 2019 18:57:26 +0000 Received: from dc2-smtprelay2.synopsys.com ([198.182.61.142] helo=smtprelay-out1.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hz3qu-0007Zh-1m for linux-arm-kernel@lists.infradead.org; Sat, 17 Aug 2019 18:55:06 +0000 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id BEA96C0E36; Sat, 17 Aug 2019 18:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1566068097; bh=iq3hH5ItBLwsoXkEnES6jnm2/Kr55SPPUNaF8bdtcgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=flXQjdRy23IKOACVe4vUHEwQk9nkWtlpBc92ya2dKyRbyGwHg3uqI4msAUVfblUkk +h9u606CJI0uh/iNi5vkeNIh5cfVlkFfTPRtsyPMyCekLhN4Bd+w5h36WebywlN1HG 75QOLoCYYdoW/Y3v3mE7AKFu48zSDZRaXH61blyx0vvhJ3yqHz7HiErdAf7Crah/Ii pfBOzoWUnJCxR7gCc2Em5qDTCfiqt3xZdhR2Xie1vX8uNcyAvtOeBg2i9wyOoi8k/H ITdoHrmXujFC4JqvmQd05CFnzljo6ep3QLnod2i/QvQmz7wyRPRjT/b5g1cu80T9X5 BnT0kjW15/33A== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 836B4A0068; Sat, 17 Aug 2019 18:54:55 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Subject: [PATCH net-next v3 03/12] net: stmmac: xgmac: Correctly return that RX descriptor is not last one Date: Sat, 17 Aug 2019 20:54:42 +0200 Message-Id: <6d563e40fd326f61cc104ab455264b49c77e569b.1566067802.git.joabreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190817_115500_113375_D141494D X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Joao Pinto , Jakub Kicinski , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Giuseppe Cavallaro , "David S. Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Return the correct value when RX descriptor is not the last one. Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c index 58b69fa97837..2c1ed8c2a9d3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c @@ -26,16 +26,15 @@ static int dwxgmac2_get_rx_status(void *data, struct stmmac_extra_stats *x, struct dma_desc *p) { unsigned int rdes3 = le32_to_cpu(p->des3); - int ret = good_frame; if (unlikely(rdes3 & XGMAC_RDES3_OWN)) return dma_own; if (likely(!(rdes3 & XGMAC_RDES3_LD))) + return rx_not_ls; + if (unlikely((rdes3 & XGMAC_RDES3_ES) && (rdes3 & XGMAC_RDES3_LD))) return discard_frame; - if (unlikely(rdes3 & XGMAC_RDES3_ES)) - ret = discard_frame; - return ret; + return good_frame; } static int dwxgmac2_get_tx_len(struct dma_desc *p)