diff mbox

[U-Boot,RFC,1/3] expose eth_is_active() function to test network device state

Message ID 55DC3B24.7010508@web.de
State Superseded
Delegated to: Joe Hershberger
Headers show

Commit Message

Bernhard Nortmann Aug. 25, 2015, 9:53 a.m. UTC
Am 24.08.2015 um 19:02 schrieb Joe Hershberger:
> Hi Simon,
>
> On Mon, Aug 24, 2015 at 11:59 AM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Bernhard,
>>
>> [...]
>> i.e. sunxi GMAC (by simply adding #define CONFIG_NETCONSOLE).
>> In that case how about adding that config to that board? Does it cause
>> problems for other people?
> I'll pile on and agree that it would be great to have at least one
> board with this enabled, and even better to have one that supports
> DM_ETH and one that does not.
>
> -Joe

grep "#define CONFIG_NETCONSOLE" include/configs/*
lists a considerable number of boards where NETCONSOLE seems to be active
by default. I guess none of these has moved to DM_ETH yet, or I'd have
expected reports of "broken" builds.

If you're all for it, I can of course enable NETCONSOLE for the Banana
Pi/Pro. (It may even be done across-the-board for all SUNXI_[EG]MAC
configs?)

Personally, I'm a bit reluctant to "enforce" this setting, because until
now my understanding was that NETCONSOLE is supposed to be mostly
optional, i.e. at user's choice - especially for boards where other
means of input/output are readily available (serial console, vga, usb
keyboard).

I don't expect this to create problems, it just adds code that probably
won't be used most of the time (as long as "nc" doesn't get used for
stdin/stdout).

I guess the proper way to do it would be to introduce Kconfig support;
will this do?



In case this gets a "go", I'd prepare a v2 patch set that includes enabling
CONFIG_NETCONSOLE via Bananapi_defconfig / Bananapro_defconfig.

Regards, B. Nortmann

Comments

Joe Hershberger Aug. 25, 2015, 3:55 p.m. UTC | #1
Hi Bernhard,

On Tue, Aug 25, 2015 at 4:53 AM, Bernhard Nortmann
<bernhard.nortmann@web.de> wrote:
> Am 24.08.2015 um 19:02 schrieb Joe Hershberger:
>>
>> Hi Simon,
>>
>> On Mon, Aug 24, 2015 at 11:59 AM, Simon Glass <sjg@chromium.org> wrote:
>>>
>>> Hi Bernhard,
>>>
>>> [...]
>>> i.e. sunxi GMAC (by simply adding #define CONFIG_NETCONSOLE).
>>> In that case how about adding that config to that board? Does it cause
>>> problems for other people?
>>
>> I'll pile on and agree that it would be great to have at least one
>> board with this enabled, and even better to have one that supports
>> DM_ETH and one that does not.
>>
>> -Joe
>
>
> grep "#define CONFIG_NETCONSOLE" include/configs/*
> lists a considerable number of boards where NETCONSOLE seems to be active
> by default. I guess none of these has moved to DM_ETH yet, or I'd have
> expected reports of "broken" builds.
>
> If you're all for it, I can of course enable NETCONSOLE for the Banana
> Pi/Pro. (It may even be done across-the-board for all SUNXI_[EG]MAC
> configs?)

Seems reasonable to me.

> Personally, I'm a bit reluctant to "enforce" this setting, because until
> now my understanding was that NETCONSOLE is supposed to be mostly
> optional, i.e. at user's choice - especially for boards where other
> means of input/output are readily available (serial console, vga, usb
> keyboard).

These are not resource constrained boards, right?

> I don't expect this to create problems, it just adds code that probably
> won't be used most of the time (as long as "nc" doesn't get used for
> stdin/stdout).

It's good to have a build target and also a test or so. We should
maybe enable it in sandbox.

> I guess the proper way to do it would be to introduce Kconfig support;
> will this do?
>
> diff --git a/net/Kconfig b/net/Kconfig
> index 915371d..87c1729 100644
> --- a/net/Kconfig
> +++ b/net/Kconfig
> @@ -16,4 +16,10 @@ config NET_RANDOM_ETHADDR
>           A new MAC address will be generated on every boot and it will
>           not be added to the environment.
>
> +config NETCONSOLE
> +       bool "Netconsole support"

I'm pretty sure CamelCase is used in NetConsole.

> +       help
> +         Support the 'nc' input/output device for networked console.
> +         See README.NetConsole for details.
> +
>  endif   # if NET
>
>
> In case this gets a "go", I'd prepare a v2 patch set that includes enabling
> CONFIG_NETCONSOLE via Bananapi_defconfig / Bananapro_defconfig.

I guess that will work (not running moveconfig.pl) with
CONFIG_NETCONSOLE since so far most boards that don't define
CONFIG_DM_ETH don't define CONFIG_NET or CONFIG_NETDEVICES so that
CONFIG_NETCONSOLE option wouldn't be available. We'll have to change
that for next release.

-Joe
Bernhard Nortmann Aug. 25, 2015, 6:01 p.m. UTC | #2
Am 25.08.2015 um 17:55 schrieb Joe Hershberger:
 > Hi Bernhard,
 >
 > [...]
 > It's good to have a build target and also a test or so. We should
 > maybe enable it in sandbox.

I'm not familiar at all with the U-Boot "sandbox" architecture, so I'd 
prefer
to leave that to someone else.

 > I'm pretty sure CamelCase is used in NetConsole.

Thanks, I'll fix that.

 > I guess that will work (not running moveconfig.pl) with
 > CONFIG_NETCONSOLE since so far most boards that don't define
 > CONFIG_DM_ETH don't define CONFIG_NET or CONFIG_NETDEVICES so that
 > CONFIG_NETCONSOLE option wouldn't be available. We'll have to change
 > that for next release.
 >
 > -Joe

Yes, that Kconfig vs. "legacy" options battle is a bit of a problem. If it
keeps things simpler for now, I could add "NETCONSOLE" to the respective
CONFIG_SYS_EXTRA_OPTIONS as an alternative approach, and leave that Kconfig
migration for the future. Which do you prefer?

Regards, B. Nortmann
Joe Hershberger Aug. 25, 2015, 6:13 p.m. UTC | #3
Hi Bernhard,

On Tue, Aug 25, 2015 at 1:01 PM, Bernhard Nortmann
<bernhard.nortmann@web.de> wrote:
> Am 25.08.2015 um 17:55 schrieb Joe Hershberger:
>> Hi Bernhard,
>>
>> [...]
>> It's good to have a build target and also a test or so. We should
>> maybe enable it in sandbox.
>
> I'm not familiar at all with the U-Boot "sandbox" architecture, so I'd
> prefer
> to leave that to someone else.
>
>> I'm pretty sure CamelCase is used in NetConsole.
>
> Thanks, I'll fix that.
>
>> I guess that will work (not running moveconfig.pl) with
>> CONFIG_NETCONSOLE since so far most boards that don't define
>> CONFIG_DM_ETH don't define CONFIG_NET or CONFIG_NETDEVICES so that
>> CONFIG_NETCONSOLE option wouldn't be available. We'll have to change
>> that for next release.
>>
>> -Joe
>
> Yes, that Kconfig vs. "legacy" options battle is a bit of a problem. If it
> keeps things simpler for now, I could add "NETCONSOLE" to the respective
> CONFIG_SYS_EXTRA_OPTIONS as an alternative approach, and leave that Kconfig
> migration for the future. Which do you prefer?

I think it will be better to take the approach you already are (add to
Kconfig). Just make sure you use savedefconfig when you add the option
to the bananapi defconfig.

Thanks,
-Joe
diff mbox

Patch

diff --git a/net/Kconfig b/net/Kconfig
index 915371d..87c1729 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -16,4 +16,10 @@  config NET_RANDOM_ETHADDR
           A new MAC address will be generated on every boot and it will
           not be added to the environment.

+config NETCONSOLE
+       bool "Netconsole support"
+       help
+         Support the 'nc' input/output device for networked console.
+         See README.NetConsole for details.
+
  endif   # if NET