Re: [PATCH v2 06/10] vhost-scsi: cache log buffer in I/O queue vhost_scsi_cmd

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

 



On 3/17/25 7:04 PM, Dongli Zhang wrote:
> @@ -1390,6 +1424,24 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
>  			goto err;
>  		}
> 
> +		if (unlikely(vq_log && log_num)) {
> +			if (!cmd->tvc_log)
> +				cmd->tvc_log = kmalloc_array(vq->dev->iov_limit,
> +							     sizeof(*cmd->tvc_log),
> +							     GFP_KERNEL);
> +
> +			if (likely(cmd->tvc_log)) {
> +				memcpy(cmd->tvc_log, vq->log,> +				       sizeof(*cmd->tvc_log) * log_num);
> +				cmd->tvc_log_num = log_num;


Hey Dongli, this approach seems ok.

Could you just move this to a function?




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux