Re: link-state change for virtual interfaces

Rin Okuyama <[email protected]>
Newsgroups gmane.os.netbsd.devel.network
Message-ID <[email protected]>
On 2024/09/25 20:08, Valery Ushakov wrote:
> On Wed, Sep 25, 2024 at 10:32:18 +0900, Rin Okuyama wrote:
> 
>> Recently, link-state emulation has been added to shmif(4) and
>> vether(4). Unfortunately, different operations are required for
>> link-up/down for these interfaces:
>>
>> For shmif(4)
>> - link-up:   ifconfig shmif%d media auto
>> - link-down: ifconfig shmif%d media none
>>
>> https://mail-index.netbsd.org/source-changes/2024/08/20/msg152934.html
>> https://mail-index.netbsd.org/source-changes/2024/08/20/msg152935.html
>>
>> For vether(4)
>> - link-up:   ifconfig vether%d link1
>> - link-down: ifconfig vether%d -link1
>>
>> https://mail-index.netbsd.org/source-changes/2024/09/24/msg153517.html
>> https://mail-index.netbsd.org/source-changes/2024/09/24/msg153525.html
>>
>> Wouldn't it be better to unify as far as possible? If so,
>> which one is more preferable? (The 3rd candidate may be
>> to add dedicated flag bit, but it seems too much to me.)
> 
> "Pluggin" and "unplugging" the media, like shmif does, seems like an
> interesting metaphor.  How is it reflected in ifconfig output?
> I.e. what does
> 
>    $ ifconfig $shmif
> 
> show for "media: ..." in both states?

Yeah, interesting :) Here's ifconfig output:

````
# rump.ifconfig shmif0 media auto
# rump.ifconfig shmif0
shmif0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
   capabilities=0x7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
   capabilities=0x7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
   capabilities=0x7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
   enabled=0
   address: b2:a0:01:9d:82:a5
   linkstr: bus1
   media: Ethernet autoselect
# rump.ifconfig shmif0 media none
# rump.ifconfig shmif0
shmif0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
   capabilities=0x7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
   capabilities=0x7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
   capabilities=0x7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
   enabled=0
   address: b2:a0:6b:44:5b:bd
   linkstr: bus1
   media: Ethernet none
````

If `-v` option is specified to ifconfig,
   linkstate: up
and
   linkstate: down
appear b/w linkstr and media lines. This should happen also for vether:

https://mail-index.netbsd.org/source-changes/2024/08/20/msg152936.html

Thanks,
rin

> 
> -uwe
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.