]> www.infradead.org Git - users/jedix/linux-maple.git/commit
IPoIB: Protect tx_outstanding from parallel access
authorWengang Wang <wen.gang.wang@oracle.com>
Fri, 15 Jan 2016 07:53:46 +0000 (15:53 +0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 29 Jan 2016 15:37:02 +0000 (07:37 -0800)
commit1cb6be04345014198fecaee2bc8edee8665b610e
tree8e29a70d20171fa3502ff01362fb2517c8dbdff2
parent366a16700780328e7aca7dfaee8b8488a364d741
IPoIB: Protect tx_outstanding from parallel access

Orabug: 22217400(UEK4)
quick ref: 21861366(UEK2) 22217399(UEK3)

In IPoIB code, parallel access of tx_outstanding (send path VS event
process path) needs to be serialized. We use priv->lock to protect it. We
also use that lock to make the stop/open tx queue to be atomic with the
changing on tx_outstanding to protect the race between the opening of tx
queue from completion hander and the closing from the send path.

This patch also make sure the increase of tx_outstanding prior to the
calling of post_send to avoid the possible decreasing before increasing in
case the running of increasing is scheduled later than the event handler.

Impact on Throuput is ~1.5% drop.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/infiniband/ulp/ipoib/ipoib_ib.c