All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Problem with the promiscuous mode of RTnet
       [not found] <1740903282.3953811.1430731145805.JavaMail.root@openwide.fr>
@ 2015-05-04  9:44 ` Damien Lagneux
  2015-05-04  9:47   ` Gilles Chanteperdrix
  2015-09-29 22:39   ` Gilles Chanteperdrix
  0 siblings, 2 replies; 5+ messages in thread
From: Damien Lagneux @ 2015-05-04  9:44 UTC (permalink / raw)
  To: xenomai

Hi all,

I'm trying to adapt openPOWERLINK to RTnet. I'm using Xenomai 3.0-rc4,
linux kernel 3.16.7, and the board I'm working with is an Armadeus apf6.

I have a problem with the promiscuous mode of the fec driver. It seems I 
can only receive packets which are addressed to the board.

I'm using the raw-ethernet and eth_p_all programs to test the promiscuous
mode. If the destination MAC address used in the raw-ethernet program 
is the the broadcast address or the board's address, the eth_p_all program
prints the messages. Otherwise, it doesn't print them.

I did set the interface rteth0 in promiscuous mode.

Does anyone have an idea what could the problem?

Thanks for your help,
Damien


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] Problem with the promiscuous mode of RTnet
  2015-05-04  9:44 ` [Xenomai] Problem with the promiscuous mode of RTnet Damien Lagneux
@ 2015-05-04  9:47   ` Gilles Chanteperdrix
  2015-05-04  9:54     ` Damien Lagneux
  2015-09-29 22:39   ` Gilles Chanteperdrix
  1 sibling, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2015-05-04  9:47 UTC (permalink / raw)
  To: Damien Lagneux; +Cc: xenomai

On Mon, May 04, 2015 at 11:44:06AM +0200, Damien Lagneux wrote:
> Hi all,
> 
> I'm trying to adapt openPOWERLINK to RTnet. I'm using Xenomai 3.0-rc4,
> linux kernel 3.16.7, and the board I'm working with is an Armadeus apf6.
> 
> I have a problem with the promiscuous mode of the fec driver. It seems I 
> can only receive packets which are addressed to the board.
> 
> I'm using the raw-ethernet and eth_p_all programs to test the promiscuous
> mode. If the destination MAC address used in the raw-ethernet program 
> is the the broadcast address or the board's address, the eth_p_all program
> prints the messages. Otherwise, it doesn't print them.
> 
> I did set the interface rteth0 in promiscuous mode.
> 
> Does anyone have an idea what could the problem?

How did you set the promiscuous mode ?

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] Problem with the promiscuous mode of RTnet
  2015-05-04  9:47   ` Gilles Chanteperdrix
@ 2015-05-04  9:54     ` Damien Lagneux
  2015-05-04 10:04       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Lagneux @ 2015-05-04  9:54 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Hi Gilles, 

Thank you for your quick reply.

Here is the script I'm using to set RTnet:
#!/bin/sh

modprobe rtnet
modprobe rt_fec
modprobe rtpacket
modprobe rtudp
modprobe rtcap

rtifconfig rteth0 up 10.5.18.161 netmask 255.255.0.0 promisc
ifconfig rteth0 up

Damien

----- Mail original -----
> De: "Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org>
> À: "Damien Lagneux" <damien.lagneux@openwide.fr>
> Cc: xenomai@xenomai.org
> Envoyé: Lundi 4 Mai 2015 11:47:45
> Objet: Re: [Xenomai] Problem with the promiscuous mode of RTnet
> 
> On Mon, May 04, 2015 at 11:44:06AM +0200, Damien Lagneux wrote:
> > Hi all,
> > 
> > I'm trying to adapt openPOWERLINK to RTnet. I'm using Xenomai
> > 3.0-rc4,
> > linux kernel 3.16.7, and the board I'm working with is an Armadeus
> > apf6.
> > 
> > I have a problem with the promiscuous mode of the fec driver. It
> > seems I
> > can only receive packets which are addressed to the board.
> > 
> > I'm using the raw-ethernet and eth_p_all programs to test the
> > promiscuous
> > mode. If the destination MAC address used in the raw-ethernet
> > program
> > is the the broadcast address or the board's address, the eth_p_all
> > program
> > prints the messages. Otherwise, it doesn't print them.
> > 
> > I did set the interface rteth0 in promiscuous mode.
> > 
> > Does anyone have an idea what could the problem?
> 
> How did you set the promiscuous mode ?
> 
> --
> 					    Gilles.
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] Problem with the promiscuous mode of RTnet
  2015-05-04  9:54     ` Damien Lagneux
@ 2015-05-04 10:04       ` Gilles Chanteperdrix
  0 siblings, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2015-05-04 10:04 UTC (permalink / raw)
  To: Damien Lagneux; +Cc: xenomai

On Mon, May 04, 2015 at 11:54:11AM +0200, Damien Lagneux wrote:
> Hi Gilles, 
> 
> Thank you for your quick reply.
> 
> Here is the script I'm using to set RTnet:
> #!/bin/sh
> 
> modprobe rtnet
> modprobe rt_fec
> modprobe rtpacket
> modprobe rtudp
> modprobe rtcap
> 
> rtifconfig rteth0 up 10.5.18.161 netmask 255.255.0.0 promisc

I do not see anything wrong in the code. rtifconfig seems to ask the
IFF_PROMISC flag to be set for the driver, and the driver code seems
to take this flag into account. So I guess you will have to trace
the path from rtifconfig to the driver code to see where the
information gets lost.

> ifconfig rteth0 up

Note that what you are doing here is enabling the rtcap interface
(which is a plain linux interface, and not the rtnet interface), you
may want to avoid doing that in a first step, in case it fiddles
with the promisc bit too.

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] Problem with the promiscuous mode of RTnet
  2015-05-04  9:44 ` [Xenomai] Problem with the promiscuous mode of RTnet Damien Lagneux
  2015-05-04  9:47   ` Gilles Chanteperdrix
@ 2015-09-29 22:39   ` Gilles Chanteperdrix
  1 sibling, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2015-09-29 22:39 UTC (permalink / raw)
  To: Damien Lagneux; +Cc: xenomai

On Mon, May 04, 2015 at 11:44:06AM +0200, Damien Lagneux wrote:
> Hi all,
> 
> I'm trying to adapt openPOWERLINK to RTnet. I'm using Xenomai 3.0-rc4,
> linux kernel 3.16.7, and the board I'm working with is an Armadeus apf6.
> 
> I have a problem with the promiscuous mode of the fec driver. It seems I 
> can only receive packets which are addressed to the board.
> 
> I'm using the raw-ethernet and eth_p_all programs to test the promiscuous
> mode. If the destination MAC address used in the raw-ethernet program 
> is the the broadcast address or the board's address, the eth_p_all program
> prints the messages. Otherwise, it doesn't print them.
> 
> I did set the interface rteth0 in promiscuous mode.
> 
> Does anyone have an idea what could the problem?

Ok, I had a closer look, and in fact, if you are really talking
about kernel/drivers/net/drivers/fec.c, setting up the hardware
filtering is done in the function set_multicast_list, but this
function is not even compiled. What you can try is to uncomment the
part of that function you are interested in, and forcibly call it at
the end of fec_enet_open, as in the following patch:

diff --git a/kernel/drivers/net/drivers/fec.c b/kernel/drivers/net/drivers/fec.c
index 8577c89..3c275ec 100644
--- a/kernel/drivers/net/drivers/fec.c
+++ b/kernel/drivers/net/drivers/fec.c
@@ -1299,6 +1299,8 @@ static int fec_enet_alloc_buffers(struct rtnet_device *ndev)
 	return 0;
 }
 
+static void set_multicast_list(struct rtnet_device *ndev)
+
 static int
 fec_enet_open(struct rtnet_device *ndev)
 {
@@ -1325,6 +1327,7 @@ fec_enet_open(struct rtnet_device *ndev)
 	phy_start(fep->phy_dev);
 	rtnetif_start_queue(ndev);
 	fep->opened = 1;
+	set_multicast_list(ndev);
 	return 0;
 }
 
@@ -1351,7 +1354,6 @@ fec_enet_close(struct rtnet_device *ndev)
 	return 0;
 }
 
-#ifdef CONFIG_XENO_DRIVERS_NET_MULTICAST
 /* Set or clear the multicast filter for this adaptor.
  * Skeleton taken from sunlance driver.
  * The CPM Ethernet implementation allows Multicast as well as individual
@@ -1383,6 +1385,7 @@ static void set_multicast_list(struct rtnet_device *ndev)
 	tmp &= ~0x8;
 	writel(tmp, fep->hwp + FEC_R_CNTRL);
 
+#ifdef CONFIG_XENO_DRIVERS_NET_MULTICAST
 	if (ndev->flags & IFF_ALLMULTI) {
 		/* Catch all multicast addresses, so set the
 		 * filter to all 1's
@@ -1425,8 +1428,8 @@ static void set_multicast_list(struct rtnet_device *ndev)
 			writel(tmp, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
 		}
 	}
-}
 #endif /* CONFIG_XENO_DRIVERS_NET_MULTICAST */
+}
 
 #ifdef ORIGINAL_CODE
 /* Set a MAC change in hardware. */


Note however that I could not get that driver to compile in my build
environment. So, this patch is untested and is all I can do for now.
If you have some patches to submit to get the driver building and
working, I am interested. I will come back on this issue later.

Regards.

-- 
					    Gilles.
https://click-hack.org


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-29 22:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1740903282.3953811.1430731145805.JavaMail.root@openwide.fr>
2015-05-04  9:44 ` [Xenomai] Problem with the promiscuous mode of RTnet Damien Lagneux
2015-05-04  9:47   ` Gilles Chanteperdrix
2015-05-04  9:54     ` Damien Lagneux
2015-05-04 10:04       ` Gilles Chanteperdrix
2015-09-29 22:39   ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.