From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Chevallier Subject: [PATCH net-next 4/4] net: mvpp2: Use htons when checking protocol info Date: Thu, 28 Jun 2018 14:42:07 +0200 Message-ID: <20180628124207.11635-5-maxime.chevallier@bootlin.com> References: <20180628124207.11635-1-maxime.chevallier@bootlin.com> Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com To: davem@davemloft.net Return-path: In-Reply-To: <20180628124207.11635-1-maxime.chevallier@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org When checking the skb->protocol field, we have to make sure we use the proper endianness using htons, and not swab16. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index ded187a20b6c..88f3da184d76 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -1738,7 +1738,7 @@ static u32 mvpp2_txq_desc_csum(int l3_offs, int l3_proto, command |= (ip_hdr_len << MVPP2_TXD_IP_HLEN_SHIFT); command |= MVPP2_TXD_IP_CSUM_DISABLE; - if (l3_proto == swab16(ETH_P_IP)) { + if (l3_proto == htons(ETH_P_IP)) { command &= ~MVPP2_TXD_IP_CSUM_DISABLE; /* enable IPv4 csum */ command &= ~MVPP2_TXD_L3_IP6; /* enable IPv4 */ } else { -- 2.11.0