[PATCH net-next v4 0/4] net: add local address bind support to vxlan and geneve

Richard Gobert posted 4 patches 2 months, 3 weeks ago
There is a newer version of this series
drivers/net/geneve.c               | 80 ++++++++++++++++++++++++++---
drivers/net/vxlan/vxlan_core.c     | 81 ++++++++++++++++++++++++------
include/net/geneve.h               |  6 +++
include/net/udp_tunnel.h           |  3 +-
include/net/vxlan.h                |  1 +
include/uapi/linux/if_link.h       |  3 ++
net/ipv4/udp_tunnel_core.c         |  1 +
net/ipv6/ip6_udp_tunnel.c          |  1 +
tools/include/uapi/linux/if_link.h |  3 ++
9 files changed, 156 insertions(+), 23 deletions(-)
[PATCH net-next v4 0/4] net: add local address bind support to vxlan and geneve
Posted by Richard Gobert 2 months, 3 weeks ago
This series adds local address bind support to both vxlan
and geneve sockets.

v3 -> v4:
  - Fix a problem where vxlan socket is bound before its outgoing interface is up
  - v3: https://lore.kernel.org/netdev/20240711131411.10439-1-richardbgobert@gmail.com/

v2 -> v3:
  - Fix typo and nit problem (Simon)
  - v2: https://lore.kernel.org/netdev/20240708111103.9742-1-richardbgobert@gmail.com/

v1 -> v2:
  - Change runtime checking of CONFIG_IPV6 to compile time in geneve
  - Change {geneve,vxlan}_find_sock to check listening address
  - Fix incorrect usage of IFLA_VXLAN_LOCAL6 in geneve
  - Use NLA_POLICY_EXACT_LEN instead of changing strict_start_type in geneve
  - v1: https://lore.kernel.org/netdev/df300a49-7811-4126-a56a-a77100c8841b@gmail.com/

Richard Gobert (4):
  net: udp: add freebind option to udp_sock_create
  net: vxlan: add netlink option to bind vxlan sockets to local
    addresses
  net: vxlan: bind vxlan sockets to their local address
  net: geneve: enable binding geneve sockets to local addresses

 drivers/net/geneve.c               | 80 ++++++++++++++++++++++++++---
 drivers/net/vxlan/vxlan_core.c     | 81 ++++++++++++++++++++++++------
 include/net/geneve.h               |  6 +++
 include/net/udp_tunnel.h           |  3 +-
 include/net/vxlan.h                |  1 +
 include/uapi/linux/if_link.h       |  3 ++
 net/ipv4/udp_tunnel_core.c         |  1 +
 net/ipv6/ip6_udp_tunnel.c          |  1 +
 tools/include/uapi/linux/if_link.h |  3 ++
 9 files changed, 156 insertions(+), 23 deletions(-)

-- 
2.36.1
Re: [PATCH net-next v4 0/4] net: add local address bind support to vxlan and geneve
Posted by Ido Schimmel 2 months, 2 weeks ago
On Thu, Jul 17, 2025 at 01:54:08PM +0200, Richard Gobert wrote:
> This series adds local address bind support to both vxlan
> and geneve sockets.

A few comments:

1. Binding the VXLAN socket to the local address does break
functionality. Run the VXLAN selftests in tools/testing/selftests/net/
and you will see failures. IOW, you cannot change the default behavior.
You might not need the first patch if the new behavior is opt-in rather
than opt-out.

2. Please add a selftest for the new functionality. See the existing
VXLAN selftests for reference. There is no need to wait for the iproute2
patch to be accepted. You can have a check to skip the test if iproute2
does not have the required functionality.

3. The cover letter should explain the motivation for these patches.
Currently it only explains what the patches do.
Re: [PATCH net-next v4 0/4] net: add local address bind support to vxlan and geneve
Posted by Richard Gobert 2 months, 1 week ago
Ido Schimmel wrote:
> On Thu, Jul 17, 2025 at 01:54:08PM +0200, Richard Gobert wrote:
>> This series adds local address bind support to both vxlan
>> and geneve sockets.
> 
> A few comments:
> 
> 1. Binding the VXLAN socket to the local address does break
> functionality. Run the VXLAN selftests in tools/testing/selftests/net/
> and you will see failures. IOW, you cannot change the default behavior.
Missed the failing tests. Will be fixed in the next revision.

> You might not need the first patch if the new behavior is opt-in rather
> than opt-out.
This patch allows the localbind option to be set while the outgoing
interface is down. IMO, it is desirable.

> 
> 2. Please add a selftest for the new functionality. See the existing
> VXLAN selftests for reference. There is no need to wait for the iproute2
> patch to be accepted. You can have a check to skip the test if iproute2
> does not have the required functionality.
Do you think adding a new test that verifies that the localbind option
works would be sufficient?

> 
> 3. The cover letter should explain the motivation for these patches.
> Currently it only explains what the patches do.
Noted. Will write a better cover letter once all other issues are resolved.
Re: [PATCH net-next v4 0/4] net: add local address bind support to vxlan and geneve
Posted by Ido Schimmel 2 months, 1 week ago
On Thu, Jul 31, 2025 at 02:05:06PM +0200, Richard Gobert wrote:
> Do you think adding a new test that verifies that the localbind option
> works would be sufficient?

Yes. My request was to add a selftest that verifies that the new option
works as expected. I usually test both good and bad flows (flows that I
expect to fail) and both control path and data path operations.