Skip to content

Commit 4af1f9a

Browse files
walking-machineanguy11
authored andcommitted
idpf: fix LAN memory regions command on some NVMs
IPU SDK versions 1.9 through 2.0.5 require send buffer to contain a single empty memory region. Set number of regions to 1 and use appropriate send buffer size to satisfy this requirement. Fixes: 6aa53e8 ("idpf: implement get LAN MMIO memory regions") Suggested-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 6daa289 commit 4af1f9a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,9 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)
10161016
struct idpf_vc_xn_params xn_params = {
10171017
.vc_op = VIRTCHNL2_OP_GET_LAN_MEMORY_REGIONS,
10181018
.recv_buf.iov_len = IDPF_CTLQ_MAX_BUF_LEN,
1019+
.send_buf.iov_len =
1020+
sizeof(struct virtchnl2_get_lan_memory_regions) +
1021+
sizeof(struct virtchnl2_mem_region),
10191022
.timeout_ms = IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC,
10201023
};
10211024
int num_regions, size;
@@ -1028,6 +1031,8 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)
10281031
return -ENOMEM;
10291032

10301033
xn_params.recv_buf.iov_base = rcvd_regions;
1034+
rcvd_regions->num_memory_regions = cpu_to_le16(1);
1035+
xn_params.send_buf.iov_base = rcvd_regions;
10311036
reply_sz = idpf_vc_xn_exec(adapter, &xn_params);
10321037
if (reply_sz < 0)
10331038
return reply_sz;

0 commit comments

Comments
 (0)