ehca: remove tgid checking
PATCH 1/1 ehca: remove tgid checking
This patch removes pid_t in ehca, as discussed with roland here:
http://lkml.org/lkml/2008/3/19/169
It will apply against roland's git tree.
Signed-off-by Hoang-Nam Nguyen <[email protected]>
--- drivers/infiniband/hw/ehca/ehca_av.c | 31 ------------------ drivers/infiniband/hw/ehca/ehca_classes.h | 2 - drivers/infiniband/hw/ehca/ehca_cq.c | 19 ----------- drivers/infiniband/hw/ehca/ehca_mrmw.c | 32 ------------------- drivers/infiniband/hw/ehca/ehca_pd.c | 11 ------ drivers/infiniband/hw/ehca/ehca_qp.c | 48 ----------------------------- drivers/infiniband/hw/ehca/ehca_uverbs.c | 19 ----------- 7 files changed, 0 insertions(+), 162 deletions(-)
drivers/infiniband/hw/ehca/ehca_av.c +0 -31
@@ -41,9 +41,6 @@* POSSIBILITY OF SUCH DAMAGE. */ - -#include <asm/current.h> -#include "ehca_tools.h" #include "ehca_iverbs.h" #include "hcp_if.h"
@@ -170,17 +167,8 @@ int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr) {struct ehca_av *av;struct ehca_ud_av new_ehca_av; - struct ehca_pd *my_pd = container_of(ah->pd, struct ehca_pd, ib_pd); struct ehca_shca *shca = container_of(ah->pd->device, struct ehca_shca, ib_device); -u32 cur_pid = current->tgid; - -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - my_pd->ownpid != cur_pid) { -ehca_err (ah->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); -return -EINVAL ; - }memset (&new_ehca_av,0 ,sizeof (new_ehca_av)); new_ehca_av.sl = ah_attr->sl;
@@ -242,15 +230,6 @@ int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr)int ehca_query_ah (struct ib_ah *ah,struct ib_ah_attr *ah_attr) { struct ehca_av *av = container_of(ah, struct ehca_av, ib_ah); - struct ehca_pd *my_pd = container_of(ah->pd, struct ehca_pd, ib_pd); -u32 cur_pid = current->tgid; - -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - my_pd->ownpid != cur_pid) { -ehca_err (ah->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); -return -EINVAL ; - }memcpy (&ah_attr->grh.dgid, &av->av.grh.word_3,sizeof (ah_attr->grh.dgid));
@@ -273,16 +252,6 @@ int ehca_query_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr)int ehca_destroy_ah (struct ib_ah *ah) { - struct ehca_pd *my_pd = container_of(ah->pd, struct ehca_pd, ib_pd); -u32 cur_pid = current->tgid; - -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - my_pd->ownpid != cur_pid) { -ehca_err (ah->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); -return -EINVAL ; - } - kmem_cache_free(av_cache, container_of(ah, struct ehca_av, ib_ah));return 0 ;
drivers/infiniband/hw/ehca/ehca_classes.h +0 -2
@@ -132,7 +132,6 @@ struct ehca_shca {struct ehca_pd {struct ib_pd ib_pd;struct ipz_pd fw_pd; -u32 ownpid;/* small queue mgmt */ struct mutex lock;struct list_head free[2 ];
@@ -215,7 +214,6 @@ struct ehca_cq {atomic_t nr_events;/* #events seen */ wait_queue_head_t wait_completion;spinlock_t task_lock; -u32 ownpid;/* mmap counter for resources mapped into user space */ u32 mm_count_queue;u32 mm_count_galpa;
drivers/infiniband/hw/ehca/ehca_cq.c +0 -19
@@ -43,8 +43,6 @@* POSSIBILITY OF SUCH DAMAGE. */ -#include <asm/current.h> -#include "ehca_iverbs.h" #include "ehca_classes.h" #include "ehca_irq.h"
@@ -148,7 +146,6 @@ struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe, int comp_vector,spin_lock_init (&my_cq->task_lock);atomic_set (&my_cq->nr_events,0 );init_waitqueue_head (&my_cq->wait_completion); - my_cq->ownpid = current->tgid; cq = &my_cq->ib_cq;
@@ -320,7 +317,6 @@ int ehca_destroy_cq(struct ib_cq *cq) struct ehca_shca *shca = container_of(device, struct ehca_shca, ib_device);struct ipz_adapter_handle adapter_handle = shca->ipz_hca_handle; -u32 cur_pid = current->tgid;unsigned long flags;if (cq->uobject) {
@@ -329,12 +325,6 @@ int ehca_destroy_cq(struct ib_cq *cq) "user space cq_num=%x", my_cq->cq_number);return -EINVAL ; } -if (my_cq->ownpid != cur_pid) { -ehca_err (device,"Invalid caller pid=%x ownpid=%x " -"cq_num=%x" , - cur_pid, my_cq->ownpid, my_cq->cq_number); -return -EINVAL ; - } }/*
@@ -374,15 +364,6 @@ int ehca_destroy_cq(struct ib_cq *cq)int ehca_resize_cq (struct ib_cq *cq,int cqe,struct ib_udata *udata) { - struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq); -u32 cur_pid = current->tgid; - -if (cq->uobject && my_cq->ownpid != cur_pid) { -ehca_err (cq->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_cq->ownpid); -return -EINVAL ; - } -/* TODO: proper resize needs to be done */ ehca_err (cq->device,"not implemented yet" );
drivers/infiniband/hw/ehca/ehca_mrmw.c +0 -32
@@ -40,8 +40,6 @@* POSSIBILITY OF SUCH DAMAGE. */ -#include <asm/current.h> -#include <rdma/ib_umem.h> #include "ehca_iverbs.h"
@@ -419,7 +417,6 @@ int ehca_rereg_phys_mr(struct ib_mr *mr,struct ehca_shca *shca = container_of(mr->device, struct ehca_shca, ib_device); struct ehca_mr *e_mr = container_of(mr, struct ehca_mr, ib.ib_mr); - struct ehca_pd *my_pd = container_of(mr->pd, struct ehca_pd, ib_pd);u64 new_size;u64 *new_start;u32 new_acl;
@@ -429,15 +426,6 @@ int ehca_rereg_phys_mr(struct ib_mr *mr,u32 num_kpages =0 ;u32 num_hwpages =0 ;struct ehca_mr_pginfo pginfo; -u32 cur_pid = current->tgid; - -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - (my_pd->ownpid != cur_pid)) { -ehca_err (mr->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); - ret = -EINVAL ; - goto rereg_phys_mr_exit0; - }if (!(mr_rereg_mask &IB_MR_REREG_TRANS )) {/* TODO not supported, because PHYP rereg hCall needs pages */
@@ -577,19 +565,9 @@ int ehca_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr)struct ehca_shca *shca = container_of(mr->device, struct ehca_shca, ib_device); struct ehca_mr *e_mr = container_of(mr, struct ehca_mr, ib.ib_mr); - struct ehca_pd *my_pd = container_of(mr->pd, struct ehca_pd, ib_pd); -u32 cur_pid = current->tgid;unsigned long sl_flags;struct ehca_mr_hipzout_parms hipzout; -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - (my_pd->ownpid != cur_pid)) { -ehca_err (mr->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); - ret = -EINVAL ; - goto query_mr_exit0; - } -if ((e_mr->flags &EHCA_MR_FLAG_FMR )) {ehca_err (mr->device,"not supported for FMR, mr=%p e_mr=%p " "e_mr->flags=%x" , mr, e_mr, e_mr->flags);
@@ -634,16 +612,6 @@ int ehca_dereg_mr(struct ib_mr *mr)struct ehca_shca *shca = container_of(mr->device, struct ehca_shca, ib_device); struct ehca_mr *e_mr = container_of(mr, struct ehca_mr, ib.ib_mr); - struct ehca_pd *my_pd = container_of(mr->pd, struct ehca_pd, ib_pd); -u32 cur_pid = current->tgid; - -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - (my_pd->ownpid != cur_pid)) { -ehca_err (mr->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); - ret = -EINVAL ; - goto dereg_mr_exit0; - }if ((e_mr->flags &EHCA_MR_FLAG_FMR )) { ehca_err(mr->device, "not supported for FMR, mr=%p e_mr=%p "
drivers/infiniband/hw/ehca/ehca_pd.c +0 -11
@@ -38,8 +38,6 @@* POSSIBILITY OF SUCH DAMAGE. */ -#include <asm/current.h> -#include "ehca_tools.h" #include "ehca_iverbs.h"
@@ -58,7 +56,6 @@ struct ib_pd *ehca_alloc_pd(struct ib_device *device,return ERR_PTR (-ENOMEM ); } - pd->ownpid = current->tgid;for (i =0 ; i <2 ; i++) {INIT_LIST_HEAD (&pd->free[i]);INIT_LIST_HEAD (&pd->full[i]);
@@ -85,18 +82,10 @@ struct ib_pd *ehca_alloc_pd(struct ib_device *device,int ehca_dealloc_pd (struct ib_pd *pd) { -u32 cur_pid = current->tgid; struct ehca_pd *my_pd = container_of(pd, struct ehca_pd, ib_pd);int i, leftovers =0 ;struct ipz_small_queue_page *page, *tmp; -if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && - my_pd->ownpid != cur_pid) { -ehca_err (pd->device,"Invalid caller pid=%x ownpid=%x" , - cur_pid, my_pd->ownpid); -return -EINVAL ; - } -for (i =0 ; i <2 ; i++) {list_splice (&my_pd->full[i], &my_pd->free[i]);list_for_each_entry_safe (page, tmp, &my_pd->free[i], list) {
drivers/infiniband/hw/ehca/ehca_qp.c +0 -48
110 lines not on this page · raw message
drivers/infiniband/hw/ehca/ehca_uverbs.c +0 -19
@@ -40,8 +40,6 @@* POSSIBILITY OF SUCH DAMAGE. */ -#include <asm/current.h> -#include "ehca_classes.h" #include "ehca_iverbs.h" #include "ehca_mrmw.h"
@@ -253,11 +251,9 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)u32 idr_handle = fileoffset &0x1FFFFFF ;u32 q_type = (fileoffset >>27 ) &0x1 ;/* CQ, QP,... */ u32 rsrc_type = (fileoffset >>25 ) &0x3 ;/* sq,rq,cmnd_window */ -u32 cur_pid = current->tgid;u32 ret;struct ehca_cq *cq;struct ehca_qp *qp; -struct ehca_pd *pd;struct ib_uobject *uobject;switch (q_type) {
@@ -270,13 +266,6 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)if (!cq)return -EINVAL ; -if (cq->ownpid != cur_pid) { -ehca_err (cq->ib_cq.device, -"Invalid caller pid=%x ownpid=%x" , - cur_pid, cq->ownpid); -return -ENOMEM ; - } -if (!cq->ib_cq.uobject || cq->ib_cq.uobject->context != context)return -EINVAL ;
@@ -298,14 +287,6 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)if (!qp)return -EINVAL ; - pd = container_of(qp->ib_qp.pd, struct ehca_pd, ib_pd); -if (pd->ownpid != cur_pid) { -ehca_err (qp->ib_qp.device, -"Invalid caller pid=%x ownpid=%x" , - cur_pid, pd->ownpid); -return -ENOMEM ; - } - uobject =IS_SRQ (qp) ? qp->ib_srq.uobject : qp->ib_qp.uobject;if (!uobject || uobject->context != context)return -EINVAL ;
Signature · 1 line
1.5.2
thanks for the quick patch, applied!