diff mbox series

[RFC,2/3] net/lo: Ensure lo devices have a MAC address

Message ID 168330135435.5953.3471584034284499194.stgit@oracle-102.nfsv4bat.org (mailing list archive)
State Rejected
Headers show
Series siw on tunnel devices | expand

Commit Message

Chuck Lever May 5, 2023, 3:42 p.m. UTC
From: Chuck Lever <chuck.lever@oracle.com>

A non-zero MAC address enables a network device to be assigned as
the underlying device for a virtual RDMA device. Without a non-
zero MAC address, cma_acquire_dev_by_src_ip() is unable to find the
underlying egress device that corresponds to a source IP address,
and rdma_resolve_address() fails.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 drivers/net/loopback.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Stephen Hemminger May 5, 2023, 4:57 p.m. UTC | #1
On Fri, 05 May 2023 11:42:44 -0400
Chuck Lever <cel@kernel.org> wrote:

> From: Chuck Lever <chuck.lever@oracle.com>
> 
> A non-zero MAC address enables a network device to be assigned as
> the underlying device for a virtual RDMA device. Without a non-
> zero MAC address, cma_acquire_dev_by_src_ip() is unable to find the
> underlying egress device that corresponds to a source IP address,
> and rdma_resolve_address() fails.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
>  drivers/net/loopback.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
> index f6d53e63ef4e..1ce4f19d8065 100644
> --- a/drivers/net/loopback.c
> +++ b/drivers/net/loopback.c
> @@ -192,6 +192,8 @@ static void gen_lo_setup(struct net_device *dev,
>  	dev->needs_free_netdev	= true;
>  	dev->priv_destructor	= dev_destructor;
>  
> +	eth_hw_addr_random(dev);
> +
>  	netif_set_tso_max_size(dev, GSO_MAX_SIZE);
>  }
>  
> 
> 
> 

This enough of a change, it will probably break somebody.
If you need dummy endpoint (ie multiple loopback), a common way
is to use dummy devices for that.
diff mbox series

Patch

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index f6d53e63ef4e..1ce4f19d8065 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -192,6 +192,8 @@  static void gen_lo_setup(struct net_device *dev,
 	dev->needs_free_netdev	= true;
 	dev->priv_destructor	= dev_destructor;
 
+	eth_hw_addr_random(dev);
+
 	netif_set_tso_max_size(dev, GSO_MAX_SIZE);
 }