Re: [PATCH rdma-next V1 03/10] IB/core: Add subnet prefix to port info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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) {
   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?

Jason
--
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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux