• Zhao Chen's avatar
    net-next: hinic: fix a problem in free_tx_poll() · 9c2956d2
    Zhao Chen authored
    This patch fixes the problem below. The problem can be reproduced by the
    following steps:
    1) Connecting all HiNIC interfaces
    2) On server side
        # sudo ifconfig eth0 192.168.100.1 up #Using MLX CX4 card
        # iperf -s
    3) On client side
        # sudo ifconfig eth0 192.168.100.2 up #Using our HiNIC card
        # iperf -c 192.168.101.1 -P 10 -t 100000
    
    after hours of testing, we will see errors:
    
        hinic 0000:05:00.0: No MGMT msg handler, mod = 0
        hinic 0000:05:00.0: No MGMT msg handler, mod = 0
        hinic 0000:05:00.0: No MGMT msg handler, mod = 0
        hinic 0000:05:00.0: No MGMT msg handler, mod = 0
    
    The errors are caused by the following problem.
    1) The hinic_get_wqe() checks the "wq->delta" to allocate new WQEs:
    
    	if (atomic_sub_return(num_wqebbs, &wq->delta) <= 0) {
    		atomic_add(num_wqebbs, &wq->delta);
    		return ERR_PTR(-EBUSY);
    	}
    
    If the WQE occupies multiple pages, the shadow WQE will be used. Then the
    hinic_xmit_frame() fills the WQE.
    
    2) While in para...
    9c2956d2
hinic_tx.c 13.1 KB