* [PATCH] infiniband: fix for NIPQUAD removal
@ 2009-01-11 5:26 Harvey Harrison
2009-01-11 5:46 ` Roland Dreier
2009-02-17 14:08 ` [PATCH 1/1 net-next] Breno Leitao
0 siblings, 2 replies; 4+ messages in thread
From: Harvey Harrison @ 2009-01-11 5:26 UTC (permalink / raw)
To: David Miller, Roland Dreier; +Cc: linux-netdev
commit 63779436ab4ad0867bcea53bf853b0004d7b895di (drivers: replace NIPQUAD())
accidentally replaced some HIPQUAD()s causing IP addresses to be
printed in reverse order, add temporary local vars until the byteswapping
can be pushed further up the stack.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
drivers/infiniband/hw/nes/nes_cm.c | 12 +++++++++---
drivers/infiniband/hw/nes/nes_utils.c | 4 +++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 6ba57e9..a01b448 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -778,12 +778,13 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
unsigned long flags;
struct list_head *hte;
struct nes_cm_node *cm_node;
+ __be32 tmp_addr = cpu_to_be32(loc_addr);
/* get a handle on the hte */
hte = &cm_core->connected_nodes;
nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n",
- &loc_addr, loc_port, cm_core, hte);
+ &tmp_addr, loc_port, cm_core, hte);
/* walk list and find cm_node associated with this session ID */
spin_lock_irqsave(&cm_core->ht_lock, flags);
@@ -816,6 +817,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
{
unsigned long flags;
struct nes_cm_listener *listen_node;
+ __be32 tmp_addr = cpu_to_be32(dst_addr);
/* walk list and find cm_node associated with this session ID */
spin_lock_irqsave(&cm_core->listen_list_lock, flags);
@@ -833,7 +835,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n",
- &dst_addr, dst_port);
+ &tmp_addr, dst_port);
/* no listener */
return NULL;
@@ -2059,6 +2061,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
struct tcphdr *tcph;
struct nes_cm_info nfo;
int skb_handled = 1;
+ __be32 tmp_daddr, tmp_saddr;
if (!skb)
return 0;
@@ -2074,8 +2077,11 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
nfo.rem_addr = ntohl(iph->saddr);
nfo.rem_port = ntohs(tcph->source);
+ tmp_daddr = cpu_to_be32(iph->daddr);
+ tmp_saddr = cpu_to_be32(iph->saddr);
+
nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n",
- &iph->daddr, tcph->dest, &iph->saddr, tcph->source);
+ &tmp_daddr, tcph->dest, &tmp_saddr, tcph->source);
do {
cm_node = find_node(cm_core,
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index aa9b734..6f3bc1b 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -655,6 +655,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
struct nes_adapter *nesadapter = nesdev->nesadapter;
int arp_index;
int err = 0;
+ __be32 tmp_addr;
for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) {
if (nesadapter->arp_table[arp_index].ip_addr == ip_addr)
@@ -682,8 +683,9 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
/* DELETE or RESOLVE */
if (arp_index == nesadapter->arp_table_size) {
+ tmp_addr = cpu_to_be32(ip_addr);
nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n",
- &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
+ &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
return -1;
}
--
1.6.1.94.g9388
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] infiniband: fix for NIPQUAD removal
2009-01-11 5:26 [PATCH] infiniband: fix for NIPQUAD removal Harvey Harrison
@ 2009-01-11 5:46 ` Roland Dreier
2009-02-17 14:08 ` [PATCH 1/1 net-next] Breno Leitao
1 sibling, 0 replies; 4+ messages in thread
From: Roland Dreier @ 2009-01-11 5:46 UTC (permalink / raw)
To: Harvey Harrison; +Cc: David Miller, linux-netdev
applied, thanks a lot for fixing this.
any further work you want to do in cleaning up some of the endian mess
in this driver would be gratefully received :)
- R.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1 net-next]
2009-01-11 5:26 [PATCH] infiniband: fix for NIPQUAD removal Harvey Harrison
2009-01-11 5:46 ` Roland Dreier
@ 2009-02-17 14:08 ` Breno Leitao
2009-02-17 14:13 ` [PATCH 1/1 net-next] Fix infiniband warnings Breno Leitao
1 sibling, 1 reply; 4+ messages in thread
From: Breno Leitao @ 2009-02-17 14:08 UTC (permalink / raw)
To: Harvey Harrison; +Cc: David Miller, Roland Dreier, linux-netdev
Commit 03080e5cbe0222744173d3e726f6ba5d13b7f04e is causing some warning
during compilation.
tmp_addr is an unused variable if CONFIG_INFINIBAND_NES_DEBUG is
not used. Causing the following Warning.
drivers/infiniband/hw/nes/nes_cm.c: In function ‘find_node’:
drivers/infiniband/hw/nes/nes_cm.c:781: warning: unused variable ‘tmp_addr’
drivers/infiniband/hw/nes/nes_cm.c: In function ‘find_listener’:
drivers/infiniband/hw/nes/nes_cm.c:820: warning: unused variable ‘tmp_addr’
Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
---
drivers/infiniband/hw/nes/nes_cm.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index a01b448..2b34859 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -778,7 +778,9 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
unsigned long flags;
struct list_head *hte;
struct nes_cm_node *cm_node;
+#ifdef CONFIG_INFINIBAND_NES_DEBUG
__be32 tmp_addr = cpu_to_be32(loc_addr);
+#endif
/* get a handle on the hte */
hte = &cm_core->connected_nodes;
@@ -817,7 +819,9 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
{
unsigned long flags;
struct nes_cm_listener *listen_node;
+#ifdef CONFIG_INFINIBAND_NES_DEBUG
__be32 tmp_addr = cpu_to_be32(dst_addr);
+#endif
/* walk list and find cm_node associated with this session ID */
spin_lock_irqsave(&cm_core->listen_list_lock, flags);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/1 net-next] Fix infiniband warnings
2009-02-17 14:08 ` [PATCH 1/1 net-next] Breno Leitao
@ 2009-02-17 14:13 ` Breno Leitao
0 siblings, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2009-02-17 14:13 UTC (permalink / raw)
To: Harvey Harrison, Roland Dreier; +Cc: David Miller, linux-netdev
Commit 03080e5cbe0222744173d3e726f6ba5d13b7f04e is causing some warning
during compilation.
tmp_addr is an unused variable if CONFIG_INFINIBAND_NES_DEBUG is
not used. Causing the following Warning.
drivers/infiniband/hw/nes/nes_cm.c: In function ‘find_node’:
drivers/infiniband/hw/nes/nes_cm.c:781: warning: unused variable ‘tmp_addr’
drivers/infiniband/hw/nes/nes_cm.c: In function ‘find_listener’:
drivers/infiniband/hw/nes/nes_cm.c:820: warning: unused variable ‘tmp_addr’
Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
---
drivers/infiniband/hw/nes/nes_cm.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index a01b448..2b34859 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -778,7 +778,9 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
unsigned long flags;
struct list_head *hte;
struct nes_cm_node *cm_node;
+#ifdef CONFIG_INFINIBAND_NES_DEBUG
__be32 tmp_addr = cpu_to_be32(loc_addr);
+#endif
/* get a handle on the hte */
hte = &cm_core->connected_nodes;
@@ -817,7 +819,9 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
{
unsigned long flags;
struct nes_cm_listener *listen_node;
+#ifdef CONFIG_INFINIBAND_NES_DEBUG
__be32 tmp_addr = cpu_to_be32(dst_addr);
+#endif
/* walk list and find cm_node associated with this session ID */
spin_lock_irqsave(&cm_core->listen_list_lock, flags);
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-17 14:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 5:26 [PATCH] infiniband: fix for NIPQUAD removal Harvey Harrison
2009-01-11 5:46 ` Roland Dreier
2009-02-17 14:08 ` [PATCH 1/1 net-next] Breno Leitao
2009-02-17 14:13 ` [PATCH 1/1 net-next] Fix infiniband warnings Breno Leitao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.