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]
Date:	Fri, 04 Jun 2010 06:05:54 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Sonic Zhang <sonic.adi@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	uclinux-dist-devel <uclinux-dist-devel@...ckfin.uclinux.org>
Subject: Re: [PATCH v2] netdev:bfin_mac: reclaim and free tx skb as soon as
  possible after transfer

Le vendredi 04 juin 2010 à 11:29 +0800, Sonic Zhang a écrit :
> David,
> 
> Any comments?
> 
> Thanks
> 
> Sonic
> 
> On Thu, Jun 3, 2010 at 11:48 AM, sonic zhang <sonic.adi@...il.com> wrote:
> > >From 40560ae9e8db42e2d2259b791ace160534c9a0f2 Mon Sep 17 00:00:00 2001
> > From: Sonic Zhang <sonic.zhang@...log.com>
> > Date: Thu, 3 Jun 2010 11:44:33 +0800
> > Subject: [PATCH v2] netdev:bfin_mac: reclaim and free tx skb as soon as possible after transfer
> >
> > SKBs hold onto resources that can't be held indefinitely, such as TCP
> > socket references and netfilter conntrack state.  So if a packet is left
> > in TX ring for a long time, there might be a TCP socket that cannot be
> > closed and freed up.
> >
> > Current blackfin EMAC driver always reclaim and free used tx skbs in future
> > transfers. The problem is that future transfer may not come as soon as
> > possible. This patch start a timer after transfer to reclaim and free skb.
> > There is nearly no performance drop with this patch.
> >
> > TX interrupt is not enabled for 2 reasons:
> >
> > 1) If Blackfin EMAC TX transfer control is turned on, endless TX
> > interrupts are triggered no matter if TX DMA is enabled. Since DMA walks
> > down the ring automatically, TX transfer control can't be turned off in the
> > middle. The only way is to disable TX interrupt completely.
> >
> > 2) skb can not be freed from interrupt context. A work queue or tasklet
> > has to be created, which introduce more overhead than timer only solution.
> >

Could you elaborate on this second point ?

skb can be freed from interrupt context using appropriate API :

1) If from NAPI context, no special care is needed and use
dev_kfree_skb().

2) If from hard irq context, use dev_kfree_skb_irq() :

With recent changes, skb is probably already orphaned and can be freed
immediately.

In the unlikely case it is not yet orphaned, skb is queued in
softnet_data.completion_queue.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists