]> bbs.cooldavid.org Git - net-next-2.6.git/commit
IB/mlx4: Signal node desc changes to SM by using FW to generate trap 144
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Mon, 4 Oct 2010 12:11:34 +0000 (12:11 +0000)
committerRoland Dreier <rolandd@cisco.com>
Sat, 23 Oct 2010 20:53:09 +0000 (13:53 -0700)
commitd0d68b8693bd16bfbbc93b89f1d9f3351723307c
tree805552db83354bff13841e523e502a0e689d1643
parent5a0fd09428e47fb08d5a887515d92bb2447f4b65
IB/mlx4: Signal node desc changes to SM by using FW to generate trap 144

The Node Description cannot be changed via MADs (it is read-only).
Until now, it was changed in the driver via sysfs, and the new Node
Description was simply inserted by the driver into MAD responses
(replacing the description returned by FW).

System startup scripts use the sysfs interface to change the node
description at driver startup to show the hostname, etc. However, this
has a race condition: the SM could discover the original FW node
description rather than the system-specific description if it queried the
port before the startup scripts finish running.

For mlx4, we fix this with a new FW command (SET_NODE) that allows
passing the new node description to FW.  When this command is invoked,
FW sends a trap 144 to the SM.  When it gets this trap, the SM can
query the node to obtain the new node description -- thus eliminating
the effects of the race.

This patch simply calls SET_NODE command when a new node description
is entered via sysfs (thus causing trap 144 to be issued by the FW).
We ignore all failures of the SET_NODE command (including those caused
by using a device FW that predates the SET_NODE command), since in
that case things work just as before.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mlx4/main.c
include/linux/mlx4/cmd.h