IB/mlx4: Fix memory ordering problem when posting LSO sends
commit0fd7e1d8559f45a6838cee93ea49adc0c5bda8f0
authorRoland Dreier <rolandd@cisco.com>
Fri, 16 Jan 2009 20:47:47 +0000 (16 12:47 -0800)
committerRoland Dreier <rolandd@cisco.com>
Fri, 16 Jan 2009 20:47:47 +0000 (16 12:47 -0800)
tree7d31d09b0d60de47a1b668474957ce1926812087
parentd3b924d960a808105180d229b4667061123cc4ef
IB/mlx4: Fix memory ordering problem when posting LSO sends

The current work request posting code writes the LSO segment before
writing any data segments.  This leaves a window where the LSO segment
overwrites the stamping in one cacheline that the HCA prefetches
before the rest of the cacheline is filled with the correct data
segments.  When the HCA processes this work request, a local
protection error may result.

Fix this by saving the LSO header size field off and writing it only
after all data segments are written.  This fix is a cleaned-up version
of a patch from Jack Morgenstein <jackm@dev.mellanox.co.il>.

This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1383>.

Reported-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mlx4/qp.c