On Fri, Sep 23, 2022 at 11:53 AM Angus Chen <[email protected]> wrote:
>
> The array capacity should be queuepair,
If this is true, we need a better name for the ifcvf_vring_lm_cfg structure.
Thanks
> and the queuepairs should
> be half of IFCVF_MAX_QUEUES without control queue,
> or should be (IFCVF_MAX_QUEUES+1)/2 with the control queue.
> So the definition of ifcvf_lm_cfg waste some memory,
> and it will waste some ioremap area also.
>
> Fixes: 2ddae773c93b ("vDPA/ifcvf: detect and use the onboard number of queues
> directly")
> Signed-off-by: Angus Chen <[email protected]>
> ---
> drivers/vdpa/ifcvf/ifcvf_base.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h
> index f5563f665cc6..563c04f9b7ac 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.h
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.h
> @@ -104,7 +104,7 @@ struct ifcvf_vring_lm_cfg {
>
> struct ifcvf_lm_cfg {
> u8 reserved[IFCVF_LM_RING_STATE_OFFSET];
> - struct ifcvf_vring_lm_cfg vring_lm_cfg[IFCVF_MAX_QUEUES];
> + struct ifcvf_vring_lm_cfg vring_lm_cfg[(IFCVF_MAX_QUEUES+1)/2];
> };
>
> struct ifcvf_vdpa_mgmt_dev {
> --
> 2.17.1
>
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization