On Mon, Mar 07, 2016 at 02:43:13PM -0700, Jason Gunthorpe wrote: > On Mon, Mar 07, 2016 at 11:08:53PM +0200, Eli Cohen wrote: > > + err = ib_query_gid(ibdev, port, 0, &gid, NULL); > > + if (err) > > + return err; > > + > > + props->subnet_prefix = be64_to_cpu(gid.global.subnet_prefix); > > Why not put this common pattern in ibv_query_port? > > device->query_port(ibdev, port, ..); > if (props->subnet_prefix == 0) { Why do you need this conditional? > err = ib_query_gid(ibdev, port, 0, &gid, NULL); > if (err) > return err; > > props->subnet_prefix = be64_to_cpu(gid.global.subnet_prefix); > } > > > +++ b/include/rdma/ib_verbs.h > > @@ -509,6 +509,7 @@ struct ib_port_attr { > > u8 active_width; > > u8 active_speed; > > u8 phys_state; > > + u64 subnet_prefix; > > }; > > Can we put that at the start for better alignment? > Sure, makes sense. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html