Message ID | 1535120736-785-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5ED1858FA; Fri, 24 Aug 2018 16:26:29 +0200 (CEST) Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 45ECF4F9B; Fri, 24 Aug 2018 16:26:27 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w7OEPdNG000913; Fri, 24 Aug 2018 15:25:39 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w7OEPcwc000912; Fri, 24 Aug 2018 15:25:38 +0100 From: Alejandro Lucero <alejandro.lucero@netronome.com> To: dev@dpdk.org Cc: stable@dpdk.org, ferruh.yigit@intel.com Date: Fri, 24 Aug 2018 15:25:34 +0100 Message-Id: <1535120736-785-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH v3 0/2] support MAC changes when no live changes allowed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
support MAC changes when no live changes allowed
|
|
Message
Alejandro Lucero
Aug. 24, 2018, 2:25 p.m. UTC
This is a patched to fix a functionality coming with the first public release: changing/setting MAC address. The original patch assumes all NICs can safely change or set the MAC in any case. However, this is not always true. NFP depends on the firmware capabilities and this is not always supported. There are other NICs with this same limitation, although, as far as I know, not in DPDK. Linux kernel has a IFF_LIVE_ADDR_CHANGE flag and two NICs are checking this flag for allowing or not live MAC changes. The flag proposed in this patch is just the opposite: advertise if live change not supported and assuming it is supported other way. Although most NICs support rte_eth_dev_default_mac_addr_set and this function returns and error when live change is not supported, note that this function is invoked during port start but the value returned is not checked. It is likely this is good enough for most of the cases, but bonding is relying on this start then mac set/change, and a PMD ports is not properly configured for being used as an slave port in some bonding modes. v2: - add RTE_ETH_DEV_NOLIVE_MAC_ADDR comment in rte_eth_dev_default_mac_addr_set doc - add rte_eth_dev_start change in release API changes v3: - merge doc API changes with first patch - comment behaviour change in rte_eth_dev_start - remove comment on rte_eth_dev_default_mac_addr_set
Comments
On Fri, 24 Aug 2018 15:25:34 +0100 Alejandro Lucero <alejandro.lucero@netronome.com> wrote: > The original patch assumes all NICs can safely change or set the MAC > in any case. However, this is not always true. NFP depends on the firmware > capabilities and this is not always supported. There are other NICs with > this same limitation, although, as far as I know, not in DPDK. Linux kernel > has a IFF_LIVE_ADDR_CHANGE flag and two NICs are checking this flag for > allowing or not live MAC changes The semantic in Linux is different than what I think you are trying to do. Some devices can not change MAC address at all because of hardware or hypervisor restrictions. Other devices can not change address while device is up (started in DPDK API). With Linux the policy was to assume by default device could change address while up. And then let a few virtual devices allow it.
On 8/24/2018 3:25 PM, Alejandro Lucero wrote: > This is a patched to fix a functionality coming with the first public > release: changing/setting MAC address. > > The original patch assumes all NICs can safely change or set the MAC > in any case. However, this is not always true. NFP depends on the firmware > capabilities and this is not always supported. There are other NICs with > this same limitation, although, as far as I know, not in DPDK. Linux kernel > has a IFF_LIVE_ADDR_CHANGE flag and two NICs are checking this flag for > allowing or not live MAC changes. > > The flag proposed in this patch is just the opposite: advertise if live > change not supported and assuming it is supported other way. > > Although most NICs support rte_eth_dev_default_mac_addr_set and this > function returns and error when live change is not supported, note that > this function is invoked during port start but the value returned is not > checked. It is likely this is good enough for most of the cases, but > bonding is relying on this start then mac set/change, and a PMD ports is > not properly configured for being used as an slave port in some bonding > modes. > > v2: > - add RTE_ETH_DEV_NOLIVE_MAC_ADDR comment in rte_eth_dev_default_mac_addr_set doc > - add rte_eth_dev_start change in release API changes > > v3: > - merge doc API changes with first patch > - comment behaviour change in rte_eth_dev_start > - remove comment on rte_eth_dev_default_mac_addr_set Series applied to dpdk-next-net/master, thanks.