lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e152e992-8868-3590-708a-ecc9a98991e5@engleder-embedded.com>
Date:   Tue, 10 Jan 2023 21:16:54 +0100
From:   Gerhard Engleder <gerhard@...leder-embedded.com>
To:     Alexander H Duyck <alexander.duyck@...il.com>,
        netdev@...r.kernel.org
Cc:     davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com,
        pabeni@...hat.com
Subject: Re: [PATCH net-next v4 04/10] tsnep: Add adapter down state

On 10.01.23 17:05, Alexander H Duyck wrote:
> On Mon, 2023-01-09 at 20:15 +0100, Gerhard Engleder wrote:
>> Add adapter state with flag for down state. This flag will be used by
>> the XDP TX path to deny TX if adapter is down.
>>
>> Signed-off-by: Gerhard Engleder <gerhard@...leder-embedded.com>
> 
> What value is this bit adding?
> 
>  From what I can tell you could probably just use netif_carrier_ok in
> place of this and actually get better coverage in terms of identifying
> state in which the Tx queue is able to function. So in your XDP_TX
> patch you could do that if you really need it.

TX does not check the link state, because the hardware just drops all
packets if there is no link. I would like to keep it like that, because
it minimizes special behavior if the link is down. netif_carrier_ok()
would include the link state.

> As far as the use in your close function it is redundant since the
> IFF_UP is only set if ndo_open completes, and ndo_stop is only called
> if IFF_UP is set. So your down flag would be redundant with !IFF_UP in
> that case.

tsnep_netdev_close() is called directly during bpf prog setup (see last
commit). If the following tsnep_netdev_open() call fails, then this
flag signals that the device is actually down even if IFF_UP is set. So
in this case the down flag is not redundant to !IFF_UP.

Is this a good enough reason for the flag?

Gerhard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ