aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-04-24 19:08:57 -0400
committerRoland Dreier <roland@purestorage.com>2012-04-24 19:08:57 -0400
commita9e7432319eb26ad90f18a7d215e50341d28ecb2 (patch)
treea6086093a69e4f3f4339085af76e323c44ef38d6 /drivers/infiniband
parent840777de530ae96ee9a3022f7ec1d6c65abb26ac (diff)
IB/mad: Don't send response for failed MADs
Commit 0b307043049f ("IB/mad: Return error response for unsupported MADs") does not failed MADs (eg those that return IB_MAD_RESULT_FAILURE) properly -- these MADs should be silently discarded. (We should not force the lower-layer drivers to return SUCCESS | CONSUMED in this case, since the MAD is NOT successful). Unsupported MADs are not failures -- they return SUCCESS, but with an "unsupported error" status value inside the response MAD. Reviewed-by: Hal Rosenstock <hal@mellanox.com> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/mad.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 1c73d8aa4b97..b0d0bc8a6fb6 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -1871,6 +1871,7 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv,
1871 struct ib_mad_list_head *mad_list; 1871 struct ib_mad_list_head *mad_list;
1872 struct ib_mad_agent_private *mad_agent; 1872 struct ib_mad_agent_private *mad_agent;
1873 int port_num; 1873 int port_num;
1874 int ret = IB_MAD_RESULT_SUCCESS;
1874 1875
1875 mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id; 1876 mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id;
1876 qp_info = mad_list->mad_queue->qp_info; 1877 qp_info = mad_list->mad_queue->qp_info;
@@ -1954,8 +1955,6 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv,
1954local: 1955local:
1955 /* Give driver "right of first refusal" on incoming MAD */ 1956 /* Give driver "right of first refusal" on incoming MAD */
1956 if (port_priv->device->process_mad) { 1957 if (port_priv->device->process_mad) {
1957 int ret;
1958
1959 ret = port_priv->device->process_mad(port_priv->device, 0, 1958 ret = port_priv->device->process_mad(port_priv->device, 0,
1960 port_priv->port_num, 1959 port_priv->port_num,
1961 wc, &recv->grh, 1960 wc, &recv->grh,
@@ -1983,7 +1982,8 @@ local:
1983 * or via recv_handler in ib_mad_complete_recv() 1982 * or via recv_handler in ib_mad_complete_recv()
1984 */ 1983 */
1985 recv = NULL; 1984 recv = NULL;
1986 } else if (generate_unmatched_resp(recv, response)) { 1985 } else if ((ret & IB_MAD_RESULT_SUCCESS) &&
1986 generate_unmatched_resp(recv, response)) {
1987 agent_send_response(&response->mad.mad, &recv->grh, wc, 1987 agent_send_response(&response->mad.mad, &recv->grh, wc,
1988 port_priv->device, port_num, qp_info->qp->qp_num); 1988 port_priv->device, port_num, qp_info->qp->qp_num);
1989 } 1989 }