Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull more rdma updates from Jason Gunthorpe: "This is being sent to get a fix for the gcc 9.1 build warnings, and I've also pulled in some bug fix patches that were posted in the last two weeks. - Avoid the gcc 9.1 warning about overflowing a union member - Fix the wrong callback type for a single response netlink to doit - Bug fixes from more usage of the mlx5 devx interface" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: net/mlx5: Set completion EQs as shared resources IB/mlx5: Verify DEVX general object type correctly RDMA/core: Change system parameters callback from dumpit to doit RDMA: Directly cast the sockaddr union to sockaddr
This commit is contained in:
@@ -154,7 +154,7 @@ bool mlx5_ib_devx_is_flow_counter(void *obj, u32 *counter_id)
|
||||
* must be considered upon checking for a valid object id.
|
||||
* For that the opcode of the creator command is encoded as part of the obj_id.
|
||||
*/
|
||||
static u64 get_enc_obj_id(u16 opcode, u32 obj_id)
|
||||
static u64 get_enc_obj_id(u32 opcode, u32 obj_id)
|
||||
{
|
||||
return ((u64)opcode << 32) | obj_id;
|
||||
}
|
||||
@@ -167,7 +167,9 @@ static u64 devx_get_obj_id(const void *in)
|
||||
switch (opcode) {
|
||||
case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT:
|
||||
case MLX5_CMD_OP_QUERY_GENERAL_OBJECT:
|
||||
obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_GENERAL_OBJECT,
|
||||
obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_GENERAL_OBJECT |
|
||||
MLX5_GET(general_obj_in_cmd_hdr, in,
|
||||
obj_type) << 16,
|
||||
MLX5_GET(general_obj_in_cmd_hdr, in,
|
||||
obj_id));
|
||||
break;
|
||||
@@ -1171,6 +1173,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)(
|
||||
struct mlx5_ib_dev *dev = to_mdev(c->ibucontext.device);
|
||||
u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)];
|
||||
struct devx_obj *obj;
|
||||
u16 obj_type = 0;
|
||||
int err;
|
||||
int uid;
|
||||
u32 obj_id;
|
||||
@@ -1230,7 +1233,11 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)(
|
||||
if (err)
|
||||
goto err_copy;
|
||||
|
||||
obj->obj_id = get_enc_obj_id(opcode, obj_id);
|
||||
if (opcode == MLX5_CMD_OP_CREATE_GENERAL_OBJECT)
|
||||
obj_type = MLX5_GET(general_obj_in_cmd_hdr, cmd_in, obj_type);
|
||||
|
||||
obj->obj_id = get_enc_obj_id(opcode | obj_type << 16, obj_id);
|
||||
|
||||
return 0;
|
||||
|
||||
err_copy:
|
||||
|
@@ -83,7 +83,6 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
|
||||
struct iphdr ipv4;
|
||||
const struct ib_global_route *ib_grh;
|
||||
union {
|
||||
struct sockaddr _sockaddr;
|
||||
struct sockaddr_in _sockaddr_in;
|
||||
struct sockaddr_in6 _sockaddr_in6;
|
||||
} sgid_addr, dgid_addr;
|
||||
@@ -133,9 +132,9 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
|
||||
ipv4.tot_len = htons(0);
|
||||
ipv4.ttl = ib_grh->hop_limit;
|
||||
ipv4.protocol = nxthdr;
|
||||
rdma_gid2ip(&sgid_addr._sockaddr, sgid);
|
||||
rdma_gid2ip((struct sockaddr *)&sgid_addr, sgid);
|
||||
ipv4.saddr = sgid_addr._sockaddr_in.sin_addr.s_addr;
|
||||
rdma_gid2ip(&dgid_addr._sockaddr, &ib_grh->dgid);
|
||||
rdma_gid2ip((struct sockaddr*)&dgid_addr, &ib_grh->dgid);
|
||||
ipv4.daddr = dgid_addr._sockaddr_in.sin_addr.s_addr;
|
||||
memcpy((u8 *)ah->av + eth_sz, &ipv4, sizeof(struct iphdr));
|
||||
} else {
|
||||
|
@@ -2499,7 +2499,6 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
|
||||
u16 vlan_id = 0xFFFF;
|
||||
u8 mac_addr[6], hdr_type;
|
||||
union {
|
||||
struct sockaddr _sockaddr;
|
||||
struct sockaddr_in _sockaddr_in;
|
||||
struct sockaddr_in6 _sockaddr_in6;
|
||||
} sgid_addr, dgid_addr;
|
||||
@@ -2542,8 +2541,8 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
|
||||
|
||||
hdr_type = rdma_gid_attr_network_type(sgid_attr);
|
||||
if (hdr_type == RDMA_NETWORK_IPV4) {
|
||||
rdma_gid2ip(&sgid_addr._sockaddr, &sgid_attr->gid);
|
||||
rdma_gid2ip(&dgid_addr._sockaddr, &grh->dgid);
|
||||
rdma_gid2ip((struct sockaddr *)&sgid_addr, &sgid_attr->gid);
|
||||
rdma_gid2ip((struct sockaddr *)&dgid_addr, &grh->dgid);
|
||||
memcpy(&cmd->params.dgid[0],
|
||||
&dgid_addr._sockaddr_in.sin_addr.s_addr, 4);
|
||||
memcpy(&cmd->params.sgid[0],
|
||||
|
Reference in New Issue
Block a user