Re: [openib-general] [PATCH 09/13] Core WQE/CQE Types

From: Steve Wise
Date: Fri Nov 17 2006 - 13:32:40 EST


On Fri, 2006-11-17 at 10:19 -0800, Bryan O'Sullivan wrote:
> Steve Wise wrote:
> > T3 WQE and CQE structures, defines, etc...
>
> I notice that none of the fields in these structs seem to be
> endianness-annotated, but that there's a lot of cpu_to_be64 and so on
> being used to frob values into them. Please make sure that the driver
> passes a sparse check, which it looks like it almost certainly cannot
> right now.

It passes sparse with only a few warnings about calling memset() with a
size > 100000. I don't know how to get around this warning, however,
because I indeed want to initialize large chunks of memory to zero using
memset...

The HW is BE. So building WR's that get DMA'd to the adapter need
values in BE. Also, pulling values out of the CQE require mapping back
to cpu byte order.

>
> > +#define RING_DOORBELL(doorbell, QPID) { \
> > + (writel(((1<<31) | (QPID)), doorbell)); \
> > +}
>
> Should probably be an inline function instead of a macro.
>

Ok.


BTW: here is the sparse output:

vic13:/home/swise/git/linux-2.6.git # make C=1
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CHK include/linux/compile.h
CHECK drivers/infiniband/hw/cxgb3/iwch_cm.c
CC [M] drivers/infiniband/hw/cxgb3/iwch_cm.o
CHECK drivers/infiniband/hw/cxgb3/iwch_ev.c
CC [M] drivers/infiniband/hw/cxgb3/iwch_ev.o
CHECK drivers/infiniband/hw/cxgb3/iwch_cq.c
CC [M] drivers/infiniband/hw/cxgb3/iwch_cq.o
CHECK drivers/infiniband/hw/cxgb3/iwch_qp.c
CC [M] drivers/infiniband/hw/cxgb3/iwch_qp.o
CHECK drivers/infiniband/hw/cxgb3/iwch_mem.c
CC [M] drivers/infiniband/hw/cxgb3/iwch_mem.o
CHECK drivers/infiniband/hw/cxgb3/iwch_provider.c
CC [M] drivers/infiniband/hw/cxgb3/iwch_provider.o
CHECK drivers/infiniband/hw/cxgb3/iwch.c
drivers/infiniband/hw/cxgb3/iwch.c:70:8: warning: memset with byte count of 262144
drivers/infiniband/hw/cxgb3/iwch.c:70:8: warning: memset with byte count of 262144
drivers/infiniband/hw/cxgb3/iwch.c:70:8: warning: memset with byte count of 262144
CC [M] drivers/infiniband/hw/cxgb3/iwch.o
CHECK drivers/infiniband/hw/cxgb3/core/cxio_hal.c
drivers/infiniband/hw/cxgb3/core/cxio_hal.c:550:8: warning: memset with byte count of 131072
CC [M] drivers/infiniband/hw/cxgb3/core/cxio_hal.o
CHECK drivers/infiniband/hw/cxgb3/core/cxio_resource.c
CC [M] drivers/infiniband/hw/cxgb3/core/cxio_resource.o
LD [M] drivers/infiniband/hw/cxgb3/iw_cxgb3.o


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/