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

From: David Dillow (dave_at_thedillows.org)
Date: 12/31/04

  • Next message: Felipe Erias: "Queues when accessing disks"
    To: Francois Romieu <romieu@fr.zoreil.com>
    Date:	Thu, 30 Dec 2004 22:31:07 -0500
    
    

    On Fri, 2004-12-31 at 00:34 +0100, Francois Romieu wrote:
    > David Dillow <dave@thedillows.org> :
    > [...]
    > > diff -Nru a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
    > > --- a/net/xfrm/xfrm_policy.c 2004-12-30 01:11:18 -05:00
    > > +++ b/net/xfrm/xfrm_policy.c 2004-12-30 01:11:18 -05:00
    > > @@ -705,6 +705,31 @@
    > > };
    > > }
    > >
    > > +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)) {
    > > + while (dst) {
    > > + xbl = kmalloc(sizeof(*xbl), GFP_ATOMIC);
    > > + if (!xbl)
    > > + goto out;
    > > +
    > > + xbl->dst = dst;
    > > + list_add_tail(&xbl->node, &bundle.node);
    > > + dst = dst->child;
    > > + }
    > > +
    > > + dev->xfrm_bundle_add(dev, &bundle);
    > > + }
    > > +
    > > +out:
    > > + list_for_each_entry_safe(xbl, tmp, &bundle.node, node)
    > > + kfree(xbl);
    > > +}
    >
    > If the driver knows the max depth which is allowed, why not have it
    > allocate its own bundle-like struct during initialization one for once ?
    > Instead of pushing the bundle list, dst is walked by the code of
    > the device's own xyz_xfrm_bundle_add into the said circular list,
    > entries get overwriten if the dst chain is longer and when the end of
    > dst is reached, the bundle-like list is walked in reverse order.
    > It avoids a few failure points imho.

    Good idea! I'll see if I can't code it up. I definitely want to get rid
    of that GFP_ATOMIC allocation.

    -- 
    David Dillow <dave@thedillows.org>
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Felipe Erias: "Queues when accessing disks"

    Relevant Pages

    • 10MB buffer
      ... I am running a SuSE 2.4.19 Kernel and have a requirement to allocate a 10MB ... how does my driver get access to this memory. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: non-paged memory inside a kernel driver
      ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... With their stuff running I cannot allocate 10 MB 's on a XP system. ... so I need 100MB of non-paged memory inside my driver. ...
      (microsoft.public.development.device.drivers)
    • ASUS P5B-MX [946GZ/GMA 3000] does not work with Intel driver
      ... I cannot make Intel 3000GMA in ASUS P5B-MX to work with intel driver. ... intel: Failed to allocate framebuffer. ... Loading extension XFree86-DRI ...
      (freebsd-stable)
    • ASUS P5B-MX [946GZ/GMA 3000] does not work with Intel driver
      ... I cannot make Intel 3000GMA in ASUS P5B-MX to work with intel driver. ... intel: Failed to allocate framebuffer. ... Loading extension XFree86-DRI ...
      (freebsd-current)
    • Re: non-paged memory inside a kernel driver
      ... Gee no one elses filter works, because Symantec owns the machine. ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... With their stuff running I cannot allocate 10 MB 's on a XP system. ...
      (microsoft.public.development.device.drivers)