[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230110161237.2a40ccc8@kernel.org>
Date: Tue, 10 Jan 2023 16:12:37 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Gerhard Engleder <gerhard@...leder-embedded.com>
Cc: Alexander H Duyck <alexander.duyck@...il.com>,
netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com
Subject: Re: [PATCH net-next v4 10/10] tsnep: Support XDP BPF program setup
On Tue, 10 Jan 2023 22:38:04 +0100 Gerhard Engleder wrote:
> > As I called out earlier the __TSNEP_DOWN is just !IFF_UP so you don't
> > need that bit.
> >
> > The fact that netif_carrier_off is here also points out the fact that
> > the code in the Tx path isn't needed regarding __TSNEP_DOWN and you can
> > probably just check netif_carrier_ok if you need the check.
>
> tsnep_netdev_close() is called directly during bpf prog setup (see
> tsnep_xdp_setup_prog() in this commit). If the following
> tsnep_netdev_open() call fails, then this flag signals that the device
> is already down and nothing needs to be cleaned up if
> tsnep_netdev_close() is called later (because IFF_UP is still set).
TBH we've been pushing pretty hard for a while now to stop people
from implementing the:
close()
change config
open()
sort of reconfiguration. I did that myself when I was a was
implementing my first Ethernet driver and DaveM nacked the change.
Must have been a decade ago.
Imagine you're working on a remote box via SSH and the box is under
transient memory pressure. Allocations fail, we don't want the machine
to fall off the network :(
Powered by blists - more mailing lists