# Re: \[RFC 2.6.10 5/22\] xfrm: Attempt to offload bundled xfrm\_states for outbound xfrms

- From: David Dillow \<dave@thedillows.org\>
- Date: 2005-01-22 05:53:01 
- List: netdev
- Page: https://ratatoskr.run/netdev/2005/01/10748411
- Thread: https://ratatoskr.run/netdev/2004/12/698207/t.md

```text
On Fri, 2005-01-21 at 15:20 -0800, David S. Miller wrote: 
> On Thu, 30 Dec 2004 03:48:35 -0500
> David Dillow [ref] wrote:
> 
> > +static void xfrm_accel_bundle(struct dst_entry *dst)
> > +{
> > +	struct xfrm_bundle_list bundle, *xbl, *tmp;
> > +	struct net_device *dev = dst->dev;
> > +	INIT_LIST_HEAD(&bundle.node);
> > +
> > +	if (dev && netif_running(dev) && (dev->features & NETIF_F_IPSEC)) {
> 
> netif_running() is only steady while the RTNL semaphore is held,
> which is not necessarily true when xfrm_lookup() is invoked.

I've been reworking this area already to add the ability for the user to
control which devices/states combinations can be offloaded, so this code
will change. What do you think about just having the driver be
responsible for ignoring offload requests when they don't make sense,
like when the device is down, or in sleep mode?

BTW, xfrm_lookup() also calls stale_bundle(), which also relies on
netif_running(), among other tests.
-- 
David Dillow [ref]
```
