[0/2] support MAC changes when no live changes allowed

Message ID 1531156496-1702-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive)
Headers
Series support MAC changes when no live changes allowed |

Message

Alejandro Lucero July 9, 2018, 5:14 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.
  

Comments

Ferruh Yigit July 18, 2018, 8:58 a.m. UTC | #1
On 7/9/2018 6:14 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.

Hi Alejandro,

Overall looks good to me, only it can be good to update "rte_eth_dev_start" API
doc to mention about affect of new flag and perhaps update release notes "API
Changes" section to document behavior change of the "rte_eth_dev_start" API
based on flag.

But, the ethdev library patch was late for this release, I suggest considering
the patch for next release, meanwhile it can get more reviews.

Thanks,
ferruh
  
Ferruh Yigit Aug. 22, 2018, 4 p.m. UTC | #2
On 7/18/2018 9:58 AM, Ferruh Yigit wrote:
> On 7/9/2018 6:14 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.
> 
> Hi Alejandro,
> 
> Overall looks good to me, only it can be good to update "rte_eth_dev_start" API
> doc to mention about affect of new flag and perhaps update release notes "API
> Changes" section to document behavior change of the "rte_eth_dev_start" API
> based on flag.

Would you mind sending a new version for this release, v18.11, with above
documentation update?

Thanks,
ferruh

> 
> But, the ethdev library patch was late for this release, I suggest considering
> the patch for next release, meanwhile it can get more reviews.
> 
> Thanks,
> ferruh
>
  
Alejandro Lucero Aug. 23, 2018, 9:22 a.m. UTC | #3
On Wed, Aug 22, 2018 at 6:00 PM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> On 7/18/2018 9:58 AM, Ferruh Yigit wrote:
> > On 7/9/2018 6:14 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.
> >
> > Hi Alejandro,
> >
> > Overall looks good to me, only it can be good to update
> "rte_eth_dev_start" API
> > doc to mention about affect of new flag and perhaps update release notes
> "API
> > Changes" section to document behavior change of the "rte_eth_dev_start"
> API
> > based on flag.
>
> Would you mind sending a new version for this release, v18.11, with above
> documentation update?
>
>
Sure. I have been on a large PTO break but I planned to send this asap.

Thanks


> Thanks,
> ferruh
>
> >
> > But, the ethdev library patch was late for this release, I suggest
> considering
> > the patch for next release, meanwhile it can get more reviews.
> >
> > Thanks,
> > ferruh
> >
>
>