<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/net/ncsi, branch dev-4.3</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.3</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.3'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2016-02-29T01:22:41+00:00</updated>
<entry>
<title>net/ncsi: Fix possible deadlock caught with lockdep</title>
<updated>2016-02-29T01:22:41+00:00</updated>
<author>
<name>Cyril Bur</name>
<email>cyrilbur@gmail.com</email>
</author>
<published>2016-02-25T02:27:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=35d2cfb27392c73096b9cbdb0e250a900474301f'/>
<id>urn:sha1:35d2cfb27392c73096b9cbdb0e250a900474301f</id>
<content type='text'>
Bringing the interfaces down with ifdown -a directly after boot causes a
lockdep warning. It appears that a network interrupt would result in an
attempt to acquire that lock again.

The solution is to soft disable interrupts.

=================================
[ INFO: inconsistent lock state ]
4.3.6 #1 Not tainted
---------------------------------
inconsistent {IN-SOFTIRQ-W} -&gt; {SOFTIRQ-ON-W} usage.
ip/934 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&amp;(&amp;ndp-&gt;ndp_package_lock)-&gt;rlock){+.?...}, at: [&lt;c03b0c9c&gt;]
ncsi_stop_dev+0x14/0x50
{IN-SOFTIRQ-W} state was registered at:
  [&lt;c03bbdf8&gt;] _raw_spin_lock+0x28/0x38
  [&lt;c03b08b0&gt;] ncsi_add_package+0x64/0xf0
  [&lt;c03af978&gt;] ncsi_rsp_handler_sp+0x80/0xe0
  [&lt;c03afb4c&gt;] ncsi_rcv_rsp+0xd4/0x104
  [&lt;c0308204&gt;] __netif_receive_skb_core+0x6c4/0x808
  [&lt;c0309d8c&gt;] netif_receive_skb_internal+0xb4/0x138
  [&lt;c030a664&gt;] napi_gro_receive+0x48/0x9c
  [&lt;c026d784&gt;] ftgmac100_poll+0x360/0x59c
  [&lt;c030ad48&gt;] net_rx_action+0xe8/0x2a0
  [&lt;c001a524&gt;] __do_softirq+0x108/0x26c
  [&lt;c001a728&gt;] do_softirq+0x48/0x70
  [&lt;c001a818&gt;] __local_bh_enable_ip+0xc8/0x104
  [&lt;c030d120&gt;] __dev_queue_xmit+0x654/0x6c4
  [&lt;c03ae648&gt;] ncsi_xmit_cmd+0x1d4/0x208
  [&lt;c03b01e0&gt;] ncsi_dev_start+0xd0/0x3c0
  [&lt;c03b0c44&gt;] ncsi_dev_work+0x1b8/0x1fc
  [&lt;c002c7a4&gt;] process_one_work+0x228/0x3cc
  [&lt;c002d5e0&gt;] worker_thread+0x2a4/0x3d8
  [&lt;c0031ba0&gt;] kthread+0xc4/0xd8
  [&lt;c000a3ac&gt;] ret_from_fork+0x14/0x28
irq event stamp: 2009
hardirqs last  enabled at (2009): [&lt;c001a834&gt;]
__local_bh_enable_ip+0xe4/0x104
hardirqs last disabled at (2007): [&lt;c001a7b4&gt;]
__local_bh_enable_ip+0x64/0x104
softirqs last  enabled at (2008): [&lt;c0326a44&gt;]
dev_deactivate_many+0x270/0x2ac
softirqs last disabled at (2006): [&lt;c0326a28&gt;]
dev_deactivate_many+0x254/0x2ac

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;ndp-&gt;ndp_package_lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;ndp-&gt;ndp_package_lock)-&gt;rlock);

 *** DEADLOCK ***

1 lock held by ip/934:
 #0:  (rtnl_mutex){+.+.+.}, at: [&lt;c036d0c8&gt;] devinet_ioctl+0x15c/0x6c8

stack backtrace:
CPU: 0 PID: 934 Comm: ip Not tainted 4.3.6 #1
Hardware name: ASpeed SoC
[&lt;c000fa2c&gt;] (unwind_backtrace) from [&lt;c000d5fc&gt;] (show_stack+0x10/0x14)
[&lt;c000d5fc&gt;] (show_stack) from [&lt;c0072a88&gt;] (print_usage_bug.part.11+0x220/0x288)
[&lt;c0072a88&gt;] (print_usage_bug.part.11) from [&lt;c0040394&gt;] (mark_lock+0x400/0x678)
[&lt;c0040394&gt;] (mark_lock) from [&lt;c004293c&gt;] (__lock_acquire+0xa0c/0x1a9c)
[&lt;c004293c&gt;] (__lock_acquire) from [&lt;c0043dc4&gt;] (lock_acquire+0x9c/0xbc)
[&lt;c0043dc4&gt;] (lock_acquire) from [&lt;c03bbdf8&gt;] (_raw_spin_lock+0x28/0x38)
[&lt;c03bbdf8&gt;] (_raw_spin_lock) from [&lt;c03b0c9c&gt;] (ncsi_stop_dev+0x14/0x50)
[&lt;c03b0c9c&gt;] (ncsi_stop_dev) from [&lt;c026cfa0&gt;] (ftgmac100_stop+0x1c/0x28)
[&lt;c026cfa0&gt;] (ftgmac100_stop) from [&lt;c0306cb0&gt;] (__dev_close_many+0xa0/0xc8)
[&lt;c0306cb0&gt;] (__dev_close_many) from [&lt;c0306dc8&gt;] (__dev_close+0x20/0x34)
[&lt;c0306dc8&gt;] (__dev_close) from [&lt;c030da50&gt;] (__dev_change_flags+0x8c/0x138)
[&lt;c030da50&gt;] (__dev_change_flags) from [&lt;c030db14&gt;] (dev_change_flags+0x18/0x48)
[&lt;c030db14&gt;] (dev_change_flags) from [&lt;c036d298&gt;] (devinet_ioctl+0x32c/0x6c8)
[&lt;c036d298&gt;] (devinet_ioctl) from [&lt;c02f42b0&gt;] (sock_ioctl+0x26c/0x2d0)
[&lt;c02f42b0&gt;] (sock_ioctl) from [&lt;c00b5804&gt;] (do_vfs_ioctl+0x588/0x67c)
[&lt;c00b5804&gt;] (do_vfs_ioctl) from [&lt;c00b592c&gt;] (SyS_ioctl+0x34/0x5c)
[&lt;c00b592c&gt;] (SyS_ioctl) from [&lt;c000a320&gt;] (ret_fast_syscall+0x0/0x1c)

Signed-off-by: Cyril Bur &lt;cyrilbur@gmail.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>ncsi: Fix not releasing lock in ncsi_rcv_rsp()</title>
<updated>2016-02-02T02:57:40+00:00</updated>
<author>
<name>Cyril Bur</name>
<email>cyrilbur@gmail.com</email>
</author>
<published>2016-01-20T22:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c43c31d0e4279664e9e04befd5c0191e0d2fb5a9'/>
<id>urn:sha1:c43c31d0e4279664e9e04befd5c0191e0d2fb5a9</id>
<content type='text'>
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>net/nsci: Remove use of dev_queue_xmit_sk</title>
<updated>2015-12-10T03:00:31+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2015-12-10T02:40:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a420ac884ec684224912e9e780286b48cc78abe1'/>
<id>urn:sha1:a420ac884ec684224912e9e780286b48cc78abe1</id>
<content type='text'>
We do not use both arguments, so the code path does not change. Upstream
removes the _sk variant in 4.4, so this helps with upstreaming.

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Introduce ncsi_stop_dev()</title>
<updated>2015-11-25T04:25:50+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-11-25T03:52:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=0ef0f094c2300a82df6c1d99b2754bcbef6e8e16'/>
<id>urn:sha1:0ef0f094c2300a82df6c1d99b2754bcbef6e8e16</id>
<content type='text'>
This introduces ncsi_stop_dev() which is to be called when network
interrupt is going to be brought down. The NCSI interface won't be
disabled and we rely on the driver to stop Rx and Tx path.

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Rename ncsi_stop_dev() to ncsi_suspend_dev()</title>
<updated>2015-11-25T04:25:49+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-11-25T03:51:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=45404ae1aec0ba17a1ba088c25c67bcc39db1da5'/>
<id>urn:sha1:45404ae1aec0ba17a1ba088c25c67bcc39db1da5</id>
<content type='text'>
This renames ncsi_stop_dev() to ncsi_suspend_dev(). The NCSI device
state ncsi_dev_state_stop_* are renamed to ncsi_dev_state_suspend_*
accordingly. No logical changes introduced.

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Disable interrupts when taking ndp-&gt;ndp_req_lock</title>
<updated>2015-11-25T04:25:47+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-11-25T03:51:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=8e393cb351466ac060393eb2bf03deba83881efc'/>
<id>urn:sha1:8e393cb351466ac060393eb2bf03deba83881efc</id>
<content type='text'>
The spinlock ndp-&gt;ndp_req_lock can be requested in NCSI packet
reception path that is done in softIRQ handler. So the external
interrupt should be disabled when taking the spinlock. Otherwise,
dead-lock could happen: softIRQ handler tries to acquire the lock
that has been taken by kernel thread (e.g. workqueue).

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Netlink support</title>
<updated>2015-11-18T04:14:19+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-10-06T02:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=073081106f8c4390e13243e1fad35aed1a5dfb7e'/>
<id>urn:sha1:073081106f8c4390e13243e1fad35aed1a5dfb7e</id>
<content type='text'>
This adds netlink support so that userland can retrieve the NCSI
topology on the specified interface. Also, more netlink commands
are introduced to retrieve information from the active channel
or configure the active channel with provided options.

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Manage NCSI device</title>
<updated>2015-11-18T04:14:19+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-10-06T02:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=105231deca9560ad98a42fbaf15e367289a45ae4'/>
<id>urn:sha1:105231deca9560ad98a42fbaf15e367289a45ae4</id>
<content type='text'>
There are multiple packages and channels connecting to NCSI enabled
interface. The available packages and channels are probed with NCSI
packets when NCSI device is started. Among the available packages
and channels, only one channel should be selected to be active to
provide service. When the active channel enters to failure state,
we need choose another channel as active one to do failover.

This implements the state machine to support above tasks. Also, the
public interfaces are exposed for NIC driver to manage NCSI device.

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Packet handler</title>
<updated>2015-11-18T04:14:18+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-10-06T02:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=cf0e64286f9c0f6e3a6be18e7c646d0738bb61b8'/>
<id>urn:sha1:cf0e64286f9c0f6e3a6be18e7c646d0738bb61b8</id>
<content type='text'>
NCSI packet encapsulated in ethernet frame is recognized by the
ethernet protocol field (0x88F8). According to NCSI spec, the
destination MAC field should be 0xFF's, but the source MAC field
could be arbitrary one since channel field in NCSI header indicates
the source of the packet.

There are 3 types of packets depending on the type field in the NCSI
packet header: command, response, Asynchronous Event Notification
(AEN). The command packets are sent from NCSI enabled interace to
the NCSI package or channel for purpose of information retrival or
configuration. The response packets, as responses to the received
command packets, originate from NCSI package or channel and terminate
at NCSI enabled interface. AEN packets are sent from NCSI channel
for asynchronous events that might indicate failure detected on
the active channel.

This implements the functions to handle NCSI packets.

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>net/ncsi: Resource management</title>
<updated>2015-11-18T04:14:17+00:00</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-10-06T02:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=1cbc4b6a63eff3fa1a1e38d8f0858e7b1e4c4780'/>
<id>urn:sha1:1cbc4b6a63eff3fa1a1e38d8f0858e7b1e4c4780</id>
<content type='text'>
According to NCSI spec (DSP0222), the NCSI enabled interface can
connected to multiple packages simultaneously, up to 8 packages.
Each package includes multiple channels, up to 32 channels. At
one moment, one channel is enabled to provide service to the NCSI
enabled interface. Besides, each channel comprises capabilities,
modes, filters, version and statistics etc. All of them are
resources to NCSI protocol stack.

At the meanwhile, the NCSI device seen from NIC driver is
represented by "struct ncsi_dev", which is expected to populated
and started by NIC driver before the NIC can work. All possible
NCSI packages and NCSI channels connected to the NCSI interface
are tracked from the NCSI device. Also, the NCSI device recognizes
active channel that is currently providing service to NCSI enabled
interface. Also, the NCSI requests (pairs of command and response)
are embedded in NCSI device.

This introduces the data structs to represents the NCSI resources
mentioned as above. Also, functions used by NCSI stack internally
are implemented. Besides, this introduces kernel config option
CONFIG_NET_NCSI to enable NCSI stack.

Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
