All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Isaac Boukris <iboukris@gmail.com>
Cc: dev@dpdk.org, mb@smartsharesystems.com
Subject: Re: [PATCH] net/tap: add new macpair option for split MAC address
Date: Tue, 3 Dec 2024 09:56:54 -0800	[thread overview]
Message-ID: <20241203095654.1f050da2@hermes.local> (raw)
In-Reply-To: <20240917115147.378146-1-iboukris@gmail.com>

On Tue, 17 Sep 2024 14:51:47 +0300
Isaac Boukris <iboukris@gmail.com> wrote:

> Normally, the MAC address of the kernel interface is the same as in the
> interface in dpdk, as they represent the same interface. It is useful
> to allow viewing them as separate connected interfaces (like ip's veth).
> 
> This solves a problem I have running a freebsd-based IPv6 stack on top
> of dpdk and using the tap interface, as both the kernel and freebsd
> stacks configure the MAC derived IPv6 address on the interface (as can
> be seen with ifconfig for the kernel), and they both complain about
> duplicate IPv6 address and the freebsd disables IPv6 as a result.
> 
> Signed-off-by: Isaac Boukris <iboukris@gmail.com>

Makes sense but a couple of small comments and rebase needed.

1. Could use rte_ether_addr_copy hear as is done elsewhere.
   And {} non needed.

@@ -2023,12 +2031,20 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
 	if (pmd->type == ETH_TUNTAP_TYPE_TAP) {
 		memset(&ifr, 0, sizeof(struct ifreq));
 		ifr.ifr_hwaddr.sa_family = AF_LOCAL;
-		rte_memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
-				RTE_ETHER_ADDR_LEN);
+
+		if (mac_pair) {
+			rte_eth_random_addr((uint8_t *)ifr.ifr_hwaddr.sa_data);
+		} else {
+			memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
+			       RTE_ETHER_ADDR_LEN);
		        rte_ether_addr_copy(&pmd->eth_addr, (struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data);

2. Need more error checks. macpair won't work with TUN device.
   and what happens if mac address is specified?
	

3. Should the mac address devarg, take two args?

  parent reply	other threads:[~2024-12-03 17:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-17 11:51 [PATCH] net/tap: add new macpair option for split MAC address Isaac Boukris
2024-09-17 12:14 ` Isaac Boukris
2024-09-29 21:54 ` Ferruh Yigit
2024-09-30 13:28   ` Isaac Boukris
2024-12-03 17:56 ` Stephen Hemminger [this message]
2024-12-07 17:47   ` Isaac Boukris
  -- strict thread matches above, loose matches on Subject: below --
2024-09-16 17:38 Isaac Boukris
2024-09-17  3:34 ` Stephen Hemminger
2024-09-17  3:36 ` Stephen Hemminger
2024-09-17  6:48   ` Isaac Boukris
2024-09-17  7:38     ` Morten Brørup

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=20241203095654.1f050da2@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=iboukris@gmail.com \
    --cc=mb@smartsharesystems.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.