Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3570593ybl; Mon, 12 Aug 2019 02:46:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpFqbz0oiJt6DxPBH/ODGs/wgeYyP2awptgRzAFhybuaawsuDOXbTBdAUxOu00c3i3IzeK X-Received: by 2002:aa7:8ad0:: with SMTP id b16mr34611780pfd.45.1565603170834; Mon, 12 Aug 2019 02:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565603170; cv=none; d=google.com; s=arc-20160816; b=zO1I/5pIqhzq4DwvB2TBFmQGy7AL8Sjw9G8+uqOVc4FkQgSNxwV6wIXs++1rlYV+/K MGLZoLXrzQUk5mLsiDLRIOQUZlNvFCthi2MVSh8GqY9Y8xC8tDuG4uU6bt54hlLIsUo8 F91H5uim6QKgB+so2rT7gpqvWqLcnZyPaH70U/sCr9QLCvA8QQJ6yUK8Vo1a3yhY62lX biliqYyjVh3mOjsrhW3LdAgeSYKbuWK7b9Nq4MgVxBYhNxvZVaP0I+xOPHMgDnZ5wzaO NY1IuT7XTHINAN1s724LIAnzQ0RcKufALBbXyx+hUgouIeoWorP3wzx5jFVIDBtIRlxR 4sEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=QoixdlAXgg+79lGa3KsYsUmtXnKy0L+iCM+V62uKnQw=; b=pc9dKh3IjPjzLYC/DqCTVwrZynaK8ZJlb2VVaMlGQGJrEdqxlxM0PhlFFEB/WfwXB3 jdnuJjkk3tkX6rvwubOW4UoOOzECZ+Fb8k5kvuhkczWNKoPSHuZgv0TgWQWTMvZSvlCv ONsZRBqz6fzataumEZLl71CBqDtzC1xbo4DM+qB2UgXG754AQD/AHozFDlImIolUK5JT Cjx1wHI1+Zexd6b2JbRWmmz+LVSTxmnXtUMzISWvUA6WL+xQDQRMhkcCxunXz7kD7SgC n3wC9jT9Sl8teu37lfYAA6DHG0MF4EboPbSRRVHAkoNQQWjwWRGNgoKGZFYNUdxzLNTc BjHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Yzh+UtJX; 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=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si32347072pgs.322.2019.08.12.02.45.56; Mon, 12 Aug 2019 02:46:10 -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=@synopsys.com header.s=mail header.b=Yzh+UtJX; 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=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727625AbfHLJob (ORCPT + 99 others); Mon, 12 Aug 2019 05:44:31 -0400 Received: from smtprelay-out1.synopsys.com ([198.182.61.142]:50840 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727451AbfHLJoZ (ORCPT ); Mon, 12 Aug 2019 05:44:25 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (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 554CCC2174; Mon, 12 Aug 2019 09:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1565603064; bh=XI2I5+R2SHYrVzVFNLd0PzPsC/OJn37cwzcytnQNIFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Yzh+UtJXRTy7CZaq//jhIE4TfQrTXnO3X+9iI6w3THwON/FTW9jcK8Rkuh8kp5SEh mXBDg+XMGOhlvHqt9d9U61+VIuaagGR+e5CR5B/V6QSe9zQ7/YVU0Obhc+jZzYOj7D z/5O5/bk8DVYyCUg9xjS/oZRtNjVoWQMAIT24BbgkYex7bJSSAQUhLMrgdZ+HYj57t VwMtHdf5lxha72iEy861nZSsra7BWIEgDcIvtZs/dSy6TRYYGnzdjqGgFA6+oo+UAo IuAIpwEb5tA89Pes+3qChOdFywGFHJSGdQRoI/ntYuo1PnkGTG2b23Ci35uR9EXx1C b/5j56GPWxbQQ== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id F1343A0062; Mon, 12 Aug 2019 09:44:22 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 03/12] net: stmmac: xgmac: Correctly return that RX descriptor is not last one Date: Mon, 12 Aug 2019 11:44:02 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 2391ede97597..717b50d4aa93 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) -- 2.7.4