Add cards parameter to rt_e1000e module?
The rtnet rt_e1000e module does not implement the 'cards' parameter. I have attached a patch for the 'next' branch of xenomai-3.git that adds this parameter, and it seems to work fine on my hardware. The code was ported straight from the rt_e1000 module. My machine has two e1000e cards, so this is a useful feature for me. (I actually applied the same fix to the standard e1000e driver, which is even more useful to me, but I know it would be a maintenance nightmare for Xenomai to start maintaining that sort of patching...)
I am trying to learn rtnet, but it seems that the code from the rtnet git repo won't compile with linux-3.14.17/xenomai-2.6.4. I saw that Gilles has pulled the rtnet code into the Xenomai-3 git repo, so it seemed to me that beta testing the Xenomai-3 rtnet code would be a better use of my time than messing with the old code base. So far, so good. My machine's primary ethernet interface is using the standard linux e1000e driver, and the secondary ethernet interface is up and running under rtnet using the rt_e1000e driver. I can use rtping to talk to another linux box that is connected via a switch, provided I ping in the reverse direction first to set up the route information.
-Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rt_e1000e.patch
Type: text/x-patch
Size: 1462 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20141212/ff3c0806/attachment.bin>
Quoted 10 lines · Jeff Webb
The rtnet
rt_e1000emodule does not implement the 'cards' parameter. I have attached a patch for the 'next' branch of xenomai-3.git that adds this parameter, and it seems to work fine on my hardware. The code was ported straight from thert_e1000module. My machine has two e1000e cards, so this is a useful feature for me. (I actually applied the same fix to the standard e1000e driver, which is even more useful to me, but I know it would be a maintenance nightmare for Xenomai to start maintaining that sort of patching...)
Quoted 11 lines
I am trying to learn rtnet, but it seems that the code from the rtnet git repo won't compile with linux-3.14.17/xenomai-2.6.4. I saw that Gilles has pulled the rtnet code into the Xenomai-3 git repo, so it seemed to me that beta testing the Xenomai-3 rtnet code would be a better use of my time than messing with the old code base. So far, so good. My machine's primary ethernet interface is using the standard linux e1000e driver, and the secondary ethernet interface is up and running under rtnet using the
rt_e1000edriver. I can use rtping to talk to another linux box that is connected via a switch, provided I ping in the reverse direction first to set up the route information.
You can get rtnet to send an arp request to learn the route by using the rtroute solicit command.
Signature · 1 line
Gilles.
Quoted 23 lines · Gilles Chanteperdrix
Quoted 10 lines · Jeff Webb
The rtnet
rt_e1000emodule does not implement the 'cards' parameter. I have attached a patch for the 'next' branch of xenomai-3.git that adds this parameter, and it seems to work fine on my hardware. The code was ported straight from thert_e1000module. My machine has two e1000e cards, so this is a useful feature for me. (I actually applied the same fix to the standard e1000e driver, which is even more useful to me, but I know it would be a maintenance nightmare for Xenomai to start maintaining that sort of patching...)Quoted 11 lines
I am trying to learn rtnet, but it seems that the code from the rtnet git repo won't compile with linux-3.14.17/xenomai-2.6.4. I saw that Gilles has pulled the rtnet code into the Xenomai-3 git repo, so it seemed to me that beta testing the Xenomai-3 rtnet code would be a better use of my time than messing with the old code base. So far, so good. My machine's primary ethernet interface is using the standard linux e1000e driver, and the secondary ethernet interface is up and running under rtnet using the
rt_e1000edriver. I can use rtping to talk to another linux box that is connected via a switch, provided I ping in the reverse direction first to set up the route information.
Quoted 3 lines
You can get rtnet to send an arp request to learn the route by using the rtroute solicit command.
That works great. Thanks for the ip.
Quoted 24 lines · Jeff Webb
Quoted 23 lines · Gilles Chanteperdrix
Quoted 21 lines · Jeff Webb
The rtnet
rt_e1000emodule does not implement the 'cards' parameter. I have attached a patch for the 'next' branch of xenomai-3.git that adds this parameter, and it seems to work fine on my hardware. The code was ported straight from thert_e1000module. My machine has two e1000e cards, so this is a useful feature for me. (I actually applied the same fix to the standard e1000e driver, which is even more useful to me, but I know it would be a maintenance nightmare for Xenomai to start maintaining that sort of patching...)I am trying to learn rtnet, but it seems that the code from the rtnet git repo won't compile with linux-3.14.17/xenomai-2.6.4. I saw that Gilles has pulled the rtnet code into the Xenomai-3 git repo, so it seemed to me that beta testing the Xenomai-3 rtnet code would be a better use of my time than messing with the old code base. So far, so good. My machine's primary ethernet interface is using the standard linux e1000e driver, and the secondary ethernet interface is up and running under rtnet using the
rt_e1000edriver. I can use rtping to talk to another linux box that is connected via a switch, provided I ping in the reverse direction first to set up the route information.
Quoted 6 lines
Quoted 3 lines
You can get rtnet to send an arp request to learn the route by using the rtroute solicit command.
That works great. Thanks for the ip.
Sorry, I meant "tip", not "ip". ;)
Quoted 9 lines · Jeff Webb
The rtnet
rt_e1000emodule does not implement the 'cards' parameter. I have attached a patch for the 'next' branch of xenomai-3.git that adds this parameter, and it seems to work fine on my hardware. The code was ported straight from thert_e1000module. My machine has two e1000e cards, so this is a useful feature for me. (I actually applied the same fix to the standard e1000e driver, which is even more useful to me, but I know it would be a maintenance nightmare for Xenomai to start maintaining that sort of patching...)
I understand the need for the "cards" parameter, but... Is not there another way to solve this issue ? I do not know, something in /proc or /sys to tell Linux to not load this driver for that card? I suppose if we tell Linux to not use its driver for some cards, then later loading the rtnet driver will be used for these cards? Adding the cards parameter means that the rtnet drivers diverge from mainline drivers, and so imply a maintenance cost. On the other hand, maybe that is a cheaper one than trying and solving the issue globally.
Signature · 1 line
Gilles.
Quoted 9 lines · Gilles Chanteperdrix
I understand the need for the "cards" parameter, but... Is not there another way to solve this issue ? I do not know, something in /proc or /sys to tell Linux to not load this driver for that card? I suppose if we tell Linux to not use its driver for some cards, then later loading the rtnet driver will be used for these cards? Adding the cards parameter means that the rtnet drivers diverge from mainline drivers, and so imply a maintenance cost. On the other hand, maybe that is a cheaper one than trying and solving the issue globally.
Certainly a well behaved driver would not touch a device already handled by a linux driver. It should be possible to just issue an unbind request to the linux driver for the desired device and then a bind request to the rtnet driver to take over that device.
But I have not looked at rtnet, so I don't know how those behave compared to linux drivers.
Signature · 1 line
Len Sorensen
Quoted 11 lines · Lennart Sorensen
Quoted 9 lines · Gilles Chanteperdrix
I understand the need for the "cards" parameter, but... Is not there another way to solve this issue ? I do not know, something in /proc or /sys to tell Linux to not load this driver for that card? I suppose if we tell Linux to not use its driver for some cards, then later loading the rtnet driver will be used for these cards? Adding the cards parameter means that the rtnet drivers diverge from mainline drivers, and so imply a maintenance cost. On the other hand, maybe that is a cheaper one than trying and solving the issue globally.
Quoted 7 lines
Certainly a well behaved driver would not touch a device already handled by a linux driver. It should be possible to just issue an unbind request to the linux driver for the desired device and then a bind request to the rtnet driver to take over that device.
But I have not looked at rtnet, so I don't know how those behave compared to linux drivers.
As all RTDM drivers, RTnet drivers are just linux drivers. The issue is to have a setup where two cards with the same chip are used by two different drivers. Linux does not have this problem, because it rarely has several drivers for the same chip. The problem with the bind/unbind solution is that the driver that will get all the cards first depends on the drivers initialization order. With the "cards" parameter, you do not have this issue.
Signature · 1 line
Gilles.
Quoted 7 lines · Gilles Chanteperdrix
As all RTDM drivers, RTnet drivers are just linux drivers. The issue is to have a setup where two cards with the same chip are used by two different drivers. Linux does not have this problem, because it rarely has several drivers for the same chip. The problem with the bind/unbind solution is that the driver that will get all the cards first depends on the drivers initialization order. With the "cards" parameter, you do not have this issue.
Well I remember multiple drivers in the past for the tulip network chip, and for a while there where two firewire drivers too. Also those that run xen with pci passthrough have the same issue of preventing linux from grabbing a given device.
It would seem that just using bind/unbind and loading all the drivers, user space could resolve the issue, but the cards parameter may be more convinient, at the expense of having to add that to the driver of course.
Signature · 1 line
Len Sorensen
Quoted 11 lines · Gilles Chanteperdrix
Quoted 10 lines · Lennart Sorensen
Quoted 9 lines · Gilles Chanteperdrix
I understand the need for the "cards" parameter, but... Is not there another way to solve this issue ? I do not know, something in /proc or /sys to tell Linux to not load this driver for that card? I suppose if we tell Linux to not use its driver for some cards, then later loading the rtnet driver will be used for these cards? Adding the cards parameter means that the rtnet drivers diverge from mainline drivers, and so imply a maintenance cost. On the other hand, maybe that is a cheaper one than trying and solving the issue globally.
I think the "cards" parameter is a pretty crude solution, too. As you mentioned, this seems like a more general problem that Linux would already have a solution for, but my search for another solution turned up empty.
Quoted 4 lines
Quoted 4 lines
Certainly a well behaved driver would not touch a device already handled by a linux driver. It should be possible to just issue an unbind request to the linux driver for the desired device and then a bind request to the rtnet driver to take over that device.
Thanks for sharing this information. It sounds like that might work.
Quoted 4 lines
The problem with the
bind/unbind solution is that the driver that will get all the cards first depends on the drivers initialization order. With the "cards" parameter, you do not have this issue.
Maybe one could create a script that would attempt to unbind both the rt and non-rt drivers (or check to see which one is bound and then unbind it), and then make the desired "bind" calls. It would be better if the incorrect binding were not made in the first place, however. I think the ideal solution would be to have a file that contains device/driver pairs that would keep the kernel from passing the specified devices to any other drivers. I wonder how hard that would be to implement.
For what it's worth, I have these same issues with 16550 serial port drivers. The 8250.nr_uarts parameter is helpful, but doesn't cover all use cases.
-Jeff