1. 04 Nov, 2020 32 commits
  2. 03 Nov, 2020 8 commits
    • Ido Schimmel's avatar
      vxlan: Use a per-namespace nexthop listener instead of a global one · 626d667b
      Ido Schimmel authored
      The nexthop notification chain is a per-namespace chain and not a global
      one like the netdev notification chain.
      
      Therefore, a single (global) listener cannot be registered to all these
      chains simultaneously as it will result in list corruptions whenever
      listeners are registered / unregistered.
      
      Instead, register a different listener in each namespace.
      
      Currently this is not an issue because only the VXLAN driver registers a
      listener to this chain, but this is going to change with netdevsim and
      mlxsw also registering their own listeners.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20201101113926.705630-1-idosch@idosch.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      626d667b
    • Jakub Kicinski's avatar
      Merge branch 'net-hdlc_fr-improve-fr_rx-and-add-support-for-any-ethertype' · 12c9ee3c
      Jakub Kicinski authored
      Xie He says:
      
      ====================
      net: hdlc_fr: Improve fr_rx and add support for any Ethertype
      
      The main purpose of this series is the last patch. The previous 4 patches
      are just code clean-ups so that the last patch will not make the code too
      messy. The patches must be applied in sequence.
      
      The receiving code of this driver doesn't support arbitrary Ethertype
      values. It only recognizes a few known Ethertypes when receiving and drops
      skbs with other Ethertypes.
      
      However, the standard document RFC 2427 allows Frame Relay to support any
      Ethertype values. This series adds support for this.
      
      Change from v6:
      Remove the explanation about why only a 2-byte address field is accepted
      because I think it is inadequate and unnecessary.
      
      Change from v5:
      Small fix to the commit messages.
      
      Change from v4:
      Drop the change related to the stats.rx_dropped count.
      Improve the commit message by stating why only a 2-byte address field
      is accepted.
      
      Change from v3:
      Split the last patch into 2 patches.
      Improve the commit message about the stats.rx_dropped count.
      
      Change from v2:
      Small fix to the commit messages.
      
      Change from v1:
      Small fix to the commit messages.
      ====================
      
      Link: https://lore.kernel.org/r/20201031181043.805329-1-xie.he.0141@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      12c9ee3c
    • Xie He's avatar
      net: hdlc_fr: Add support for any Ethertype · 54b77a77
      Xie He authored
      Change the fr_rx function to make this driver support any Ethertype
      when receiving skbs on normal (non-Ethernet-emulating) PVC devices.
      (This driver is already able to handle any Ethertype when sending.)
      
      Originally in the fr_rx function, the code that parses the long (10-byte)
      header only recognizes a few Ethertype values and drops frames with other
      Ethertype values. This patch replaces this code to make fr_rx support
      any Ethertype. This patch also creates a new function fr_snap_parse as
      part of the new code.
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      54b77a77
    • Xie He's avatar
      net: hdlc_fr: Improve the initial checks when we receive an skb · 77124c44
      Xie He authored
      1.
      Change the skb->len check from "<= 4" to "< 4".
      At first we only need to ensure a 4-byte header is present. We indeed
      normally need the 5th byte, too, but it'd be more logical and cleaner
      to check its existence when we actually need it.
      
      2.
      Add an fh->ea2 check to the initial checks in fr_rx. fh->ea2 == 1 means
      the second address byte is the final address byte. We only support the
      case where the address length is 2 bytes.
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      77124c44
    • Xie He's avatar
      net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices · efc79039
      Xie He authored
      When an skb is received on a normal (non-Ethernet-emulating) PVC device,
      call skb_reset_mac_header before we pass it to upper layers.
      
      This is because normal PVC devices don't have header_ops, so any header we
      have would not be visible to upper layer code when sending, so the header
      shouldn't be visible to upper layer code when receiving, either.
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      efc79039
    • Xie He's avatar
      net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner · 14b20704
      Xie He authored
      The eth_type_trans function is called when we receive frames carrying
      Ethernet frames. This function expects a non-NULL pointer as an argument,
      and assigns it directly to skb->dev.
      
      However, the code handling other types of frames first assigns the pointer
      to "dev", and then at the end checks whether the value is NULL, and if it
      is not NULL, assigns it to skb->dev.
      
      The two flows are different. Mixing them in this function makes the code
      messy. It's better that we convert the second flow to align with how
      eth_type_trans does things.
      
      So this patch changes the code to: first make sure the pointer is not
      NULL, then assign it directly to skb->dev. "dev" is no longer needed until
      the end where we use it to update stats.
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      14b20704
    • Xie He's avatar
      net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames · 583d5333
      Xie He authored
      When the fr_rx function drops a received frame (because the protocol type
      is not supported, or because the PVC virtual device that corresponds to
      the DLCI number and the protocol type doesn't exist), the function frees
      the skb and returns.
      
      The code for freeing the skb and returning is repeated several times, this
      patch uses "goto rx_drop" to replace them so that the code looks cleaner.
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      583d5333
    • Lijun Pan's avatar
      ibmvnic: merge do_change_param_reset into do_reset · 16b5f5ce
      Lijun Pan authored
      Commit b27507bb ("net/ibmvnic: unlock rtnl_lock in reset so
      linkwatch_event can run") introduced do_change_param_reset function to
      solve the rtnl lock issue. Majority of the code in do_change_param_reset
      duplicates do_reset. Also, we can handle the rtnl lock issue in do_reset
      itself. Hence merge do_change_param_reset back into do_reset to clean up
      the code.
      Signed-off-by: default avatarLijun Pan <ljp@linux.ibm.com>
      Link: https://lore.kernel.org/r/20201031094645.17255-1-ljp@linux.ibm.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      16b5f5ce