netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* size calculation wasted cpu time
@ 2009-03-16 13:02 Kuzin Andrey
  2009-03-16 14:06 ` Pablo Neira Ayuso
  2009-07-24 18:55 ` Jan Engelhardt
  0 siblings, 2 replies; 6+ messages in thread
From: Kuzin Andrey @ 2009-03-16 13:02 UTC (permalink / raw)
  To: netfilter-devel

In /net/netfilter/nfnetlink_queue.c every call of nfqnl_build_packet_message()
make series of call nla_total_size() for 'size' calculations.
I think 'size' is constant value for kernel build and may be define static
variable for this ?

Thank you.

static struct sk_buff *
nfqnl_build_packet_message(struct nfqnl_instance *queue,
                           struct nf_queue_entry *entry)
{
        sk_buff_data_t old_tail;
        size_t size;
        size_t data_len = 0;
        struct sk_buff *skb;
        struct nfqnl_msg_packet_hdr pmsg;
        struct nlmsghdr *nlh;
        struct nfgenmsg *nfmsg;
        struct sk_buff *entskb = entry->skb;
        struct net_device *indev;
        struct net_device *outdev;

        size =    NLMSG_SPACE(sizeof(struct nfgenmsg))
                + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
                + nla_total_size(sizeof(u_int32_t))     /* ifindex */
                + nla_total_size(sizeof(u_int32_t))     /* ifindex */
#ifdef CONFIG_BRIDGE_NETFILTER
                + nla_total_size(sizeof(u_int32_t))     /* ifindex */
                + nla_total_size(sizeof(u_int32_t))     /* ifindex */
#endif
                + nla_total_size(sizeof(u_int32_t))     /* mark */
                + nla_total_size(sizeof(struct nfqnl_msg_packet_hw))
                + nla_total_size(sizeof(struct nfqnl_msg_packet_timestamp));




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

end of thread, other threads:[~2009-07-25 23:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-16 13:02 size calculation wasted cpu time Kuzin Andrey
2009-03-16 14:06 ` Pablo Neira Ayuso
2009-03-16 14:14   ` Patrick McHardy
2009-07-24 18:55 ` Jan Engelhardt
2009-07-25  5:10   ` Re[2]: " Kuzin Andrey
2009-07-25 23:41     ` Henrik Nordstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).