ipoib: Bound the number of egress mbufs buffered during pathrec lookups.

In pathological situations where the master subnet manager becomes
unresponsive for an extended period, we may otherwise end up queuing all
of the system's mbufs while waiting for a response to a path record lookup.

This addresses the same issue as commit 1e85b806f9 in Linux.

Reviewed by:	cem, ngie
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
markj 2016-08-01 22:22:11 +00:00
parent f0b9ceba3c
commit c7299da72a

View File

@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, struct ipoib_dev_priv *priv, struct ipoib_he
new_path = 1;
}
if (path) {
_IF_ENQUEUE(&path->queue, mb);
if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE)
_IF_ENQUEUE(&path->queue, mb);
else {
if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
}
if (!path->query && path_rec_start(priv, path)) {
spin_unlock_irqrestore(&priv->lock, flags);
if (new_path)