From: Pascal Mazon <pascal.mazon@6wind.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: keith.wiles@intel.com, dev@dpdk.org
Subject: Re: [PATCH v3 1/6] net/tap: add MAC address management ops
Date: Fri, 10 Mar 2017 10:01:52 +0100 [thread overview]
Message-ID: <20170310100152.7b9297db@paques.dev.6wind.com> (raw)
In-Reply-To: <53d1a212-9354-ee10-72fb-2f8bfb1d29f6@intel.com>
On Thu, 9 Mar 2017 14:05:51 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 3/7/2017 4:31 PM, Pascal Mazon wrote:
> > Set a random MAC address when probing the device, as to not leave an
> > empty MAC in pmd->eth_addr.
> >
> > This MAC will be set on the tap netdevice as soon as it's been
> > created using tun_alloc(). As the tap_mac_add() function depend on
> > the fd in the first rxq, move code from tun_alloc() to
> > tap_setup_queue(), after it's been set.
> >
> > Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
> > ---
> > doc/guides/nics/features/tap.ini | 1 +
> > drivers/net/tap/rte_eth_tap.c | 97
> > ++++++++++++++++++++++++++++++++++------ 2 files changed, 85
> > insertions(+), 13 deletions(-)
> >
> > diff --git a/doc/guides/nics/features/tap.ini
> > b/doc/guides/nics/features/tap.ini index f4aca6921ddc..d9b47a003654
> > 100644 --- a/doc/guides/nics/features/tap.ini
> > +++ b/doc/guides/nics/features/tap.ini
> > @@ -9,6 +9,7 @@ Jumbo frame = Y
> > Promiscuous mode = Y
> > Allmulticast mode = Y
> > Basic stats = Y
> > +Unicast MAC filter = Y
> > Other kdrv = Y
> > ARMv7 = Y
> > ARMv8 = Y
> > diff --git a/drivers/net/tap/rte_eth_tap.c
> > b/drivers/net/tap/rte_eth_tap.c index ece3a5fcc897..1e46ee36efa2
> > 100644 --- a/drivers/net/tap/rte_eth_tap.c
> > +++ b/drivers/net/tap/rte_eth_tap.c
> > @@ -63,6 +63,8 @@
> > #define RTE_PMD_TAP_MAX_QUEUES 1
> > #endif
> >
> > +#define RTE_PMD_TAP_MAX_MAC_ADDRS 1
>
> mac_addr_add and mac_addr_remove not really supported, because only
> one MAC is supported. For mac_addr_add() all indexes other than 0
> will give an error. So only mac_addr_set is supported.
>
> For this case what is the benefit of implementing these functions and
> claim support, instead of just leaving mac_addr_add and
> mac_addr_remove NULL?
>
Well, I wanted to implement those along with the mac_addr_set, as they
all dealt with mac addresses. But you're right, I might as well leave
the ops NULL.
I'll send a new version reflecting this.
>
> <...>
>
> > + if (qid == 0) {
> > + /*
> > + * tap_setup_queue() is called for both tx and rx.
> > + * Let's use dev->data->r/tx_queues[qid] to
> > determine if init
> > + * has already been done.
> > + */
> > + if (dev->data->rx_queues[qid] &&
> > dev->data->tx_queues[qid])
> > + return fd;
> > +
> > + tap_mac_set(dev, &pmd->eth_addr);
>
> What is the reason of changing behavior here?
>
> Tap devices assigned random MAC by kernel, and previous implementation
> was reading that value and using it for DPDK.
>
> Now kernel assigns a random MAC, and DPDK overwrites it another random
> MAC, previous implementation was simpler I think.
>
> It is OK to move this code tap_setup_queue(), I just missed the
> benefit of overwriting with DPDK random MAC?
>
> <...>
As far as I remember, I did it because somewhere the mac_addr_set was
checked as part of reconfiguration, which happenened before queue setup
was done. The default mac address (dev->data->mac_addrs[0]) got set to 0
and later call for the default mac address tried using this mac address.
Or something along those lines.
I'll definitely re-take a closer look at all this for my next version.
Regards,
Pascal
next prev parent reply other threads:[~2017-03-10 9:02 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 9:46 [PATCH 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-03 9:46 ` [PATCH 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-03 9:46 ` [PATCH 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-03 15:27 ` Wiles, Keith
2017-03-06 13:58 ` Pascal Mazon
2017-03-06 14:38 ` Wiles, Keith
2017-03-03 9:46 ` [PATCH 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-03 9:46 ` [PATCH 4/6] net/tap: add MTU management Pascal Mazon
2017-03-03 15:23 ` Wiles, Keith
2017-03-06 13:59 ` Pascal Mazon
2017-03-03 9:46 ` [PATCH 5/6] net/tap: add packet type management Pascal Mazon
2017-03-03 15:31 ` Wiles, Keith
2017-03-06 14:10 ` Pascal Mazon
2017-03-06 14:46 ` Wiles, Keith
2017-03-03 9:46 ` [PATCH 6/6] net/tap: add flow control management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 4/6] net/tap: add MTU management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 5/6] net/tap: add packet type management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 6/6] net/tap: add flow control management Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 0/8] " Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 1/8] net/tap: remove wrong IFF_NOARP flags Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 2/8] net/tap: refactor ioctl calls Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 3/8] net/tap: add MAC address management Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 4/8] net/tap: add MTU management Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 5/8] net/tap: add speed capabilities Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 6/8] net/tap: add multicast addresses management Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 7/8] net/tap: add packet type management Pascal Mazon
2017-03-15 13:35 ` Ferruh Yigit
2017-03-15 13:44 ` Pascal Mazon
2017-03-15 14:31 ` Ferruh Yigit
2017-03-15 13:42 ` Ferruh Yigit
2017-03-14 8:22 ` [PATCH v4 8/8] net/tap: add flow control management Pascal Mazon
2017-03-15 13:43 ` [PATCH v4 0/8] net/tap: add additional management ops Ferruh Yigit
2017-03-15 14:48 ` [PATCH v5 " Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 1/8] net/tap: remove wrong IFF_NOARP flags Pascal Mazon
2017-03-15 21:37 ` Wiles, Keith
2017-03-15 14:48 ` [PATCH v5 2/8] net/tap: refactor ioctl calls Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 3/8] net/tap: add MAC address management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 4/8] net/tap: add MTU management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 5/8] net/tap: add speed capabilities Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 6/8] net/tap: add multicast addresses management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 7/8] net/tap: add packet type management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 8/8] net/tap: add flow control management Pascal Mazon
2017-03-15 16:46 ` [PATCH v5 0/8] net/tap: add additional management ops Ferruh Yigit
2017-03-15 21:44 ` Wiles, Keith
2017-03-07 16:31 ` [PATCH v3 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-09 14:05 ` Ferruh Yigit
2017-03-10 9:01 ` Pascal Mazon [this message]
2017-03-07 16:31 ` [PATCH v3 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-09 14:18 ` Ferruh Yigit
2017-03-09 14:36 ` Wiles, Keith
2017-03-09 16:05 ` Ferruh Yigit
2017-03-10 9:03 ` Pascal Mazon
2017-03-10 9:11 ` Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 4/6] net/tap: add MTU management Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 5/6] net/tap: add packet type management Pascal Mazon
2017-03-09 14:26 ` Ferruh Yigit
2017-03-10 12:34 ` Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 6/6] net/tap: add flow control management Pascal Mazon
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=20170310100152.7b9297db@paques.dev.6wind.com \
--to=pascal.mazon@6wind.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=keith.wiles@intel.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.