-----"Leon Romanovsky" <leon@xxxxxxxxxx> wrote: ----- >To: "Bernard Metzler" <bmt@xxxxxxxxxxxxxx> >From: "Leon Romanovsky" <leon@xxxxxxxxxx> >Date: 03/26/2019 10:38AM >Cc: linux-rdma@xxxxxxxxxxxxxxx >Subject: Re: [PATCH v6 02/13] SIW main inclue file > >On Mon, Mar 25, 2019 at 06:10:35PM +0100, Bernard Metzler wrote: >> Signed-off-by: Bernard Metzler <bmt@xxxxxxxxxxxxxx> >> --- >> drivers/infiniband/sw/siw/siw.h | 747 >++++++++++++++++++++++++++++++++ >> 1 file changed, 747 insertions(+) >> create mode 100644 drivers/infiniband/sw/siw/siw.h >> >> diff --git a/drivers/infiniband/sw/siw/siw.h >b/drivers/infiniband/sw/siw/siw.h >> new file mode 100644 >> index 000000000000..619517941ebd >> --- /dev/null >> +++ b/drivers/infiniband/sw/siw/siw.h >> @@ -0,0 +1,747 @@ >> +/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ >> + >> +/* Authors: Bernard Metzler <bmt@xxxxxxxxxxxxxx> */ >> +/* Copyright (c) 2008-2019, IBM Corporation */ >> + >> +#ifndef _SIW_H >> +#define _SIW_H >> + >> +#include <linux/idr.h> >> +#include <rdma/ib_verbs.h> >> +#include <linux/socket.h> >> +#include <linux/skbuff.h> >> +#include <linux/in.h> >> +#include <linux/fs.h> >> +#include <linux/netdevice.h> >> +#include <crypto/hash.h> >> +#include <linux/resource.h> /* MLOCK_LIMIT */ >> +#include <linux/module.h> >> +#include <linux/version.h> >> +#include <linux/llist.h> >> +#include <linux/mm.h> >> +#include <linux/sched/signal.h> >> + >> +#include <rdma/siw_user.h> >> +#include "iwarp.h" >> + >> +#define DEBUG Sorry, I had this in to enable dynamic device debugging. Should not be part of the final thing... > >Please without such defines. > <...> >> + >> + struct { /* information to be carried in TERMINATE pkt, if valid >*/ >> + u8 valid; >> + u8 in_tx; >> + u8 layer : 4, etype : 4; >> + u8 ecode; >> + } term_info; >> +}; >> + >> +/* helper macros */ >> +#define rx_qp(rx) container_of(rx, struct siw_qp, rx_ctx) >> +#define tx_qp(tx) container_of(tx, struct siw_qp, tx_ctx) >> +#define tx_wqe(qp) (&(qp)->tx_ctx.wqe_active) >> +#define rx_wqe(qp) (&(qp)->rx_ctx.wqe_active) >> +#define rx_mem(qp) ((qp)->rx_ctx.wqe_active.mem[0]) >> +#define tx_type(wqe) ((wqe)->sqe.opcode) >> +#define rx_type(wqe) ((wqe)->rqe.opcode) >> +#define tx_flags(wqe) ((wqe)->sqe.flags) >> + >> +#define QP_ID(qp) ((qp)->hdr.id) >> +#define OBJ_ID(obj) ((obj)->hdr.id) > >First these defines are the same QP_ID(qp) == OBJ_ID(qp) Absolutely. Doesn't make sense. will remove QP_ID >and second, please don't obfuscate "id", after we will convert all >objects to core allocation scheme, we will remove those IDs from all >drivers. > >> +#define RX_QPID(rx) QP_ID(rx_qp(rx)) >> +#define TX_QPID(tx) QP_ID(tx_qp(tx)) >> + > >Thanks > [attachment "signature.asc" removed by Bernard Metzler/Zurich/IBM]