how to completely makes an interface down?

Olivier Cochard-Labbé olivier at cochard.me
Tue May 14 18:43:06 UTC 2013


On Tue, May 14, 2013 at 2:02 PM, Eugene Grosbein <egrosbein at rdtc.ru> wrote:
>
> I've needed this feature several years ago so I made a patch for igb(4) and em(4) drivers.
> The patch introduces new per-interface sysctls with default zero values:
>
> dev.em.X.down_disables_link
> dev.igb.X.down.disables_link
>
> With this patch, sysctl dev.em.0.down_disables_link=1 makes "ifconfig em0 down" bring link down.
> For LACP mode this feature is very useful as it makes LACP peer reconfigure itself quickly.
>

Great !

but what about adding a generic ifconfig mediaopt option in place of
adding another new sysctl ?
Something like "poweroff", "linkdown" or your "disablelink" as example.

Because with this kind of sysctl values we can imagine a
non-homogeneous future: We have already this problem with flow-control
on em(4).
The sysctl option for configuring flowcontrol on em(4) (no idea how to
configure it with other drivers) are:
- dev.em.0.fc (if chipset depends of if_em.c)
- dev.em.0.flow_control (if chipset depends of if_lem.c)

=> By using ifconfig like "ifconfig INTERFACE mediaopt flowcontrol
off|rx|tx|full" we could prevent different sysctl names between all
NIC drivers.

Regards,

Olivier


More information about the freebsd-net mailing list