You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "sastel (via GitHub)" <gi...@apache.org> on 2024/06/05 18:38:43 UTC
[I] Loopback Configuration Bug in mpfs_ethernet.c [nuttx]
sastel opened a new issue, #12456:
URL: https://github.com/apache/nuttx/issues/12456
@acassis on `nuttx-12.5.0`, switching on `CONFIG_NET_LOOPBACK` to get the `lo` localhost working breaks `eth0` interface so that I can no longer ping the board.
The `mpfs_ethernet.c` file turns on the `NETWORK_CONTROL_LOOPBACK_LOCAL` flag in `mpfs_macconfig()` if `CONFIG_NET_LOOPBACK` is defined. I think that this is a misunderstanding of what `CONFIG_NET_LOOPBACK` is for.
```
config NET_LOOPBACK
bool "Local loopback"
select ARCH_HAVE_NETDEV_STATISTICS
default n
---help---
Add support for the local network loopback device, lo.
```
Proposed fix is below. I'd like to open a PR and merge this fix if the NuttX developers approve.
```diff
diff --git a/arch/risc-v/src/mpfs/mpfs_ethernet.c b/arch/risc-v/src/mpfs/mpfs_ethernet.c
index 382477fa9e..0a5755d354 100644
--- a/arch/risc-v/src/mpfs/mpfs_ethernet.c
+++ b/arch/risc-v/src/mpfs/mpfs_ethernet.c
@@ -3104,7 +3104,7 @@ static int mpfs_macconfig(struct mpfs_ethmac_s *priv)
net_config |= NETWORK_CONFIG_SGMII_MODE_ENABLE | NETWORK_CONFIG_PCS_SELECT;
#endif
-#ifdef CONFIG_NET_LOOPBACK
+#ifdef CONFIG_MPFS_MAC_LOOPBACK
net_control |= NETWORK_CONTROL_LOOPBACK_LOCAL;
#endif
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Loopback Configuration Bug in mpfs_ethernet.c [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #12456:
URL: https://github.com/apache/nuttx/issues/12456#issuecomment-2150964279
So, is this PolarFire Loopback something specific of is Ethernet controller? If so your modification seems correct.
@pussuw could you please take a look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Loopback Configuration Bug in mpfs_ethernet.c [nuttx]
Posted by "sastel (via GitHub)" <gi...@apache.org>.
sastel commented on issue #12456:
URL: https://github.com/apache/nuttx/issues/12456#issuecomment-2150986943
Yes `NETWORK_CONTROL_LOOPBACK_LOCAL` is a bit in the `NETWORK_CONTROL` MAC register on MPFS.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org