DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: "Robin Jarry" <rjarry@redhat.com>, <dev@dpdk.org>,
	"Christophe Fontaine" <cfontain@redhat.com>, <stable@dpdk.org>
Subject: Re: [PATCH dpdk] net: ipv6 link local compliance with rfc 4291
Date: Fri, 14 Nov 2025 08:48:14 -0800	[thread overview]
Message-ID: <20251114084814.039d2949@phoenix> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35F65560@smartserver.smartshare.dk>

On Fri, 14 Nov 2025 17:14:32 +0100
Morten Brørup <mb@smartsharesystems.com> wrote:

> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Friday, 14 November 2025 17.06
> > 
> > On Fri, 14 Nov 2025 11:57:53 +0100
> > Robin Jarry <rjarry@redhat.com> wrote:
> >   
> > > diff --git a/app/test/test_net_ip6.c b/app/test/test_net_ip6.c
> > > index cfc550940306..e4642c9a39d9 100644
> > > --- a/app/test/test_net_ip6.c
> > > +++ b/app/test/test_net_ip6.c
> > > @@ -160,7 +160,7 @@ test_ipv6_llocal_from_ethernet(void)
> > >  {
> > >  	const struct rte_ether_addr local_mac = {{0x04, 0x7b, 0xcb, 0x5c,  
> > 0x08, 0x44}};  
> > >  	const struct rte_ipv6_addr local_ip =
> > > -		RTE_IPV6(0xfe80, 0, 0, 0, 0x047b, 0xcbff, 0xfe5c, 0x0844);
> > > +		RTE_IPV6(0xfe80, 0, 0, 0, 0x067b, 0xcbff, 0xfe5c, 0x0844);
> > >  	struct rte_ipv6_addr ip;  
> > 
> > Reading the kernel source there is also special handling to include
> > device
> > id into link local address. This is to handle corner case where
> > multiple network
> > cards have same hardware MAC address.  
> 
> Multiple physical NICs should never have the same MAC address.
> Lots of stuff will break if they do.
> E.g. a network switch will forward packets to the NIC that most recently sent packets, so its MAC address was learned in the MAC address table in the switch.
> 
> What is the use case justifying this tweak in the kernel?
> 
> > 
> > Perhaps DPDK should roll port id into link local address?  

It is allowed for multiple NIC's to have the same MAC but they
can't be on same network namespace.

Code in Linux is working around special case here:

static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
{
	if (dev->addr_len != ETH_ALEN)
		return -1;

	/*
	 * The zSeries OSA network cards can be shared among various
	 * OS instances, but the OSA cards have only one MAC address.
	 * This leads to duplicate address conflicts in conjunction
	 * with IPv6 if more than one instance uses the same card.
	 *
	 * The driver for these cards can deliver a unique 16-bit
	 * identifier for each instance sharing the same card.  It is
	 * placed instead of 0xFFFE in the interface identifier.  The
	 * "u" bit of the interface identifier is not inverted in this
	 * case.  Hence the resulting interface identifier has local
	 * scope according to RFC2373.
	 */

	addrconf_addr_eui48_base(eui, dev->dev_addr);

	if (dev->dev_id) {
		eui[3] = (dev->dev_id >> 8) & 0xFF;
		eui[4] = dev->dev_id & 0xFF;
	} else {
		eui[0] ^= 2;
	}

	return 0;
}



  parent reply	other threads:[~2025-11-14 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 10:57 Robin Jarry
2025-11-14 16:05 ` Stephen Hemminger
2025-11-14 16:08   ` Robin Jarry
2025-11-14 16:14   ` Morten Brørup
2025-11-14 16:46     ` Robin Jarry
2025-11-14 17:03       ` Stephen Hemminger
2025-11-14 16:48     ` Stephen Hemminger [this message]
2025-11-14 16:08 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251114084814.039d2949@phoenix \
    --to=stephen@networkplumber.org \
    --cc=cfontain@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=rjarry@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).