merge struct ib_device_attr into struct ib_device V2
Subsystems (15)
This patch gets rid of struct ib_device_attr and cleans up drivers nicely.
It goes on top of my send_wr cleanups and the memory registration udpates from Sagi.
Changes since V1:
- rebased on top of the Sagi's latest reg_api.6 branch
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1444633078-27166-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org
PATCH 1/1 IB: merge struct ib_device_attr into struct ib_device
Avoid the need to query for device attributes and store them in a separate structure by merging struct ib_device_attr into struct ib_device. This matches how the device structures are used in most Linux subsystems.
--- drivers/infiniband/core/cm.c | 12 +- drivers/infiniband/core/cma.c | 8 - drivers/infiniband/core/device.c | 20 --- drivers/infiniband/core/fmr_pool.c | 20 +-- drivers/infiniband/core/sysfs.c | 14 +- drivers/infiniband/core/uverbs_cmd.c | 128 +++++++--------- drivers/infiniband/core/verbs.c | 8 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 60 +++----- drivers/infiniband/hw/cxgb4/provider.c | 64 +++----- drivers/infiniband/hw/mlx4/main.c | 169 ++++++++++++--------- drivers/infiniband/hw/mlx5/main.c | 116 ++++++-------- drivers/infiniband/hw/mthca/mthca_provider.c | 77 +++++----- drivers/infiniband/hw/nes/nes_verbs.c | 94 +++++------- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 40 ++++- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 49 ------ drivers/infiniband/hw/ocrdma/ocrdma_verbs.h | 2 - drivers/infiniband/hw/qib/qib_verbs.c | 86 +++++------ drivers/infiniband/hw/usnic/usnic_ib_main.c | 3 +- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 50 ++---- drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 4 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 19 +-- drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 14 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 21 +-- drivers/infiniband/ulp/iser/iscsi_iser.c | 4 +- drivers/infiniband/ulp/iser/iscsi_iser.h | 2 - drivers/infiniband/ulp/iser/iser_memory.c | 9 +- drivers/infiniband/ulp/iser/iser_verbs.c | 38 ++--- drivers/infiniband/ulp/isert/ib_isert.c | 43 ++---- drivers/infiniband/ulp/isert/ib_isert.h | 1 - drivers/infiniband/ulp/srp/ib_srp.c | 32 ++-- drivers/infiniband/ulp/srpt/ib_srpt.c | 15 +- drivers/infiniband/ulp/srpt/ib_srpt.h | 3 - .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 21 +-- drivers/staging/rdma/amso1100/c2.h | 3 - drivers/staging/rdma/amso1100/c2_pd.c | 6 +- drivers/staging/rdma/amso1100/c2_provider.c | 23 +-- drivers/staging/rdma/amso1100/c2_rnic.c | 63 +++----- drivers/staging/rdma/ehca/ehca_hca.c | 78 +++++----- drivers/staging/rdma/ehca/ehca_iverbs.h | 3 +- drivers/staging/rdma/ehca/ehca_main.c | 3 +- drivers/staging/rdma/hfi1/verbs.c | 89 +++++------ drivers/staging/rdma/ipath/ipath_verbs.c | 90 +++++------ include/rdma/ib_verbs.h | 98 ++++++------ net/rds/ib.c | 28 +--- net/rds/iw.c | 23 +-- net/sunrpc/xprtrdma/frwr_ops.c | 7 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 48 +++--- net/sunrpc/xprtrdma/verbs.c | 24 +-- net/sunrpc/xprtrdma/xprt_rdma.h | 1 - 49 files changed, 725 insertions(+), 1108 deletions(-)
drivers/infiniband/core/cm.c +1 -11
@@ -3749,16 +3749,6 @@ int ib_cm_init_qp_attr(struct ib_cm_id *cm_id, }EXPORT_SYMBOL (ib_cm_init_qp_attr); -static void cm_get_ack_delay (struct cm_device *cm_dev) -{ -struct ib_device_attr attr; - -if (ib_query_device (cm_dev->ib_device, &attr)) - cm_dev->ack_delay =0 ;/* acks will rely on packet life time */ -else - cm_dev->ack_delay = attr.local_ca_ack_delay; -} -static ssize_t cm_show_counter (struct kobject *obj,struct attribute *attr,char *buf) {
@@ -3870,7 +3860,7 @@ static void cm_add_one(struct ib_device *ib_device)return ; cm_dev->ib_device = ib_device; -cm_get_ack_delay (cm_dev); + cm_dev->ack_delay = ib_device->local_ca_ack_delay; cm_dev->going_down =0 ; cm_dev->device = device_create(&cm_class, &ib_device->dev, MKDEV(0, 0), NULL,
drivers/infiniband/core/cma.c +0 -8
@@ -1847,7 +1847,6 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,struct rdma_id_private *listen_id, *conn_id;struct rdma_cm_event event;int ret; -struct ib_device_attr attr;struct sockaddr *laddr = (struct sockaddr *)&iw_event->local_addr;struct sockaddr *raddr = (struct sockaddr *)&iw_event->remote_addr;
@@ -1888,13 +1887,6 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,memcpy (cma_src_addr (conn_id), laddr,rdma_addr_size (laddr));memcpy (cma_dst_addr (conn_id), raddr,rdma_addr_size (raddr)); - ret =ib_query_device (conn_id->id.device, &attr); -if (ret) { -mutex_unlock (&conn_id->handler_mutex); -rdma_destroy_id (new_cm_id); - goto out; - } -memset (&event,0 ,sizeof event); event.event =RDMA_CM_EVENT_CONNECT_REQUEST ; event.param.conn.private_data = iw_event->private_data;
drivers/infiniband/core/device.c +0 -20
@@ -89,7 +89,6 @@ static int ib_device_check_mandatory(struct ib_device *device)size_t offset;char *name; } mandatory_table[] = { -IB_MANDATORY_FUNC (query_device),IB_MANDATORY_FUNC (query_port),IB_MANDATORY_FUNC (query_pkey), IB_MANDATORY_FUNC(query_gid),
@@ -628,25 +627,6 @@ void ib_dispatch_event(struct ib_event *event)EXPORT_SYMBOL (ib_dispatch_event);/** -* ib_query_device - Query IB device attributes -* @device:Device to query -* @device_attr:Device attributes -* -* ib_query_device() returns the attributes of a device through the -* @device_attr pointer. -*/ -int ib_query_device (struct ib_device *device, -struct ib_device_attr *device_attr) -{ -struct ib_udata uhw = {.outlen =0 , .inlen =0 }; - -memset (device_attr,0 ,sizeof (*device_attr)); - -return device->query_device (device, device_attr, &uhw); -} -EXPORT_SYMBOL (ib_query_device); - -/** * ib_query_port - Query IB port attributes * @device:Device to query * @port_num:Port number to query
drivers/infiniband/core/fmr_pool.c +2 -18
@@ -212,7 +212,6 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, {struct ib_device *device;struct ib_fmr_pool *pool; -struct ib_device_attr *attr;int i;int ret;int max_remaps;
@@ -228,25 +227,10 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,return ERR_PTR (-ENOSYS ); } - attr =kmalloc (sizeof *attr,GFP_KERNEL ); -if (!attr) { - printk(KERN_WARNING PFX "couldn't allocate device attr struct\n"); -return ERR_PTR (-ENOMEM ); - } - - ret =ib_query_device (device, attr); -if (ret) { - printk(KERN_WARNING PFX "couldn't query device: %d\n", ret); -kfree (attr); -return ERR_PTR (ret); - } - -if (!attr->max_map_per_fmr) +if (!device->max_map_per_fmr) max_remaps =IB_FMR_MAX_REMAPS ;else - max_remaps = attr->max_map_per_fmr; - -kfree (attr); + max_remaps = device->max_map_per_fmr; pool =kmalloc (sizeof *pool,GFP_KERNEL );if (!pool) {
drivers/infiniband/core/sysfs.c +4 -10
@@ -614,18 +614,12 @@ static ssize_t show_sys_image_guid(struct device *device, struct device_attribute *dev_attr, char *buf) { struct ib_device *dev = container_of(device, struct ib_device, dev); -struct ib_device_attr attr; -ssize_t ret; - - ret =ib_query_device (dev, &attr); -if (ret) -return ret;return sprintf (buf,"%04x:%04x:%04x:%04x\n" , -be16_to_cpu (((__be16 *) &attr.sys_image_guid)[0 ]), -be16_to_cpu (((__be16 *) &attr.sys_image_guid)[1 ]), -be16_to_cpu (((__be16 *) &attr.sys_image_guid)[2 ]), -be16_to_cpu (((__be16 *) &attr.sys_image_guid)[3 ])); +be16_to_cpu (((__be16 *) &dev->sys_image_guid)[0 ]), +be16_to_cpu (((__be16 *) &dev->sys_image_guid)[1 ]), +be16_to_cpu (((__be16 *) &dev->sys_image_guid)[2 ]), +be16_to_cpu (((__be16 *) &dev->sys_image_guid)[3 ])); } static ssize_t show_node_guid(struct device *device,
drivers/infiniband/core/uverbs_cmd.c +57 -71
200 lines not on this page · raw message
drivers/infiniband/core/verbs.c +1 -7
@@ -226,12 +226,6 @@ EXPORT_SYMBOL(rdma_port_get_link_layer);struct ib_pd *ib_alloc_pd (struct ib_device *device) {struct ib_pd *pd; -struct ib_device_attr devattr; -int rc; - - rc =ib_query_device (device, &devattr); -if (rc) -return ERR_PTR (rc); pd = device->alloc_pd (device,NULL ,NULL );if (IS_ERR (pd))
@@ -242,7 +236,7 @@ struct ib_pd *ib_alloc_pd(struct ib_device *device) pd->local_mr =NULL ;atomic_set (&pd->usecnt,0 ); -if (devattr.device_cap_flags &IB_DEVICE_LOCAL_DMA_LKEY ) +if (device->device_cap_flags &IB_DEVICE_LOCAL_DMA_LKEY ) pd->local_dma_lkey = device->local_dma_lkey;else {struct ib_mr *mr;
drivers/infiniband/hw/cxgb3/iwch_provider.c +22 -38
78 lines not on this page · raw message
drivers/infiniband/hw/cxgb4/provider.c +24 -40
82 lines not on this page · raw message
drivers/infiniband/hw/mlx4/main.c +101 -68
226 lines not on this page · raw message
drivers/infiniband/hw/mlx5/main.c +50 -66
204 lines not on this page · raw message
drivers/infiniband/hw/mthca/mthca_provider.c +37 -40
121 lines not on this page · raw message
drivers/infiniband/hw/nes/nes_verbs.c +38 -56
112 lines not on this page · raw message
drivers/infiniband/hw/ocrdma/ocrdma_main.c +39 -1
@@ -145,7 +145,6 @@ static int ocrdma_register_device(struct ocrdma_dev *dev) dev->ibdev.num_comp_vectors = dev->eq_cnt;/* mandatory verbs. */ - dev->ibdev.query_device = ocrdma_query_device; dev->ibdev.query_port = ocrdma_query_port; dev->ibdev.modify_port = ocrdma_modify_port; dev->ibdev.query_gid = ocrdma_query_gid;
@@ -207,6 +206,45 @@ static int ocrdma_register_device(struct ocrdma_dev *dev) dev->ibdev.destroy_srq = ocrdma_destroy_srq; dev->ibdev.post_srq_recv = ocrdma_post_srq_recv; } + +memcpy (&dev->ibdev.fw_ver, &dev->attr.fw_ver[0 ], +min (sizeof (dev->attr.fw_ver),sizeof (dev->ibdev.fw_ver))); +ocrdma_get_guid (dev, (u8 *)&dev->ibdev.sys_image_guid); + dev->ibdev.max_mr_size = dev->attr.max_mr_size; + dev->ibdev.page_size_cap =0xffff000 ; + dev->ibdev.vendor_id = dev->nic_info.pdev->vendor; + dev->ibdev.vendor_part_id = dev->nic_info.pdev->device; + dev->ibdev.hw_ver = dev->asic_id; + dev->ibdev.max_qp = dev->attr.max_qp; + dev->ibdev.max_ah =OCRDMA_MAX_AH ; + dev->ibdev.max_qp_wr = dev->attr.max_wqe; + + dev->ibdev.device_cap_flags =IB_DEVICE_CURR_QP_STATE_MOD | +IB_DEVICE_RC_RNR_NAK_GEN | +IB_DEVICE_SHUTDOWN_PORT | +IB_DEVICE_SYS_IMAGE_GUID | +IB_DEVICE_LOCAL_DMA_LKEY | +IB_DEVICE_MEM_MGT_EXTENSIONS ; + dev->ibdev.max_sge =min (dev->attr.max_send_sge, dev->attr.max_srq_sge); + dev->ibdev.max_sge_rd =0 ; + dev->ibdev.max_cq = dev->attr.max_cq; + dev->ibdev.max_cqe = dev->attr.max_cqe; + dev->ibdev.max_mr = dev->attr.max_mr; + dev->ibdev.max_mw = dev->attr.max_mw; + dev->ibdev.max_pd = dev->attr.max_pd; + dev->ibdev.atomic_cap =0 ; + dev->ibdev.max_fmr =0 ; + dev->ibdev.max_map_per_fmr =0 ; + dev->ibdev.max_qp_rd_atom = +min (dev->attr.max_ord_per_qp, dev->attr.max_ird_per_qp); + dev->ibdev.max_qp_init_rd_atom = dev->attr.max_ord_per_qp; + dev->ibdev.max_srq = dev->attr.max_srq; + dev->ibdev.max_srq_sge = dev->attr.max_srq_sge; + dev->ibdev.max_srq_wr = dev->attr.max_rqe; + dev->ibdev.local_ca_ack_delay = dev->attr.local_ca_ack_delay; + dev->ibdev.max_fast_reg_page_list_len = dev->attr.max_pages_per_frmr; + dev->ibdev.max_pkeys =1 ; +return ib_register_device (&dev->ibdev,NULL ); }
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +0 -49
55 lines not on this page · raw message
drivers/infiniband/hw/ocrdma/ocrdma_verbs.h +0 -2
@@ -51,8 +51,6 @@ int ocrdma_post_recv(struct ib_qp *, struct ib_recv_wr *,int ocrdma_poll_cq (struct ib_cq *,int num_entries,struct ib_wc *wc);int ocrdma_arm_cq (struct ib_cq *,enum ib_cq_notify_flags flags); -int ocrdma_query_device (struct ib_device *,struct ib_device_attr *props, -struct ib_udata *uhw);int ocrdma_query_port (struct ib_device *,u8 port,struct ib_port_attr *props);int ocrdma_modify_port (struct ib_device *,u8 port,int mask,struct ib_port_modify *props);
drivers/infiniband/hw/qib/qib_verbs.c +36 -50
104 lines not on this page · raw message
drivers/infiniband/hw/usnic/usnic_ib_main.c +2 -1
@@ -374,7 +374,6 @@ static void *usnic_ib_device_add(struct pci_dev *dev) (1ull <<IB_USER_VERBS_CMD_DETACH_MCAST ) | (1ull <<IB_USER_VERBS_CMD_OPEN_QP ); - us_ibdev->ib_dev.query_device = usnic_ib_query_device; us_ibdev->ib_dev.query_port = usnic_ib_query_port; us_ibdev->ib_dev.query_pkey = usnic_ib_query_pkey; us_ibdev->ib_dev.query_gid = usnic_ib_query_gid;
@@ -401,6 +400,8 @@ static void *usnic_ib_device_add(struct pci_dev *dev) us_ibdev->ib_dev.get_dma_mr = usnic_ib_get_dma_mr; us_ibdev->ib_dev.get_port_immutable = usnic_port_immutable; +if (usnic_ib_init_device_flags (&us_ibdev->ib_dev)) + goto err_fwd_dealloc;if (ib_register_device (&us_ibdev->ib_dev,NULL )) goto err_fwd_dealloc;
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +15 -35
73 lines not on this page · raw message
drivers/infiniband/hw/usnic/usnic_ib_verbs.h +1 -3
@@ -23,9 +23,7 @@enum rdma_link_layer usnic_ib_port_link_layer (struct ib_device *device,u8 port_num); -int usnic_ib_query_device (struct ib_device *ibdev, -struct ib_device_attr *props, -struct ib_udata *uhw); +int usnic_ib_init_device_flags (struct ib_device *ibdev);int usnic_ib_query_port (struct ib_device *ibdev,u8 port,struct ib_port_attr *props);enum rdma_protocol_type
drivers/infiniband/ulp/ipoib/ipoib_cm.c +6 -13
@@ -1522,8 +1522,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)int ipoib_cm_dev_init (struct net_device *dev) {struct ipoib_dev_priv *priv =netdev_priv (dev); -int i, ret; -struct ib_device_attr attr; +int max_srq_sge, i;INIT_LIST_HEAD (&priv->cm.passive_ids);INIT_LIST_HEAD (&priv->cm.reap_list);
@@ -1540,19 +1539,13 @@ int ipoib_cm_dev_init(struct net_device *dev)skb_queue_head_init (&priv->cm.skb_queue); - ret =ib_query_device (priv->ca, &attr); -if (ret) { -printk (KERN_WARNING "ib_query_device() failed with %d\n" , ret); -return ret; - } - -ipoib_dbg (priv,"max_srq_sge=%d\n" , attr.max_srq_sge); +ipoib_dbg (priv,"max_srq_sge=%d\n" , priv->ca->max_srq_sge); - attr.max_srq_sge =min_t (int,IPOIB_CM_RX_SG , attr.max_srq_sge); -ipoib_cm_create_srq (dev, attr.max_srq_sge); + max_srq_sge =min_t (int,IPOIB_CM_RX_SG , priv->ca->max_srq_sge); +ipoib_cm_create_srq (dev, max_srq_sge);if (ipoib_cm_has_srq (dev)) { - priv->cm.max_cm_mtu = attr.max_srq_sge *PAGE_SIZE -0x10 ; - priv->cm.num_frags = attr.max_srq_sge; + priv->cm.max_cm_mtu = max_srq_sge *PAGE_SIZE -0x10 ; + priv->cm.num_frags = max_srq_sge;ipoib_dbg (priv,"max_cm_mtu = 0x%x, num_frags=%d\n" , priv->cm.max_cm_mtu, priv->cm.num_frags); }else {
drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +5 -9
@@ -40,15 +40,11 @@ static void ipoib_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) {struct ipoib_dev_priv *priv =netdev_priv (netdev); -struct ib_device_attr *attr; - - attr =kmalloc (sizeof (*attr),GFP_KERNEL ); -if (attr && !ib_query_device (priv->ca, attr)) -snprintf (drvinfo->fw_version,sizeof (drvinfo->fw_version), -"%d.%d.%d" , (int )(attr->fw_ver >>32 ), - (int )(attr->fw_ver >>16 ) &0xffff , - (int )attr->fw_ver &0xffff ); -kfree (attr); + +snprintf (drvinfo->fw_version,sizeof (drvinfo->fw_version), +"%d.%d.%d" , (int )(priv->ca->fw_ver >>32 ), + (int )(priv->ca->fw_ver >>16 ) &0xffff , + (int )priv->ca->fw_ver &0xffff );strlcpy (drvinfo->bus_info,dev_name (priv->ca->dma_device),sizeof (drvinfo->bus_info));
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -20
@@ -1775,26 +1775,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { -struct ib_device_attr *device_attr; -int result = -ENOMEM ; - - device_attr =kmalloc (sizeof *device_attr,GFP_KERNEL ); -if (!device_attr) { -printk (KERN_WARNING "%s: allocation of %zu bytes failed\n" , - hca->name,sizeof *device_attr); -return result; - } - - result =ib_query_device (hca, device_attr); -if (result) { -printk (KERN_WARNING "%s: ib_query_device failed (ret = %d)\n" , - hca->name, result); -kfree (device_attr); -return result; - } - priv->hca_caps = device_attr->device_cap_flags; - -kfree (device_attr); + priv->hca_caps = hca->device_cap_flags;if (priv->hca_caps &IB_DEVICE_UD_IP_CSUM ) { priv->dev->hw_features = NETIF_F_SG |
drivers/infiniband/ulp/iser/iscsi_iser.c +2 -2
@@ -648,7 +648,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, ib_conn = &iser_conn->ib_conn;if (ib_conn->pi_support) { -u32 sig_caps = ib_conn->device->dev_attr.sig_prot_cap; +u32 sig_caps = ib_conn->device->ib_device->sig_prot_cap;scsi_host_set_prot (shost,iser_dif_prot_caps (sig_caps)); scsi_host_set_guard(shost, SHOST_DIX_GUARD_IP |
@@ -660,7 +660,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,* max fastreg page list length. */ shost->sg_tablesize = min_t(unsigned short, shost->sg_tablesize, - ib_conn->device->dev_attr.max_fast_reg_page_list_len); + ib_conn->device->ib_device->max_fast_reg_page_list_len); shost->max_sectors = min_t(unsigned int,1024 , (shost->sg_tablesize *PAGE_SIZE ) >>9 );
drivers/infiniband/ulp/iser/iscsi_iser.h +0 -2
@@ -380,7 +380,6 @@ struct iser_reg_ops {* * @ib_device: RDMA device * @pd: Protection Domain for this device -* @dev_attr: Device attributes container * @mr: Global DMA memory region * @event_handler: IB events handle routine * @ig_list: entry in devices list
@@ -393,7 +392,6 @@ struct iser_reg_ops {struct iser_device {struct ib_device *ib_device;struct ib_pd *pd; -struct ib_device_attr dev_attr;struct ib_mr *mr;struct ib_event_handler event_handler;struct list_head ig_list;
drivers/infiniband/ulp/iser/iser_memory.c +4 -5
@@ -69,15 +69,14 @@ static struct iser_reg_ops fmr_ops = {int iser_assign_reg_ops (struct iser_device *device) { -struct ib_device_attr *dev_attr = &device->dev_attr; +struct ib_device *ib_dev = device->ib_device;/* Assign function handles - based on FMR support */ -if (device->ib_device->alloc_fmr && device->ib_device->dealloc_fmr && - device->ib_device->map_phys_fmr && device->ib_device->unmap_fmr) { +if (ib_dev->alloc_fmr && ib_dev->dealloc_fmr && + ib_dev->map_phys_fmr && ib_dev->unmap_fmr) {iser_info ("FMR supported, using FMR for registration\n" ); device->reg_ops = &fmr_ops; - }else -if (dev_attr->device_cap_flags &IB_DEVICE_MEM_MGT_EXTENSIONS ) { + }else if (ib_dev->device_cap_flags &IB_DEVICE_MEM_MGT_EXTENSIONS ) {iser_info ("FastReg supported, using FastReg for registration\n" ); device->reg_ops = &fastreg_ops; }else {
drivers/infiniband/ulp/iser/iser_verbs.c +16 -22
@@ -78,34 +78,28 @@ static void iser_event_handler(struct ib_event_handler *handler,*/ static int iser_create_device_ib_res (struct iser_device *device) { -struct ib_device_attr *dev_attr = &device->dev_attr; +struct ib_device *ib_dev = device->ib_device;int ret, i, max_cqe; - ret =ib_query_device (device->ib_device, dev_attr); -if (ret) { -pr_warn ("Query device failed for %s\n" , device->ib_device->name); -return ret; - } - ret =iser_assign_reg_ops (device);if (ret)return ret; device->comps_used =min_t (int,num_online_cpus (), - device->ib_device->num_comp_vectors); + ib_dev->num_comp_vectors); device->comps =kcalloc (device->comps_used,sizeof (*device->comps),GFP_KERNEL );if (!device->comps) goto comps_err; - max_cqe =min (ISER_MAX_CQ_LEN , dev_attr->max_cqe); + max_cqe =min (ISER_MAX_CQ_LEN , ib_dev->max_cqe);iser_info ("using %d CQs, device %s supports %d vectors max_cqe %d\n" , - device->comps_used, device->ib_device->name, - device->ib_device->num_comp_vectors, max_cqe); + device->comps_used, ib_dev->name, + ib_dev->num_comp_vectors, max_cqe); - device->pd =ib_alloc_pd (device->ib_device); + device->pd =ib_alloc_pd (ib_dev);if (IS_ERR (device->pd)) goto pd_err;
@@ -116,7 +110,7 @@ static int iser_create_device_ib_res(struct iser_device *device) comp->device = device; cq_attr.cqe = max_cqe; cq_attr.comp_vector = i; - comp->cq = ib_create_cq(device->ib_device, + comp->cq = ib_create_cq(ib_dev, iser_cq_callback, iser_cq_event_callback, (void *)comp,
@@ -464,7 +458,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn) struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn, ib_conn);struct iser_device *device; -struct ib_device_attr *dev_attr; +struct ib_device *ib_dev;struct ib_qp_init_attr init_attr;int ret = -ENOMEM ;int index, min_index =0 ;
@@ -472,7 +466,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)BUG_ON (ib_conn->device ==NULL ); device = ib_conn->device; - dev_attr = &device->dev_attr; + ib_dev = device->ib_device;memset (&init_attr,0 ,sizeof init_attr);
@@ -503,16 +497,16 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn) iser_conn->max_cmds =ISER_GET_MAX_XMIT_CMDS (ISER_QP_SIG_MAX_REQ_DTOS ); }else { -if (dev_attr->max_qp_wr >ISER_QP_MAX_REQ_DTOS ) { +if (ib_dev->max_qp_wr >ISER_QP_MAX_REQ_DTOS ) { init_attr.cap.max_send_wr =ISER_QP_MAX_REQ_DTOS +1 ; iser_conn->max_cmds =ISER_GET_MAX_XMIT_CMDS (ISER_QP_MAX_REQ_DTOS ); }else { - init_attr.cap.max_send_wr = dev_attr->max_qp_wr; + init_attr.cap.max_send_wr = ib_dev->max_qp_wr; iser_conn->max_cmds = -ISER_GET_MAX_XMIT_CMDS (dev_attr->max_qp_wr); +ISER_GET_MAX_XMIT_CMDS (ib_dev->max_qp_wr);iser_dbg ("device %s supports max_send_wr %d\n" , - device->ib_device->name, dev_attr->max_qp_wr); + device->ib_device->name, ib_dev->max_qp_wr); } }
@@ -756,7 +750,7 @@ iser_calc_scsi_params(struct iser_conn *iser_conn, sg_tablesize =DIV_ROUND_UP (max_sectors *512 ,SIZE_4K ); sup_sg_tablesize =min_t (unsigned,ISCSI_ISER_MAX_SG_TABLESIZE , - device->dev_attr.max_fast_reg_page_list_len); + device->ib_device->max_fast_reg_page_list_len);if (sg_tablesize > sup_sg_tablesize) { sg_tablesize = sup_sg_tablesize;
@@ -799,7 +793,7 @@ static void iser_addr_handler(struct rdma_cm_id *cma_id)/* connection T10-PI support */ if (iser_pi_enable) { -if (!(device->dev_attr.device_cap_flags & +if (!(device->ib_device->device_cap_flags &IB_DEVICE_SIGNATURE_HANDOVER )) { iser_warn("T10-PI requested but not supported on %s, " "continue without T10-PI\n",
@@ -841,7 +835,7 @@ static void iser_route_handler(struct rdma_cm_id *cma_id) goto failure;memset (&conn_param,0 ,sizeof conn_param); - conn_param.responder_resources = device->dev_attr.max_qp_rd_atom; + conn_param.responder_resources = device->ib_device->max_qp_rd_atom; conn_param.initiator_depth =1 ; conn_param.retry_count =7 ; conn_param.rnr_retry_count =6 ;
drivers/infiniband/ulp/isert/ib_isert.c +12 -31
98 lines not on this page · raw message
drivers/infiniband/ulp/isert/ib_isert.h +0 -1
@@ -207,7 +207,6 @@ struct isert_device {struct isert_comp *comps;int comps_used;struct list_head dev_node; -struct ib_device_attr dev_attr;int (*reg_rdma_mem)(struct iscsi_conn *conn,struct iscsi_cmd *cmd,struct isert_rdma_wr *wr);
drivers/infiniband/ulp/srp/ib_srp.c +9 -23
@@ -3440,27 +3440,17 @@ free_host:static void srp_add_one (struct ib_device *device) {struct srp_device *srp_dev; -struct ib_device_attr *dev_attr;struct srp_host *host;int mr_page_shift, p;u64 max_pages_per_mr; - dev_attr =kmalloc (sizeof *dev_attr,GFP_KERNEL ); -if (!dev_attr) -return ; - -if (ib_query_device (device, dev_attr)) { -pr_warn ("Query device failed for %s\n" , device->name); - goto free_attr; - } - srp_dev =kmalloc (sizeof *srp_dev,GFP_KERNEL );if (!srp_dev) - goto free_attr; +return ; srp_dev->has_fmr = (device->alloc_fmr && device->dealloc_fmr && device->map_phys_fmr && device->unmap_fmr); - srp_dev->has_fr = (dev_attr->device_cap_flags & + srp_dev->has_fr = (device->device_cap_flags &IB_DEVICE_MEM_MGT_EXTENSIONS );if (!srp_dev->has_fmr && !srp_dev->has_fr)dev_warn (&device->dev,"neither FMR nor FR is supported\n" );
@@ -3474,23 +3464,23 @@ static void srp_add_one(struct ib_device *device)* minimum of 4096 bytes. We're unlikely to build large sglists * out of smaller entries. */ - mr_page_shift =max (12 ,ffs (dev_attr->page_size_cap) -1 ); + mr_page_shift =max (12 ,ffs (device->page_size_cap) -1 ); srp_dev->mr_page_size =1 << mr_page_shift; srp_dev->mr_page_mask = ~((u64 ) srp_dev->mr_page_size -1 ); - max_pages_per_mr = dev_attr->max_mr_size; + max_pages_per_mr = device->max_mr_size;do_div (max_pages_per_mr, srp_dev->mr_page_size); srp_dev->max_pages_per_mr =min_t (u64,SRP_MAX_PAGES_PER_MR , max_pages_per_mr);if (srp_dev->use_fast_reg) { srp_dev->max_pages_per_mr =min_t (u32, srp_dev->max_pages_per_mr, - dev_attr->max_fast_reg_page_list_len); + device->max_fast_reg_page_list_len); } srp_dev->mr_max_size = srp_dev->mr_page_size * srp_dev->max_pages_per_mr; -pr_debug ("%s: mr_page_shift = %d, dev_attr->max_mr_size = %#llx, dev_attr->max_fast_reg_page_list_len = %u, max_pages_per_mr = %d, mr_max_size = %#x\n" , - device->name, mr_page_shift, dev_attr->max_mr_size, - dev_attr->max_fast_reg_page_list_len, +pr_debug ("%s: mr_page_shift = %d, device->max_mr_size = %#llx, device->max_fast_reg_page_list_len = %u, max_pages_per_mr = %d, mr_max_size = %#x\n" , + device->name, mr_page_shift, device->max_mr_size, + device->max_fast_reg_page_list_len, srp_dev->max_pages_per_mr, srp_dev->mr_max_size);INIT_LIST_HEAD (&srp_dev->dev_list);
@@ -3518,17 +3508,13 @@ static void srp_add_one(struct ib_device *device) }ib_set_client_data (device, &srp_client, srp_dev); - - goto free_attr; +return ; err_pd:ib_dealloc_pd (srp_dev->pd); free_dev:kfree (srp_dev); - -free_attr: -kfree (dev_attr); }static void srp_remove_one (struct ib_device *device,void *client_data)
drivers/infiniband/ulp/srpt/ib_srpt.c +6 -9
@@ -343,10 +343,10 @@ static void srpt_get_ioc(struct srpt_port *sport, u32 slot,memset (iocp,0 ,sizeof *iocp);strcpy (iocp->id_string,SRPT_ID_STRING ); iocp->guid =cpu_to_be64 (srpt_service_guid); - iocp->vendor_id =cpu_to_be32 (sdev->dev_attr.vendor_id); - iocp->device_id =cpu_to_be32 (sdev->dev_attr.vendor_part_id); - iocp->device_version =cpu_to_be16 (sdev->dev_attr.hw_ver); - iocp->subsys_vendor_id =cpu_to_be32 (sdev->dev_attr.vendor_id); + iocp->vendor_id =cpu_to_be32 (sdev->device->vendor_id); + iocp->device_id =cpu_to_be32 (sdev->device->vendor_part_id); + iocp->device_version =cpu_to_be16 (sdev->device->hw_ver); + iocp->subsys_vendor_id =cpu_to_be32 (sdev->device->vendor_id); iocp->subsys_device_id =0x0 ; iocp->io_class =cpu_to_be16 (SRP_REV16A_IB_IO_CLASS ); iocp->io_subclass =cpu_to_be16 (SRP_IO_SUBCLASS );
@@ -3204,14 +3204,11 @@ static void srpt_add_one(struct ib_device *device)init_waitqueue_head (&sdev->ch_releaseQ);spin_lock_init (&sdev->spinlock); -if (ib_query_device (device, &sdev->dev_attr)) - goto free_dev; - sdev->pd =ib_alloc_pd (device);if (IS_ERR (sdev->pd)) goto free_dev; - sdev->srq_size =min (srpt_srq_size, sdev->dev_attr.max_srq_wr); + sdev->srq_size =min (srpt_srq_size, sdev->device->max_srq_wr); srq_attr.event_handler = srpt_srq_event; srq_attr.srq_context = (void *)sdev;
@@ -3225,7 +3222,7 @@ static void srpt_add_one(struct ib_device *device) goto err_pd;pr_debug ("%s: create SRQ #wr= %d max_allow=%d dev= %s\n" , - __func__, sdev->srq_size, sdev->dev_attr.max_srq_wr, + __func__, sdev->srq_size, sdev->device->max_srq_wr, device->name);if (!srpt_service_guid)
drivers/infiniband/ulp/srpt/ib_srpt.h +0 -3
@@ -379,8 +379,6 @@ struct srpt_port {* @mr: L_Key (local key) with write access to all local memory. * @srq: Per-HCA SRQ (shared receive queue). * @cm_id: Connection identifier. -* @dev_attr: Attributes of the InfiniBand device as obtained during the -* ib_client.add() callback. * @srq_size: SRQ size. * @ioctx_ring: Per-HCA SRQ. * @rch_list: Per-device channel list -- see also srpt_rdma_ch.list.
@@ -395,7 +393,6 @@ struct srpt_device {struct ib_pd *pd;struct ib_srq *srq;struct ib_cm_id *cm_id; -struct ib_device_attr dev_attr;int srq_size;struct srpt_recv_ioctx **ioctx_ring;struct list_head rch_list;
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +1 -20
@@ -2070,32 +2070,13 @@ static int kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts)static int kiblnd_hdev_get_attr (kib_hca_dev_t *hdev) { -struct ib_device_attr *attr; -int rc; -/* It's safe to assume a HCA can handle a page size * matching that of the native system */ hdev->ibh_page_shift =PAGE_SHIFT ; hdev->ibh_page_size =1 <<PAGE_SHIFT ; hdev->ibh_page_mask = ~((__u64 )hdev->ibh_page_size -1 ); -LIBCFS_ALLOC (attr,sizeof (*attr)); -if (attr ==NULL ) { -CERROR ("Out of memory\n" ); -return -ENOMEM ; - } - - rc =ib_query_device (hdev->ibh_ibdev, attr); -if (rc ==0 ) - hdev->ibh_mr_size = attr->max_mr_size; - -LIBCFS_FREE (attr,sizeof (*attr)); - -if (rc !=0 ) { -CERROR ("Failed to query IB device: %d\n" , rc); -return rc; - } - + hdev->ibh_mr_size = hdev->ibh_ibdev->max_mr_size;if (hdev->ibh_mr_size == ~0ULL ) { hdev->ibh_mr_shift =64 ;return 0 ;
drivers/staging/rdma/amso1100/c2.h +0 -3
@@ -306,9 +306,6 @@ struct c2_dev {struct list_head eh_wakeup_list;/* event wakeup list */ wait_queue_head_t req_vq_wo; -/* Cached RNIC properties */ -struct ib_device_attr props; -struct c2_pd_table pd_table;struct c2_qp_table qp_table;int ports;/* num of GigE ports */
drivers/staging/rdma/amso1100/c2_pd.c +3 -3
@@ -74,13 +74,13 @@ int c2_init_pd_table(struct c2_dev *c2dev) { c2dev->pd_table.last =0 ; - c2dev->pd_table.max = c2dev->props.max_pd; + c2dev->pd_table.max = c2dev->ibdev.max_pd;spin_lock_init (&c2dev->pd_table.lock); - c2dev->pd_table.table =kmalloc (BITS_TO_LONGS (c2dev->props.max_pd) * + c2dev->pd_table.table =kmalloc (BITS_TO_LONGS (c2dev->ibdev.max_pd) *sizeof (long ),GFP_KERNEL );if (!c2dev->pd_table.table)return -ENOMEM ; -bitmap_zero (c2dev->pd_table.table, c2dev->props.max_pd); +bitmap_zero (c2dev->pd_table.table, c2dev->ibdev.max_pd);return 0 ; }
drivers/staging/rdma/amso1100/c2_provider.c +4 -19
@@ -63,20 +63,6 @@#include "c2_provider.h" #include "c2_user.h" -static int c2_query_device (struct ib_device *ibdev,struct ib_device_attr *props, -struct ib_udata *uhw) -{ -struct c2_dev *c2dev =to_c2dev (ibdev); - -pr_debug ("%s:%u\n" , __func__, __LINE__); - -if (uhw->inlen || uhw->outlen) -return -EINVAL ; - - *props = c2dev->props; -return 0 ; -} -static int c2_query_port (struct ib_device *ibdev,u8 port,struct ib_port_attr *props) {
@@ -523,7 +509,7 @@ static ssize_t show_rev(struct device *dev, struct device_attribute *attr, { struct c2_dev *c2dev = container_of(dev, struct c2_dev, ibdev.dev);pr_debug ("%s:%u\n" , __func__, __LINE__); -return sprintf (buf,"%x\n" , c2dev->props.hw_ver); +return sprintf (buf,"%x\n" , c2dev->ibdev.hw_ver); } static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
@@ -532,9 +518,9 @@ static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, struct c2_dev *c2dev = container_of(dev, struct c2_dev, ibdev.dev);pr_debug ("%s:%u\n" , __func__, __LINE__);return sprintf (buf,"%x.%x.%x\n" , - (int ) (c2dev->props.fw_ver >>32 ), - (int ) (c2dev->props.fw_ver >>16 ) &0xffff , - (int ) (c2dev->props.fw_ver &0xffff )); + (int ) (c2dev->ibdev.fw_ver >>32 ), + (int ) (c2dev->ibdev.fw_ver >>16 ) &0xffff , + (int ) (c2dev->ibdev.fw_ver &0xffff )); } static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
@@ -828,7 +814,6 @@ int c2_register_device(struct c2_dev *dev) dev->ibdev.phys_port_cnt =1 ; dev->ibdev.num_comp_vectors =1 ; dev->ibdev.dma_device = &dev->pcidev->dev; - dev->ibdev.query_device = c2_query_device; dev->ibdev.query_port = c2_query_port; dev->ibdev.query_pkey = c2_query_pkey; dev->ibdev.query_gid = c2_query_gid;
drivers/staging/rdma/amso1100/c2_rnic.c +23 -40
84 lines not on this page · raw message
drivers/staging/rdma/ehca/ehca_hca.c +37 -41
108 lines not on this page · raw message
drivers/staging/rdma/ehca/ehca_iverbs.h +1 -2
@@ -44,8 +44,7 @@#include "ehca_classes.h" -int ehca_query_device (struct ib_device *ibdev,struct ib_device_attr *props, -struct ib_udata *uhw); +int ehca_init_device_limits (struct ib_device *ibdev);int ehca_query_port (struct ib_device *ibdev,u8 port,struct ib_port_attr *props);
drivers/staging/rdma/ehca/ehca_main.c +1 -2
@@ -484,7 +484,6 @@ static int ehca_init_device(struct ehca_shca *shca) shca->ib_device.phys_port_cnt = shca->num_ports; shca->ib_device.num_comp_vectors =1 ; shca->ib_device.dma_device = &shca->ofdev->dev; - shca->ib_device.query_device = ehca_query_device; shca->ib_device.query_port = ehca_query_port; shca->ib_device.query_gid = ehca_query_gid; shca->ib_device.query_pkey = ehca_query_pkey;
@@ -545,7 +544,7 @@ static int ehca_init_device(struct ehca_shca *shca) shca->ib_device.post_srq_recv = ehca_post_srq_recv; } -return ret; +return ehca_init_device_limits (&shca->ib_device); }static int ehca_create_aqp1 (struct ehca_shca *shca,u32 port)
drivers/staging/rdma/hfi1/verbs.c +37 -52
107 lines not on this page · raw message
drivers/staging/rdma/ipath/ipath_verbs.c +38 -52
108 lines not on this page · raw message
include/rdma/ib_verbs.h +46 -52
122 lines not on this page · raw message
net/rds/ib.c +8 -20
@@ -120,40 +120,30 @@ void rds_ib_dev_put(struct rds_ib_device *rds_ibdev)static void rds_ib_add_one (struct ib_device *device) {struct rds_ib_device *rds_ibdev; -struct ib_device_attr *dev_attr;/* Only handle IB (no iWARP) devices */ if (device->node_type !=RDMA_NODE_IB_CA )return ; - dev_attr =kmalloc (sizeof *dev_attr,GFP_KERNEL ); -if (!dev_attr) -return ; - -if (ib_query_device (device, dev_attr)) { -rdsdebug ("Query device failed for %s\n" , device->name); - goto free_attr; - } - rds_ibdev =kzalloc_node (sizeof (struct rds_ib_device ),GFP_KERNEL ,ibdev_to_node (device));if (!rds_ibdev) - goto free_attr; +return ;spin_lock_init (&rds_ibdev->spinlock);atomic_set (&rds_ibdev->refcount,1 );INIT_WORK (&rds_ibdev->free_work, rds_ib_dev_free); - rds_ibdev->max_wrs = dev_attr->max_qp_wr; - rds_ibdev->max_sge =min (dev_attr->max_sge,RDS_IB_MAX_SGE ); + rds_ibdev->max_wrs = device->max_qp_wr; + rds_ibdev->max_sge =min (device->max_sge,RDS_IB_MAX_SGE ); - rds_ibdev->fmr_max_remaps = dev_attr->max_map_per_fmr?:32 ; - rds_ibdev->max_fmrs = dev_attr->max_fmr ? - min_t(unsigned int, dev_attr->max_fmr, fmr_pool_size) : + rds_ibdev->fmr_max_remaps = device->max_map_per_fmr?:32 ; + rds_ibdev->max_fmrs = device->max_fmr ? + min_t(unsigned int, device->max_fmr, fmr_pool_size) : fmr_pool_size; - rds_ibdev->max_initiator_depth = dev_attr->max_qp_init_rd_atom; - rds_ibdev->max_responder_resources = dev_attr->max_qp_rd_atom; + rds_ibdev->max_initiator_depth = device->max_qp_init_rd_atom; + rds_ibdev->max_responder_resources = device->max_qp_rd_atom; rds_ibdev->dev = device; rds_ibdev->pd =ib_alloc_pd (device);
@@ -183,8 +173,6 @@ static void rds_ib_add_one(struct ib_device *device) put_dev:rds_ib_dev_put (rds_ibdev); -free_attr: -kfree (dev_attr); }/*
net/rds/iw.c +5 -18
@@ -60,30 +60,20 @@ LIST_HEAD(iw_nodev_conns);static void rds_iw_add_one (struct ib_device *device) {struct rds_iw_device *rds_iwdev; -struct ib_device_attr *dev_attr;/* Only handle iwarp devices */ if (device->node_type !=RDMA_NODE_RNIC )return ; - dev_attr =kmalloc (sizeof *dev_attr,GFP_KERNEL ); -if (!dev_attr) -return ; - -if (ib_query_device (device, dev_attr)) { -rdsdebug ("Query device failed for %s\n" , device->name); - goto free_attr; - } - rds_iwdev =kmalloc (sizeof *rds_iwdev,GFP_KERNEL );if (!rds_iwdev) - goto free_attr; +return ;spin_lock_init (&rds_iwdev->spinlock); - rds_iwdev->dma_local_lkey = !!(dev_attr->device_cap_flags &IB_DEVICE_LOCAL_DMA_LKEY ); - rds_iwdev->max_wrs = dev_attr->max_qp_wr; - rds_iwdev->max_sge =min (dev_attr->max_sge,RDS_IW_MAX_SGE ); + rds_iwdev->dma_local_lkey = !!(device->device_cap_flags &IB_DEVICE_LOCAL_DMA_LKEY ); + rds_iwdev->max_wrs = device->max_qp_wr; + rds_iwdev->max_sge =min (device->max_sge,RDS_IW_MAX_SGE ); rds_iwdev->dev = device; rds_iwdev->pd =ib_alloc_pd (device);
@@ -111,8 +101,7 @@ static void rds_iw_add_one(struct ib_device *device)list_add_tail (&rds_iwdev->list, &rds_iw_devices);ib_set_client_data (device, &rds_iw_client, rds_iwdev); - - goto free_attr; +return ; err_mr:if (rds_iwdev->mr)
@@ -121,8 +110,6 @@ err_pd:ib_dealloc_pd (rds_iwdev->pd); free_dev:kfree (rds_iwdev); -free_attr: -kfree (dev_attr); }static void rds_iw_remove_one (struct ib_device *device,void *client_data)
net/sunrpc/xprtrdma/frwr_ops.c +3 -4
@@ -190,12 +190,11 @@ static int frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, struct rpcrdma_create_data_internal *cdata) { - struct ib_device_attr *devattr = &ia->ri_devattr; int depth, delta; ia->ri_max_frmr_depth = min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS, - devattr->max_fast_reg_page_list_len); + ia->ri_device->max_fast_reg_page_list_len);dprintk ("RPC: %s: device's max FR page list len = %u\n" , __func__, ia->ri_max_frmr_depth);
@@ -222,8 +221,8 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, } ep->rep_attr.cap.max_send_wr *= depth; -if (ep->rep_attr.cap.max_send_wr > devattr->max_qp_wr) { - cdata->max_requests = devattr->max_qp_wr / depth; +if (ep->rep_attr.cap.max_send_wr > ia->ri_device->max_qp_wr) { + cdata->max_requests = ia->ri_device->max_qp_wr / depth;if (!cdata->max_requests)return -EINVAL ; ep->rep_attr.cap.max_send_wr = cdata->max_requests *
net/sunrpc/xprtrdma/svc_rdma_transport.c +19 -29
120 lines not on this page · raw message
net/sunrpc/xprtrdma/verbs.c +8 -16
@@ -515,7 +515,6 @@ int rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) { struct rpcrdma_ia *ia = &xprt->rx_ia; -struct ib_device_attr *devattr = &ia->ri_devattr;int rc; ia->ri_dma_mr =NULL ;
@@ -535,16 +534,10 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) goto out2; } - rc =ib_query_device (ia->ri_device, devattr); -if (rc) { -dprintk ("RPC: %s: ib_query_device failed %d\n" , - __func__, rc); - goto out3; - } -if (memreg ==RPCRDMA_FRMR ) { -if (!(devattr->device_cap_flags &IB_DEVICE_MEM_MGT_EXTENSIONS ) || - (devattr->max_fast_reg_page_list_len ==0 )) { +if (!(ia->ri_device->device_cap_flags & +IB_DEVICE_MEM_MGT_EXTENSIONS ) || + (ia->ri_device->max_fast_reg_page_list_len ==0 )) {dprintk ("RPC: %s: FRMR registration " "not supported by HCA\n" , __func__); memreg =RPCRDMA_MTHCAFMR ;
@@ -619,20 +612,19 @@ int rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia, struct rpcrdma_create_data_internal *cdata) { - struct ib_device_attr *devattr = &ia->ri_devattr; struct ib_cq *sendcq, *recvcq;struct ib_cq_init_attr cq_attr = {};int rc, err; -if (devattr->max_sge <RPCRDMA_MAX_IOVS ) { +if (ia->ri_device->max_sge <RPCRDMA_MAX_IOVS ) {dprintk ("RPC: %s: insufficient sge's available\n" , __func__);return -ENOMEM ; }/* check provider's send/recv wr limits */ -if (cdata->max_requests > devattr->max_qp_wr) - cdata->max_requests = devattr->max_qp_wr; +if (cdata->max_requests > ia->ri_device->max_qp_wr) + cdata->max_requests = ia->ri_device->max_qp_wr; ep->rep_attr.event_handler = rpcrdma_qp_async_error_upcall; ep->rep_attr.qp_context = ep;
@@ -713,11 +705,11 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,/* Client offers RDMA Read but does not initiate */ ep->rep_remote_cma.initiator_depth =0 ; -if (devattr->max_qp_rd_atom >32 )/* arbitrary but <= 255 */ +if (ia->ri_device->max_qp_rd_atom >32 )/* arbitrary but <= 255 */ ep->rep_remote_cma.responder_resources =32 ;else ep->rep_remote_cma.responder_resources = - devattr->max_qp_rd_atom; + ia->ri_device->max_qp_rd_atom; ep->rep_remote_cma.retry_count =7 ; ep->rep_remote_cma.flow_control =0 ;
net/sunrpc/xprtrdma/xprt_rdma.h +0 -1
@@ -68,7 +68,6 @@ struct rpcrdma_ia {struct completion ri_done;int ri_async_rc;unsigned int ri_max_frmr_depth; -struct ib_device_attr ri_devattr;struct ib_qp_attr ri_qp_attr;struct ib_qp_init_attr ri_qp_init_attr; };
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Christoph Hellwig
This patch gets rid of struct
ib_device_attrand cleans up drivers nicely.It goes on top of my
send_wrcleanups and the memory registration udpates from Sagi.Changes since V1:
- rebased on top of the Sagi's latest reg_api.6 branch
Christoph,
First go with this looks OK for mlx4. mlx5 needs the below incremental patch to be folded in.
we need dev->ib_dev.max_pkeys set when get_port_caps() is called.
--
drivers/infiniband/hw/mlx5/main.c +4 -4
@@ -1321,6 +1321,10 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->mdev = mdev; + err =mlx5_ib_init_device_flags (&dev->ib_dev); +if (err) + goto err_dealloc; + err =get_port_caps (dev);if (err) goto err_dealloc;
@@ -1433,10 +1437,6 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)if (err) goto err_rsrc; - err =mlx5_ib_init_device_flags (&dev->ib_dev); -if (err) - goto err_rsrc; - err =ib_register_device (&dev->ib_dev,NULL );if (err) goto err_odp;
--
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 561B7CAE.3040505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 4 lines · Sagi Grimberg
First go with this looks OK for mlx4. mlx5 needs the below incremental patch to be folded in.
we need
dev->ib_dev.max_pkeysset whenget_port_caps()is called.
Thanks, I've folded your patch and force pushed out the updated tree. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
So this patch seems to work well for me. I've ran some kernel applications (ipoib, iser, srp, nfs) and a user-space application (ibsrpdm) over mlx4/mlx5 and didn't spot any issues.
I think this is very useful to have and I'd love having it in 4.4, does anyone have any other comments on this patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56262CF9.1040509-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 6 lines · Sagi Grimberg
So this patch seems to work well for me. I've ran some kernel applications (ipoib, iser, srp, nfs) and a user-space application (ibsrpdm) over mlx4/mlx5 and didn't spot any issues.
I think this is very useful to have and I'd love having it in 4.4, does anyone have any other comments on this patch?
Were we ever presented with performance gains achieved using the patch?
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAJ3xEMhEE=Qp=LcYQYJB3rjfhdgd28QG_ZXbpFUCUubGD2uAGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 5 lines
Quoted 3 lines
I think this is very useful to have and I'd love having it in 4.4, does anyone have any other comments on this patch?
Were we ever presented with performance gains achieved using the patch?
Hi Or,
Can you explain what you mean by performance gains? My understanding is that this patch is not performance critical. It just replaces each and every ULP device attributes caching.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56263CE6.5010005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 3 lines · Sagi Grimberg
Can you explain what you mean by performance gains? My understanding is that this patch is not performance critical. It just replaces each and every ULP device attributes caching.
Exactly. The only 'performance' we care about is that of ULD writers :) --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Sagi Grimberg
Quoted 4 lines
Quoted 2 lines
I think this is very useful to have and I'd love having it in 4.4, does anyone have any other comments on this patch?
Were we ever presented with performance gains achieved using the patch?
Can you explain what you mean by performance gains? My understanding is that this patch is not performance critical. It just replaces each and every ULP device attributes caching.
oops, sorry, I was referring to the patch that deals with re-structuring of struct ib_wc, so...
(1) did we even got performance gains achieved using **that** patch?
(2) re this one, as I wrote in the past, I am in favor of simple caching of structib_device_attr on struct ib_device (best with pointer) and not adding 333 fields
to struct ib_device, I don't see the benefit from this patch. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAJ3xEMjmfNmiTiNctobN=BKvwB-oaMZtBxdqL5zVyvvG_M1KiQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 6 lines · Or Gerlitz
Quoted 4 lines · Sagi Grimberg
Quoted 4 lines
Quoted 2 lines
I think this is very useful to have and I'd love having it in 4.4, does anyone have any other comments on this patch?
Were we ever presented with performance gains achieved using the patch?
Quoted 8 lines
Quoted 3 lines
Can you explain what you mean by performance gains? My understanding is that this patch is not performance critical. It just replaces each and every ULP device attributes caching.
oops, sorry, I was referring to the patch that deals with re-structuring of struct
ib_wc, so...(1) did we even got performance gains achieved using **that** patch?
I don't know if we'd see noticeable performance gains from **that** patch either.. The benefit is mostly stack relief as usually ULPs keep the work request structure on the stack.
Quoted 7 lines
(2) re this one, as I wrote in the past, I am in favor of simple caching of struct
ib_device_attron structib_device(best with pointer) and not adding 333 fields
to structib_device, I don't see the benefit from this patch.
Christoph commented on that:
"I'm strongly against this. As the reviews show the move is highly confusing. The attributes don't change and there is no need to 'cache' or 'query' them. Just merge them into the device, follow years of experience with how every other Linux subsystem does it and be done with it."
If the attributes are automatically a part of the ib_device then it does seem a bit redundant keeping the structure around...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56265702.1030209-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 6 lines · Sagi Grimberg
Quoted 3 lines
(2) re this one, as I wrote in the past, I am in favor of simple
caching of structib_device_attron structib_device(best with pointer) and not adding 333 fields to structib_device, I don't see the benefit from this patch.Christoph commented on that:
Quoted 8 lines
"I'm strongly against this. As the reviews show the move is highly confusing. The attributes don't change and there is no need to 'cache' or 'query' them. Just merge them into the device, follow years of experience with how every other Linux subsystem does it and be done with it."
If the attributes are automatically a part of the
ib_devicethen it does seem a bit redundant keeping the structure around...
But this makes struct ib_device much much bigger, and this structure is used in **fast** path,
e.g the ULP traverses through a pointer from struct ib_device to post_send/recv, poll_cq and friends.
The networking community will let you work for 10y before they add a field to struct net_device exactly b/c
of the reason I brought. Why here we can come out of the blue and add tens if not hundreds of fields to our device structure?
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAJ3xEMh12RjU9ws3r5djigHdkMGnT35+uouRAMzGxj2jhmgKFA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 5 lines
But this makes struct
ib_devicemuch much bigger, and this structure is used in **fast** path,
e.g the ULP traverses through a pointer from structib_deviceto post_send/recv,poll_cqand friends.
Umm, all the caps are appended to the end of the ib_device structure so I don't see how it will affect the fast path - am I missing something?
Quoted 5 lines
The networking community will let you work for 10y before they add a field to struct
net_deviceexactly b/c
of the reason I brought. Why here we can come out of the blue and add tens if not hundreds of fields to our device structure?
Keeping struct ib_device_attr embedded at the end of struct ib_device is exactly the same isn't it?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56265A1F.6090204-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 7 lines · Sagi Grimberg
Quoted 4 lines
The networking community will let you work for 10y before they add a field to struct
net_deviceexactly b/c
of the reason I brought. Why here we can come out of the blue and add tens if not hundreds of fields to our device structure?Keeping struct
ib_device_attrembedded at the end of structib_deviceis exactly the same isn't it?
I said " (best with pointer)"
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Sagi Grimberg
Quoted 4 lines
The networking community will let you work for 10y before they add a field to struct
net_deviceexactly b/c
of the reason I brought. Why here we can come out of the blue and add tens if not hundreds of fields to our device structure?Keeping struct
ib_device_attrembedded at the end of structib_deviceis exactly the same isn't it?
In terms of layout it is, in terms of usability it's worse. Just to take the networking example Or seems to like so much there is no struct netdev_attr to which fields of struct netdev are moved out to, which you then need to
query and cache anyway in your private device structure. This design simply
was a idiotic idea to start with and I don't understand why anyone would han onto it. I do understand Chuck's concern about churn, but I'd rather fix the infiniband subsystem up before we're growing even more users. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Or Gerlitz
But this makes struct
ib_devicemuch much bigger, and this structure is used in **fast** path,
e.g the ULP traverses through a pointer from structib_deviceto post_send/recv,poll_cqand friends.
But it doesn't get near the end of the structure. Maybe it's time for a little cache line 101 primer?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Or Gerlitz
Quoted 4 lines
But this makes struct
ib_devicemuch much bigger, and this structure is used in **fast** path,
e.g the ULP traverses through a pointer from structib_deviceto post_send/recv,poll_cqand friends.But it doesn't get near the end of the structure. Maybe it's time for a little cache line 101 primer?
Oh, not that I am fully qualified on that front, but I understand the end-of-structure argument.
Fact is that for struct net_device you will not add 333 new fields over night in the coming 33 years, for sure.
This makes much sense to me, as a guideline. I don't think we should have a device structure with the current 100 fields and another few hundreds without any notable benefit and against the common practice in the networking subsystem.
We have a UAPI that requires us to keep the device query verb for ever, and hence the returned device attr struct, it would be a much smaller and noisy patch to cache an device attr pointer on the device structure.
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56273459.6050007-VPRAkNaXOzVWk0Htik3J/[email protected]
Quoted 2 lines · Or Gerlitz
Fact is that for struct
net_deviceyou will not add 333 new fields over night in the coming 33 years, for sure.
That's because they never had this split and added fields to struct netdev as required. One interesting difference in netdev is that it move all the function pointers out to a different structure so it could be kept const. This introduces one more level of pointer chasing but has other advantages.
Quoted 5 lines
This makes much sense to me, as a guideline. I don't think we should have a device structure with the current
100 fields and another few hundreds without any notable benefit and against the common practice in the networking
subsystem.
Please understand the networking subsystem (or SCSI, or NVMe, or ...) before making such incorrect comments. We're moving towards how all other subsystems work.
Quoted 4 lines
We have a UAPI that requires us to keep the device query verb for ever, and hence the returned device attr struct,
it would be a much smaller and noisy patch to cache an device attr pointer on the device structure.
Take a look at the code. The only time we ever call into ->query_device is for the userspace only timestamping extensions only implemented for mlx4.
With all the stuff we have on the plate the kernel API will look substatially different from the arkane 'Verbs' implementation in userspace, and they will use less and less common code. Libuvers and the ABIs it uses are something we can't change unfortunately, but we can make the kernel API much much better by learining lessons from other kernel subsystems. That's work that Jason Sagi and me have been doing for a while.
I'd also suggest you update your Linux knowledge before trying to micromanage patch submissions.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Christoph Hellwig
Quoted 3 lines
We have a UAPI that requires us to keep the device query verb for ever, and hence the returned device attr struct, it would be a much smaller and noisy patch pointer to cache an device attr on the device structure.
Take a look at the code. The only time we ever call into ->query_device is for the userspace only timestamping extensions only implemented for mlx4.
We will have many more device query extensions, but the point I tried to make here is a bit different -- we do need to keep the user/kernel device attr struct as part of the UAPI, and don't see any reason to avoid it in the kernel, just because some other subsystems do that, according to your view. As I said, you would have to work real (real) hard to convince the networking ppl to add fields to struct net_device sk_buff and friends... the nature of rdma/offloading is such that new attr come often and I don't think we need to touch our device struct every release.
Quoted 9 lines
With all the stuff we have on the plate the kernel API will look substatially different from the arkane 'Verbs' implementation in userspace, and they will use less and less common code. Libuvers and the ABIs it uses are something we can't change unfortunately, but we can make the kernel API much much better by learining lessons from other kernel subsystems. That's work that Jason Sagi and me have been doing for a while.
I'd also suggest you update your Linux knowledge before trying to micromanage patch submissions.
not trying to micro-manage @ all, I went over the archives and haven't found any review or ack to your giant patch that touches the whole subsystem (drivers, core and ULPs) expect from Sagi's -- lets hear more opinions. Re my education -- can you make the argument more precise: what are we making much much better in the kernel API by thins house moving exercise?
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56273AA1.6060607-VPRAkNaXOzVWk0Htik3J/[email protected]
Quoted 2 lines · Or Gerlitz
We will have many more device query extensions,
None of which use struct ib_device_attr I hope!
Quoted 3 lines
but the point I tried to
make here is a bit different --
we do need to keep the user/kernel device attr struct as part of the UAPI,
It's an entirely separate ib_uverbs_query_device_resp structure.
Quoted 5 lines
and don't see any reason to
avoid it in the kernel, just because some other subsystems do that, according to your view. As I said, you
would have to work real (real) hard to convince the networking ppl to add fields to structnet_devicesk_buff
Or, please stop these bullshit strawman arguments. Yes, adding fields to struct sk_buff will be hard, but that's not the right comparism. struct sk_buff is a structured allocated for the data buffers in great quantities and not the net_device structure allocated once per device. I'm going to finish this email, but if you don't even try to get your facts right I'll stop responding ro you because it's futile.
Quoted 3 lines
and friends... the nature of rdma/offloading is such that new attr come often and I don't think we need
to touch our device struct every release.
For anything you want to add you need to touch _a_ struct. It's not any difference in efforts if it's ib_device_attr or ib_device.
You're not even saving much memory if at all as every driver caches at least some fields of it in their own device structure, and iser, isert, srpt and nfs cache the full structure, so if you use one of those you're already having one of them per device. If you use two of them you have multiple copies plus individual fields caches by other ULDs and core code.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Christoph Hellwig
For anything you want to add you need to
touch_a_struct. It's not any difference in efforts if it'sib_device_attrorib_device.You're not even saving much memory if at all as every driver caches at least some fields of it in their own device structure, and iser, isert, srpt and nfs cache the full structure,
I know, but a patch that adds caching an attr pointer on the device will remove these local caches, we actually had that/similar patch posted here and it was dropped/forgotten.
Quoted 4 lines
so if you use one of those you're
already having one of them per device. If you use two of them you have multiple copies plus individual fields caches by other ULDs and core code.
again, the method I propose does remove these duplications all together.
I am still waiting to hear what is the precise argument for having this change.
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 56274199.1030800-VPRAkNaXOzVWk0Htik3J/[email protected]
Quoted 9 lines · Or Gerlitz
I know, but a patch that adds caching an attr pointer on the device will remove these local caches,
we actually had that/similar patch posted here and it was dropped/forgotten.Quoted 4 lines
so if you use one of those you're
already having one of them per device. If you use two of them you have multiple copies plus individual fields caches by other ULDs and core code.
Quoted 4 lines
again, the method I propose does remove these duplications all together.
I am still waiting to hear what is the precise argument for having this change.
It does everything the pointer does, but in addition saves memory (no rounding up of the slab size), reduces pointer chasing and makes and API that's easier to use and more similar to how all other major Linux subsystems work.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Or Gerlitz
haven't found any review or ack to your giant patch that touches the whole subsystem (drivers, core and ULPs) expect from Sagi's -- lets hear more opinions.
Although I have not yet had the time to review the entire patch, removing ib_query_device() seems a great idea to me and an idea that I welcome very much. The ib_device_attr structure is too large to be allocated on the stack. This means that with Christoph's patch it is no longer needed to call kmalloc() + ib_query_device() + kfree() when a device attribute is needed from kernel code.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · Bart Van Assche
Quoted 3 lines · Or Gerlitz
haven't found any review or ack to your giant patch that touches the whole subsystem (drivers, core and ULPs) expect from Sagi's -- lets hear more opinions.
Although I have not yet had the time to review the entire patch, removing
ib_query_device()seems a great idea to me and an idea that I welcome very much. Theib_device_attrstructure is too large to be allocated on the stack. This means that with Christoph's patch it is no longer needed to callkmalloc()+ib_query_device()+kfree()when a device attribute is needed from kernel code.
I agree, this is absolutely the right way to go.
The bikeshedding is not important, nobody has come up with a reason why we need to maintain the attr structure as-is and Christoph already has a patch - I say go with it.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20151021164356.GA17666-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Quoted 11 lines · Jason Gunthorpe
Quoted 10 lines · Bart Van Assche
Quoted 3 lines · Or Gerlitz
haven't found any review or ack to your giant patch that touches the whole subsystem (drivers, core and ULPs) expect from Sagi's -- lets hear more opinions.
Although I have not yet had the time to review the entire patch, removing
ib_query_device()seems a great idea to me and an idea that I welcome very much. Theib_device_attrstructure is too large to be allocated on the stack. This means that with Christoph's patch it is no longer needed to callkmalloc()+ib_query_device()+kfree()when a device attribute is needed from kernel code.
Quoted 8 lines
I agree, this is absolutely the right way to go.
The bikeshedding is not important, nobody has come up with a reason why we need to maintain the attr structure as-is and Christoph already has a patch - I say go with it.
Jason
While I don't really like the uber patch review-wise, I'm all for nuking ib_query_device() and the attr struct.
Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Bart Van Assche
Quoted 5 lines · Or Gerlitz
haven't found any review or ack to your giant patch that touches the
whole subsystem (drivers, core and ULPs) expect from Sagi's -- lets hear more opinions.
Quoted 6 lines
Although I have not yet had the time to review the entire patch, removing
ib_query_device()seems a great idea to me and an idea that I welcome very much. Theib_device_attrstructure is too large to be allocated on the stack. This means that with Christoph's patch it is no longer needed to callkmalloc()+ib_query_device()+kfree()when a device attribute is needed from kernel code.
Bart, Jason, Steve,
The alternative approach to address this which was also running here in the form of a patch from Ira following a reviewer comment from me, is the have struct ib_device to contain a struct ib_device_attr member (potentially a pointer) which is filled by the device driver before they register themselves with the IB core.
This way there's no need for kmalloc() + ib_query_device() + kfree() when a device attribute is needed and we don't introduce tens/hundreds new fields for struct ib_device.
Thoughts?
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAJ3xEMh3pE61sNaZKBr8k47Lb52cUc=n4JToXvvKyrTTu3WW2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 5 lines · Or Gerlitz
The alternative approach to address this which was also running here in the form of a patch from Ira following a reviewer comment from me, is the have struct
ib_deviceto contain a structib_device_attrmember (potentially a pointer) which is filled by the device driver before they register themselves with the IB core.
No to the pointer idea.
Quoted 3 lines
This way there's no need for
kmalloc()+ib_query_device()+kfree()when a device attribute is needed and we don't introduce tens/hundreds new fields for structib_device.
I care very little if the name is ibdev->attr.foo or ibdev->foo, that is just bikeshedding.
I have a slight preference toward ibdev->foo to match other subsystems.
I have no idea why you care so much about something so trivial.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20151021182019.GB15771-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Quoted 1 line · Jason Gunthorpe
No to the pointer idea.
can you spare few words why?
And if you have a valid argument, as Christoph said they teach in cache 101 course which he's pretty sure I skipped as twenty other courses taken by kernel developers, put the no pointer member @ the end
Quoted 1 line
I have a slight preference toward
ibdev->footo match other subsystems.
I have a slight preference to keep the struct ib_device_attr notion to match other portions of the RDMA stack such as the UAPI and the user space API to applications.
Quoted 1 line
I have no idea why you care so much about something so trivial.
I don't care so much, I have the small right to speak without getting so much mud on my head.
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Did we converge on this?
Just a heads up to Doug, this conflicts with
[PATCH v4 11/16] xprtrdma: Pre-allocate Work Requests for backchannel
but it's trivial to sort out...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html