[PATCH] tools: hv: kvp: fix memory leak in realloc failure handling

2023-09-23 Thread Kuan-Wei Chiu
In the previous code, there was a memory leak issue where the previously allocated memory was not freed upon a failed realloc operation. This patch addresses the problem by releasing the old memory before setting the pointer to NULL in case of a realloc failure. This ensures that memory is

Re: [PATCH net, 3/3] net: mana: Fix oversized sge0 for GSO packets

2023-09-23 Thread Greg KH
On Sat, Sep 23, 2023 at 06:31:47PM -0700, Haiyang Zhang wrote: > Handle the case when GSO SKB linear length is too large. > > MANA NIC requires GSO packets to put only the header part to SGE0, > otherwise the TX queue may stop at the HW level. > > So, use 2 SGEs for the skb linear part which

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-23 Thread Saurabh Singh Sengar
On Sat, Sep 23, 2023 at 08:58:00PM +, Wei Liu wrote: > Greg, thank you for looking at the code. > > On Sat, Sep 23, 2023 at 09:56:13AM +0200, Greg KH wrote: > > On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote: > > > +static int __init mshv_vtl_init(void) > > > +{ > > > + int

[PATCH net, 3/3] net: mana: Fix oversized sge0 for GSO packets

2023-09-23 Thread Haiyang Zhang
Handle the case when GSO SKB linear length is too large. MANA NIC requires GSO packets to put only the header part to SGE0, otherwise the TX queue may stop at the HW level. So, use 2 SGEs for the skb linear part which contains more than the packet header. Fixes: ca9c54d2d6a5 ("net: mana: Add a

[PATCH net, 2/3] net: mana: Fix the tso_bytes calculation

2023-09-23 Thread Haiyang Zhang
sizeof(struct hop_jumbo_hdr) is not part of tso_bytes, so remove the subtraction from header size. Cc: sta...@vger.kernel.org Fixes: bd7fc6e1957c ("net: mana: Add new MANA VF performance counters for easier troubleshooting") Signed-off-by: Haiyang Zhang ---

[PATCH net, 1/3] net: mana: Fix TX CQE error handling

2023-09-23 Thread Haiyang Zhang
For an unknown TX CQE error type (probably from a newer hardware), still free the SKB, update the queue tail, etc., otherwise the accounting will be wrong. Also, TX errors can be triggered by injecting corrupted packets, so replace the WARN_ONCE to ratelimited error logging, because we don't need

[PATCH net, 0/3] net: mana: Fix some TX processing bugs

2023-09-23 Thread Haiyang Zhang
Fix TX processing bugs on error handling, tso_bytes calculation, and sge0 size. Haiyang Zhang (3): net: mana: Fix TX CQE error handling net: mana: Fix the tso_bytes calculation net: mana: Fix oversized sge0 for GSO packets drivers/net/ethernet/microsoft/mana/mana_en.c | 206

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-23 Thread Wei Liu
Greg, thank you for looking at the code. On Sat, Sep 23, 2023 at 09:56:13AM +0200, Greg KH wrote: > On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote: > > +static int __init mshv_vtl_init(void) > > +{ > > + int ret; > > + > > + tasklet_init(_dpc, mshv_vtl_sint_on_msg_dpc, 0); > >

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-23 Thread Greg KH
On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote: > +static int mshv_vtl_get_vsm_regs(void) > +{ > + struct hv_register_assoc registers[2]; > + union hv_input_vtl input_vtl; > + int ret, count = 2; > + > + input_vtl.as_uint8 = 0; > + registers[0].name =

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-23 Thread Greg KH
On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote: > +static int __init mshv_vtl_init(void) > +{ > + int ret; > + > + tasklet_init(_dpc, mshv_vtl_sint_on_msg_dpc, 0); > + init_waitqueue_head(_wait_queue); > + > + if (mshv_vtl_get_vsm_regs()) { > +