Re: [PATCH RFC 1/3] NFQUEUE: introduce CPU fanout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: holger@xxxxxxxxxxxxxxxx
Date: Tue, 19 Mar 2013 15:14:43 +0100

> +			if (par->family == NFPROTO_IPV4)
> +				queue = (((u64) hash_v4(skb) * info->queues_total) >>
> +						 32) + queue;
> +#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
> +			else if (par->family == NFPROTO_IPV6)
> +				queue = (((u64) hash_v6(skb) * info->queues_total) >>
> +						 32) + queue;
> +#endif

Maybe add a helper function so you don't have to indent so deeply.  Something
like:

static u32 compute_queue(struct sk_buff *skb, u32 queue, u16 family, u16 qtotl)
{
	u32 hash;

	if (family == NFPROTO_IPV4)
		hash = hash_v4(skb);
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
	else if (family == NFPROTO_IPV6)
		hash = hash_v6(skb);
#endif

	return (((u64) hash * qtotl) >> 32) + queue;
}
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux