diff options
| author | Jim Foraker <foraker1@llnl.gov> | 2012-05-02 14:57:23 -0400 |
|---|---|---|
| committer | Roland Dreier <roland@purestorage.com> | 2012-05-14 15:42:44 -0400 |
| commit | 3236b2d469dba42fde837b8cb06308f7f360dfed (patch) | |
| tree | 755ed9ac544961594e8fb6c65061696e16a944cb | |
| parent | 6199c8961e1bcd38c112bee9028d482e2a7768eb (diff) | |
IB/qib: MADs with misset M_Keys should return failure
If a MAD is sent directly to the local HCA rather than placed on a QP
and the MAD fails M_Key checks, there is no means to generate a
timeout for the client, which may hang. Instead we report
IB_MAD_RESULT_FAILURE, which operates the same for on-the-wire
packets, but will generate a send failure back to the client.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jim Foraker <foraker1@llnl.gov>
Signed-off-by: Roland Dreier <roland@purestorage.com>
| -rw-r--r-- | drivers/infiniband/hw/qib/qib_mad.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c index ed611e8df64f..43390217a026 100644 --- a/drivers/infiniband/hw/qib/qib_mad.c +++ b/drivers/infiniband/hw/qib/qib_mad.c | |||
| @@ -433,7 +433,7 @@ static int check_mkey(struct qib_ibport *ibp, struct ib_smp *smp, int mad_flags) | |||
| 433 | ibp->mkey_lease_period * HZ; | 433 | ibp->mkey_lease_period * HZ; |
| 434 | /* Generate a trap notice. */ | 434 | /* Generate a trap notice. */ |
| 435 | qib_bad_mkey(ibp, smp); | 435 | qib_bad_mkey(ibp, smp); |
| 436 | ret = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED; | 436 | ret = 1; |
| 437 | } | 437 | } |
| 438 | } | 438 | } |
| 439 | 439 | ||
| @@ -464,6 +464,7 @@ static int subn_get_portinfo(struct ib_smp *smp, struct ib_device *ibdev, | |||
| 464 | ibp = to_iport(ibdev, port_num); | 464 | ibp = to_iport(ibdev, port_num); |
| 465 | ret = check_mkey(ibp, smp, 0); | 465 | ret = check_mkey(ibp, smp, 0); |
| 466 | if (ret) | 466 | if (ret) |
| 467 | ret = IB_MAD_RESULT_FAILURE; | ||
| 467 | goto bail; | 468 | goto bail; |
| 468 | } | 469 | } |
| 469 | } | 470 | } |
| @@ -1848,6 +1849,7 @@ static int process_subn(struct ib_device *ibdev, int mad_flags, | |||
| 1848 | port_num && port_num <= ibdev->phys_port_cnt && | 1849 | port_num && port_num <= ibdev->phys_port_cnt && |
| 1849 | port != port_num) | 1850 | port != port_num) |
| 1850 | (void) check_mkey(to_iport(ibdev, port_num), smp, 0); | 1851 | (void) check_mkey(to_iport(ibdev, port_num), smp, 0); |
| 1852 | ret = IB_MAD_RESULT_FAILURE; | ||
| 1851 | goto bail; | 1853 | goto bail; |
| 1852 | } | 1854 | } |
| 1853 | 1855 | ||
