[PATCH net-next v2] net/mlx5e: Fix uninitialised struct field moder.comps

2021-04-20 Thread wangyunjian
From: Yunjian Wang The 'comps' struct field in 'moder' is not being initialized in mlx5e_get_def_rx_moderation() and mlx5e_get_def_tx_moderation(). So initialize 'moder' to zero to avoid the issue. Addresses-Coverity: ("Uninitialized scalar variable") Signed-off-by: Yunjian Wang --- v2: update

[PATCH net] net/mlx5e: Fix uninitialised struct field moder.comps

2021-04-19 Thread wangyunjian
From: Yunjian Wang The 'comps' struct field in 'moder' is not being initialized in mlx5e_get_def_rx_moderation(). So initialize 'moder' to zero to avoid the issue. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 398c2b05bbee ("linux/dim: Add completions count to dim_sample") Signed-

[PATCH net] i40e: Fix use-after-free in i40e_client_subtask()

2021-04-12 Thread wangyunjian
From: Yunjian Wang Currently the call to i40e_client_del_instance frees the object pf->cinst, however pf->cinst->lan_info is being accessed after the free. Fix this by adding the missing return. Addresses-Coverity: ("Read from pointer after free") Fixes: 7b0b1a6d0ac9 ("i40e: Disable iWARP VSI PE

[PATCH net] net: cls_api: Fix uninitialised struct field bo->unlocked_driver_cb

2021-03-31 Thread wangyunjian
From: Yunjian Wang The 'unlocked_driver_cb' struct field in 'bo' is not being initialized in tcf_block_offload_init(). The uninitialized 'unlocked_driver_cb' will be used when calling unlocked_driver_cb(). So initialize 'bo' to zero to avoid the issue. Addresses-Coverity: ("Uninitialized scalar

[PATCH net] sch_htb: fix null pointer dereference on a null new_q

2021-03-30 Thread wangyunjian
From: Yunjian Wang sch_htb: fix null pointer dereference on a null new_q Currently if new_q is null, the null new_q pointer will be dereference when 'q->offload' is true. Fix this by adding a braces around htb_parent_to_leaf_offload() to avoid it. Addresses-Coverity: ("Dereference after null ch

[PATCH net-next] ice: remove redundant null check on pf

2021-01-27 Thread wangyunjian
From: Yunjian Wang Before calling ice_set_dflt_mib(), the 'pf' has been dereferenced. So the additional check is unnecessary, just remove it. Addresses-Coverity: ("Dereference before null check") Fixes: 7d9c9b791f9e ("ice: Implement LFC workaround") Signed-off-by: Yunjian Wang --- drivers/net/

[PATCH net v2] ixgbe: add NULL pointer check before calling xdp_rxq_info_reg

2021-01-22 Thread wangyunjian
From: Yunjian Wang The rx_ring->q_vector could be NULL, so it needs to be checked before calling xdp_rxq_info_reg. Fixes: b02e5a0ebb172 ("xsk: Propagate napi_id to XDP socket Rx path") Addresses-Coverity: ("Dereference after null check") Signed-off-by: Yunjian Wang --- v2: * fix commit log --

[PATCH net] ixgbe: add NULL pointer check before calling xdp_rxq_info_reg

2021-01-22 Thread wangyunjian
From: Yunjian Wang The rx_ring->q_vector could be NULL, so it need to be checked before calling xdp_rxq_info_reg. Fixes: b02e5a0ebb172 ("xsk: Propagate napi_id to XDP socket Rx path") Addresses-Coverity: ("Dereference after null check") Signed-off-by: Yunjian Wang --- drivers/net/ethernet/inte

[PATCH net-next v7] vhost_net: avoid tx queue stuck when sendmsg fails

2021-01-14 Thread wangyunjian
From: Yunjian Wang Currently the driver doesn't drop a packet which can't be sent by tun (e.g bad packet). In this case, the driver will always process the same packet lead to the tx queue stuck. To fix this issue: 1. in the case of persistent failure (e.g bad packet), the driver can skip thi

[PATCH net-next] devlink: fix return of uninitialized variable err

2021-01-08 Thread wangyunjian
From: Yunjian Wang There is a potential execution path in which variable err is returned without being properly initialized previously. Fix this by initializing variable err to 0. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 1db64e8733f6 ("devlink: Add devlink formatted message (

[PATCH v6] vhost_net: avoid tx queue stuck when sendmsg fails

2021-01-07 Thread wangyunjian
From: Yunjian Wang Currently the driver doesn't drop a packet which can't be sent by tun (e.g bad packet). In this case, the driver will always process the same packet lead to the tx queue stuck. To fix this issue: 1. in the case of persistent failure (e.g bad packet), the driver can skip thi

RE: [PATCH net] macvlan: fix null pointer dereference in macvlan_changelink_sources()

2021-01-04 Thread wangyunjian
> -Original Message- > From: Jakub Kicinski [mailto:k...@kernel.org] > Sent: Tuesday, January 5, 2021 5:35 AM > To: wangyunjian > Cc: netdev@vger.kernel.org; da...@davemloft.net; Lilijun (Jerry) > ; xudingke > Subject: Re: [PATCH net] macvlan: fix null p

[PATCH net v2] macvlan: remove redundant null check on data

2021-01-04 Thread wangyunjian
From: Yunjian Wang Because macvlan_common_newlink() and macvlan_changelink() already checked NULL data parameter, so the additional check is unnecessary, just remove it. Fixes: 79cf79abce71 ("macvlan: add source mode") Signed-off-by: Yunjian Wang --- v2: * change code styles and commit log su

[PATCH net] macvlan: fix null pointer dereference in macvlan_changelink_sources()

2020-12-30 Thread wangyunjian
From: Yunjian Wang Currently pointer data is dereferenced when declaring addr before pointer data is null checked. This could lead to a null pointer dereference. Fix this by checking if pointer data is null first. Fixes: 79cf79abce71 ("macvlan: add source mode") Signed-off-by: Yunjian Wang ---

[PATCH net v6] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-28 Thread wangyunjian
From: Yunjian Wang Currently the vhost_zerocopy_callback() maybe be called to decrease the refcount when sendmsg fails in tun. The error handling in vhost handle_tx_zerocopy() will try to decrease the same refcount again. This is wrong. To fix this issue, we only call vhost_net_ubuf_put() when vq

RE: [PATCH net v5 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-28 Thread wangyunjian
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Sunday, December 27, 2020 7:21 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; jasow...@redhat.com; > willemdebruijn.ker...@gmail.com; virtualizat...@lists.linux-foundation.org

RE: [PATCH net v5 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-28 Thread wangyunjian
> -Original Message- > From: Willem de Bruijn [mailto:willemdebruijn.ker...@gmail.com] > Sent: Monday, December 28, 2020 12:15 AM > To: Michael S. Tsirkin > Cc: wangyunjian ; Network Development > ; Jason Wang ; Willem de > Bruijn ; > virtualizat...@lists.linux

RE: [PATCH net v5 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-28 Thread wangyunjian
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Sunday, December 27, 2020 7:21 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; jasow...@redhat.com; > willemdebruijn.ker...@gmail.com; virtualizat...@lists.linux-foundation.org

[PATCH net v2] net: hns: fix return value check in __lb_other_process()

2020-12-26 Thread wangyunjian
From: Yunjian Wang The function skb_copy() could return NULL, the return value need to be checked. Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support") Signed-off-by: Yunjian Wang --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 1 file changed, 4 i

RE: [PATCH net] net: hns: fix return value check in __lb_other_process()

2020-12-25 Thread wangyunjian
> -Original Message- > From: liuyonglong > Sent: Saturday, December 26, 2020 2:39 PM > To: wangyunjian ; netdev@vger.kernel.org > Cc: Zhuangyuzeng (Yisen) ; Salil Mehta > ; Lilijun (Jerry) ; > xudingke > Subject: Re: [PATCH net] net: hns: fix return value check

[PATCH net] net: hns: fix return value check in __lb_other_process()

2020-12-25 Thread wangyunjian
From: Yunjian Wang The function skb_copy() could return NULL, the return value need to be checked. Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support") Signed-off-by: Yunjian Wang --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 1 file changed, 4 i

[PATCH net v5 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-24 Thread wangyunjian
From: Yunjian Wang Currently the vhost_zerocopy_callback() maybe be called to decrease the refcount when sendmsg fails in tun. The error handling in vhost handle_tx_zerocopy() will try to decrease the same refcount again. This is wrong. To fix this issue, we only call vhost_net_ubuf_put() when vq

[PATCH net v5 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-24 Thread wangyunjian
From: Yunjian Wang Currently the driver doesn't drop a packet which can't be sent by tun (e.g bad packet). In this case, the driver will always process the same packet lead to the tx queue stuck. To fix this issue: 1. in the case of persistent failure (e.g bad packet), the driver can skip thi

[PATCH net v5 0/2] fixes for vhost_net

2020-12-24 Thread wangyunjian
From: Yunjian Wang This series include two fixes patches for vhost_net. --- v5: * update patch 2/2 add -ENOBUFS check v4: * update patch 2/2 return check and commit log suggested * by Willem de Bruijn v3: * update patch 2/2 code styles and commit log suggested * by Jason Wang an

[PATCH net v2] tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS

2020-12-24 Thread wangyunjian
From: Yunjian Wang Currently the tun_napi_alloc_frags() function returns -ENOMEM when the number of iovs exceeds MAX_SKB_FRAGS + 1. However this is inappropriate, we should use -EMSGSIZE instead of -ENOMEM. The following distinctions are matters: 1. the caller need to drop the bad packet when -E

[PATCH net] tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS

2020-12-24 Thread wangyunjian
From: Yunjian Wang Currently the tun_napi_alloc_frags() function returns -ENOMEM when the number of iovs exceeds MAX_SKB_FRAGS + 1. However this is inappropriate, we should use -EMSGSIZE instead of -ENOMEM. Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Yu

RE: [PATCH net v4 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-24 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Thursday, December 24, 2020 1:56 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; m...@redhat.com; > willemdebruijn.ker...@gmail.com; virtualizat...@lists.linux-foundation.org; > Lilijun

RE: [PATCH net v4 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-23 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Thursday, December 24, 2020 11:10 AM > To: wangyunjian ; netdev@vger.kernel.org; > m...@redhat.com; willemdebruijn.ker...@gmail.com > Cc: virtualizat...@lists.linux-foundation.org; Lilijun (Jerr

[PATCH net v4 0/2] fixes for vhost_net

2020-12-23 Thread wangyunjian
From: Yunjian Wang This series include two fixes patches for vhost_net. --- v4: * update patch 2/2 return check and commit log suggested * by Willem de Bruijn v3: * update patch 2/2 code styles and commit log suggested * by Jason Wang and Willem de Bruijn v2: * update patch 1/2

[PATCH net v4 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-23 Thread wangyunjian
From: Yunjian Wang Currently the vhost_zerocopy_callback() maybe be called to decrease the refcount when sendmsg fails in tun. The error handling in vhost handle_tx_zerocopy() will try to decrease the same refcount again. This is wrong. To fix this issue, we only call vhost_net_ubuf_put() when vq

[PATCH net v4 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-23 Thread wangyunjian
From: Yunjian Wang Currently the driver doesn't drop a packet which can't be sent by tun (e.g bad packet). In this case, the driver will always process the same packet lead to the tx queue stuck. To fix this issue: 1. in the case of persistent failure (e.g bad packet), the driver can skip this d

[PATCH net v3 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-23 Thread wangyunjian
From: Yunjian Wang Currently the driver don't drop a packet which can't be send by tun (e.g bad packet). In this case, the driver will always process the same packet lead to the tx queue stuck. To fix this issue: 1. in the case of persistent failure (e.g bad packet), the driver can skip this des

[PATCH net v3 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-23 Thread wangyunjian
From: Yunjian Wang Currently the vhost_zerocopy_callback() maybe be called to decrease the refcount when sendmsg fails in tun. The error handling in vhost handle_tx_zerocopy() will try to decrease the same refcount again. This is wrong. To fix this issue, we only call vhost_net_ubuf_put() when vq

[PATCH net v3 0/2] fixes for vhost_net

2020-12-23 Thread wangyunjian
From: Yunjian Wang This series include two fixes patches for vhost_net. --- v3: * update patch 2/2 code styles and commit log suggested * by Jason Wang and Willem de Bruijn v2: * update patch 1/2 Fixes tag suggested by Willem de Bruijn * update patch 2/2 code styles suggested by Jas

RE: [PATCH net v2 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-23 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Wednesday, December 23, 2020 10:54 AM > To: Willem de Bruijn > Cc: wangyunjian ; Network Development > ; Michael S. Tsirkin ; > virtualizat...@lists.linux-foundation.org; Lilijun (J

RE: [PATCH net v2 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-22 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Tuesday, December 22, 2020 12:41 PM > To: Willem de Bruijn ; wangyunjian > > Cc: Network Development ; Michael S. Tsirkin > ; virtualizat...@lists.linux-foundation.org; Lilijun (J

RE: [PATCH net v2 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-16 Thread wangyunjian
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Wednesday, December 16, 2020 5:23 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; jasow...@redhat.com; > willemdebruijn.ker...@gmail.com; virtualizat...@lists.linux-foundation.org

[PATCH net v2 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-16 Thread wangyunjian
From: Yunjian Wang Currently we break the loop and wake up the vhost_worker when sendmsg fails. When the worker wakes up again, we'll meet the same error. This will cause high CPU load. To fix this issue, we can skip this description by ignoring the error. When we exceeds sndbuf, the return value

[PATCH net v2 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-16 Thread wangyunjian
From: Yunjian Wang Currently the vhost_zerocopy_callback() maybe be called to decrease the refcount when sendmsg fails in tun. The error handling in vhost handle_tx_zerocopy() will try to decrease the same refcount again. This is wrong. To fix this issue, we only call vhost_net_ubuf_put() when vq

[PATCH net v2 0/2] fixes for vhost_net

2020-12-16 Thread wangyunjian
From: Yunjian Wang This series include two fixes patches for vhost_net. --- v2: * update patch 1/2 Fixes tag suggested by Willem de Bruijn * update patch 2/2 code styles suggested by Jason Wang Yunjian Wang (2): vhost_net: fix ubuf refcount incorrectly when sendmsg fails vhost_net: f

RE: [PATCH net 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-15 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Wednesday, December 16, 2020 1:57 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; m...@redhat.com; willemdebruijn kernel > ; virtualizat...@lists.linux-foundation.org; > Lilijun

RE: [PATCH net 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-15 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Tuesday, December 15, 2020 12:10 PM > To: wangyunjian ; netdev@vger.kernel.org; > m...@redhat.com; willemdebruijn.ker...@gmail.com > Cc: virtualizat...@lists.linux-foundation.org; Lilijun (Jerr

RE: [PATCH net 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-14 Thread wangyunjian
> -Original Message- > From: Willem de Bruijn [mailto:willemdebruijn.ker...@gmail.com] > Sent: Tuesday, December 15, 2020 10:46 AM > To: wangyunjian > Cc: Network Development ; Michael S. Tsirkin > ; Jason Wang ; Willem de Bruijn > ; virtualizat...@lists.linux-foun

[PATCH net 0/2] fixes for vhost_net

2020-12-14 Thread wangyunjian
From: Yunjian Wang This series include two fixes patches for vhost_net. Yunjian Wang (2): vhost_net: fix ubuf refcount incorrectly when sendmsg fails vhost_net: fix high cpu load when sendmsg fails drivers/vhost/net.c | 27 --- 1 file changed, 12 insertions(+), 15 d

[PATCH net 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-14 Thread wangyunjian
From: Yunjian Wang Currently the vhost_zerocopy_callback() maybe be called to decrease the refcount when sendmsg fails in tun. The error handling in vhost handle_tx_zerocopy() will try to decrease the same refcount again. This is wrong. To fix this issue, we only call vhost_net_ubuf_put() when vq

[PATCH net 2/2] vhost_net: fix high cpu load when sendmsg fails

2020-12-14 Thread wangyunjian
From: Yunjian Wang Currently we break the loop and wake up the vhost_worker when sendmsg fails. When the worker wakes up again, we'll meet the same error. This will cause high CPU load. To fix this issue, we can skip this description by ignoring the error. When we exceeds sndbuf, the return value

RE: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-13 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Monday, December 14, 2020 12:07 PM > To: Willem de Bruijn > Cc: wangyunjian ; Michael S. Tsirkin > ; virtualizat...@lists.linux-foundation.org; Network > Development ; Lilijun (J

RE: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-11 Thread wangyunjian
> -Original Message- > From: Willem de Bruijn [mailto:willemdebruijn.ker...@gmail.com] > Sent: Wednesday, December 9, 2020 10:43 PM > To: wangyunjian > Cc: Michael S. Tsirkin ; Jason Wang > ; virtualizat...@lists.linux-foundation.org; Network > Develop

RE: [PATCH net] vhost_net: fix high cpu load when sendmsg fails

2020-12-10 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Friday, December 11, 2020 10:53 AM > To: wangyunjian ; Michael S. Tsirkin > > Cc: virtualizat...@lists.linux-foundation.org; netdev@vger.kernel.org; Lilijun > (Jerry) ; chenchanghu ; >

RE: [PATCH net] vhost_net: fix high cpu load when sendmsg fails

2020-12-09 Thread wangyunjian
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Wednesday, December 9, 2020 8:50 PM > To: wangyunjian > Cc: jasow...@redhat.com; virtualizat...@lists.linux-foundation.org; > netdev@vger.kernel.org; Lilijun (Jerry) ; > chenchanghu ; xu

[PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-09 Thread wangyunjian
From: Yunjian Wang After setting callback for ubuf_info of skb, the callback (vhost_net_zerocopy_callback) will be called to decrease the refcount when freeing skb. But when an exception occurs afterwards, the error handling in vhost handle_tx() will try to decrease the same refcount again. This

[PATCH net] vhost_net: fix high cpu load when sendmsg fails

2020-12-09 Thread wangyunjian
From: Yunjian Wang Currently we break the loop and wake up the vhost_worker when sendmsg fails. When the worker wakes up again, we'll meet the same error. This will cause high CPU load. To fix this issue, we can skip this description by ignoring the error. Signed-off-by: Yunjian Wang --- drive

RE: [PATCH net-next] tun: fix ubuf refcount incorrectly on error path

2020-12-07 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Monday, December 7, 2020 11:54 AM > To: wangyunjian ; m...@redhat.com > Cc: virtualizat...@lists.linux-foundation.org; netdev@vger.kernel.org; Lilijun > (Jerry) ; xudingke > Subject: Re:

RE: [PATCH net-next] tun: fix ubuf refcount incorrectly on error path

2020-12-04 Thread wangyunjian
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Friday, December 4, 2020 2:11 PM > To: wangyunjian ; m...@redhat.com > Cc: virtualizat...@lists.linux-foundation.org; netdev@vger.kernel.org; Lilijun > (Jerry) ; xudingke > Subject: Re: [PAT

[PATCH net-next] tun: fix ubuf refcount incorrectly on error path

2020-12-03 Thread wangyunjian
From: Yunjian Wang After setting callback for ubuf_info of skb, the callback (vhost_net_zerocopy_callback) will be called to decrease the refcount when freeing skb. But when an exception occurs afterwards, the error handling in vhost handle_tx() will try to decrease the same refcount again. This

[PATCH net-next] net: 7990: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/amd/7990.c | 2 +- drivers/net/ethernet/amd/7990.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) di

[PATCH net-next] net: cpmac: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/ti/cpmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpmac.c

[PATCH net-next] net: moxa: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/moxa/moxart_ether.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethern

[PATCH net-next] net: lantiq: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/lantiq_xrx200.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/lant

[PATCH net-next] net: mediatek: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet

[PATCH net-next] net: socionext: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/socionext/sni_ave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/so

[PATCH net-next] net: renesas: Fix use correct return type for ndo_start_xmit()

2020-05-06 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/renesas/sh_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ren

[PATCH net-next] net: cortina: Fix use correct return type for ndo_start_xmit()

2020-05-05 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/cortina/gemini.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cor

[PATCH net-next] net: ni: Fix use correct return type for ndo_start_xmit()

2020-05-05 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/ni/nixge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ni/nixge.

[PATCH] net: emac: Fix use correct return type for ndo_start_xmit()

2020-05-04 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/qualcomm/emac/emac-mac.c | 5 +++-- drivers/net/ethernet/qualcomm/emac/emac-mac.h | 5 +++-- drivers/net/ethern

[PATCH net-next] net: nxp: Fix use correct return type for ndo_start_xmit()

2020-05-04 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/nxp/lpc_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/nxp/lp

[PATCH net-next] net: altera: Fix use correct return type for ndo_start_xmit()

2020-05-04 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/altera/altera_tse_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/et

[PATCH net-next] net: allwinner: Fix use correct return type for ndo_start_xmit()

2020-05-04 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. And emac_start_xmit() can leak one skb if 'channel' == 3. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/allwinner/sun4i-emac.c | 4 ++-- 1 file changed, 2 in

[PATCH net-next] rionet: Fix use correct return type for ndo_start_xmit()

2020-04-30 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- drivers/net/rionet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/rionet.c b/drivers/net/rionet

[PATCH net-next] net: caif: Fix use correct return type for ndo_start_xmit()

2020-04-30 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- net/caif/chnl_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c

[PATCH net-next] netpoll: Fix use correct return type for ndo_start_xmit()

2020-04-29 Thread wangyunjian
From: Yunjian Wang The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang --- net/core/netpoll.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/core/netpoll.c b/net/core/netpol

[PATCH net] net/mlx4_core: Change the error print to info print

2019-05-14 Thread wangyunjian
From: Yunjian Wang The error print within mlx4_flow_steer_promisc_add() should be a info print. Fixes: 592e49dda812 ('net/mlx4: Implement promiscuous mode with device managed flow-steering') Signed-off-by: Yunjian Wang --- drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 +- 1 file changed, 1 ins

[PATCH net v4] net: bridge: Fix ethernet header pointer before check skb forwardable

2019-01-16 Thread wangyunjian
From: Yunjian Wang The skb header should be set to ethernet header before using is_skb_forwardable. Because the ethernet header length has been considered in is_skb_forwardable(including dev->hard_header_len length). To reproduce the issue: 1, add 2 ports on linux bridge br using following comma

RE: [PATCH net v3] net: bridge: Fix ethernet header pointer before check skb forwardable

2019-01-16 Thread wangyunjian
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Thursday, January 17, 2019 1:33 AM > To: wangyunjian > Cc: netdev@vger.kernel.org; xudingke ; > bri...@lists.linux-foundation.org; Nkolay Aleksandrov > ; Roopa Prabhu > >

[PATCH net v3] net: bridge: Fix ethernet header pointer before check skb forwardable

2019-01-16 Thread wangyunjian
From: Yunjian Wang The skb header should be set to ethernet header before using is_skb_forwardable. Because the ethernet header length has been considered in is_skb_forwardable(including dev->hard_header_len length). To reproduce the issue: 1, add 2 ports on linux bridge br using following comma

RE: [PATCH net v2] net: bridge: Fix ethernet header pointer before check skb forwardable

2019-01-16 Thread wangyunjian
> -Original Message- > From: Toshiaki Makita [mailto:makita.toshi...@lab.ntt.co.jp] > Sent: Tuesday, January 15, 2019 3:50 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; xudingke ; > bri...@lists.linux-foundation.org; Nkolay Aleksandrov > ; Roopa Prabhu > >

RE: [PATCH net v2] net: bridge: Fix ethernet header pointer before check skb forwardable

2019-01-16 Thread wangyunjian
> -Original Message- > From: Sergei Shtylyov [mailto:sergei.shtyl...@cogentembedded.com] > Sent: Tuesday, January 15, 2019 5:22 PM > To: wangyunjian ; netdev@vger.kernel.org > Cc: xudingke ; bri...@lists.linux-foundation.org; > Nkolay Aleksandrov ; Roopa Prabhu >

[PATCH net v2] net: bridge: Fix ethernet header pointer before check skb forwardable

2019-01-14 Thread wangyunjian
From: Yunjian Wang The skb header should be set to ethernet header before using is_skb_forwardable. Because the ethernet header length has been considered in is_skb_forwardable(including dev->hard_header_len length). To reproduce the issue: 1, add 2 ports on linux bridge br using following comma

RE: [PATCH net] bridge: Fix ethernet header pointer before check skb forwardable

2019-01-14 Thread wangyunjian
> -Original Message- > From: Nikolay Aleksandrov [mailto:niko...@cumulusnetworks.com] > Sent: Monday, January 14, 2019 10:05 PM > To: wangyunjian > Cc: Andrew Lunn ; netdev@vger.kernel.org; xudingke > > Subject: Re: [PATCH net] bridge: Fix ethernet header point

RE: [PATCH net] bridge: Fix ethernet header pointer before check skb forwardable

2019-01-13 Thread wangyunjian
> -Original Message- > From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Saturday, January 12, 2019 10:55 PM > To: wangyunjian > Cc: netdev@vger.kernel.org; xudingke > Subject: Re: [PATCH net] bridge: Fix ethernet header pointer before check > skb forwardable > &

[PATCH net] bridge: Fix ethernet header pointer before check skb forwardable

2019-01-12 Thread wangyunjian
From: Yunjian Wang The skb header should be set to ethernet header before using is_skb_forwardable(including dev->hard_header_len length). Signed-off-by: Yunjian Wang --- net/bridge/br_forward.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bridge/br_forward.c b/n

[PATCH net] igb: fix uninitialized variables

2018-11-06 Thread wangyunjian
From: Yunjian Wang This patch fixes the variable 'phy_word' may be used uninitialized. Signed-off-by: Yunjian Wang --- drivers/net/ethernet/intel/igb/e1000_i210.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e

BUG: 4.15.0-rc6 unable to handle kernel NULL pointer dereference in ixgbe_down

2018-01-08 Thread wangyunjian
Hi, I'm running into a NULL pointer dereference in ixgbe_down on b84449dc14d274a3f3c78cd734b702ca31aa4dd1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master. I think the variable adapter->vfinfo has not been protected well, when disable sriov and down nic. Anyone has an ide

RE: [Intel-wired-lan] [PATCH net v2] i40e: Fix limit imprecise of the number of MAC/VLAN that can be added for VFs

2017-09-29 Thread wangyunjian
> -Original Message- > From: Alexander Duyck [mailto:alexander.du...@gmail.com] > Sent: Thursday, September 28, 2017 11:44 PM > To: wangyunjian > Cc: David Miller ; Jeff Kirsher > ; Sergei Shtylyov > ; Netdev > ; caihe ; intel-wired-lan > > Subject: Re: [

RE: [PATCH net] i40e: Fix limit imprecise of the number of MAC/VLAN that can be added for VFs

2017-09-27 Thread wangyunjian
Thanks, I will send the v2 later. > -Original Message- > From: Sergei Shtylyov [mailto:sergei.shtyl...@cogentembedded.com] > Sent: Wednesday, September 27, 2017 7:34 PM > To: wangyunjian ; da...@davemloft.net; > jeffrey.t.kirs...@intel.com > Cc: netdev@vger.kerne

RE: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread wangyunjian
>-Original Message- >From: Jason Wang [mailto:jasow...@redhat.com] >Sent: Thursday, December 01, 2016 11:37 AM >To: Michael S. Tsirkin >Cc: wangyunjian; netdev@vger.kernel.org; linux-ker...@vger.kernel.org; caihe >Subject: Re: [PATCH net] vhost_net: don't continue t

RE: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread wangyunjian
>-Original Message- >From: Michael S. Tsirkin [mailto:m...@redhat.com] >Sent: Wednesday, November 30, 2016 9:41 PM >To: wangyunjian >Cc: jasow...@redhat.com; netdev@vger.kernel.org; linux-ker...@vger.kernel.org; >caihe >Subject: Re: [PATCH net] vhost_net: don&#

RE: The ubufs->refcount maybe be subtracted twice when tun_get_user failed

2016-11-29 Thread wangyunjian
- From: Jason Wang [mailto:jasow...@redhat.com] Sent: Tuesday, November 29, 2016 6:07 PM To: wangyunjian; m...@redhat.com; netdev@vger.kernel.org Cc: caihe Subject: Re: The ubufs->refcount maybe be subtracted twice when tun_get_user failed On 2016年11月29日 17:30, wangyunjian wrote: >

The ubufs->refcount maybe be subtracted twice when tun_get_user failed

2016-11-29 Thread wangyunjian
In function tun_get_user , the ubufs->refcount may be subtracted twice, when msg_control is true and zerocopy is false. About the below code: static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, void *msg_control, struct iov_iter *from,

[PATCH net v2] virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv

2016-05-25 Thread wangyunjian
In function virtnet_open() and virtnet_probe(), func try_fill_recv() will be executed at the same time. VQ in virtqueue_add() is not protected well and BUG_ON will be triggered when virito_net.ko being removed. Signed-off-by: Yunjian Wang --- drivers/net/virtio_net.c | 18 ++ 1 f

答复: [PATCH] virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv

2016-05-25 Thread wangyunjian
Jason Wang, Thanks for your comments. I make new patch, according to your comments. -邮件原件- 发件人: Jason Wang [mailto:jasow...@redhat.com] 发送时间: 2016年5月26日 9:41 收件人: wangyunjian; da...@davemloft.net; netdev@vger.kernel.org; m...@redhat.com; Liuyongan 主题: Re

[PATCH] virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv

2016-05-25 Thread wangyunjian
In function virtnet_open() and virtnet_probe(), func try_fill_recv() will be executed at the same time. VQ in virtqueue_add() is not protected well and BUG_ON will be triggered when virito_net.ko being removed. Test Script: for (( i=0; i<500; i=i+1 )); do rmmod virtio_net mod