[PATCHv2 net-next 1/1] net: rds: use memset to optimize the recv

2018-09-16 Thread Zhu Yanjun
The function rds_inc_init is in recv process. To use memset can optimize the function rds_inc_init. The test result: Before: 1) + 24.950 us |rds_inc_init [rds](); After: 1) + 10.990 us |rds_inc_init [rds](); Acked-by: Santosh Shilimkar Signed-off-by: Zhu

[PATCH 1/1] net: rds: use memset to optimize the recv

2018-09-14 Thread Zhu Yanjun
The function rds_inc_init is in recv process. To use memset can optimize the function rds_inc_init. The test result: Before: 1) + 24.950 us |rds_inc_init [rds](); After: 1) + 10.990 us |rds_inc_init [rds](); Signed-off-by: Zhu Yanjun --- net/rds/recv.c | 5

[PATCH 1/1] net/rds: Use rdma_read_gids to get connection SGID/DGID in IPv6

2018-08-25 Thread Zhu Yanjun
connections returns MAC address, instead of DGID. rdma_addr_get_sgid() for RoCE doesn't return correct SGID for IPv6 and when more than one IP address is assigned to the netdevice. So the transport agnostic rdma_read_gids() API is provided by rdma_cm module. Signed-off-by: Zhu Yanjun --- net/rds/ib.c | 9

[PATCH 1/1] Revert "rds: ib: add error handle"

2018-04-23 Thread Zhu Yanjun
This reverts commit 3b12f73a5c2977153f28a224392fd4729b50d1dc. After long time discussion and investigations, it seems that there is no mem leak. So this patch is reverted. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_cm.

[PATCHv2 1/1] net/mlx4_core: avoid resetting HCA when accessing an offline device

2018-04-18 Thread Zhu Yanjun
t;haakon.bu...@oracle.com> Suggested-by: Tariq Toukan <tar...@mellanox.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- V1->V2: Follow Tariq's advice, avoid the disturbance from other returned errors. Since the returned values from the function mlx4_cmd_post are -EIO and -EINV

[PATCH 1/1] net/mlx4_core: avoid resetting HCA when accessing an offline device

2018-04-15 Thread Zhu Yanjun
t;haakon.bu...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/mellanox/mlx4/cmd.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 6a9086d..f1c8c42

[PATCH net-next 1/1] forcedeth: remove duplicate structure member in rx

2018-01-22 Thread Zhu Yanjun
o...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index a3f6d51..66c6

[PATCHv2 net-next 1/1] forcedeth: remove unused variable

2018-01-16 Thread Zhu Yanjun
The variable miistat is not used. So it is removed. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- v1->v2: Keep readl function --- drivers/net/

[PATCH net-next 1/1] forcedeth: remove unused variable

2018-01-14 Thread Zhu Yanjun
The variable miistat is not used. So it is removed. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 7 ++

[PATCH NET-NEXT 1/1] forcedeth: remove duplicate structure member in rx

2018-01-04 Thread Zhu Yanjun
cle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index a79b9f8..21e1

[PATCH net-next 1/1] forcedeth: optimize the rx with likely

2017-12-25 Thread Zhu Yanjun
In the rx fastpath, the function netdev_alloc_skb rarely fails. Therefore, a likely() optimization is added to this error check conditional. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by:

[PATCH net-next 1/1] forcedeth: remove duplicate structure member in xmit

2017-12-16 Thread Zhu Yanjun
o...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index

[PATCHv2 net-next 1/1] forcedeth: remove unnecessary structure member

2017-12-09 Thread Zhu Yanjun
cle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index

[PATCH net-next 1/1] forcedeth: remove unnecessary variable

2017-12-06 Thread Zhu Yanjun
Since both tx_ring and first_tx are the head of tx ring, it not necessary to use two variables. So first_tx is removed. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <

[PATCH net-next 1/1] forcedeth: optimize the xmit with unlikely

2017-11-27 Thread Zhu Yanjun
In xmit, it is very impossible that TX_ERROR occurs. So using unlikely optimizes the xmit process. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> -

[PATCHv2 net-next 1/1] forcedeth: replace pci_unmap_page with dma_unmap_page

2017-11-19 Thread Zhu Yanjun
The function pci_unmap_page is obsolete. So it is replaced with the function dma_unmap_page. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- V1->V

[PATCH net-next 1/1] forcedeth: replace pci_unmap_page with dma_unmap_page

2017-11-19 Thread Zhu Yanjun
The function pci_unmap_page is obsolete. So it is replaced with the function dma_unmap_page. CC: Srinivas Eeda <srinivas.e...@oracle.com> CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- dri

[PATCHv3 1/1] bnx2x: fix slowpath null crash

2017-11-11 Thread Zhu Yanjun
And in the function bnx2x_sp_rtnl_task, after dma memory allocation fails, another shutdown and open NIC is executed. CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> Acked-by: Ariel Elior <ael...@cavi

[PATCH net-next 1/1] forcedeth: remove redudant assignments in xmit

2017-11-10 Thread Zhu Yanjun
Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 28 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/f

[PATCHv2 1/1] bnx2x: fix slowpath null crash

2017-11-08 Thread Zhu Yanjun
And in the function bnx2x_sp_rtnl_task, after dma memory allocation fails, another shutdown and open NIC is executed. CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> Acked-by: Ariel Elior <ael...@cavium.com&

[PATCH 1/1] bnx2x: fix slowpath null crash

2017-11-07 Thread Zhu Yanjun
And in the function bnx2x_sp_rtnl_task, after dma memory allocation fails, another shutdown and open NIC is executed. CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/broadcom/bnx2x/bn

[PATCH net-next 1/1] forcedeth: replace pci_alloc_consistent with dma_alloc_coherent

2017-10-28 Thread Zhu Yanjun
The functions pci_alloc_consistent is obsolete. So it is replaced with dma_alloc_coherent Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 61 ++--- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/d

[PATCH 1/1] forcedeth: optimize the xmit/rx with unlikely

2017-09-22 Thread Zhu Yanjun
In the xmit/rx fastpath, the function dma_map_single rarely fails. Therefore, add an unlikely() optimization to this error check conditional. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 26 ++ 1 file chang

[PATCH 1/1] forcedeth: replace pci_map_single with dma_map_single functions

2017-09-14 Thread Zhu Yanjun
pci_map_single functions are obsolete. So replace them with dma_map_single functions. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 70 + 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/drive

[PATCH 1/1] forcedeth: remove tx_stop variable

2017-09-08 Thread Zhu Yanjun
The variable tx_stop is used to indicate the tx queue state: started or stopped. In fact, the inline function netif_queue_stopped can do the same work. So replace the variable tx_stop with the function netif_queue_stopped. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drive

[PATCH 2/2] mlx5: remove unnecessary pci_set_drvdata()

2017-08-15 Thread Zhu Yanjun
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not necessary to manually clear the device driver data to NULL. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun

[PATCH 1/2] mlx4: remove unnecessary pci_set_drvdata()

2017-08-15 Thread Zhu Yanjun
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not necessary to manually clear the device driver data to NULL. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun

[PATCH 1/1] forcedeth: replace init_timer_deferrable with setup_deferrable_timer

2017-08-10 Thread Zhu Yanjun
Replace init_timer_deferrable with setup_deferrable_timer to simplify the source code. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedet

[PATCH 1/1] mlx4_en: remove unnecessary error check

2017-07-24 Thread Zhu Yanjun
The function mlx4_en_get_profile always return zero. So it is not necessary to check its return value. CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/mellanox/mlx4/en_main.c | 9

[PATCH 1/1] mlx4_en: remove unnecessary returned value

2017-07-23 Thread Zhu Yanjun
The function mlx4_en_arm_cq always returns zero. So change the return type of the function mlx4_en_arm_cq to void. CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/mellanox/

[PATCHv2 1/1] mlx4_en: remove unnecessary returned value check

2017-07-13 Thread Zhu Yanjun
The function __mlx4_zone_remove_one_entry always returns zero. So it is not necessary to check it. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> Reviewed-by: Yuval Shaia <yuval.sh...@oracle.com>

[PATCH 1/1] mlx4_en: remove unnecessary returned value check

2017-07-12 Thread Zhu Yanjun
The function __mlx4_zone_remove_one_entry always returns zero. So it is not necessary to check it. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/mellanox/mlx4/alloc.c | 7 +++--

[PATCH 1/1] mlx4_en: make mlx4_log_num_mgm_entry_size static

2017-07-02 Thread Zhu Yanjun
The variable mlx4_log_num_mgm_entry_size is only called in main.c. CC: Joe Jin <joe@oracle.com> CC: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/mellanox/mlx4/main.c | 2 +- drivers/net/ethernet/mellanox/ml

[PATCH 1/1] forcedeth: remove unnecessary carrier status check

2017-05-02 Thread Zhu Yanjun
Since netif_carrier_on() will do nothing if device's carrier is already on, so it's unnecessary to do carrier status check. It's the same for netif_carrier_off(). Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 6 ++ 1 file chan

[PATCH 1/1] bonding: use 'M' or 'G' based on the speed

2017-04-20 Thread Zhu Yanjun
If the speed of the slave netdev is more than 1000M, it is better to use 'G' instead of 'M'. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/bonding/bond_main.c | 8 ++-- drivers/net/bonding/bond_procfs.c | 6 +- 2 files changed, 11 insertions(+), 3 deletions(-)

[PATCH 1/1] bonding: remove unnecessary return

2017-04-19 Thread Zhu Yanjun
The type of the function bond_update_speed_duplex is void. So the return in the end of the function should be removed. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/bonding/bond_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/bonding/bond_ma

[PATCH 2/5] rds: rdma: fix memory leak error

2017-03-27 Thread Zhu Yanjun
In the function __rds_rdma_map, the allocated memory and other resources should be freed when some error occurs. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/rdma.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/rds/rdma.c b/net/rds/rdma.c index f06fac4..a

[PATCH 0/5] rds: trivial patches

2017-03-27 Thread Zhu Yanjun
Hi, all The 5 patches are trivial patches. Thanks a lot. Zhu Yanjun (5): rds: tcp: release the created connection rds: rdma: fix memory leak error rds: remove unnecessary returned value check rds: remove the unused variable rds: ib: add the static type to the functions net/rds

[PATCH 1/5] rds: tcp: release the created connection

2017-03-27 Thread Zhu Yanjun
When some error occurs, the created connection should be destroyed. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/tcp_listen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 5076788..58aa5bc 100644 --- a/net/rds/tcp_li

[PATCH 4/5] rds: remove the unused variable

2017-03-27 Thread Zhu Yanjun
In the function rds_ib_recv_path, the variable ret is not used. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index e10624a..be8d2f2 100644 --- a/n

[PATCH 3/5] rds: remove unnecessary returned value check

2017-03-27 Thread Zhu Yanjun
In the function rds_stats_init, the returned value is always zero. As such, it is not necessary to check it. And change the return type to void. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/af_rds.c | 5 + net/rds/rds.h| 2 +- net/rds/stats.c | 3 +-- 3 files chan

[PATCH 5/5] rds: ib: add the static type to the functions

2017-03-27 Thread Zhu Yanjun
The functions rds_ib_flush_mr_pool and rds_ib_reuse_mr are called in the local file. As such, the static type is added to limit them in the local file. And the function rds_ib_flush_mr_pool always returns zero. As such, change the return type to void. Signed-off-by: Zhu Yanjun <yan

[PATCHv3 4/4] rds: ib: unmap the scatter/gather list when error

2017-03-12 Thread Zhu Yanjun
When some errors occur, the scatter/gather list mapped to DMA addresses should be handled. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com&g

[PATCHv3 3/4] rds: ib: add the static type to the function

2017-03-12 Thread Zhu Yanjun
The function rds_ib_map_fmr is used only in the ib_fmr.c file. As such, the static type is added to limit it in this file. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by:

[PATCHv3 1/4] rds: ib: drop unnecessary rdma_reject

2017-03-12 Thread Zhu Yanjun
When rdma_accept fails, rdma_reject is called in it. As such, it is not necessary to execute rdma_reject again. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Zhu Yanjun <

[PATCHv3 0/4] rds: ib: trivial patches

2017-03-12 Thread Zhu Yanjun
v2 -> v3 remove err from messages. Zhu Yanjun (4): rds: ib: drop unnecessary rdma_reject rds: ib: remove redundant ib_dealloc_fmr rds: ib: add the static type to the function rds: ib: unmap the scatter/gather list when error net/rds/ib_cm.c | 5 ++--- net/rds/ib_fmr.c |

[PATCHv3 2/4] rds: ib: remove redundant ib_dealloc_fmr

2017-03-12 Thread Zhu Yanjun
ed-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_fmr.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/rds/ib_fmr.c b/net/rds/ib_fmr.c index 4fe8f4f..249ae1c 100644 --- a/net/rds/ib_fmr.c ++

[PATCH 1/1] r8169: replace init_timer with setup_timer

2017-03-12 Thread Zhu Yanjun
Replace init_timer with setup_timer to simplify the source code. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/realtek/r8169.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/r

[PATCHv2 1/4] rds: ib: drop unnecessary rdma_reject

2017-03-12 Thread Zhu Yanjun
When rdma_accept fails, rdma_reject is called in it. As such, it is not necessary to execute rdma_reject again. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Zhu Yanjun <

[PATCHv2 2/4] rds: ib: remove redundant ib_dealloc_fmr

2017-03-12 Thread Zhu Yanjun
ed-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- Change from v1 to v2: Add the reviewer and acker. Remove ibmr NULL test. net/rds/ib_fmr.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/rds/ib_fm

[PATCHv2 3/4] rds: ib: add the static type to the function

2017-03-12 Thread Zhu Yanjun
The function rds_ib_map_fmr is used only in the ib_fmr.c file. As such, the static type is added to limit it in this file. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by:

[PATCHv2 4/4] rds: ib: unmap the scatter/gather list when error

2017-03-12 Thread Zhu Yanjun
When some errors occur, the scatter/gather list mapped to DMA addresses should be handled. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com>

[PATCHv2 3/5] rds: ib: remove redundant ib_dealloc_fmr

2017-03-09 Thread Zhu Yanjun
The function ib_dealloc_fmr will never be called. As such, it should be removed. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- Change from v1 to v2: remove ibmr NULL test. net/rds/ib_fmr.c |

[PATCH 2/5] rds: ib: replace spin_lock_irq with spin_lock_irqsave

2017-03-08 Thread Zhu Yanjun
It is difficult to make sure the state of the interrupt when this function is called. As such, it is safer to use spin_lock_irqsave than spin_lock_irq. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --

[PATCH 3/5] rds: ib: remove redundant ib_dealloc_fmr

2017-03-08 Thread Zhu Yanjun
The function ib_dealloc_fmr will never be called. As such, it should be removed. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_fmr.c | 6 ++ 1 file changed, 2 insertions(+), 4 deleti

[PATCH 4/5] rds: ib: add the static type to the function

2017-03-08 Thread Zhu Yanjun
The function rds_ib_map_fmr is used only in the ib_fmr.c file. As such, the static type is added to limit it in this file. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_fmr.c | 5 +++-

[PATCH 1/5] rds: ib: drop unnecessary rdma_reject

2017-03-08 Thread Zhu Yanjun
When rdma_accept fails, rdma_reject is called in it. As such, it is not necessary to execute rdma_reject again. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_cm.c | 3 +-- 1 file changed,

[PATCH 5/5] rds: ib: unmap the scatter/gather list when error

2017-03-08 Thread Zhu Yanjun
When some errors occur, the scatter/gather list mapped to DMA addresses should be handled. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_fmr.c | 26 +++--- 1 file chan

[PATCH 1/1] rds: ib: add error handle

2017-03-06 Thread Zhu Yanjun
cle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_cm.c | 47 --- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index ce3775a..d47ae0f 100644 --- a/net/rds/ib_cm.c +++ b/n

[PATCH 1/1] rds: remove unnecessary returned value check

2017-03-02 Thread Zhu Yanjun
The function rds_trans_register always returns 0. As such, it is not necessary to check the returned value. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib.c| 6 +- net/r

[PATCH 1/1] rds: ib: add the static type to the variables

2017-02-28 Thread Zhu Yanjun
The variables rds_ib_mr_1m_pool_size and rds_ib_mr_8k_pool_size are used only in the ib.c file. As such, the static type is added to limit them in this file. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com>

[PATCH 1/1] rds: fix memory leak error

2017-02-24 Thread Zhu Yanjun
When the function register_netdevice_notifier fails, the memory allocated by kmem_cache_create should be freed by the function kmem_cache_destroy. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> ---

[PATCH 1/1] forcedeth: Remove return from a void function

2017-02-23 Thread Zhu Yanjun
In a void function, it is not necessary to append a return statement in it. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/nvidia/forcedeth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/

[PATCHv2 1/1] rds:Remove unnecessary ib_ring unalloc

2017-02-17 Thread Zhu Yanjun
In the function rds_ib_xmit_atomic, ib_ring is not allocated successfully. As such, it is not necessary to unalloc it. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- Change from v1 to v2: f

[PATCH 1/1] rds:Remove unnecessary ib_ring unalloc

2017-02-17 Thread Zhu Yanjun
In the function rds_ib_xmit_atomic, ib_ring is not successfully. As such, it is not necessary to unalloc it. Cc: Joe Jin <joe@oracle.com> Cc: Junxiao Bi <junxiao...@oracle.com> Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- net/rds/ib_send.c | 1 - 1 file changed, 1

[PATCH 1/1] ixgbe: add the external ixgbe fiber transceiver status

2017-02-08 Thread Zhu Yanjun
-on: d ... Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 15 +++ include/uapi/linux/ethtool.h | 4 2 files changed, 19 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b

[PATCH 1/1] ethtool: add the external transceiver status of the ixgbe fiber

2017-02-08 Thread Zhu Yanjun
iation: on Supports Wake-on: d ... Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- ethtool-copy.h | 2 ++ ethtool.c | 6 ++ 2 files changed, 8 insertions(+) diff --git a/ethtool-copy.h b/ethtool-copy.h index 3d299e3..1c6db9a 100644 --- a/ethtool-copy.h +++ b/ethtool-copy.h @@ -15

[PATCH 1/1] bonding: Remove unnecessary returned value check

2017-02-02 Thread Zhu Yanjun
The function bond_info_query alwarys returns 0. As such, in the function bond_do_ioctl, it is not necessary to check the returned value. So the interface type of the function bond_info_query is changed to void. The redundant check is removed. Signed-off-by: Zhu Yanjun <yanjun@oracle.

[PATCHv2 1/1] r8169: fix the typo in the comment

2017-01-05 Thread Zhu Yanjun
>From the realtek data sheet, the PID0 should be bit 0. Signed-off-by: Zhu Yanjun <yanjun@oracle.com> --- Change from v1 to v2: change the commit header. drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/etherne

[PATCH 1/1] ixgbevf: replace integer number with bool value

2016-07-28 Thread Zhu Yanjun
The variable get_mac_status is a bool variable. So a bool value is better than an integer number. Signed-off-by: Zhu Yanjun <zyjzyj2...@gmail.com> --- drivers/net/ethernet/intel/ixgbevf/ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++-- 2 files chan

[PATCH 1/1] bonding: restrict the data protected by rcu_read_lock

2016-07-12 Thread Zhu Yanjun
In this function, origin is a pointer to struct aggregator. No matter what agg is changed to, it has nothing to do with origin. CC: Jay Vosburgh <jay.vosbu...@canonical.com> Signed-off-by: Zhu Yanjun <zyjzyj2...@gmail.com> --- drivers/net/bonding/bond_3ad.c |2 +- 1 file changed,

[RFC PATCH 1/1] net namespace: dynamically configure new net namespace inherit net config

2016-03-09 Thread Zhu Yanjun
ip netns exec mynewns_new cat /proc/sys/net/ipv4/ip_forward 0 Suggested-by: Bruce Ashfield <bruce.ashfi...@windriver.com> Signed-off-by: Zhu Yanjun <yanjun@windriver.com> CC: David S. Miller <da...@davemloft.net> CC: Alexey Kuznetsov <kuz...@ms2.inr.ac.ru> CC: James Mo

[PATCH 1/1] net: bonding: remove redudant brackets

2015-12-03 Thread Zhu Yanjun
It is not necessary to use two brackets. As such, the redudant brackets are removed. CC: Jay Vosburgh <j.vosbu...@gmail.com> CC: Veaceslav Falico <vfal...@gmail.com> CC: Andy Gospodarek <go...@cumulusnetworks.com> Signed-off-by: Zhu Yanjun <yanjun@windriver.com>

[PATCH 1/1] net namespace: dynamically configure new net namespace inherit net config

2015-06-26 Thread Zhu Yanjun
The new net namespace can inherit from the original net config, or the current net config. As such, a config is needed to decide where the new namespace inherit from. Signed-off-by: Zhu Yanjun yanjun@windriver.com --- init/Kconfig | 9 + net/ipv4/devinet.c | 13