diff options
author | Chengwen Feng <fengchengwen@huawei.com> | 2021-07-19 17:13:05 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-07-20 13:12:48 +0200 |
commit | 1b713d14dc3c077ec45e65dab4ea01a8bc41b8c1 (patch) | |
tree | e8cea0b96e7e1068328956021b0f5fd1beda1fd4 /lib/decompress.c | |
parent | cbb56b03ec3f317e3728d0f68d25d4b9e590cdc9 (diff) |
net: hns3: fix possible mismatches resp of mailbox
Currently, the mailbox synchronous communication between VF and PF use
the following fields to maintain communication:
1. Origin_mbx_msg which was combined by message code and subcode, used
to match request and response.
2. Received_resp which means whether received response.
There may possible mismatches of the following situation:
1. VF sends message A with code=1 subcode=1.
2. PF was blocked about 500ms when processing the message A.
3. VF will detect message A timeout because it can't get the response
within 500ms.
4. VF sends message B with code=1 subcode=1 which equal message A.
5. PF processes the first message A and send the response message to
VF.
6. VF will identify the response matched the message B because the
code/subcode is the same. This will lead to mismatch of request and
response.
To fix the above bug, we use the following scheme:
1. The message sent from VF was labelled with match_id which was a
unique 16-bit non-zero value.
2. The response sent from PF will label with match_id which got from
the request.
3. The VF uses the match_id to match request and response message.
As for PF driver, it only needs to copy the match_id from request to
response.
Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF driver")
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/decompress.c')
0 files changed, 0 insertions, 0 deletions