Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp638123pxv; Thu, 15 Jul 2021 12:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZEYNtrZKaO3vkDgLYyaknxe+zqMrELE6rf3hCnRC4P7z/N13zmlnCHjqKYweU9dFVzFP0 X-Received: by 2002:aa7:da13:: with SMTP id r19mr9240534eds.252.1626376161872; Thu, 15 Jul 2021 12:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376161; cv=none; d=google.com; s=arc-20160816; b=WQwLZh8sOzUaS4/RjOPReJ/kPp+q7OwcwEStu2QPUWLYGpmy0ndYvRfkzybBVXiW+x ahN9pF5y/tSk4icek9Uyis8kPEIxwmPcPjLGGDz2D/oKW/ALGYQIMrzc51nXNhiKsY6r 54MZTLmETdih2ZXhMKbKNIVJJneQyf5l4yZMD9CeZou3Y7OmyY9eiS6di1qE891iGX8g goNum3VCNBWSb9YXwdzDI0uhiQzq0iaJsn/J42gw1CmhT5Yef+NCqKcThzt144rOVUci rt0R02xeh7oiuHoLoQiSbpZVS2yRfA2pwUMqqjK3p2IFOFMeJauRpZsBsYoUW+Lf8gPr SvOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JK874M1rCv6KF4WhF7b5SPesfVgDVNEZfalT9QrcwtI=; b=fMxfrpEGKAyQAyoou2WdUGMeHPsBvtFaOcdF6fLKfkgLMsbeajKUe48Sfozl/HYxNX 9Z5VztCTUFdkgo+ENrdRPuaw4etj1/e3tLCqd7hsVN4LMgbw53khjI5bvZRDWRmFe0Ob dGUTgKV9YTLSq9jB8OAIuDyo/Vp4HIHjd6BlwSwFTX1o9raAIDo0RtePYCCDtqFm5ec0 amZAvx0tAcp8TyUsPsetQQLzIBPJ5GrLyMeMgvX7UkJF0SpBaKeSM0j+TQ8Nf2ykyj6Y In26HD921QU0cjgCw5vOk8Ur6xyg4HRKv5MRIz1qQrT3Pca4xLzRPu2FU+7Au01y+bBu 1Ymw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hx0D3QQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si8290403ejk.550.2021.07.15.12.08.58; Thu, 15 Jul 2021 12:09:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hx0D3QQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242824AbhGOTJR (ORCPT + 99 others); Thu, 15 Jul 2021 15:09:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:34266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241273AbhGOS6E (ORCPT ); Thu, 15 Jul 2021 14:58:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 097D0613E9; Thu, 15 Jul 2021 18:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375308; bh=gyNbe78AFY1UzqreDnREF1h2G5X1Dv9nW1W/K3xfdW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hx0D3QQJ110Wshk91T1U71nQK45+jfm2PAzfMiM8P6cbPvb29817nQZoZ2NA/FdYI blohLhB31GB+wcPqiDKsFPAEEInrhdqTwcSiQoDsQYmpRA7U8VNR0Z9H6R/TqCfd/+ aC+0km7Wr/I8XTBkqBUufmo86LbQBpxJVgRTuW0A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesse Brandeburg , Dave Switzer , Tony Nguyen , Sasha Levin Subject: [PATCH 5.12 033/242] igb: fix assignment on big endian machines Date: Thu, 15 Jul 2021 20:36:35 +0200 Message-Id: <20210715182557.789971903@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jesse Brandeburg [ Upstream commit b514958dd1a3bd57638b0e63b8e5152b1960e6aa ] The igb driver was trying hard to be sparse correct, but somehow ended up converting a variable into little endian order and then tries to OR something with it. A much plainer way of doing things is to leave all variables and OR operations in CPU (non-endian) mode, and then convert to little endian only once, which is what this change does. This probably fixes a bug that might have been seen only on big endian systems. Signed-off-by: Jesse Brandeburg Tested-by: Dave Switzer Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 894b9b87dba1..434220a342df 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -6277,12 +6277,12 @@ int igb_xmit_xdp_ring(struct igb_adapter *adapter, cmd_type |= len | IGB_TXD_DCMD; tx_desc->read.cmd_type_len = cpu_to_le32(cmd_type); - olinfo_status = cpu_to_le32(len << E1000_ADVTXD_PAYLEN_SHIFT); + olinfo_status = len << E1000_ADVTXD_PAYLEN_SHIFT; /* 82575 requires a unique index per ring */ if (test_bit(IGB_RING_FLAG_TX_CTX_IDX, &tx_ring->flags)) olinfo_status |= tx_ring->reg_idx << 4; - tx_desc->read.olinfo_status = olinfo_status; + tx_desc->read.olinfo_status = cpu_to_le32(olinfo_status); netdev_tx_sent_queue(txring_txq(tx_ring), tx_buffer->bytecount); -- 2.30.2