Bug 201240 - Ping does not work after MAC change on ixl (Intel Fortville NIC) link
Summary: Ping does not work after MAC change on ixl (Intel Fortville NIC) link
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords: IntelNetworking
Depends on:
Blocks:
 
Reported: 2015-07-01 07:05 UTC by Pushkar Kothavade
Modified: 2016-01-07 23:49 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pushkar Kothavade 2015-07-01 07:05:47 UTC
Issue

I am evaluating functionality of Intel Fortville NIC on FreeBSD platform.
Change in MAC address on a ixl (Intel Fortville NIC) link does not reflect on NIC. Ping stops working after change in MAC address. Ping works, if PROMISC mode is set.

Steps to reproduce the problem

# ifconfig ixl1

ixl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000

options=6407bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
ether 68:05:ca:35:97:29
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (10Gbase-Twinax <full-duplex>)
status: active

# ping XYZ
Ping Works

# ifconfig ixl1 ether 58:04:89:12:34:56
Assign new MAC to the link.

# ping XYZ
Ping does _NOT_ Work

Bug Analysis

While working on this issue, I found bug in the code.
Refer 'ixl_init_locked(struct ixl_pf *pf) function' present in 'dev/ixl/if_ixl.c' file.

 1080         /* Get the latest mac address... User might use a LAA */
 1081         bcopy(IF_LLADDR(vsi->ifp), tmpaddr,
 1082               I40E_ETH_LENGTH_OF_ADDRESS);
 1083         if (!cmp_etheraddr(hw->mac.addr, tmpaddr) &&
 1084             i40e_validate_mac_addr(tmpaddr)) {
 1085                 bcopy(tmpaddr, hw->mac.addr,
 1086                     I40E_ETH_LENGTH_OF_ADDRESS);
 1087                 ret = i40e_aq_mac_address_write(hw,
 1088                     I40E_AQC_WRITE_TYPE_LAA_ONLY,
 1089                     hw->mac.addr, NULL);
 1090                 if (ret) {
 1091                         device_printf(dev, "LLA address"
 1092                          "change failed!!\n");
 1093                         return;
 1094                 }
 1095         }

Refer lines 1083 & 1084 - 'i40e_validate_mac_addr(tmpaddr)' function returns 0 on success. Therefore 'i40e_aq_mac_address_write()' function is not getting called.

Bug Fix is as Follows -

        if (!cmp_etheraddr(hw->mac.addr, tmpaddr) &&
            i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)

After this fix, 'i40e_aq_mac_address_write()' function is getting called.

Conclusion
This 'bug fix' could not resolve the Ping issue.
Comment 1 Ravi Pokala 2015-07-01 07:21:56 UTC
CCing erj@ since he's the maintainer for ixl(4)
Comment 2 commit-hook freebsd_committer 2015-07-21 21:07:55 UTC
A commit references this bug:

Author: erj
Date: Tue Jul 21 21:07:19 UTC 2015
New revision: 285768
URL: https://svnweb.freebsd.org/changeset/base/285768

Log:
  Fix for a customer issue with ixl(4):

  - Add required MAC/VLAN filter when adding an LAA
  - Fix bug where code did not check for I40E_SUCCESS from a successful
    i40e_validate_mac_address() call in ixl_init_locked(), when setting
    an LAA.

  PR: 201240
  Differential Revision: https://reviews.freebsd.org/D3111
  Submitted by: Gregory Rose <gregory.v.rose@intel.com>
  Reviewed by: gnn, rstone
  Approved by: gnn
  MFC after: 2 weeks

Changes:
  head/sys/dev/ixl/if_ixl.c