Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp983159ybx; Thu, 31 Oct 2019 04:04:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNomIlxYrjuFP77RQD1FgDfMEogXgwIK21NRQpFEAA/1GPYtZ5DLdNoCI2Ui/0pP/MEMgH X-Received: by 2002:a17:906:e2cb:: with SMTP id gr11mr3264381ejb.205.1572519875737; Thu, 31 Oct 2019 04:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572519875; cv=none; d=google.com; s=arc-20160816; b=ySp3y2U8/YMltt1kX17BKncKC9sBSpolCeLq42QCzBr7LDN7vnSUxagDBh0XEJErr1 v5FiLBXg5cBz8MMSud44SMzwTvtTBeQXCWHXFxZz17/JVC1MEthRCaJdezppIaznfdmu qI7cDrHiuML+lW9+PHcaFRo24/fyuBbK38x2cOY+aFhVwc1LYtf9k5YDdr/Fp/4Hh0Z7 nSneTkfuK68vlubuX9qSpOgrPns2C0NiOJ9PmKomP+xE4vXWbF8taFAQV8Iy12fhhfGb /QALPwE+p2nhQnub6I6F0QrGpqY7+2avXCAsN5Si4yAxsw05kJzxW99A0K6BEHWOdx6p h69Q== 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=kQD9en47/ExTjlIravlL6Hk8PdZ33kPI6rhen1SN+7k=; b=Nfgol4IHgbIXpFGFZuGNEaaqi2gMCXwNzwCesGwyQlnfALHgH1oUg5tOBr/Z9UHgsN wVbqaZeSU3HTX1ATHkNzUTFqo+io47lb1SIMnLjPntzmKXCcqsFBIz+mbc2yxASTbOly ryIHxPzb5CccDVG+MvAVOIrZg3A3Eol7tH+zBG0jx5PJptbDBMcvoLLYvW5PsGtadmor HHxZL2M/1e2POUe1oQyurzpIF1tRCtBh8QzGuBZbPNYR21PwdSZj/4PG45sWP9qwgX+V VvrvtlfoNm5AbSZLR1cOnld4suGwB11HnuanrQmsrm+58iCTI/UifOg28NRWmqCPkqNs kxzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=JasDuHEj; 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 z24si3437047ejb.118.2019.10.31.04.04.10; Thu, 31 Oct 2019 04:04:35 -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=JasDuHEj; 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 S1727576AbfJaLBR (ORCPT + 99 others); Thu, 31 Oct 2019 07:01:17 -0400 Received: from us03-smtprelay2.synopsys.com ([149.117.87.133]:59436 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727348AbfJaLBD (ORCPT ); Thu, 31 Oct 2019 07:01:03 -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 7ADC1C08AF; Thu, 31 Oct 2019 11:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1572519662; bh=WOrHnH2Cw3T6U8+gS8Ru/YnMbaTqsbVhoS8x//3uSik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=JasDuHEj5pNvCLT7DTbMtslrySsnWajObl0IO41Afnp2rMgs+oUQyaTwwsyYSbBUA 9Vv6MET2sj9KRxtYHiKomn8goinSwGSoNTKphJQFQw+RD677vTj1x6Sb4IqpXcoQiO gYnk2rlpGE1tWfyOqqvv+rFitdSjCdrbs3b+pobv+GKdGGqqCV6FkcR1QEfcMvgks0 fgJ5cZx+hwSbzW9Sbjd8/gLOE+ZuVjqR/GqSUINK8ihs0AnbD2gnPShGoOfuwhmY4Y EM40obcCRZ+KJ5+WMophT1zsLjTAlC851qjFp8IsbNpZxPmz8DTlVRo9fbdsnGhul9 VAgG52/blLdgQ== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 21584A0073; Thu, 31 Oct 2019 11:01:00 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "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 v2 05/10] net: stmmac: xgmac: Only get SPH header len if available Date: Thu, 31 Oct 2019 12:00:43 +0100 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 Split Header length is only available when L34T != 0. Fix this by correctly checking if L34T is not zero before trying to get Header length. Fixes: 67afd6d1cfdf ("net: stmmac: Add Split Header support and enable it in XGMAC cores") 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c index ae48154f933c..bd5838ce1e8a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c @@ -288,7 +288,8 @@ static int dwxgmac2_get_rx_hash(struct dma_desc *p, u32 *hash, static int dwxgmac2_get_rx_header_len(struct dma_desc *p, unsigned int *len) { - *len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL; + if (le32_to_cpu(p->des3) & XGMAC_RDES3_L34T) + *len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL; return 0; } -- 2.7.4