Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=intel.com (client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=johnathanx.mantey@intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=intel.com Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47RcJr0FY8zDqNm for ; Tue, 3 Dec 2019 07:33:40 +1100 (AEDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Dec 2019 12:33:36 -0800 X-IronPort-AV: E=Sophos;i="5.69,270,1571727600"; d="asc'?scan'208,217";a="213156270" Received: from jmanteyx-desk.jf.intel.com ([10.54.51.79]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2019 12:33:36 -0800 To: OpenBMC Maillist From: Johnathan Mantey Subject: LAN Cable insertion/removal Autocrypt: addr=johnathanx.mantey@intel.com; prefer-encrypt=mutual; keydata= mQENBFija08BCAC60TO2X22b0tJ2Gy2iQLWx20mGcD7ugBpm1o2IW2M+um3GR0BG/bUcLciw dEnX9SWT30jx8TimenyUYeDS1CKML/e4JnCAUhSktNZRPBjzla991OkpqtFJEHj/pHrXTsz0 ODhmnSaZ49TsY+5BqtRMexICYOtSP8+xuftPN7g2pQNFi7xYlQkutP8WKIY3TacW/6MPiYek pqVaaF0cXynCMDvbK0km7m0S4X01RZFKXUwlbuMireNk4IyZ/59hN+fh1MYMQ6RXOgmHqxSu 04GjkbBLf2Sddplb6KzPMRWPJ5uNdvlkAfyT4P0R5EfkV5wCRdoJ1lNC9WI1bqHkbt07ABEB AAG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8eW9d6d2Yf/RzTBJvZxjBFbIgeUGeykbSKztp2OBe6mecpVPhKooTq+X/mJehpRA6mAhuQZ 28lvie7hbRFjqR3JB7inAKL4eT1/9bT/MqcPh43PXTAzB6/Iclg5B7GGgEFe27VL0hyqiqc= Message-ID: <51636f8f-7d6c-4f89-61cb-0b4da48a5956@intel.com> Date: Mon, 2 Dec 2019 12:33:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7wyxg8DVbsuLmfuouHBakMmeggbc93HEJ" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2019 20:33:49 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7wyxg8DVbsuLmfuouHBakMmeggbc93HEJ Content-Type: multipart/mixed; boundary="R65cQCXiKBw0L848Rozsh9UEXS2ecRQjS" --R65cQCXiKBw0L848Rozsh9UEXS2ecRQjS Content-Type: multipart/alternative; boundary="------------BEDFD9977404ECDF7A9362D0" Content-Language: en-US This is a multi-part message in MIME format. --------------BEDFD9977404ECDF7A9362D0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable LAN/NCSI experts, I'm looking for some guidance to correctly report LAN state when RJ45 cables are inserted/removed from the NIC's monitored by the BMC. Background: 1. Intel uses one NIC that is dedicated to the BMC (1Gib phy, eth0) 2. There is another LAN channel managed by the BMC via NCSI (100Mib NCSI, eth1) 3. Prior generations of Intel servers correctly report the presence of an active LAN link upon insertion/removal 4. Prior generations correctly update /sys/class/net/eth(x)/carrier based on cable insertion 5. LAN carrier state is propagated to the IPMI system, and is logged via IPMI events. OpenBMC: 1. The dedicated NIC (aka eth0) correctly propagates /sys/class/net/eth0/carrier state to the kernel 2. The eth0 carrier state does not propagate to Redfish/IPMI. I believe this to be a problem related to DBus update. 3. The NCSI NIC (aka eth1) does not propagate the cable presence to /sys/class/net/eth1, which I believe to be invalid behavior. 4. The eth1 carrier state does not propagate to Redfish/IPMI. I believe this is a two-fold problem with DBus update, and kernel update. 5. LAN carrier state is not propagated to IPMI or Redfish, and is not logged. I've already pushed a change to handle synchronous enable/disable actions via DBus. Unfortunately it's only half the solution. I've been trying to work my way through the FTGMAC100 driver code, and the phosphor-networkd code in an effort to tie the async event into the DBus space.=C2=A0 So far without success. Desired results: 1. Redfish GET /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 (eth1) correctly reports the InterfaceEnabled state when a cable is pulled/inserted. 2. Redfish receives an event that permits the state change to be logged.= 3. IPMI correctly reports the link status (up/down) 4. ip link correctly reports the link status (up/down). Does anyone on the list have some recommendations? Details of my investigation for the strong of heart: * Synchronous NIC Enable/Disable change 1. https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-networkd/+/= 26696 2. https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interf= aces/+/26694 3. https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/26693 * FTGMAC driver: (kernel-source/drivers/net/ethernet/faraday/ftgmac100.= c) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 This code looks suspect, as it uses= "speed" to determine if the link is up/down.=C2=A0 For the Intel system the NCSI channel is always running 100Mibps, so does this really work? =C2=A0=C2=A0=C2=A0 /* Link is down, do nothing else */ =C2=A0=C2=A0=C2=A0 if (!new_speed) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Likewise, this code announces the l= ink is "down", which seems would cause the kernel to alter the state of /sys/class/net/eth1/carrier.=C2=A0 Insertion of the cable does not cause = a corresponding "link is up" message: =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 static void ftgmac100_ncsi_handler(= struct ncsi_dev *nd) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 if (unlikely(nd->stat= e !=3D ncsi_dev_state_functional)) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 netdev_dbg(nd->dev, "N= CSI interface %s\n", =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 nd->link_up ? "up" : "= down"); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= } * PHY driver (kernel-source/drivers/net/phy/phy.c and phylink.c) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 The PHY driver for eth0 seems to be= working correctly. Removal shows the link going down, and the /sys/class/net/eth0/carrier file changing state from 1->0. Insertion works correctly changing the state from 0->1.=C2=A0 What isn't present is some action to phosphor-network or= DBus indicating a link state change. * ip link =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 The "ip link" command always return= s "" for eth1 (NCSI) channel. --=20 Johnathan Mantey Senior Software Engineer *azad te**chnology partners* Contributing to Technology Innovation since 1992 Phone: (503) 712-6764 Email: johnathanx.mantey@intel.com --------------BEDFD9977404ECDF7A9362D0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable LAN/NCSI experts,

I'm looking for some guidance to correctly report LAN state when RJ45 cables are inserted/removed from the NIC's monitored by the BMC.

Background:
  1. Intel uses one NIC that is dedicated to the BMC (1Gib phy, eth0)
  2. There is another LAN channel managed by the BMC via NCSI (100Mib NCSI, eth1)
  3. Prior generations of Intel servers correctly report the presence of an active LAN link upon insertion/removal
  4. Prior generations correctly update /sys/class/net/eth(x)/carrier based on cable insertion
  5. LAN carrier state is propagated to the IPMI system, and is logged via IPMI events.

OpenBMC:

  1. The dedicated NIC (aka eth0) correctly propagates /sys/class/net/eth0/carrier state to the kernel
  2. The eth0 carrier state does not propagate to Redfish/IPMI. I believe this to be a problem related to DBus update.
  3. The NCSI NIC (aka eth1) does not propagate the cable presence to /sys/class/net/eth1, which I believe to be invalid behavior.
  4. The eth1 carrier state does not propagate to Redfish/IPMI. I believe this is a two-fold problem with DBus update, and kernel update.
  5. LAN carrier state is not propagated to IPMI or Redfish, and is not logged.

I've already pushed a change to handle synchronous enable/disable actions via DBus. Unfortunately it's only half the solution. I've been trying to work my way through the FTGMAC100 driver code, and the phosphor-networkd code in an effort to tie the async event into the DBus space.=C2=A0 So far without success.

Desired results:
  1. Redfish GET /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 (eth1) correctly reports the InterfaceEnabled state when a cable is pulled/inserted.
  2. Redfish receives an event that permits the state change to be logged.
  3. IPMI correctly reports the link status (up/down)
  4. ip link correctly reports the link status (up/down).

Does anyone on the list have some recommendations?



Details of my investigation for the strong of heart:

  • Synchronous NIC Enable/Disable change
    1. https://gerrit.open= bmc-project.xyz/c/openbmc/phosphor-networkd/+/26696
    2. https://gerr= it.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/26694
    3. https://gerrit.openbmc-project= =2Exyz/c/openbmc/bmcweb/+/26693
  • FTGMAC driver: (kernel-source/drivers/net/ethernet/faraday/ftgmac100.c)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 This code looks suspect, as it = uses "speed" to determine if the link is up/down.=C2=A0 For the Intel system the NCSI channel is always running 100Mibps, so does this really work?
=C2=A0=C2=A0= =C2=A0 /* Link is down, do nothing else */
=C2=A0=C2=A0=C2=A0 i= f (!new_speed)
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 return;

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Likewise, this code announce= s the link is "down", which seems would cause the kernel to alter the state of /sys/class/net/eth1/carrier.=C2=A0 Insertion of the cable does not cause a corresponding "link is up" message:

=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 static void ftgmac100_ncsi_handler(struct ncsi_dev *nd)
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0 =C2=A0 =C2=A0=C2=A0 if (unlikely(nd->state !=3D ncsi_dev_state_functional)) =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return;

=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0 netdev_dbg(nd->dev, "NCSI interface %s\n",
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0 nd->link_up ? "up" : "down");
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 }

  • PHY driver (kernel-source/drivers/net/phy/phy.c and phylink.c)<= br>

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 The PHY driver for eth0 seem= s to be working correctly. Removal shows the link going down, and the /sys/class/net/eth0/carrier file changing state from 1->0. Insertion works correctly changing the state from 0->1.=C2=A0 Wh= at isn't present is some action to phosphor-network or DBus indicating a link state change.

  • ip link

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 The "ip link" command always= returns "<BROADCAST,MULTICAST,UP,LOWER_UP>" for eth1 (NCSI) channel.<= br>

--
Johnathan Man= tey
Senior Software Engineer
azad technology partners
Contributing to Technology Innovation since 1992
Phone: (503) 712-6764
Email: johnathanx.mantey@intel.com


--------------BEDFD9977404ECDF7A9362D0-- --R65cQCXiKBw0L848Rozsh9UEXS2ecRQjS-- --7wyxg8DVbsuLmfuouHBakMmeggbc93HEJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEVa822oZtYaVqAzq50EfviT3fHwkFAl3ldRwACgkQ0EfviT3f Hwm4Owf/aw/6C0NGl32DeHpUOQ3henz0AeDNtZz0QcuHMnxi2OPjEndk39Danpon fAC4632hqu+MlYAWJUNQPebXycbNkscI/gOTovR1hSgbELbxjPEDA0Li5hJK2x31 ixWjPnHuYD9awuyCMlo9kZHujpXIu4yVqybtbT4KwhTHn0TYaybyiCfaqw+x10ug 5MIknJTNerHMH+AEjfCZmAyJjN3iUSEcF9FA7sIHGb8BZY8Vq2l0SWd9cQUpLGfp QLI/UAniBUKnCcqOWXe7wa3eoRsJrxFBTPp1InrxMbT2Q9S57OfO2FHXjFoNCtBJ ZIXI/pix6ZD29lhBb1nwFjaUag6A4A== =yF24 -----END PGP SIGNATURE----- --7wyxg8DVbsuLmfuouHBakMmeggbc93HEJ--