Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-05-04 Thread poma
On 04.05.2015 03:29, Lennart Poettering wrote:
 On Sat, 02.05.15 12:00, Paul Menzel (paulepan...@users.sourceforge.net) wrote:
 
 /etc/udev/rules.d/10-speed1G-enp1s6.rules
 ACTION==add, SUBSYSTEM==net, RUN+=/usr/sbin/ethtool -s enp1s6 
 advertise 0x20

 :03 systemd[1]: Starting Network Service...
 :05 systemd-networkd[1612]: enp1s6  : link configured
 :05 systemd-networkd[1612]: enp1s6  : gained carrier
 :06 systemd-networkd[1612]: enp1s6  : lost carrier
 :09 systemd-networkd[1612]: enp1s6  : gained carrier

 ~~~

 /etc/udev/rules.d/10-speed1G-enp1s6.rules-

 :15 systemd[1]: Starting Network Service...
 :17 systemd-networkd[1633]: enp1s6  : link configured
 :17 systemd-networkd[1633]: enp1s6  : gained carrier

 So in your case, `gained carrier` is indeed shown earlier saving two
 seconds. The next message probably indicates a problem with the driver.

 Poma, what Linux kernel do you use?

 Lennart, is poma’s test sufficient to show that integrating an
 `advertise` command(?) into systemd-networkd would be useful?
 
 Hmm? Not sure I understand the test, but if I got it right then it
 shows that using ethtool like this slows things down by 3s?
 
 
 Lennart
 

Almost true, 4s. :)
Various kernels, from longterm 3.18.12 to mainline 4.1.x.


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-05-03 Thread Lennart Poettering
On Sat, 02.05.15 12:00, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

  /etc/udev/rules.d/10-speed1G-enp1s6.rules
  ACTION==add, SUBSYSTEM==net, RUN+=/usr/sbin/ethtool -s enp1s6 
  advertise 0x20
  
  :03 systemd[1]: Starting Network Service...
  :05 systemd-networkd[1612]: enp1s6  : link configured
  :05 systemd-networkd[1612]: enp1s6  : gained carrier
  :06 systemd-networkd[1612]: enp1s6  : lost carrier
  :09 systemd-networkd[1612]: enp1s6  : gained carrier
  
  ~~~
  
  /etc/udev/rules.d/10-speed1G-enp1s6.rules-
  
  :15 systemd[1]: Starting Network Service...
  :17 systemd-networkd[1633]: enp1s6  : link configured
  :17 systemd-networkd[1633]: enp1s6  : gained carrier
 
 So in your case, `gained carrier` is indeed shown earlier saving two
 seconds. The next message probably indicates a problem with the driver.
 
 Poma, what Linux kernel do you use?
 
 Lennart, is poma’s test sufficient to show that integrating an
 `advertise` command(?) into systemd-networkd would be useful?

Hmm? Not sure I understand the test, but if I got it right then it
shows that using ethtool like this slows things down by 3s?


Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-05-02 Thread Paul Menzel
Dear poma,


Thank you for the reply with a test and sorry for my late reply. I was
unfortunately unable to test this on the server, as there was no
maintenance window yet. It’s still on my todo list though.

Am Donnerstag, den 09.04.2015, 00:28 +0200 schrieb poma:
 On 08.04.2015 23:05, Lennart Poettering wrote:
  On Wed, 08.04.15 22:13, Paul Menzel wrote:
  
  Wouldn't it suffice to unplug the ethernet cable, then use ethtool to
  turn this on, then replug it, and measuring the time until networkd
  notices the link beat is back?
 
  It would. But this is a rented Hetzner server and I have no access to
  the data center. Do you have another idea. Please keep in mind that I
  also only have remote access using that NIC. ;-)
  
  Then, I figure a udev rule should do. Something like this (untested:)
  
  ACTION==add, SUBSYSTEM==net, KERNEL!=lo, RUN+=/usr/bin/ethtool $name 
  ...
  
  Replace the ... of course with the ethool options you need.
  
  This would then be run immediately when the device appears. If this
  makes a measurable difference, then let us know.

 /etc/udev/rules.d/10-speed1G-enp1s6.rules
 ACTION==add, SUBSYSTEM==net, RUN+=/usr/sbin/ethtool -s enp1s6 advertise 
 0x20
 
 :03 systemd[1]: Starting Network Service...
 :05 systemd-networkd[1612]: enp1s6  : link configured
 :05 systemd-networkd[1612]: enp1s6  : gained carrier
 :06 systemd-networkd[1612]: enp1s6  : lost carrier
 :09 systemd-networkd[1612]: enp1s6  : gained carrier
 
 ~~~
 
 /etc/udev/rules.d/10-speed1G-enp1s6.rules-
 
 :15 systemd[1]: Starting Network Service...
 :17 systemd-networkd[1633]: enp1s6  : link configured
 :17 systemd-networkd[1633]: enp1s6  : gained carrier

So in your case, `gained carrier` is indeed shown earlier saving two
seconds. The next message probably indicates a problem with the driver.

Poma, what Linux kernel do you use?

Lennart, is poma’s test sufficient to show that integrating an
`advertise` command(?) into systemd-networkd would be useful?


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-08 Thread Paul Menzel
Am Dienstag, den 07.04.2015, 18:37 +0200 schrieb Lennart Poettering:
 On Mon, 06.04.15 22:16, Paul Menzel wrote:
 
  Am Freitag, den 03.04.2015, 16:47 +0200 schrieb Lennart Poettering:
   On Thu, 02.04.15 13:11, Paul Menzel wrote:
  
some network cards with certain cables and devices take up to five
seconds so that the link is up [1].

$ sudo journalctl -u systemd-networkd
-- Logs begin at Fr 2015-03-20 17:39:31 CET, end at So 
2015-03-22 08:39:39 CET. --
Mär 20 17:39:31 myhostname systemd-networkd[245]: lo
  : gained carrier
Mär 20 17:39:31 myhostname systemd-networkd[245]: eth0  
  : link configured
Mär 20 17:39:34 myhostname systemd-networkd[245]: eth0  
  : gained carrier

This is annoying if the system is up, but you cannot log into a server
because the NIC is so slow configuring the link.

The Linux kernel module developers from the e1000-devel mailing list
suggested the following [2]:

 Both sides either need to be forced or both sides need to be auto-neg.
 Otherwise the auto-negotiation process will usually detect link (the
 physical signal) but fail to find duplex (since one side is not
 talking) and default to the lowest common denominator, e.g. half
 duplex.  So, you could try forcing speed, it may look right on your
 end but if you have no visibility to the other end it could be running
 at half duplex.

 You may be able to speed up the auto negotiation process by
 exclusively advertising 1000 Mbps Full Duplex.

 # ethtool -s ethX advertise 0x20

In the IRC channel #syst...@irc.freenode.net somebody told me to look
into systemd’s network link configuration (`man systemd.link`).

Reading the manual page, it’s not clear to me, if auto-negotiation is
going to be disabled, if the following is set.

BitsPerSecond=1G
Duplex=Full

Is that equivalent to `ethtool -s ethX advertise 0x20`? If not, how
could I set that up?
   
   BitsPerSecond= and Duplex= are equivalent to ethtool speed and
   ethtool duplex. 
   
   We currently have no setting in .link files that was equivalent to
   ethtool advertise. Maybe we could add that, Tom?
   
   Paul, are you sure that this will really cut 5s from the configuration
   time? Did you try this?
  
  I am not sure and didn’t try this, as I do not know where to integrate
  that `ethtool -s eth0 advertise …` call. In udev or `systemd-networkd`?
  
  If somebody could help me, how I can test this, I’ll report my findings
  back.
 
 Wouldn't it suffice to unplug the ethernet cable, then use ethtool to
 turn this on, then replug it, and measuring the time until networkd
 notices the link beat is back?

It would. But this is a rented Hetzner server and I have no access to
the data center. Do you have another idea. Please keep in mind that I
also only have remote access using that NIC. ;-)


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-08 Thread poma
On 08.04.2015 23:05, Lennart Poettering wrote:
 On Wed, 08.04.15 22:13, Paul Menzel (paulepan...@users.sourceforge.net) wrote:
 
 Wouldn't it suffice to unplug the ethernet cable, then use ethtool to
 turn this on, then replug it, and measuring the time until networkd
 notices the link beat is back?

 It would. But this is a rented Hetzner server and I have no access to
 the data center. Do you have another idea. Please keep in mind that I
 also only have remote access using that NIC. ;-)
 
 Then, I figure a udev rule should do. Something like this (untested:)
 
 ACTION==add, SUBSYSTEM==net, KERNEL!=lo, RUN+=/usr/bin/ethtool $name 
 ...
 
 Replace the ... of course with the ethool options you need.
 
 This would then be run immediately when the device appears. If this
 makes a measurable difference, then let us know.
 
 Lennart
 

/etc/udev/rules.d/10-speed1G-enp1s6.rules
ACTION==add, SUBSYSTEM==net, RUN+=/usr/sbin/ethtool -s enp1s6 advertise 
0x20

:03 systemd[1]: Starting Network Service...
:05 systemd-networkd[1612]: enp1s6  : link configured
:05 systemd-networkd[1612]: enp1s6  : gained carrier
:06 systemd-networkd[1612]: enp1s6  : lost carrier
:09 systemd-networkd[1612]: enp1s6  : gained carrier

~~~

/etc/udev/rules.d/10-speed1G-enp1s6.rules-

:15 systemd[1]: Starting Network Service...
:17 systemd-networkd[1633]: enp1s6  : link configured
:17 systemd-networkd[1633]: enp1s6  : gained carrier


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-08 Thread Lennart Poettering
On Wed, 08.04.15 22:13, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

  Wouldn't it suffice to unplug the ethernet cable, then use ethtool to
  turn this on, then replug it, and measuring the time until networkd
  notices the link beat is back?
 
 It would. But this is a rented Hetzner server and I have no access to
 the data center. Do you have another idea. Please keep in mind that I
 also only have remote access using that NIC. ;-)

Then, I figure a udev rule should do. Something like this (untested:)

ACTION==add, SUBSYSTEM==net, KERNEL!=lo, RUN+=/usr/bin/ethtool $name ...

Replace the ... of course with the ethool options you need.

This would then be run immediately when the device appears. If this
makes a measurable difference, then let us know.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-07 Thread Lennart Poettering
On Mon, 06.04.15 22:16, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

 Am Freitag, den 03.04.2015, 16:47 +0200 schrieb Lennart Poettering:
  On Thu, 02.04.15 13:11, Paul Menzel wrote:
 
   some network cards with certain cables and devices take up to five
   seconds so that the link is up [1].
   
   $ sudo journalctl -u systemd-networkd
   -- Logs begin at Fr 2015-03-20 17:39:31 CET, end at So 2015-03-22 
   08:39:39 CET. --
   Mär 20 17:39:31 myhostname systemd-networkd[245]: lo  
   : gained carrier
   Mär 20 17:39:31 myhostname systemd-networkd[245]: eth0
   : link configured
   Mär 20 17:39:34 myhostname systemd-networkd[245]: eth0
   : gained carrier
   
   This is annoying if the system is up, but you cannot log into a server
   because the NIC is so slow configuring the link.
   
   The Linux kernel module developers from the e1000-devel mailing list
   suggested the following [2]:
   
Both sides either need to be forced or both sides need to be auto-neg.
Otherwise the auto-negotiation process will usually detect link (the
physical signal) but fail to find duplex (since one side is not
talking) and default to the lowest common denominator, e.g. half
duplex.  So, you could try forcing speed, it may look right on your
end but if you have no visibility to the other end it could be running
at half duplex.
   
You may be able to speed up the auto negotiation process by
exclusively advertising 1000 Mbps Full Duplex.
   
# ethtool -s ethX advertise 0x20
   
   In the IRC channel #syst...@irc.freenode.net somebody told me to look
   into systemd’s network link configuration (`man systemd.link`).
   
   Reading the manual page, it’s not clear to me, if auto-negotiation is
   going to be disabled, if the following is set.
   
   BitsPerSecond=1G
   Duplex=Full
   
   Is that equivalent to `ethtool -s ethX advertise 0x20`? If not, how
   could I set that up?
  
  BitsPerSecond= and Duplex= are equivalent to ethtool speed and
  ethtool duplex. 
  
  We currently have no setting in .link files that was equivalent to
  ethtool advertise. Maybe we could add that, Tom?
  
  Paul, are you sure that this will really cut 5s from the configuration
  time? Did you try this?
 
 I am not sure and didn’t try this, as I do not know where to integrate
 that `ethtool -s eth0 advertise …` call. In udev or `systemd-networkd`?
 
 If somebody could help me, how I can test this, I’ll report my findings
 back.

Wouldn't it suffice to unplug the ethernet cable, then use ethtool to
turn this on, then replug it, and measuring the time until networkd
notices the link beat is back?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-06 Thread Paul Menzel
Am Freitag, den 03.04.2015, 16:47 +0200 schrieb Lennart Poettering:
 On Thu, 02.04.15 13:11, Paul Menzel wrote:

  some network cards with certain cables and devices take up to five
  seconds so that the link is up [1].
  
  $ sudo journalctl -u systemd-networkd
  -- Logs begin at Fr 2015-03-20 17:39:31 CET, end at So 2015-03-22 
  08:39:39 CET. --
  Mär 20 17:39:31 myhostname systemd-networkd[245]: lo  : 
  gained carrier
  Mär 20 17:39:31 myhostname systemd-networkd[245]: eth0: 
  link configured
  Mär 20 17:39:34 myhostname systemd-networkd[245]: eth0: 
  gained carrier
  
  This is annoying if the system is up, but you cannot log into a server
  because the NIC is so slow configuring the link.
  
  The Linux kernel module developers from the e1000-devel mailing list
  suggested the following [2]:
  
   Both sides either need to be forced or both sides need to be auto-neg.
   Otherwise the auto-negotiation process will usually detect link (the
   physical signal) but fail to find duplex (since one side is not
   talking) and default to the lowest common denominator, e.g. half
   duplex.  So, you could try forcing speed, it may look right on your
   end but if you have no visibility to the other end it could be running
   at half duplex.
  
   You may be able to speed up the auto negotiation process by
   exclusively advertising 1000 Mbps Full Duplex.
  
   # ethtool -s ethX advertise 0x20
  
  In the IRC channel #syst...@irc.freenode.net somebody told me to look
  into systemd’s network link configuration (`man systemd.link`).
  
  Reading the manual page, it’s not clear to me, if auto-negotiation is
  going to be disabled, if the following is set.
  
  BitsPerSecond=1G
  Duplex=Full
  
  Is that equivalent to `ethtool -s ethX advertise 0x20`? If not, how
  could I set that up?
 
 BitsPerSecond= and Duplex= are equivalent to ethtool speed and
 ethtool duplex. 
 
 We currently have no setting in .link files that was equivalent to
 ethtool advertise. Maybe we could add that, Tom?
 
 Paul, are you sure that this will really cut 5s from the configuration
 time? Did you try this?

I am not sure and didn’t try this, as I do not know where to integrate
that `ethtool -s eth0 advertise …` call. In udev or `systemd-networkd`?

If somebody could help me, how I can test this, I’ll report my findings
back.


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-03 Thread Tom Gundersen
On Fri, Apr 3, 2015 at 4:47 PM, Lennart Poettering
lenn...@poettering.net wrote:
 On Thu, 02.04.15 13:11, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

 Dear systemd folks,


 some network cards with certain cables and devices take up to five
 seconds so that the link is up [1].

 $ sudo journalctl -u systemd-networkd
 -- Logs begin at Fr 2015-03-20 17:39:31 CET, end at So 2015-03-22 
 08:39:39 CET. --
 Mär 20 17:39:31 myhostname systemd-networkd[245]: lo  : 
 gained carrier
 Mär 20 17:39:31 myhostname systemd-networkd[245]: eth0: 
 link configured
 Mär 20 17:39:34 myhostname systemd-networkd[245]: eth0: 
 gained carrier

 This is annoying if the system is up, but you cannot log into a server
 because the NIC is so slow configuring the link.

 The Linux kernel module developers from the e1000-devel mailing list
 suggested the following [2]:

  Both sides either need to be forced or both sides need to be auto-neg.
  Otherwise the auto-negotiation process will usually detect link (the
  physical signal) but fail to find duplex (since one side is not
  talking) and default to the lowest common denominator, e.g. half
  duplex.  So, you could try forcing speed, it may look right on your
  end but if you have no visibility to the other end it could be running
  at half duplex.
 
  You may be able to speed up the auto negotiation process by
  exclusively advertising 1000 Mbps Full Duplex.
 
  # ethtool -s ethX advertise 0x20

 In the IRC channel #syst...@irc.freenode.net somebody told me to look
 into systemd’s network link configuration (`man systemd.link`).

 Reading the manual page, it’s not clear to me, if auto-negotiation is
 going to be disabled, if the following is set.

 BitsPerSecond=1G
 Duplex=Full

 Is that equivalent to `ethtool -s ethX advertise 0x20`? If not, how
 could I set that up?

 BitsPerSecond= and Duplex= are equivalent to ethtool speed and
 ethtool duplex.

 We currently have no setting in .link files that was equivalent to
 ethtool advertise. Maybe we could add that, Tom?

 Paul, are you sure that this will really cut 5s from the configuration
 time? Did you try this?

No objections from me if it really cuts 5s as described.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-03 Thread Lennart Poettering
On Thu, 02.04.15 13:11, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

 Dear systemd folks,
 
 
 some network cards with certain cables and devices take up to five
 seconds so that the link is up [1].
 
 $ sudo journalctl -u systemd-networkd
 -- Logs begin at Fr 2015-03-20 17:39:31 CET, end at So 2015-03-22 
 08:39:39 CET. --
 Mär 20 17:39:31 myhostname systemd-networkd[245]: lo  : 
 gained carrier
 Mär 20 17:39:31 myhostname systemd-networkd[245]: eth0: 
 link configured
 Mär 20 17:39:34 myhostname systemd-networkd[245]: eth0: 
 gained carrier
 
 This is annoying if the system is up, but you cannot log into a server
 because the NIC is so slow configuring the link.
 
 The Linux kernel module developers from the e1000-devel mailing list
 suggested the following [2]:
 
  Both sides either need to be forced or both sides need to be auto-neg.
  Otherwise the auto-negotiation process will usually detect link (the
  physical signal) but fail to find duplex (since one side is not
  talking) and default to the lowest common denominator, e.g. half
  duplex.  So, you could try forcing speed, it may look right on your
  end but if you have no visibility to the other end it could be running
  at half duplex.
 
  You may be able to speed up the auto negotiation process by
  exclusively advertising 1000 Mbps Full Duplex.
 
  # ethtool -s ethX advertise 0x20
 
 In the IRC channel #syst...@irc.freenode.net somebody told me to look
 into systemd’s network link configuration (`man systemd.link`).
 
 Reading the manual page, it’s not clear to me, if auto-negotiation is
 going to be disabled, if the following is set.
 
 BitsPerSecond=1G
 Duplex=Full
 
 Is that equivalent to `ethtool -s ethX advertise 0x20`? If not, how
 could I set that up?

BitsPerSecond= and Duplex= are equivalent to ethtool speed and
ethtool duplex. 

We currently have no setting in .link files that was equivalent to
ethtool advertise. Maybe we could add that, Tom?

Paul, are you sure that this will really cut 5s from the configuration
time? Did you try this?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

2015-04-02 Thread Paul Menzel
Dear systemd folks,


some network cards with certain cables and devices take up to five
seconds so that the link is up [1].

$ sudo journalctl -u systemd-networkd
-- Logs begin at Fr 2015-03-20 17:39:31 CET, end at So 2015-03-22 
08:39:39 CET. --
Mär 20 17:39:31 myhostname systemd-networkd[245]: lo  : 
gained carrier
Mär 20 17:39:31 myhostname systemd-networkd[245]: eth0: 
link configured
Mär 20 17:39:34 myhostname systemd-networkd[245]: eth0: 
gained carrier

This is annoying if the system is up, but you cannot log into a server
because the NIC is so slow configuring the link.

The Linux kernel module developers from the e1000-devel mailing list
suggested the following [2]:

 Both sides either need to be forced or both sides need to be auto-neg.
 Otherwise the auto-negotiation process will usually detect link (the
 physical signal) but fail to find duplex (since one side is not
 talking) and default to the lowest common denominator, e.g. half
 duplex.  So, you could try forcing speed, it may look right on your
 end but if you have no visibility to the other end it could be running
 at half duplex.

 You may be able to speed up the auto negotiation process by
 exclusively advertising 1000 Mbps Full Duplex.

 # ethtool -s ethX advertise 0x20

In the IRC channel #syst...@irc.freenode.net somebody told me to look
into systemd’s network link configuration (`man systemd.link`).

Reading the manual page, it’s not clear to me, if auto-negotiation is
going to be disabled, if the following is set.

BitsPerSecond=1G
Duplex=Full

Is that equivalent to `ethtool -s ethX advertise 0x20`? If not, how
could I set that up?


Thanks,

Paul


[1] http://sourceforge.net/p/e1000/mailman/message/33623906/
[2] http://sourceforge.net/p/e1000/mailman/message/33635403/


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel