numam-dpdk/drivers/net/hns3
Chengwen Feng c8dec72de0 net/hns3: fix possible mismatched response of mailbox
Currently, the mailbox synchronous communication between VF and PF use
the following fields to maintain communication:
1. Req_msg_data which was combined by message code and subcode, used to
   match request and response.
2. Head which means the number of requests successfully sent by VF.
3. Tail which means the number of responses successfully received by VF.
4. Lost which means the number of requests which are timeout.

There may possible mismatches of the following situation:
1. VF sends message A with code=1 subcode=1.
	Then head=1, tail=0, lost=0.
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.
	Then head=1, tail=0, lost=1.
4. VF sends message B with code=1 subcode=1 which equal message A.
	Then head=2, tail=0, lost=1.
5. PF processes the first message A and send the response message to VF.
6. VF will update tail field to 1, but the lost field will remain
   unchanged because the code/subcode equal message B's, so driver will
   return success because now the head(2) equals tail(1) plus lost(1).
   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.

This scheme depends on the PF driver, if the PF driver don't support
then VF will uses the original scheme.

Fixes: 463e748964 ("net/hns3: support mailbox")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-14 19:45:27 +02:00
..
hns3_cmd.c net/hns3: fix FLR miss detection 2021-04-08 18:57:09 +02:00
hns3_cmd.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_dcb.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_dcb.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_ethdev_vf.c net/hns3: simplify selecting Rx/Tx function 2021-04-13 11:13:41 +02:00
hns3_ethdev.c net/hns3: fix configure FEC when concurrent with reset 2021-04-13 11:13:41 +02:00
hns3_ethdev.h net/hns3: delete mailbox arq ring 2021-04-14 19:45:27 +02:00
hns3_fdir.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_fdir.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_flow.c net/hns3: fix flow counter value 2021-04-08 18:57:09 +02:00
hns3_intr.c net/hns3: fix concurrent interrupt handling 2021-04-13 11:13:41 +02:00
hns3_intr.h net/hns3: refactor VF LSC event report 2021-04-13 02:44:20 +02:00
hns3_logs.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_mbx.c net/hns3: fix possible mismatched response of mailbox 2021-04-14 19:45:27 +02:00
hns3_mbx.h net/hns3: fix possible mismatched response of mailbox 2021-04-14 19:45:27 +02:00
hns3_mp.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_mp.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_ptp.c net/hns3: support IEEE 1588 PTP 2021-04-01 18:39:55 +02:00
hns3_regs.c net/hns3: support get device version when dump register 2021-04-08 18:57:09 +02:00
hns3_regs.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rss.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rss.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rxtx_vec_neon.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rxtx_vec_sve.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rxtx_vec.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rxtx_vec.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_rxtx.c net/hns3: fix queue state when concurrent with reset 2021-04-13 11:13:41 +02:00
hns3_rxtx.h net/hns3: fix some packet types 2021-04-13 11:13:41 +02:00
hns3_stats.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_stats.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_tm.c net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
hns3_tm.h net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
meson.build net/hns3: fix copyright date 2021-04-08 17:55:35 +02:00
version.map build: remove library name from version map file name 2020-10-19 22:13:59 +02:00