mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	igb: correct link test not being run when link is down
The igb online link test was always reporting pass because instead of checking for if_running it was checking for netif_carrier_ok. This change corrects the test so that it is run if the interface is running instead of checking for netif carrier ok. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									c0f2276f36
								
							
						
					
					
						commit
						8d420a1b3e
					
				
					 1 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
					@ -1823,12 +1823,10 @@ static void igb_diag_test(struct net_device *netdev,
 | 
				
			||||||
		dev_info(&adapter->pdev->dev, "online testing starting\n");
 | 
							dev_info(&adapter->pdev->dev, "online testing starting\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* PHY is powered down when interface is down */
 | 
							/* PHY is powered down when interface is down */
 | 
				
			||||||
		if (!netif_carrier_ok(netdev)) {
 | 
							if (if_running && igb_link_test(adapter, &data[4]))
 | 
				
			||||||
			data[4] = 0;
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			if (igb_link_test(adapter, &data[4]))
 | 
					 | 
				
			||||||
			eth_test->flags |= ETH_TEST_FL_FAILED;
 | 
								eth_test->flags |= ETH_TEST_FL_FAILED;
 | 
				
			||||||
		}
 | 
							else
 | 
				
			||||||
 | 
								data[4] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Online tests aren't run; pass by default */
 | 
							/* Online tests aren't run; pass by default */
 | 
				
			||||||
		data[0] = 0;
 | 
							data[0] = 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue