-
Describe the bug We are using UDP multicast in our application. We are facing issue with receiving MC packets on IMX1064RT, whereas this is correctly working for other targets (several STM32 :H7 and H7-NUCLEO series) For information, we raised a similar issue in 2020 which lead to a functional fix (#See #26584 and suggested patch for imx1064 #26585).
Some additionnal information:
To Reproduce
Expected behavior
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments 3 replies
-
@jchabod would you be able to bisect down to a specific commit? |
Beta Was this translation helpful? Give feedback.
-
@fabiobaltieri I had it working on V2.3 and V2.3 up to v3.0.0 is 19K commits... I don't think I'll have time for that . Don't you think it possible that there is a NETWORK flag I missed in configuration? |
Beta Was this translation helpful? Give feedback.
-
I have been looking into history, and I found out that in v2.4 / v2.5 (where I had MC reception OK on IMX), the We thus used the following intrusive function to have MC reception working: (However, I have not been able to rebuild ith Zephyr V2.5, and patch below does not make the job on V3.0.0...)
|
Beta Was this translation helpful? Give feedback.
-
Can't you bisect? That should be 13 steps or so.
If we can identify the commit it may help, or maybe check if there's some other upstream multicast enabled feature that works that is enabling something? @rlubos any comment on this? |
Beta Was this translation helpful? Give feedback.
-
It seems that Zephyr v2.6 brought IGMPv2 support (see #34579), perhaps it's related. I think however that the actual culprit would be hard to identify w/o using a bisect, there are simply too many changes since 2.3 to guess where's the problem (please note that not everyone has particular hardware to reproduce the problem). |
Beta Was this translation helpful? Give feedback.
-
@jchabod, is there a test case or sample in the Zephyr tree that reproduces this problem or is it just your application? |
Beta Was this translation helpful? Give feedback.
-
@jchabod can you share you test application?looks like the CONFIG_NET_IPV4_IGMP is need to support multi-cast |
Beta Was this translation helpful? Give feedback.
-
Hi, the reproducer is attached in the ticket description above. I'll try with |
Beta Was this translation helpful? Give feedback.
-
I made the test with I "visually" see the ETH led blinking on IMX, but no packet is received on ETH stack: I've instrumented what I suppose is the entry point of network reception (ethernet.c) |
Beta Was this translation helpful? Give feedback.
-
Note: I used the following python3 script (windows) to send MC packets (of course, you may need to update local IP address):
|
Beta Was this translation helpful? Give feedback.
-
@jchabod , please check the eth_mcux_init(const struct device *dev) in out eth_mcux.c, the myltucase is defined, if you have special address to monitor you need add accrodingly.
and according to https://datatracker.ietf.org/doc/html/rfc1112 yo should specifice a multicase address starting with (01:00:5e) |
Beta Was this translation helpful? Give feedback.
-
I meet error with your script
|
Beta Was this translation helpful? Give feedback.
-
You will need some changes to run it under python27 |
Beta Was this translation helpful? Give feedback.
-
@jchabod , thanks for this message, now I can send multicast message, and this looks like not a driver issue, nor stack issue, and just because you need some code to process your own multicast protocol. |
Beta Was this translation helpful? Give feedback.
-
Thanks @hakehuang I can see packets reaching in I have 2 small questions before closing this subject, maybe you can help quickly:
Anyway thank for support and help ! |
Beta Was this translation helpful? Give feedback.
-
I'm converting this issue to a discussion It looks like the STM32 may, by default, enable promiscuous mode in their drivers. Not sure. But enabling promiscuous mode is a bit of a sledgehammer solution because now the application will need to filter everything when the HW could be filtering the multicast frames for you. |
Beta Was this translation helpful? Give feedback.
-
Take a look at net_if_mcast_monitor() function. /**
If you have a custom multicast you are trying to receive this would setup the HW to use this filter. |
Beta Was this translation helpful? Give feedback.
-
If this is still open question I think I have found the culprit. As dleach02 states it has to do with this monitor mechanism. The problem was that eth_mcux.c (zephyr 2.7) adds multicast addresses only in case of ipv6 addresses (big big facepalm). I made simple rewrite of the callback function and eth_iface_init to support both ipv4 and ipv6: in drivers/ethernet/eth_mcux.c
As you can see, there are configs for ipv6 that are now commented out (before that fix the ipv4 family was just ignored!). Now it is possible to add ipv4 multicast addresses without promiscous mode! Maybe the authors of eth_mcux.c can share what was the idea of disabling ipv4 multicasting? Did it had some deeper reason? |
Beta Was this translation helpful? Give feedback.
Take a look at net_if_mcast_monitor() function.
/**
*/
void net_if_mcast_monitor(struct net_if *iface, const struct net_addr *addr,
bool is_joined);
If you have a custom multicast you are trying to receive this would setup the HW to use this filter.