All of lore.kernel.org
 help / color / mirror / Atom feed
* unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
@ 2007-03-26  5:25 Jay Manni
  2007-03-27 15:16 ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Jay Manni @ 2007-03-26  5:25 UTC (permalink / raw)
  To: netfilter-devel

I am using iptables to queue packets to an NFQUEUE from a tap interface (attached to a VM). It works fine, except that I get an unregister_netdevice error with a negative refcnt, while freeing the tap devices.

 unregister_netdevice: waiting for tap3 to become free. Usage count = -50

I noticed some posts about the negative refcnt issue but that was related to appletalk.
Anybody know whats happening here?

-jay

-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-26  5:25 unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark Jay Manni
@ 2007-03-27 15:16 ` Patrick McHardy
  2007-03-28  8:42   ` Jay Manni
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2007-03-27 15:16 UTC (permalink / raw)
  To: Jay Manni; +Cc: netfilter-devel

Jay Manni wrote:
> I am using iptables to queue packets to an NFQUEUE from a tap interface (attached to a VM). It works fine, except that I get an unregister_netdevice error with a negative refcnt, while freeing the tap devices.
> 
>  unregister_netdevice: waiting for tap3 to become free. Usage count = -50
> 
> I noticed some posts about the negative refcnt issue but that was related to appletalk.
> Anybody know whats happening here?


Something very broken obviously, the reference count should never
drop below zero. What kernel version are you running, and what
are you using as queuing backend (ip_queue, nfnetlink_queue)?
Can you also reproduce the problem without queueing?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-27 15:16 ` Patrick McHardy
@ 2007-03-28  8:42   ` Jay Manni
  2007-03-28  9:33     ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Jay Manni @ 2007-03-28  8:42 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel

Kernel version - 2.6.15.4
I am using the nfnetlink_queue and haven't been able to reproduce without queueing.

-jay

-----Original Message-----
From: Patrick McHardy [mailto:kaber@trash.net] 
Sent: Tuesday, March 27, 2007 8:17 AM
To: Jay Manni
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark

Jay Manni wrote:
> I am using iptables to queue packets to an NFQUEUE from a tap interface (attached to a VM). It works fine, except that I get an unregister_netdevice error with a negative refcnt, while freeing the tap devices.
> 
>  unregister_netdevice: waiting for tap3 to become free. Usage count = -50
> 
> I noticed some posts about the negative refcnt issue but that was related to appletalk.
> Anybody know whats happening here?


Something very broken obviously, the reference count should never
drop below zero. What kernel version are you running, and what
are you using as queuing backend (ip_queue, nfnetlink_queue)?
Can you also reproduce the problem without queueing?

-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-28  8:42   ` Jay Manni
@ 2007-03-28  9:33     ` Patrick McHardy
  2007-03-28 23:34       ` Jay Manni
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2007-03-28  9:33 UTC (permalink / raw)
  To: Jay Manni; +Cc: netfilter-devel

Jay Manni wrote:
> Kernel version - 2.6.15.4
> I am using the nfnetlink_queue and haven't been able to reproduce without queueing.


Please send the exact commands you use for queueing
and whether these packets are bridged or routed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-28  9:33     ` Patrick McHardy
@ 2007-03-28 23:34       ` Jay Manni
  2007-03-29 11:07         ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Jay Manni @ 2007-03-28 23:34 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel

I have a bridge br0, with a couple of tap interfaces tap0, tap1 etc as part of it. I use the following ebtables rules to mark packets originating from a bridge port and destined to it.

ebtables -t broute -A BROUTING -i tap0 -p ipv4 -j mark --mark-set 10
ebtables -t nat    -A POSTROUTING -o tap0 -p ipv4 -j mark --mark-set 20

Then the following iptables rules to send them to an NFQUEUE

iptables -t mangle -A PREROUTING  -m mark --mark 10 -j NFQUEUE --queue 5
iptables -t mangle -A POSTROUTING -m mark --mark 20 -j NFQUEUE --queue 5 

The tap interfaces do not have any ip address configured.

Based on the detailed packet flow picture at http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png, I figured that the above rules would get me all the packets for the tap interface in question.

The process which attaches to NFQUEUE 5 does receive all the packets, and sets a verdict of NF_ACCEPT for each packet. However when I try to free the interfaces after it is done, I notice that the tap device has a negative refcnt.

- jay 

-----Original Message-----
From: Patrick McHardy [mailto:kaber@trash.net] 
Sent: Wednesday, March 28, 2007 2:33 AM
To: Jay Manni
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark

Jay Manni wrote:
> Kernel version - 2.6.15.4
> I am using the nfnetlink_queue and haven't been able to reproduce without queueing.


Please send the exact commands you use for queueing
and whether these packets are bridged or routed.

-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-28 23:34       ` Jay Manni
@ 2007-03-29 11:07         ` Patrick McHardy
  2007-03-29 23:19           ` Jay Manni
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2007-03-29 11:07 UTC (permalink / raw)
  To: Jay Manni; +Cc: netfilter-devel

Jay Manni wrote:
> I have a bridge br0, with a couple of tap interfaces tap0, tap1 etc as part of it. I use the following ebtables rules to mark packets originating from a bridge port and destined to it.
> 
> ebtables -t broute -A BROUTING -i tap0 -p ipv4 -j mark --mark-set 10
> ebtables -t nat    -A POSTROUTING -o tap0 -p ipv4 -j mark --mark-set 20
> 
> Then the following iptables rules to send them to an NFQUEUE
> 
> iptables -t mangle -A PREROUTING  -m mark --mark 10 -j NFQUEUE --queue 5
> iptables -t mangle -A POSTROUTING -m mark --mark 20 -j NFQUEUE --queue 5 
> 
> The tap interfaces do not have any ip address configured.
> 
> Based on the detailed packet flow picture at http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png, I figured that the above rules would get me all the packets for the tap interface in question.
> 
> The process which attaches to NFQUEUE 5 does receive all the packets, and sets a verdict of NF_ACCEPT for each packet. However when I try to free the interfaces after it is done, I notice that the tap device has a negative refcnt.


I can't find the problem. Is there any relation between the number
of packets queued and the final refcount value?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-29 11:07         ` Patrick McHardy
@ 2007-03-29 23:19           ` Jay Manni
  2007-03-30 13:21             ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Jay Manni @ 2007-03-29 23:19 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel

The final refcnt (abs value) is much less than the number of the packets queued. The total packets queued in my tests have usually been on the order of about 300 to 500 packets. And the refcnt has been between -30 to -60.

Maybe I can try more tests and see if there is any obvious relation .. but it doesn't appear to be.

-jay

-----Original Message-----
From: Patrick McHardy [mailto:kaber@trash.net] 
Sent: Thursday, March 29, 2007 4:08 AM
To: Jay Manni
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark

Jay Manni wrote:
> I have a bridge br0, with a couple of tap interfaces tap0, tap1 etc as part of it. I use the following ebtables rules to mark packets originating from a bridge port and destined to it.
> 
> ebtables -t broute -A BROUTING -i tap0 -p ipv4 -j mark --mark-set 10
> ebtables -t nat    -A POSTROUTING -o tap0 -p ipv4 -j mark --mark-set 20
> 
> Then the following iptables rules to send them to an NFQUEUE
> 
> iptables -t mangle -A PREROUTING  -m mark --mark 10 -j NFQUEUE --queue 5
> iptables -t mangle -A POSTROUTING -m mark --mark 20 -j NFQUEUE --queue 5 
> 
> The tap interfaces do not have any ip address configured.
> 
> Based on the detailed packet flow picture at http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png, I figured that the above rules would get me all the packets for the tap interface in question.
> 
> The process which attaches to NFQUEUE 5 does receive all the packets, and sets a verdict of NF_ACCEPT for each packet. However when I try to free the interfaces after it is done, I notice that the tap device has a negative refcnt.


I can't find the problem. Is there any relation between the number
of packets queued and the final refcount value?


-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/619 - Release Date: 1/7/2007 6:29 PM
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark
  2007-03-29 23:19           ` Jay Manni
@ 2007-03-30 13:21             ` Patrick McHardy
  0 siblings, 0 replies; 8+ messages in thread
From: Patrick McHardy @ 2007-03-30 13:21 UTC (permalink / raw)
  To: Jay Manni; +Cc: netfilter-devel

Jay Manni wrote:
> The final refcnt (abs value) is much less than the number of the packets queued. The total packets queued in my tests have usually been on the order of about 300 to 500 packets. And the refcnt has been between -30 to -60.
> 
> Maybe I can try more tests and see if there is any obvious relation .. but it doesn't appear to be.


Still can't find the problem. Can you test 2.6.20 or the current -git
kernel please?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-03-30 13:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-26  5:25 unregister_netdevice with negative refcnt error while using NFQUEUE with ebtables mark Jay Manni
2007-03-27 15:16 ` Patrick McHardy
2007-03-28  8:42   ` Jay Manni
2007-03-28  9:33     ` Patrick McHardy
2007-03-28 23:34       ` Jay Manni
2007-03-29 11:07         ` Patrick McHardy
2007-03-29 23:19           ` Jay Manni
2007-03-30 13:21             ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.