NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring the Technology Ability Field

Is there a way to manipulate the technology ability field (TAF field used during autonegotation) on NI Linux RT targets? I guess I would need to put this on the wish list / Idea Exchange if I wanted to configure this from the web interface/NI Max...and programmatically via the System Configuration API, or?

0 Kudos
Message 1 of 7
(4,300 Views)

Do you need something else other than configuring speed/duplex? If not, you can configure both from MAX (Select the target, select the networking tab, and expland the "More settings" tab on the adapter(s) you want to configure)

0 Kudos
Message 2 of 7
(3,306 Views)

Unfortunately I need more control than available from NI MAX. I need for example to be able to only set flag 1 and 3 (full duplex 10/100).

0 Kudos
Message 3 of 7
(3,306 Views)

You can use ethtool directly from a terminal to test out settings. When you find settings that will work for you, you can add your changes to either a startup script or to the ifplugd scripts that control setting up the network interfaces on cable plugging/unplugging and handle the DHCP/LL failover.

admin@HerNameIsRIO:~# ethtool eth0

...

        Advertised link modes:  10baseT/Half 10baseT/Full                      

                                100baseT/Half 100baseT/Full                    

                                1000baseT/Full

...

admin@HerNameIsRIO:~# ethtool -s eth0 advertise 0x102A

admin@HerNameIsRIO:~# ethtool eth0

...

        Advertised link modes:  10baseT/Full                                   

                                100baseT/Full                                  

                                1000baseT/Full

...

This is a bit of an unusual use-case, so there's not a friendly UI, but at least it is possible and not too difficult

Message 4 of 7
(3,306 Views)

I edited /etc/network/interfaces as shown below to test if I could make a persistent change, but it does not work. Browsing the general Linux idscussion boards have not made me any wiser on why...perhaps such a change is overridden by something else on Linux RT?

#auto eth0

#iface eth0 inet dhcp

#  hostname `hostname`

#iface eth1 inet dhcp

#pre-up /sbin/ethtool -s eth1 speed 10 duplex full

0 Kudos
Message 5 of 7
(3,306 Views)

As you guessed, NI Linux RT configures the network with a different file. You can get at the same set of options you found in MAX/WIF by editing your /etc/natinst/share/ni-rt.ini file (specifically the [ETH1] section in this example) so that MediaMode is, say, "10full". These tokens and in fact this entire file are considered internal and can change without notice, and just as with MAX/WIF you can only list one at a time, though, so it doesn't solve your use case of wanting to advertise 10 and 100Mbit and full duplex only.

As you mentioned in the original post, you might want to post this to the idea forum http://forums.ni.com/t5/LabVIEW-Real-Time-Idea-Exchange/idb-p/lvrtideas so that we can consider adding advertise configuration to our user-facing tools.

For now, as Brad noted, you should be able to do what you want in the ifplugd scripts, i.e. /etc/ifplugd/ifplugd.action. I just tried that with Brad's advertise command and it seems to work. Note that passing "speed" and "duplex" set the current speed  and duplex for the interface. Obviously only one combination of  those  can be set at a time, so for that, the MAX/WIF interface works.  As Brad noted in his reply above, based on your original request, what  it sounds like you want is "advertise".

The only thing we use /etc/network/interfaces for is the loopback interface "lo". You actually can put pre-up directives on that, I just tried it for my own curiousity and it works (I made it echo "HELLO SCOT" to the console when networking starts). If you had a use case for that, there are issues with your snippet above that you may already know but just in case:

  1. ethtool is found in /usr/sbin, not /sbin, on my NI Linux RT system.
  2. pre-up should be indented under the iface section for the interface it applies to.
  3. Don't forget to remove the # comment prefix from the appropriate lines.

I don't think that's what you want, though. I've created an issue in our tracking database to clean out /etc/network/interfaces to reduce confusion.

Message 6 of 7
(3,306 Views)

Thanks.

The goal is to change the advertised modes yes, I just used the bolded command as a test (easier to check the success of it than the advertise-command).

0 Kudos
Message 7 of 7
(3,306 Views)