Skip to content

netfilter: ctnetlink allocation improvement

Holger Eitzenberger netdev netfilter-devel 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 12 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6ctnetlink: add callbacks to the per-proto nlattrsinclude/net/netfilter/nf_conntrack_l3proto.h include/net/netfilter/nf_conntrack_l4proto.h net/netfilter/nf_conntrack_proto.c+29 -01 reply
2/6netlink: add nla_policy_len()include/net/netlink.h net/netlink/attr.c+28 -01 reply
3/6netfilter: limit the length of the helper nameinclude/net/netfilter/nf_conntrack_helper.h net/netfilter/nf_conntrack_helper.c+3 -03 replies
4/6ctnetlink: allocate right-sized ctnetlink skbnet/netfilter/nf_conntrack_netlink.c+64 -11 reply
5/6netfilter: add generic function to get len of generic policyinclude/net/netfilter/nf_conntrack_l4proto.h net/netfilter/nf_conntrack_core.c+7 -00 replies
6/6netfilter: calculate per-protocol nlattr sizenet/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c net/ipv4/netfilter/nf_conntrack_proto_icmp.c net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +7 more+62 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/6] netfilter: ctnetlink allocation improvement

Hi,

what follows is a small patchset against net-next-2.6 which tries to improve the way ctnetlink events are allocated. By allocating the ctnetlink skbs roughly the size of the message we prevent the skb from later being reallocated in netlink_trim().

Though I haven't got any hard performance numbers yet I think this might introduce a noticable performance gain.

The overall idea of these patches is to compute the proto independant attribute sizes at compile time, the proto-dependant parts are computed at registration of the actual proto helpers. This is achieved by introducing nla_policy_len(), which computes the max. length of a nla_policy.

I also have to introduce NF_CT_HELPER_NAME_LEN as an upper limit for the conntrack protcol helper names, which is not much of a problem because all names in mainline are actually shorter than that.

It would be great to have that being merged. Please share youre comments.

Thanks.

/holger