[PATCH 1/1] vhost: fix a double fetch when dequeue offloading
    Stephen Hemminger 
    stephen at networkplumber.org
       
    Thu Dec 19 17:15:32 CET 2024
    
    
  
On Thu, 19 Dec 2024 14:38:28 +0800
Yunjian Wang <wangyunjian at huawei.com> wrote:
> -			hdr = (struct virtio_net_hdr *)((uintptr_t)buf_vec[0].buf_addr);
> +			rte_memcpy((void *)(uintptr_t)&tmp_hdr,
> +				(void *)(uintptr_t)buf_vec[0].buf_addr,
> +				sizeof(struct virtio_net_hdr));
>  		}
Do not introduce more rte_memcpy of a fixed size.
You don't need that many casts!
Why can you not use a structure assignment here.
    
    
More information about the dev
mailing list