> -----Original Message----- > From: Jason Gunthorpe <jgg@xxxxxxxx> > Sent: Thursday, November 22, 2018 3:09 PM > To: Leon Romanovsky <leon@xxxxxxxxxx> > Cc: Doug Ledford <dledford@xxxxxxxxxx>; Leon Romanovsky > <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux-rdma@xxxxxxxxxxxxxxx>; > Daniel Jurgens <danielj@xxxxxxxxxxxx>; Parav Pandit > <parav@xxxxxxxxxxxx> > Subject: Re: [PATCH rdma-next 3/9] RDMA/core: Introduce ib_core_device to > hold device > > On Wed, Nov 21, 2018 at 10:44:55AM +0200, Leon Romanovsky wrote: > > @@ -1189,7 +1190,7 @@ static int add_port(struct ib_device *device, > > int port_num, static ssize_t node_type_show(struct device *device, > > struct device_attribute *attr, char *buf) { > > - struct ib_device *dev = container_of(device, struct ib_device, dev); > > + struct ib_device *dev = rdma_device_to_ibdev(device); > > > > switch (dev->node_type) { > > case RDMA_NODE_IB_CA: return sprintf(buf, "%d: CA\n", dev- > >node_type); > > @@ -1206,7 +1207,7 @@ static DEVICE_ATTR_RO(node_type); static > > ssize_t sys_image_guid_show(struct device *device, > > struct device_attribute *dev_attr, char > *buf) { > > - struct ib_device *dev = container_of(device, struct ib_device, dev); > > + struct ib_device *dev = rdma_device_to_ibdev(device); > > > > return sprintf(buf, "%04x:%04x:%04x:%04x\n", > > be16_to_cpu(((__be16 *) &dev- > >attrs.sys_image_guid)[0]), @@ > > -1219,7 +1220,7 @@ static DEVICE_ATTR_RO(sys_image_guid); static > > ssize_t node_guid_show(struct device *device, > > struct device_attribute *attr, char *buf) { > > - struct ib_device *dev = container_of(device, struct ib_device, dev); > > + struct ib_device *dev = rdma_device_to_ibdev(device); > > > > return sprintf(buf, "%04x:%04x:%04x:%04x\n", > > be16_to_cpu(((__be16 *) &dev->node_guid)[0]), @@ - > 1232,7 > > +1233,7 @@ static DEVICE_ATTR_RO(node_guid); static ssize_t > > node_desc_show(struct device *device, > > struct device_attribute *attr, char *buf) { > > - struct ib_device *dev = container_of(device, struct ib_device, dev); > > + struct ib_device *dev = rdma_device_to_ibdev(device); > > > > return sprintf(buf, "%.64s\n", dev->node_desc); } @@ -1241,7 > > +1242,7 @@ static ssize_t node_desc_store(struct device *device, > > struct device_attribute *attr, > > const char *buf, size_t count) { > > - struct ib_device *dev = container_of(device, struct ib_device, dev); > > + struct ib_device *dev = rdma_device_to_ibdev(device); > > struct ib_device_modify desc = {}; > > int ret; > > > > @@ -1260,7 +1261,7 @@ static DEVICE_ATTR_RW(node_desc); static > > ssize_t fw_ver_show(struct device *device, struct device_attribute *attr, > > char *buf) > > { > > - struct ib_device *dev = container_of(device, struct ib_device, dev); > > + struct ib_device *dev = rdma_device_to_ibdev(device); > > > > ib_get_device_fw_str(dev, buf); > > strlcat(buf, "\n", IB_FW_VERSION_NAME_MAX); > > Why not put these in the prior patch? Yes. This was moved to prior patch on internal gerrit on 7th Nov and Leon had +2 on 19th Nov. So I assumed that he would have picked up the new patch. He has taken this patch in the series a while back, so what actually came out for this and previous patch is older version. I missed to update him to retake this patch again for these minor change. I will do better communication next time. > > > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index > > c7055e242792..ccb279cc5d98 100644 > > +++ b/include/rdma/ib_verbs.h > > @@ -2253,6 +2253,15 @@ struct ib_counters_read_attr { > > > > struct uverbs_attr_bundle; > > > > +struct ib_core_device { > > + /* device must be the first element in structure until, > > + * union of ib_core_device and device exists in ib_device. > > + */ > > + struct device dev; > > + struct kobject *ports_kobj; > > + struct list_head port_list; > > +}; > > Bleck, don't do the horizontal white space thing. If you really can't help > yourself then at least choose a sane alignment column, this is just ugly. > This one too, in internal Gerrit, this was fixed on 31st Oct when you reviewed internally. Leon took few patches before that in the series and I missed to update him to re-take the all the patches. Regardless, will have send v1 through Leon. > Jason