Bug 1357598 - Set /proc/sys/net/bridge/bridge-nf-call-arptables to zero
Summary: Set /proc/sys/net/bridge/bridge-nf-call-arptables to zero
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-neutron
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Ihar Hrachyshka
QA Contact: Toni Freger
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-18 15:32 UTC by Phil Sutter
Modified: 2017-07-24 17:17 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-05 19:44:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 413645 0 None None None 2016-12-21 14:07:42 UTC
RDO 7863 0 None None None 2017-07-24 17:17:14 UTC

Description Phil Sutter 2016-07-18 15:32:51 UTC
The procfs files /proc/sys/net/bridge/bridge-nf-call-* control whether
iptables sees packets being forwarded by linux bridges. Since neither Compute
nor Network nodes in an OpenStack setup contain any arptables rules, it is not
necessary to pass ARP packets to it.

Here's the relevant kernel code:

static unsigned int br_nf_forward_arp(void *priv,
                                      struct sk_buff *skb,
                                      const struct nf_hook_state *state)
{
        struct net_bridge_port *p;
        struct net_bridge *br;
        struct net_device **d = (struct net_device **)(skb->cb);

        p = br_port_get_rcu(state->out);
        if (p == NULL)
                return NF_ACCEPT;
        br = p->br;

        if (!brnf_call_arptables && !br->nf_call_arptables)
                return NF_ACCEPT;

        if (!IS_ARP(skb)) {
                if (!IS_VLAN_ARP(skb))
                        return NF_ACCEPT;
                nf_bridge_pull_encap_header(skb);
        }

        if (arp_hdr(skb)->ar_pln != 4) {
                if (IS_VLAN_ARP(skb))
                        nf_bridge_push_encap_header(skb);
                return NF_ACCEPT;
        }
        *d = state->in;
        NF_HOOK(NFPROTO_ARP, NF_ARP_FORWARD, state->net, state->sk, skb,
                state->in, state->out, br_nf_forward_finish);

        return NF_STOLEN;
}

The value of /proc/sys/net/bridge/bridge-nf-call-arptables is reflected in
brnf_call_arptables variable. So unless the setting is enabled on a per-bridge
basis, setting it to zero will eliminate the IS_ARP() check for every packet
passing the bridge and a few more checks including the NF_HOOK() call for
every ARP packet passing by.

Per packet, I expect a very small performance improvement here. On a larger
scale, thinking of ARP broadcasts this might reduce the system's base load
considerably. Also, it's a very simple change and guaranteed to be safe since
OSP doesn't even require arptables to be present on any of the systems it is
deployed on.

Comment 2 Miguel Angel Ajo 2016-07-19 12:18:17 UTC
I've checked the installers don't set that currently, so it's only on the neutron side :)

Comment 3 Assaf Muller 2017-04-05 19:44:56 UTC
The fix is available in upstream stable/ocata, master.


Note You need to log in before you can comment on or make changes to this bug.