<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter/nf_queue.c, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-01-10T14:32:15Z</updated>
<entry>
<title>netfilter: remove duplicated include</title>
<updated>2018-01-10T14:32:15Z</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2018-01-10T13:06:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=99eadf67c8fe0d9ebe5f4a2b1551d8238b4a43bf'/>
<id>urn:sha1:99eadf67c8fe0d9ebe5f4a2b1551d8238b4a43bf</id>
<content type='text'>
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: remove route_key_size field in struct nf_afinfo</title>
<updated>2018-01-08T17:11:01Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2017-11-27T21:58:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=464356234f88518f7d0678b979013e78607e8266'/>
<id>urn:sha1:464356234f88518f7d0678b979013e78607e8266</id>
<content type='text'>
This is only needed by nf_queue, place this code where it belongs.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: move reroute indirection to struct nf_ipv6_ops</title>
<updated>2018-01-08T17:10:53Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2017-11-27T21:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce388f452f0af2013c657dd24be4415d94e7704f'/>
<id>urn:sha1:ce388f452f0af2013c657dd24be4415d94e7704f</id>
<content type='text'>
We cannot make a direct call to nf_ip6_reroute() because that would result
in autoloading the 'ipv6' module because of symbol dependencies.
Therefore, define reroute indirection in nf_ipv6_ops where this really
belongs to.

For IPv4, we can indeed make a direct function call, which is faster,
given IPv4 is built-in in the networking code by default. Still,
CONFIG_INET=n and CONFIG_NETFILTER=y is possible, so define empty inline
stub for IPv4 in such case.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: remove saveroute indirection in struct nf_afinfo</title>
<updated>2018-01-08T17:01:25Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2017-12-20T15:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7db9a51e0f9931446ed4231feb1040ed5134fc60'/>
<id>urn:sha1:7db9a51e0f9931446ed4231feb1040ed5134fc60</id>
<content type='text'>
This is only used by nf_queue.c and this function comes with no symbol
dependencies with IPv6, it just refers to structure layouts. Therefore,
we can replace it by a direct function call from where it belongs.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: don't allocate space for arp/bridge hooks unless needed</title>
<updated>2018-01-08T17:01:11Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2017-12-07T15:28:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a95183a5e0375df756efb2ca37602d71e8455f9'/>
<id>urn:sha1:2a95183a5e0375df756efb2ca37602d71e8455f9</id>
<content type='text'>
no need to define hook points if the family isn't supported.
Because we need these hooks for either nftables, arp/ebtables
or the 'call-iptables' hack we have in the bridge layer add two
new dependencies, NETFILTER_FAMILY_{ARP,BRIDGE}, and have the
users select them.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: reduce size of hook entry point locations</title>
<updated>2018-01-08T17:01:08Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2017-12-02T23:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0f38338aef2dae5ade3c16acf713737e3b15a73'/>
<id>urn:sha1:b0f38338aef2dae5ade3c16acf713737e3b15a73</id>
<content type='text'>
struct net contains:

struct nf_hook_entries __rcu *hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS];

which store the hook entry point locations for the various protocol
families and the hooks.

Using array results in compact c code when doing accesses, i.e.
  x = rcu_dereference(net-&gt;nf.hooks[pf][hook]);

but its also wasting a lot of memory, as most families are
not used.

So split the array into those families that are used, which
are only 5 (instead of 13).  In most cases, the 'pf' argument is
constant, i.e. gcc removes switch statement.

struct net before:
 /* size: 5184, cachelines: 81, members: 46 */
after:
 /* size: 4672, cachelines: 73, members: 46 */

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: core: remove synchronize_net call if nfqueue is used</title>
<updated>2018-01-08T17:01:06Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2017-11-30T23:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=26888dfd7e7454686b8d3ea9ba5045d5f236e4d7'/>
<id>urn:sha1:26888dfd7e7454686b8d3ea9ba5045d5f236e4d7</id>
<content type='text'>
since commit 960632ece6949b ("netfilter: convert hook list to an array")
nfqueue no longer stores a pointer to the hook that caused the packet
to be queued.  Therefore no extra synchronize_net() call is needed after
dropping the packets enqueued by the old rule blob.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: convert hook list to an array</title>
<updated>2017-08-28T15:44:00Z</updated>
<author>
<name>Aaron Conole</name>
<email>aconole@bytheb.org</email>
</author>
<published>2017-08-23T22:08:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=960632ece6949be1ab6f7a911faa4fa6e8305f4a'/>
<id>urn:sha1:960632ece6949be1ab6f7a911faa4fa6e8305f4a</id>
<content type='text'>
This converts the storage and layout of netfilter hook entries from a
linked list to an array.  After this commit, hook entries will be
stored adjacent in memory.  The next pointer is no longer required.

The ops pointers are stored at the end of the array as they are only
used in the register/unregister path and in the legacy br_netfilter code.

nf_unregister_net_hooks() is slower than needed as it just calls
nf_unregister_net_hook in a loop (i.e. at least n synchronize_net()
calls), this will be addressed in followup patch.

Test setup:
 - ixgbe 10gbit
 - netperf UDP_STREAM, 64 byte packets
 - 5 hooks: (raw + mangle prerouting, mangle+filter input, inet filter):
empty mangle and raw prerouting, mangle and filter input hooks:
353.9
this patch:
364.2

Signed-off-by: Aaron Conole &lt;aconole@bytheb.org&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: destroy functions need to free queued packets</title>
<updated>2017-07-31T17:09:39Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2017-07-25T22:02:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2a750070aeec7af3818065b39d61cb38627ce64'/>
<id>urn:sha1:e2a750070aeec7af3818065b39d61cb38627ce64</id>
<content type='text'>
queued skbs might be using conntrack extensions that are being removed,
such as timeout.  This happens for skbs that have a skb-&gt;nfct in
unconfirmed state (i.e., not in hash table yet).

This is destructive, but there are only two use cases:
 - module removal (rare)
 - netns cleanup (most likely no conntracks exist, and if they do,
   they are removed anyway later on).

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_queue: only call synchronize_net twice if nf_queue is active</title>
<updated>2017-05-01T09:19:12Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2017-04-24T13:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=039b40ee5854dc733cf786fee4a88e240a012115'/>
<id>urn:sha1:039b40ee5854dc733cf786fee4a88e240a012115</id>
<content type='text'>
nf_unregister_net_hook(s) can avoid a second call to synchronize_net,
provided there is no nfqueue active in that net namespace (which is
the common case).

This also gets rid of the extra arg to nf_queue_nf_hook_drop(), normally
this gets called during netns cleanup so no packets should be queued.

For the rare case of base chain being unregistered or module removal
while nfqueue is in use the extra hiccup due to the packet drops isn't
a big deal.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
