Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ethernet not working after being disconnected
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Fri Jul 01, 2016 12:14 pm    Post subject: ethernet not working after being disconnected Reply with quote

my ethernet gets accidentally disconnected, after reconnecting there is no connection
g50-80 ~ # ethtool enp2s0
Settings for enp2s0:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available


the following message is repeated frequently in journalctl:
Jul 01 14:14:18 g50-80 kernel: r8169 0000:02:00.0 enp2s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Wed Jul 06, 2016 11:37 am    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Mon Jul 11, 2016 7:17 pm    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
sebB
l33t
l33t


Joined: 02 Mar 2011
Posts: 732
Location: S.O. France

PostPosted: Tue Jul 12, 2016 11:06 am    Post subject: Reply with quote

How did you build your driver? Module or hard?
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1696

PostPosted: Tue Jul 12, 2016 2:59 pm    Post subject: Reply with quote

How is the cable to the ethernet hooked up? Like is it going directly to another computer or to a switch/router/modem?

Have you tried replacing the cable and/or the ethernet card? Most ethernet cards and switches/routers have a green led light next to the port (a link state light) that is just detecting if a cable is hooked up or not. Note: There will usually be a second LED light for activity.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Wed Jul 13, 2016 7:48 am    Post subject: Reply with quote

ethernet driver is built into the kernel
the cable is directly attached to another computer
I'll pay attention next time to the LEDS, the other ethernet card is working just fine I know that because rebooting this laptop(the one in reference) fixes things.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1696

PostPosted: Wed Jul 13, 2016 3:29 pm    Post subject: Reply with quote

One thing to make sure, since you said you are connecting directly from computer to another one without a switch/hub/router in between, is that you are using a cross-over cable and not a patch/straight cable.

Autosense (detects if a cross-over is needed) does not always work too well; so you should aim to use the correct cabling when connecting 2 devices. If you have an hub or switch in between the 2 computers, you use a patch/straight cable. Do not get this mixed with the auto-negotiation, as that determines what speed both devices are using (which can cause duplex mismatch affecting performance).

Note: Most cables will have it printed on them on if they are cross-over or straight. For the ones that are not, you can look at the wiring layout in the connectors and match that up to the cabling chart (easily found on the web). Most cables tend to NOT be cross-over cables.
Back to top
View user's profile Send private message
vilehost
n00b
n00b


Joined: 07 Jan 2016
Posts: 26

PostPosted: Wed Jul 13, 2016 5:28 pm    Post subject: Reply with quote

https://bugzilla.kernel.org/show_bug.cgi?id=107421

its been reported many times

when it dc's next test to see if the hw still shows up

Code:
 % lspci
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)


https://lkml.org/lkml/2016/2/24/88

Quote:
There will be a log spam when there is no cable plugged. Please refer to
following links. https://bugzilla.kernel.org/show_bug.cgi?id=104351
https://bugzilla.kernel.org/show_bug.cgi?id=107421

This issue is caused by runtime power management. When there is no cable
plugged, the driver will be suspend (runtime suspend) by OS and NIC will be
put into the D3 state. During this time, if OS call rtl8169_get_stats64()
to dump tally counter, because NIC is in D3 state, the register value read
by driver will return all 0xff. This will let driver think tally counter
flag is not toggled and then sends the warning message "rtl_counters_cond
== 1 (loop: 1000, delay: 10)" to kernel log.


For fixing this issue, 1.add checking driver's pm runtime status in
rtl8169_get_stats64(). 2.dump tally counter before going runtime suspend
for counter accuracy in runtime suspend.


Signed-off-by: Chunhao Lin <hau@realtek.com>

Code:
---
 drivers/net/ethernet/realtek/r8169.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 537974c..4caeacb 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7730,10 +7730,13 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
 {
    struct rtl8169_private *tp = netdev_priv(dev);
    void __iomem *ioaddr = tp->mmio_addr;
+   struct pci_dev *pdev = tp->pci_dev;
    struct rtl8169_counters *counters = tp->counters;
    unsigned int start;
 
-   if (netif_running(dev))
+   pm_runtime_get_noresume(&pdev->dev);
+
+   if (netif_running(dev) && pm_runtime_active(&pdev->dev))
       rtl8169_rx_missed(dev, ioaddr);
 
    do {
@@ -7761,7 +7764,8 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
     * Fetch additonal counter values missing in stats collected by driver
     * from tally counters.
     */
-   rtl8169_update_counters(dev);
+   if (pm_runtime_active(&pdev->dev))
+      rtl8169_update_counters(dev);
 
    /*
     * Subtract values fetched during initalization.
@@ -7774,6 +7778,8 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
    stats->tx_aborted_errors = le16_to_cpu(counters->tx_aborted) -
       le16_to_cpu(tp->tc_offset.tx_aborted);
 
+   pm_runtime_put_noidle(&pdev->dev);
+
    return stats;
 }
 
@@ -7853,6 +7859,10 @@ static int rtl8169_runtime_suspend(struct device *device)
 
    rtl8169_net_suspend(dev);
 
+   /* Update counters before going runtime suspend */
+   rtl8169_rx_missed(dev, tp->mmio_addr);
+   rtl8169_update_counters(dev);
+
    return 0;
 }
 
--
1.9.1


not sure it's the same issue, but the symptom is the same.. it thinks theres no cable plugged in.

i think your eth card is crashing(rebooting hw in such cases usually will work it just isnt being allocated power after the first time it shuts off accidentally without the rest of the cpu going down with it which to me makes me think hw issue) rebuild the kernel module... though theres no reason a kernel you've been using with out issue would start doing this all of a sudden

or it's crossover/ethernet bridge related
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum