* [PATCH] infiniband: use %p6 for printing message ids
@ 2008-10-28 21:38 Harvey Harrison
2008-10-28 22:00 ` Roland Dreier
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Harvey Harrison @ 2008-10-28 21:38 UTC (permalink / raw)
To: David Miller; +Cc: Joe Perches, linux-netdev
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
drivers/infiniband/core/sysfs.c | 10 +---------
drivers/infiniband/hw/mthca/mthca_mcg.c | 23 ++---------------------
drivers/infiniband/ulp/srp/ib_srp.c | 31 ++++---------------------------
drivers/net/mlx4/mcg.c | 23 ++---------------------
4 files changed, 9 insertions(+), 78 deletions(-)
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 4d10421..e985193 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -262,15 +262,7 @@ static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr,
if (ret)
return ret;
- return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
- be16_to_cpu(((__be16 *) gid.raw)[0]),
- be16_to_cpu(((__be16 *) gid.raw)[1]),
- be16_to_cpu(((__be16 *) gid.raw)[2]),
- be16_to_cpu(((__be16 *) gid.raw)[3]),
- be16_to_cpu(((__be16 *) gid.raw)[4]),
- be16_to_cpu(((__be16 *) gid.raw)[5]),
- be16_to_cpu(((__be16 *) gid.raw)[6]),
- be16_to_cpu(((__be16 *) gid.raw)[7]));
+ return sprintf(buf, "%p6\n", gid.raw);
}
static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr,
diff --git a/drivers/infiniband/hw/mthca/mthca_mcg.c b/drivers/infiniband/hw/mthca/mthca_mcg.c
index 3f5f948..693bed0 100644
--- a/drivers/infiniband/hw/mthca/mthca_mcg.c
+++ b/drivers/infiniband/hw/mthca/mthca_mcg.c
@@ -87,17 +87,7 @@ static int find_mgm(struct mthca_dev *dev,
}
if (0)
- mthca_dbg(dev, "Hash for %04x:%04x:%04x:%04x:"
- "%04x:%04x:%04x:%04x is %04x\n",
- be16_to_cpu(((__be16 *) gid)[0]),
- be16_to_cpu(((__be16 *) gid)[1]),
- be16_to_cpu(((__be16 *) gid)[2]),
- be16_to_cpu(((__be16 *) gid)[3]),
- be16_to_cpu(((__be16 *) gid)[4]),
- be16_to_cpu(((__be16 *) gid)[5]),
- be16_to_cpu(((__be16 *) gid)[6]),
- be16_to_cpu(((__be16 *) gid)[7]),
- *hash);
+ mthca_dbg(dev, "Hash for %p6 is %04x\n", gid, *hash);
*index = *hash;
*prev = -1;
@@ -264,16 +254,7 @@ int mthca_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
goto out;
if (index == -1) {
- mthca_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
- "not found\n",
- be16_to_cpu(((__be16 *) gid->raw)[0]),
- be16_to_cpu(((__be16 *) gid->raw)[1]),
- be16_to_cpu(((__be16 *) gid->raw)[2]),
- be16_to_cpu(((__be16 *) gid->raw)[3]),
- be16_to_cpu(((__be16 *) gid->raw)[4]),
- be16_to_cpu(((__be16 *) gid->raw)[5]),
- be16_to_cpu(((__be16 *) gid->raw)[6]),
- be16_to_cpu(((__be16 *) gid->raw)[7]));
+ mthca_err(dev, "MGID %p6 not found\n", gid->raw);
err = -EINVAL;
goto out;
}
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 5b8b533..bc82531 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1514,15 +1514,7 @@ static ssize_t show_dgid(struct device *dev, struct device_attribute *attr,
target->state == SRP_TARGET_REMOVED)
return -ENODEV;
- return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[0]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[1]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[2]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[3]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[4]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[5]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[6]),
- be16_to_cpu(((__be16 *) target->path.dgid.raw)[7]));
+ return sprintf(buf, "%p6\n", target->path.dgid.raw);
}
static ssize_t show_orig_dgid(struct device *dev,
@@ -1534,15 +1526,7 @@ static ssize_t show_orig_dgid(struct device *dev,
target->state == SRP_TARGET_REMOVED)
return -ENODEV;
- return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
- be16_to_cpu(target->orig_dgid[0]),
- be16_to_cpu(target->orig_dgid[1]),
- be16_to_cpu(target->orig_dgid[2]),
- be16_to_cpu(target->orig_dgid[3]),
- be16_to_cpu(target->orig_dgid[4]),
- be16_to_cpu(target->orig_dgid[5]),
- be16_to_cpu(target->orig_dgid[6]),
- be16_to_cpu(target->orig_dgid[7]));
+ return sprintf(buf, "%p6\n", target->orig_dgid);
}
static ssize_t show_zero_req_lim(struct device *dev,
@@ -1883,19 +1867,12 @@ static ssize_t srp_create_target(struct device *dev,
shost_printk(KERN_DEBUG, target->scsi_host, PFX
"new target: id_ext %016llx ioc_guid %016llx pkey %04x "
- "service_id %016llx dgid %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
+ "service_id %016llx dgid %p6\n",
(unsigned long long) be64_to_cpu(target->id_ext),
(unsigned long long) be64_to_cpu(target->ioc_guid),
be16_to_cpu(target->path.pkey),
(unsigned long long) be64_to_cpu(target->service_id),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[0]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[2]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[4]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[6]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[8]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[10]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[12]),
- (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[14]));
+ target->path.dgid.raw);
ret = srp_create_target_ib(target);
if (ret)
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index 592c01a..6f79e84 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -118,17 +118,7 @@ static int find_mgm(struct mlx4_dev *dev,
return err;
if (0)
- mlx4_dbg(dev, "Hash for %04x:%04x:%04x:%04x:"
- "%04x:%04x:%04x:%04x is %04x\n",
- be16_to_cpu(((__be16 *) gid)[0]),
- be16_to_cpu(((__be16 *) gid)[1]),
- be16_to_cpu(((__be16 *) gid)[2]),
- be16_to_cpu(((__be16 *) gid)[3]),
- be16_to_cpu(((__be16 *) gid)[4]),
- be16_to_cpu(((__be16 *) gid)[5]),
- be16_to_cpu(((__be16 *) gid)[6]),
- be16_to_cpu(((__be16 *) gid)[7]),
- *hash);
+ mlx4_dbg(dev, "Hash for %p6 is %04x\n", gid, *hash);
*index = *hash;
*prev = -1;
@@ -277,16 +267,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
goto out;
if (index == -1) {
- mlx4_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
- "not found\n",
- be16_to_cpu(((__be16 *) gid)[0]),
- be16_to_cpu(((__be16 *) gid)[1]),
- be16_to_cpu(((__be16 *) gid)[2]),
- be16_to_cpu(((__be16 *) gid)[3]),
- be16_to_cpu(((__be16 *) gid)[4]),
- be16_to_cpu(((__be16 *) gid)[5]),
- be16_to_cpu(((__be16 *) gid)[6]),
- be16_to_cpu(((__be16 *) gid)[7]));
+ mlx4_err(dev, "MGID %p6 not found\n", gid);
err = -EINVAL;
goto out;
}
--
1.6.0.3.729.g6ea410
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] infiniband: use %p6 for printing message ids
2008-10-28 21:38 [PATCH] infiniband: use %p6 for printing message ids Harvey Harrison
@ 2008-10-28 22:00 ` Roland Dreier
2008-10-28 23:02 ` Joe Perches
2008-10-29 5:36 ` [PATCH] infiniband: use %p6 for printing message ids David Miller
2 siblings, 0 replies; 11+ messages in thread
From: Roland Dreier @ 2008-10-28 22:00 UTC (permalink / raw)
To: Harvey Harrison; +Cc: David Miller, Joe Perches, linux-netdev
Looks fine (once the p6 support goes in of course). You could also look
at IPOIB_GID_FMT in drivers/infiniband/ulp/ipoib for further things
worth converting. And I didn't notice if you already did it, but
drivers/net/mlx4 has lots of similar stuff to convert the same way as
you did for mthca.
Thanks,
Roland
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] infiniband: use %p6 for printing message ids
2008-10-28 21:38 [PATCH] infiniband: use %p6 for printing message ids Harvey Harrison
2008-10-28 22:00 ` Roland Dreier
@ 2008-10-28 23:02 ` Joe Perches
2008-10-28 23:07 ` Roland Dreier
2008-10-29 5:36 ` [PATCH] infiniband: use %p6 for printing message ids David Miller
2 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2008-10-28 23:02 UTC (permalink / raw)
To: Harvey Harrison, Roland Dreier; +Cc: David Miller, linux-netdev
On Tue, 2008-10-28 at 14:38 -0700, Harvey Harrison wrote:
> diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
> index 4d10421..e985193 100644
> --- a/drivers/infiniband/core/sysfs.c
> +++ b/drivers/infiniband/core/sysfs.c
> @@ -262,15 +262,7 @@ static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr,
> if (ret)
> return ret;
>
> - return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
> - be16_to_cpu(((__be16 *) gid.raw)[0]),
> - be16_to_cpu(((__be16 *) gid.raw)[1]),
> - be16_to_cpu(((__be16 *) gid.raw)[2]),
> - be16_to_cpu(((__be16 *) gid.raw)[3]),
> - be16_to_cpu(((__be16 *) gid.raw)[4]),
> - be16_to_cpu(((__be16 *) gid.raw)[5]),
> - be16_to_cpu(((__be16 *) gid.raw)[6]),
> - be16_to_cpu(((__be16 *) gid.raw)[7]));
> + return sprintf(buf, "%p6\n", gid.raw);
I'm not sure any of these should be converted like this.
Infiniband gids are not IPv6 addresses.
I think a new %p<foo> type (maybe: IB) type should be defined for these.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] infiniband: use %p6 for printing message ids
2008-10-28 23:02 ` Joe Perches
@ 2008-10-28 23:07 ` Roland Dreier
2008-10-28 23:22 ` Joe Perches
0 siblings, 1 reply; 11+ messages in thread
From: Roland Dreier @ 2008-10-28 23:07 UTC (permalink / raw)
To: Joe Perches; +Cc: Harvey Harrison, David Miller, linux-netdev
> I'm not sure any of these should be converted like this.
> Infiniband gids are not IPv6 addresses.
Actually, they are. The IB specification section 4.1 says:
"A GID is a valid 128-bit IPv6 address (per RFC 2373) with additional
properties / restrictions defined...."
and it makes sense to format an IB GID as an IPv6 address for display
(that's what the IB spec does; eg it mentions the "Multicast GID
FF02:0:0:0:0:0:0:1").
- R.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] infiniband: use %p6 for printing message ids
2008-10-28 23:07 ` Roland Dreier
@ 2008-10-28 23:22 ` Joe Perches
2008-10-29 0:16 ` [ofa-general] ***SPAM*** [PATCH] infiniband: Add struct in6_addr addr to union ib_gib Joe Perches
0 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2008-10-28 23:22 UTC (permalink / raw)
To: Roland Dreier; +Cc: Harvey Harrison, David Miller, linux-netdev
On Tue, 2008-10-28 at 16:07 -0700, Roland Dreier wrote:
> > I'm not sure any of these should be converted like this.
> > Infiniband gids are not IPv6 addresses.
>
> Actually, they are. The IB specification section 4.1 says:
>
> "A GID is a valid 128-bit IPv6 address (per RFC 2373) with additional
> properties / restrictions defined...."
>
> and it makes sense to format an IB GID as an IPv6 address for display
> (that's what the IB spec does; eg it mentions the "Multicast GID
> FF02:0:0:0:0:0:0:1").
Perhaps the union in ib_verbs
union ib_gid {
u8 raw[16];
struct {
__be64 subnet_prefix;
__be64 interface_id;
} global;
};
could/should include a struct in6_addr?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ofa-general] ***SPAM*** [PATCH] infiniband: Add struct in6_addr addr to union ib_gib
2008-10-28 23:22 ` Joe Perches
@ 2008-10-29 0:16 ` Joe Perches
2008-10-29 5:39 ` [ofa-general] " David Miller
0 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2008-10-29 0:16 UTC (permalink / raw)
To: Roland Dreier
Cc: linux-netdev, David Miller, general, Sean Hefty, Harvey Harrison
ib_gid's can be print'd using the new %p6 facility
Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 936e333..464ed9d 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -47,6 +47,7 @@
#include <linux/list.h>
#include <linux/rwsem.h>
#include <linux/scatterlist.h>
+#include <linux/in6.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
@@ -57,6 +58,7 @@ union ib_gid {
__be64 subnet_prefix;
__be64 interface_id;
} global;
+ struct in6_addr addr;
};
enum rdma_node_type {
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] infiniband: use %p6 for printing message ids
2008-10-28 21:38 [PATCH] infiniband: use %p6 for printing message ids Harvey Harrison
2008-10-28 22:00 ` Roland Dreier
2008-10-28 23:02 ` Joe Perches
@ 2008-10-29 5:36 ` David Miller
2 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2008-10-29 5:36 UTC (permalink / raw)
To: harvey.harrison; +Cc: joe, netdev
From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Tue, 28 Oct 2008 14:38:21 -0700
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ofa-general] Re: [PATCH] infiniband: Add struct in6_addr addr to union ib_gib
2008-10-29 0:16 ` [ofa-general] ***SPAM*** [PATCH] infiniband: Add struct in6_addr addr to union ib_gib Joe Perches
@ 2008-10-29 5:39 ` David Miller
2008-10-29 6:58 ` Joe Perches
0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2008-10-29 5:39 UTC (permalink / raw)
To: joe; +Cc: netdev, rdreier, general, sean.hefty, harvey.harrison
From: Joe Perches <joe@perches.com>
Date: Tue, 28 Oct 2008 17:16:14 -0700
> ib_gid's can be print'd using the new %p6 facility
>
> Signed-off-by: Joe Perches <joe@perches.com>
Joe, please provide something relative to Harvey's patches
so that this new union member gets passed into the %p6
uses.
Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ofa-general] Re: [PATCH] infiniband: Add struct in6_addr addr to union ib_gib
2008-10-29 5:39 ` [ofa-general] " David Miller
@ 2008-10-29 6:58 ` Joe Perches
2008-10-29 8:39 ` David Miller
2008-10-29 18:15 ` Roland Dreier
0 siblings, 2 replies; 11+ messages in thread
From: Joe Perches @ 2008-10-29 6:58 UTC (permalink / raw)
To: David Miller; +Cc: netdev, rdreier, general, sean.hefty, harvey.harrison
On Tue, 2008-10-28 at 22:39 -0700, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Tue, 28 Oct 2008 17:16:14 -0700
> > ib_gid's can be print'd using the new %p6 facility
> > Signed-off-by: Joe Perches <joe@perches.com>
> Joe, please provide something relative to Harvey's patches
> so that this new union member gets passed into the %p6
> uses.
Sure. After Harvey's patches show up in
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=summary
I'll make a patchset including this union ib_gid addition as
well as changes to drivers/infiniband/
Roland, in a separate question, are the infiniband maintainers
also the maintainers of include/rdma/? If "F: patterns" ever
gets accepted into MAINTAINERS, should include/rdma/ be listed
under infiniband?
You and Sean Hefty seem to be the primary authors.
$ git log include/rdma/ | grep Author: | \
sort | uniq -c | sort -nr | head -5
32 Author: Sean Hefty <sean.hefty@intel.com>
23 Author: Roland Dreier <rolandd@cisco.com>
6 Author: Michael S. Tsirkin <mst@mellanox.co.il>
5 Author: Or Gerlitz <ogerlitz@voltaire.com>
4 Author: Jack Morgenstein <jackm@mellanox.co.il>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ofa-general] Re: [PATCH] infiniband: Add struct in6_addr addr to union ib_gib
2008-10-29 6:58 ` Joe Perches
@ 2008-10-29 8:39 ` David Miller
2008-10-29 18:15 ` Roland Dreier
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2008-10-29 8:39 UTC (permalink / raw)
To: joe; +Cc: netdev, rdreier, general, sean.hefty, harvey.harrison
From: Joe Perches <joe@perches.com>
Date: Tue, 28 Oct 2008 23:58:40 -0700
> On Tue, 2008-10-28 at 22:39 -0700, David Miller wrote:
> > From: Joe Perches <joe@perches.com>
> > Date: Tue, 28 Oct 2008 17:16:14 -0700
> > > ib_gid's can be print'd using the new %p6 facility
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > Joe, please provide something relative to Harvey's patches
> > so that this new union member gets passed into the %p6
> > uses.
>
> Sure. After Harvey's patches show up in
> http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=summary
They should be there now.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ofa-general] Re: [PATCH] infiniband: Add struct in6_addr addr to union ib_gib
2008-10-29 6:58 ` Joe Perches
2008-10-29 8:39 ` David Miller
@ 2008-10-29 18:15 ` Roland Dreier
1 sibling, 0 replies; 11+ messages in thread
From: Roland Dreier @ 2008-10-29 18:15 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, rdreier, general, David Miller, harvey.harrison
> Sure. After Harvey's patches show up in
> http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=summary
> I'll make a patchset including this union ib_gid addition as
> well as changes to drivers/infiniband/
OK I guess. I also don't have any objection to using a different
format letter but the
same underlying code as the p6 implementation as an alternative for handling
the type checking.
> Roland, in a separate question, are the infiniband maintainers
> also the maintainers of include/rdma/? If "F: patterns" ever
> gets accepted into MAINTAINERS, should include/rdma/ be listed
> under infiniband?
Yes, drivers/infiniband and include/rdma are all part of the
InfiniBand/RDMA stack.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-10-29 18:15 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28 21:38 [PATCH] infiniband: use %p6 for printing message ids Harvey Harrison
2008-10-28 22:00 ` Roland Dreier
2008-10-28 23:02 ` Joe Perches
2008-10-28 23:07 ` Roland Dreier
2008-10-28 23:22 ` Joe Perches
2008-10-29 0:16 ` [ofa-general] ***SPAM*** [PATCH] infiniband: Add struct in6_addr addr to union ib_gib Joe Perches
2008-10-29 5:39 ` [ofa-general] " David Miller
2008-10-29 6:58 ` Joe Perches
2008-10-29 8:39 ` David Miller
2008-10-29 18:15 ` Roland Dreier
2008-10-29 5:36 ` [PATCH] infiniband: use %p6 for printing message ids David Miller
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.