1. 25 Sep, 2020 9 commits
    • Martin KaFai Lau's avatar
      bpf: selftest: Adapt sock_fields test to use skel and global variables · b18c1f0a
      Martin KaFai Lau authored
      skel is used.
      
      Global variables are used to store the result from bpf prog.
      addr_map, sock_result_map, and tcp_sock_result_map are gone.
      Instead, global variables listen_tp, srv_sa6, cli_tp,, srv_tp,
      listen_sk, srv_sk, and cli_sk are added.
      Because of that, bpf_addr_array_idx and bpf_result_array_idx are also
      no longer needed.
      
      CHECK() macro from test_progs.h is reused and bail as soon as
      a CHECK failure.
      
      shutdown() is used to ensure the previous data-ack is received.
      The bytes_acked, bytes_received, and the pkt_out_cnt checks are
      using "<" to accommodate the final ack may not have been received/sent.
      It is enough since it is not the focus of this test.
      
      The sk local storage is all initialized to 0xeB9F now, so the
      check_sk_pkt_out_cnt() always checks with the 0xeB9F base.  It is to
      keep things simple.
      
      The next patch will reuse helpers from network_helpers.h to simplify
      things further.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200925000434.3858204-1-kafai@fb.com
      b18c1f0a
    • Martin KaFai Lau's avatar
      bpf: selftest: Move sock_fields test into test_progs · 6f521a2b
      Martin KaFai Lau authored
      This is a mechanical change to
      1. move test_sock_fields.c to prog_tests/sock_fields.c
      2. rename progs/test_sock_fields_kern.c to progs/test_sock_fields.c
      
      Minimal change is made to the code itself.  Next patch will make
      changes to use new ways of writing test, e.g. use skel and global
      variables.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200925000427.3857814-1-kafai@fb.com
      6f521a2b
    • Martin KaFai Lau's avatar
      bpf: selftest: Add ref_tracking verifier test for bpf_skc casting · 5d13746d
      Martin KaFai Lau authored
      The patch tests for:
      1. bpf_sk_release() can be called on a tcp_sock btf_id ptr.
      
      2. Ensure the tcp_sock btf_id pointer cannot be used
         after bpf_sk_release().
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarLorenz Bauer <lmb@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20200925000421.3857616-1-kafai@fb.com
      5d13746d
    • Martin KaFai Lau's avatar
      bpf: Change bpf_sk_assign to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON · 27e5203b
      Martin KaFai Lau authored
      This patch changes the bpf_sk_assign() to take
      ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will work with the pointer
      returned by the bpf_skc_to_*() helpers also.
      
      The bpf_sk_lookup_assign() is taking ARG_PTR_TO_SOCKET_"OR_NULL".  Meaning
      it specifically takes a literal NULL.  ARG_PTR_TO_BTF_ID_SOCK_COMMON
      does not allow a literal NULL, so another ARG type is required
      for this purpose and another follow-up patch can be used if
      there is such need.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200925000415.3857374-1-kafai@fb.com
      27e5203b
    • Martin KaFai Lau's avatar
      bpf: Change bpf_tcp_*_syncookie to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON · c0df236e
      Martin KaFai Lau authored
      This patch changes the bpf_tcp_*_syncookie() to take
      ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will work with the pointer
      returned by the bpf_skc_to_*() helpers also.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarLorenz Bauer <lmb@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20200925000409.3856725-1-kafai@fb.com
      c0df236e
    • Martin KaFai Lau's avatar
      bpf: Change bpf_sk_storage_*() to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON · 592a3498
      Martin KaFai Lau authored
      This patch changes the bpf_sk_storage_*() to take
      ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will work with the pointer
      returned by the bpf_skc_to_*() helpers also.
      
      A micro benchmark has been done on a "cgroup_skb/egress" bpf program
      which does a bpf_sk_storage_get().  It was driven by netperf doing
      a 4096 connected UDP_STREAM test with 64bytes packet.
      The stats from "kernel.bpf_stats_enabled" shows no meaningful difference.
      
      The sk_storage_get_btf_proto, sk_storage_delete_btf_proto,
      btf_sk_storage_get_proto, and btf_sk_storage_delete_proto are
      no longer needed, so they are removed.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarLorenz Bauer <lmb@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20200925000402.3856307-1-kafai@fb.com
      592a3498
    • Martin KaFai Lau's avatar
      bpf: Change bpf_sk_release and bpf_sk_*cgroup_id to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON · a5fa25ad
      Martin KaFai Lau authored
      The previous patch allows the networking bpf prog to use the
      bpf_skc_to_*() helpers to get a PTR_TO_BTF_ID socket pointer,
      e.g. "struct tcp_sock *".  It allows the bpf prog to read all the
      fields of the tcp_sock.
      
      This patch changes the bpf_sk_release() and bpf_sk_*cgroup_id()
      to take ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will
      work with the pointer returned by the bpf_skc_to_*() helpers
      also.  For example, the following will work:
      
      	sk = bpf_skc_lookup_tcp(skb, tuple, tuplen, BPF_F_CURRENT_NETNS, 0);
      	if (!sk)
      		return;
      	tp = bpf_skc_to_tcp_sock(sk);
      	if (!tp) {
      		bpf_sk_release(sk);
      		return;
      	}
      	lsndtime = tp->lsndtime;
      	/* Pass tp to bpf_sk_release() will also work */
      	bpf_sk_release(tp);
      
      Since PTR_TO_BTF_ID could be NULL, the helper taking
      ARG_PTR_TO_BTF_ID_SOCK_COMMON has to check for NULL at runtime.
      
      A btf_id of "struct sock" may not always mean a fullsock.  Regardless
      the helper's running context may get a non-fullsock or not,
      considering fullsock check/handling is pretty cheap, it is better to
      keep the same verifier expectation on helper that takes ARG_PTR_TO_BTF_ID*
      will be able to handle the minisock situation.  In the bpf_sk_*cgroup_id()
      case,  it will try to get a fullsock by using sk_to_full_sk() as its
      skb variant bpf_sk"b"_*cgroup_id() has already been doing.
      
      bpf_sk_release can already handle minisock, so nothing special has to
      be done.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200925000356.3856047-1-kafai@fb.com
      a5fa25ad
    • Martin KaFai Lau's avatar
      bpf: Enable bpf_skc_to_* sock casting helper to networking prog type · 1df8f55a
      Martin KaFai Lau authored
      There is a constant need to add more fields into the bpf_tcp_sock
      for the bpf programs running at tc, sock_ops...etc.
      
      A current workaround could be to use bpf_probe_read_kernel().  However,
      other than making another helper call for reading each field and missing
      CO-RE, it is also not as intuitive to use as directly reading
      "tp->lsndtime" for example.  While already having perfmon cap to do
      bpf_probe_read_kernel(), it will be much easier if the bpf prog can
      directly read from the tcp_sock.
      
      This patch tries to do that by using the existing casting-helpers
      bpf_skc_to_*() whose func_proto returns a btf_id.  For example, the
      func_proto of bpf_skc_to_tcp_sock returns the btf_id of the
      kernel "struct tcp_sock".
      
      These helpers are also added to is_ptr_cast_function().
      It ensures the returning reg (BPF_REF_0) will also carries the ref_obj_id.
      That will keep the ref-tracking works properly.
      
      The bpf_skc_to_* helpers are made available to most of the bpf prog
      types in filter.c. The bpf_skc_to_* helpers will be limited by
      perfmon cap.
      
      This patch adds a ARG_PTR_TO_BTF_ID_SOCK_COMMON.  The helper accepting
      this arg can accept a btf-id-ptr (PTR_TO_BTF_ID + &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON])
      or a legacy-ctx-convert-skc-ptr (PTR_TO_SOCK_COMMON).  The bpf_skc_to_*()
      helpers are changed to take ARG_PTR_TO_BTF_ID_SOCK_COMMON such that
      they will accept pointer obtained from skb->sk.
      
      Instead of specifying both arg_type and arg_btf_id in the same func_proto
      which is how the current ARG_PTR_TO_BTF_ID does, the arg_btf_id of
      the new ARG_PTR_TO_BTF_ID_SOCK_COMMON is specified in the
      compatible_reg_types[] in verifier.c.  The reason is the arg_btf_id is
      always the same.  Discussion in this thread:
      https://lore.kernel.org/bpf/20200922070422.1917351-1-kafai@fb.com/
      
      The ARG_PTR_TO_BTF_ID_ part gives a clear expectation that the helper is
      expecting a PTR_TO_BTF_ID which could be NULL.  This is the same
      behavior as the existing helper taking ARG_PTR_TO_BTF_ID.
      
      The _SOCK_COMMON part means the helper is also expecting the legacy
      SOCK_COMMON pointer.
      
      By excluding the _OR_NULL part, the bpf prog cannot call helper
      with a literal NULL which doesn't make sense in most cases.
      e.g. bpf_skc_to_tcp_sock(NULL) will be rejected.  All PTR_TO_*_OR_NULL
      reg has to do a NULL check first before passing into the helper or else
      the bpf prog will be rejected.  This behavior is nothing new and
      consistent with the current expectation during bpf-prog-load.
      
      [ ARG_PTR_TO_BTF_ID_SOCK_COMMON will be used to replace
        ARG_PTR_TO_SOCK* of other existing helpers later such that
        those existing helpers can take the PTR_TO_BTF_ID returned by
        the bpf_skc_to_*() helpers.
      
        The only special case is bpf_sk_lookup_assign() which can accept a
        literal NULL ptr.  It has to be handled specially in another follow
        up patch if there is a need (e.g. by renaming ARG_PTR_TO_SOCKET_OR_NULL
        to ARG_PTR_TO_BTF_ID_SOCK_COMMON_OR_NULL). ]
      
      [ When converting the older helpers that take ARG_PTR_TO_SOCK* in
        the later patch, if the kernel does not support BTF,
        ARG_PTR_TO_BTF_ID_SOCK_COMMON will behave like ARG_PTR_TO_SOCK_COMMON
        because no reg->type could have PTR_TO_BTF_ID in this case.
      
        It is not a concern for the newer-btf-only helper like the bpf_skc_to_*()
        here though because these helpers must require BTF vmlinux to begin
        with. ]
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20200925000350.3855720-1-kafai@fb.com
      1df8f55a
    • Martin KaFai Lau's avatar
      bpf: Move the PTR_TO_BTF_ID check to check_reg_type() · a968d5e2
      Martin KaFai Lau authored
      check_reg_type() checks whether a reg can be used as an arg of a
      func_proto.  For PTR_TO_BTF_ID, the check is actually not
      completely done until the reg->btf_id is pointing to a
      kernel struct that is acceptable by the func_proto.
      
      Thus, this patch moves the btf_id check into check_reg_type().
      "arg_type" and "arg_btf_id" are passed to check_reg_type() instead of
      "compatible".  The compatible_reg_types[] usage is localized in
      check_reg_type() now.
      
      The "if (!btf_id) verbose(...); " is also removed since it won't happen.
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarLorenz Bauer <lmb@cloudflare.com>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20200925000344.3854828-1-kafai@fb.com
      a968d5e2
  2. 24 Sep, 2020 17 commits
  3. 23 Sep, 2020 14 commits
    • David S. Miller's avatar
      Merge branch 'net-bridge-mcast-IGMPv3-MLDv2-fast-path-part-2' · 68d4fd30
      David S. Miller authored
      Nikolay Aleksandrov says:
      
      ====================
      net: bridge: mcast: IGMPv3/MLDv2 fast-path (part 2)
      
      This is the second part of the IGMPv3/MLDv2 support which adds support
      for the fast-path. In order to be able to handle source entries we add
      mdb support for S,G entries (i.e. we add source address support to
      br_ip), that requires to extend the current mdb netlink API, fortunately
      we just add another attribute which will contain nested future mdb
      attributes, then we use it to add support for S,G user- add, del and
      dump. The lookup sequence is simple: when IGMPv3/MLDv2 are enabled do
      the S,G lookup first and if it fails fallback to *,G. The more complex
      part is when we begin handling source lists and auto-installing S,G entries
      and *,G filter mode transitions. We have the following cases:
       1) *,G INCLUDE -> EXCLUDE transition: we need to install the port in
          all of *,G's installed S,G entries for proper replication (except
          the ones explicitly blocked), this is also necessary when adding a
          new *,G EXCLUDE port group
      
       2) *,G EXCLUDE -> INCLUDE transition: we need to remove the port from
          all of *,G's installed S,G entries, this is also necessary when
          removing a *,G port group
      
       3) New S,G port entry: we need to install all current *,G EXCLUDE ports
      
       4) Remove S,G port entry: if all other port groups were auto-installed we
          can safely remove them and delete the whole S,G entry
      
      Currently we compute these operations from the available ports, their
      source lists and their filter mode. In the future we can extend the port
      group structure and reduce the running time of these ops. Also one
      current limitation is that host-joined S,G entries are not supported.
      I.e. one cannot add "dev bridge port bridge" mdb S,G entries. The host
      join is currently considered an EXCLUDE {} join, so it's reflected in
      all of *,G's installed S,G entries. If an S,G,port entry is added as
      temporary then the kernel can take it over if a source shows up from a
      report, permanent entries are skipped. In order to properly handle
      blocked sources we add a new port group blocked flag to avoid forwarding
      to that port group in the S,G. Finally when forwarding we use the port
      group filter mode (if it's INCLUDE and the port group is from a *,G then
      don't replicate to it, respectively if it's EXCLUDE then forward) and the
      blocked flag (obviously if it's set - skip that port unless it's a
      router port) to decide if the port should be skipped. Another limitation
      is that we can't do some of the above transitions without small traffic
      drop while installing/removing entries. That will be taken care of when
      we add atomic swap of port replication lists later.
      
      Patch break down:
       patches 1-3: prepare the mdb code for better extack support which is
                    used in future patches to return a more meaningful error
       patches 4-6: add the source address field to struct br_ip, and do minor
                    cleanups around it
       patches 7-8: extend the mdb netlink API so we can send new mdb
                    attributes and uses the new API for S,G entry add/del/dump
                    support
       patch     9: takes care of S,G entries when doing a lookup (first S,G
                    then *,G lookup)
       patch    10: adds a new port group field and attribute for origin protocol
                    we use the already available RTPROT_ definitions,
                    currently user-space entries are added as RTPROT_STATIC and
                    kernel entries are added as RTPROT_KERNEL, we may allow
                    user-space to set custom values later (e.g. for FRR, clag)
       patch    11: adds an internal S,G,port rhashtable to speed up filter
                    mode transitions
       patch    12: initial automatic install of S,G entries based on port
                    groups' source lists
       patch    13: handles port group modes on transitions or when new
                    port group entries are added
       patch    14: self-explanatory - adds support for blocked port group
                    entries needed to stop forwarding to particular S,G,port
                    entries
       patch    15: handles host-join/leave state changes, treats host-joins
                    as EXCLUDE {} groups (reflected in all *,G's S,G entries)
       patch    16: finally adds the fast-path filter mode and block flag
                    support
      
      Here're the sets that will come next (in order):
       - iproute2 support for IGMPv3/MLDv2
       - selftests for all mode transitions and group flags
       - explicit host tracking for proper fast-leave support
       - atomic port replication lists (these are also needed for broadcast
         forwarding optimizations)
       - mode transition optimization and removal of open-coded sorted lists
      
      Not implemented yet:
       - Host IGMPv3/MLDv2 filter support (currently we handle only join/leave
         as before)
       - Proper other querier source timer and value updates
       - IGMPv3/v2 MLDv2/v1 compat (I have a few rough patches for this one)
      
      v2: fix build with CONFIG_BATMAN_ADV_MCAST in patch 6
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      68d4fd30
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: when forwarding handle filter mode and blocked flag · 36cfec73
      Nikolay Aleksandrov authored
      We need to avoid forwarding to ports in MCAST_INCLUDE filter mode when the
      mdst entry is a *,G or when the port has the blocked flag.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      36cfec73
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: handle host state · 094b82fd
      Nikolay Aleksandrov authored
      Since host joins are considered as EXCLUDE {} joins we need to reflect
      that in all of *,G ports' S,G entries. Since the S,Gs can have
      host_joined == true only set automatically we can safely set it to false
      when removing all automatically added entries upon S,G delete.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      094b82fd
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: add support for blocked port groups · 9116ffbf
      Nikolay Aleksandrov authored
      When excluding S,G entries we need a way to block a particular S,G,port.
      The new port group flag is managed based on the source's timer as per
      RFCs 3376 and 3810. When a source expires and its port group is in
      EXCLUDE mode, it will be blocked.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9116ffbf
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: handle port group filter modes · 8266a049
      Nikolay Aleksandrov authored
      We need to handle group filter mode transitions and initial state.
      To change a port group's INCLUDE -> EXCLUDE mode (or when we have added
      a new port group in EXCLUDE mode) we need to add that port to all of
      *,G ports' S,G entries for proper replication. When the EXCLUDE state is
      changed from IGMPv3 report, br_multicast_fwd_filter_exclude() must be
      called after the source list processing because the assumption is that
      all of the group's S,G entries will be created before transitioning to
      EXCLUDE mode, i.e. most importantly its blocked entries will already be
      added so it will not get automatically added to them.
      The transition EXCLUDE -> INCLUDE happens only when a port group timer
      expires, it requires us to remove that port from all of *,G ports' S,G
      entries where it was automatically added previously.
      Finally when we are adding a new S,G entry we must add all of *,G's
      EXCLUDE ports to it.
      In order to distinguish automatically added *,G EXCLUDE ports we have a
      new port group flag - MDB_PG_FLAGS_STAR_EXCL.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8266a049
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: install S,G entries automatically based on reports · b0812368
      Nikolay Aleksandrov authored
      This patch adds support for automatic install of S,G mdb entries based
      on the port group's source list and the source entry's timer.
      Once installed the S,G will be used when forwarding packets if the
      approprate multicast/mld versions are set. A new source flag called
      BR_SGRP_F_INSTALLED denotes if the source has a forwarding mdb entry
      installed.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0812368
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: add sg_port rhashtable · 085b53c8
      Nikolay Aleksandrov authored
      To speedup S,G forward handling we need to be able to quickly find out
      if a port is a member of an S,G group. To do that add a global S,G port
      rhashtable with key: source addr, group addr, protocol, vid (all br_ip
      fields) and port pointer.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      085b53c8
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: add rt_protocol field to the port group struct · 8f8cb77e
      Nikolay Aleksandrov authored
      We need to be able to differentiate between pg entries created by
      user-space and the kernel when we start generating S,G entries for
      IGMPv3/MLDv2's fast path. User-space entries are created by default as
      RTPROT_STATIC and the kernel entries are RTPROT_KERNEL. Later we can
      allow user-space to provide the entry rt_protocol so we can
      differentiate between who added the entries specifically (e.g. clag,
      admin, frr etc).
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f8cb77e
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: when igmpv3/mldv2 are enabled lookup (S,G) first, then (*,G) · 7d07a68c
      Nikolay Aleksandrov authored
      If (S,G) entries are enabled (igmpv3/mldv2) then look them up first. If
      there isn't a present (S,G) entry then try to find (*,G).
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d07a68c
    • Nikolay Aleksandrov's avatar
      net: bridge: mdb: add support for add/del/dump of entries with source · 88d4bd18
      Nikolay Aleksandrov authored
      Add new mdb attributes (MDBE_ATTR_SOURCE for setting,
      MDBA_MDB_EATTR_SOURCE for dumping) to allow add/del and dump of mdb
      entries with a source address (S,G). New S,G entries are created with
      filter mode of MCAST_INCLUDE. The same attributes are used for IPv4 and
      IPv6, they're validated and parsed based on their protocol.
      S,G host joined entries which are added by user are not allowed yet.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88d4bd18
    • Nikolay Aleksandrov's avatar
      net: bridge: mdb: add support to extend add/del commands · 9c4258c7
      Nikolay Aleksandrov authored
      Since the MDB add/del code expects an exact struct br_mdb_entry we can't
      really add any extensions, thus add a new nested attribute at the level of
      MDBA_SET_ENTRY called MDBA_SET_ENTRY_ATTRS which will be used to pass
      all new options via netlink attributes. This patch doesn't change
      anything functionally since the new attribute is not used yet, only
      parsed.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c4258c7
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: rename br_ip's u member to dst · eab3227b
      Nikolay Aleksandrov authored
      Since now we have src in br_ip, u no longer makes sense so rename
      it to dst. No functional changes.
      
      v2: fix build with CONFIG_BATMAN_ADV_MCAST
      
      CC: Marek Lindner <mareklindner@neomailbox.ch>
      CC: Simon Wunderlich <sw@simonwunderlich.de>
      CC: Antonio Quartulli <a@unstable.cc>
      CC: Sven Eckelmann <sven@narfation.org>
      CC: b.a.t.m.a.n@lists.open-mesh.org
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eab3227b
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: use br_ip's src for src groups and querier address · deb96566
      Nikolay Aleksandrov authored
      Now that we have src and dst in br_ip it is logical to use the src field
      for the cases where we need to work with a source address such as
      querier source address and group source address.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      deb96566
    • Nikolay Aleksandrov's avatar
      net: bridge: add src field to br_ip · e1ac1185
      Nikolay Aleksandrov authored
      Add a new src field to struct br_ip which will be used to lookup S, G
      entries. When SSM option is added we will enable full br_ip lookups.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e1ac1185