diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2019-07-08 11:36:32 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-07-08 11:52:50 -0300 |
commit | 4c7d6dcd364843e408a60952ba914bb72bafc6cc (patch) | |
tree | 9b4dbbaa44b2682d9c8bbecbeb754a90e9379c82 /drivers/infiniband/sw/siw/siw_qp_tx.c | |
parent | ibverbs/rxe: Remove variable self-initialization (diff) | |
download | linux-dev-4c7d6dcd364843e408a60952ba914bb72bafc6cc.tar.xz linux-dev-4c7d6dcd364843e408a60952ba914bb72bafc6cc.zip |
RDMA/siw: Fix DEFINE_PER_CPU compilation when ARCH_NEEDS_WEAK_PER_CPU
The initializer for the variable cannot be inside the macro (and zero
initialization isn't needed anyhow).
include/linux/percpu-defs.h:92:33: warning: '__pcpu_unique_use_cnt' initialized and declared 'extern'
extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
^~~~~~~~~~~~~~
include/linux/percpu-defs.h:115:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
DEFINE_PER_CPU_SECTION(type, name, "")
^~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/sw/siw/siw_main.c:129:8: note: in expansion of macro 'DEFINE_PER_CPU'
static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
^~~~~~~~~~~~~~
Also the rules for PER_CPU require the variable names to be globally
unique, so prefix them with siw_
Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/sw/siw/siw_qp_tx.c')
-rw-r--r-- | drivers/infiniband/sw/siw/siw_qp_tx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c index 5e926fac51db..1c9fa8fa96e5 100644 --- a/drivers/infiniband/sw/siw/siw_qp_tx.c +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c @@ -1183,12 +1183,12 @@ struct tx_task_t { wait_queue_head_t waiting; }; -static DEFINE_PER_CPU(struct tx_task_t, tx_task_g); +static DEFINE_PER_CPU(struct tx_task_t, siw_tx_task_g); void siw_stop_tx_thread(int nr_cpu) { kthread_stop(siw_tx_thread[nr_cpu]); - wake_up(&per_cpu(tx_task_g, nr_cpu).waiting); + wake_up(&per_cpu(siw_tx_task_g, nr_cpu).waiting); } int siw_run_sq(void *data) @@ -1196,7 +1196,7 @@ int siw_run_sq(void *data) const int nr_cpu = (unsigned int)(long)data; struct llist_node *active; struct siw_qp *qp; - struct tx_task_t *tx_task = &per_cpu(tx_task_g, nr_cpu); + struct tx_task_t *tx_task = &per_cpu(siw_tx_task_g, nr_cpu); init_llist_head(&tx_task->active); init_waitqueue_head(&tx_task->waiting); @@ -1261,9 +1261,9 @@ int siw_sq_start(struct siw_qp *qp) } siw_qp_get(qp); - llist_add(&qp->tx_list, &per_cpu(tx_task_g, qp->tx_cpu).active); + llist_add(&qp->tx_list, &per_cpu(siw_tx_task_g, qp->tx_cpu).active); - wake_up(&per_cpu(tx_task_g, qp->tx_cpu).waiting); + wake_up(&per_cpu(siw_tx_task_g, qp->tx_cpu).waiting); return 0; } |