Patchwork qlge: fix endian issue

login
register
mail settings
Submitter roy.qing.li@gmail.com
Date July 3, 2012, 8:47 a.m.
Message ID <1341305276-17053-1-git-send-email-roy.qing.li@gmail.com>
Download mbox | patch
Permalink /patch/168736/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

roy.qing.li@gmail.com - July 3, 2012, 8:47 a.m.
From: RongQing.Li <roy.qing.li@gmail.com>

commit 6d29b1ef introduces a bug, ntohs is __be16_to_cpu,
not cpu_to_be16.

We always use htons on IP_OFFSET and IP_MF, then compare
with network package.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
David Miller - July 3, 2012, 9:22 a.m.
From: roy.qing.li@gmail.com
Date: Tue,  3 Jul 2012 16:47:56 +0800

> Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>

Is "RongQing.Li" really how you would write your name?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
roy.qing.li@gmail.com - July 3, 2012, 9:44 a.m.
2012/7/3 David Miller <davem@davemloft.net>:
> From: roy.qing.li@gmail.com
> Date: Tue,  3 Jul 2012 16:47:56 +0800
>
>> Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
>
> Is "RongQing.Li" really how you would write your name?

Yes

Chinese name, Li RongQing

I maybe should not add the dot.

-RongQing
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - July 3, 2012, 9:47 a.m.
From: RongQing Li <roy.qing.li@gmail.com>
Date: Tue, 3 Jul 2012 17:44:58 +0800

> I maybe should not add the dot.

That's what I'm trying to say.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 09d8d33..7c520fa 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -1546,7 +1546,7 @@  static void ql_process_mac_rx_page(struct ql_adapter *qdev,
 			struct iphdr *iph =
 				(struct iphdr *) ((u8 *)addr + ETH_HLEN);
 			if (!(iph->frag_off &
-				cpu_to_be16(IP_MF|IP_OFFSET))) {
+				htons(IP_MF|IP_OFFSET))) {
 				skb->ip_summed = CHECKSUM_UNNECESSARY;
 				netif_printk(qdev, rx_status, KERN_DEBUG,
 					     qdev->ndev,
@@ -1654,7 +1654,7 @@  static void ql_process_mac_rx_skb(struct ql_adapter *qdev,
 			/* Unfragmented ipv4 UDP frame. */
 			struct iphdr *iph = (struct iphdr *) skb->data;
 			if (!(iph->frag_off &
-				ntohs(IP_MF|IP_OFFSET))) {
+				htons(IP_MF|IP_OFFSET))) {
 				skb->ip_summed = CHECKSUM_UNNECESSARY;
 				netif_printk(qdev, rx_status, KERN_DEBUG,
 					     qdev->ndev,
@@ -1968,7 +1968,7 @@  static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev,
 		/* Unfragmented ipv4 UDP frame. */
 			struct iphdr *iph = (struct iphdr *) skb->data;
 			if (!(iph->frag_off &
-				ntohs(IP_MF|IP_OFFSET))) {
+				htons(IP_MF|IP_OFFSET))) {
 				skb->ip_summed = CHECKSUM_UNNECESSARY;
 				netif_printk(qdev, rx_status, KERN_DEBUG, qdev->ndev,
 					     "TCP checksum done!\n");