raw/ntb: clear all valid DB bits when DB init
PATCH 1/1 raw/ntb: clear all valid DB bits when DB init
Before registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to aviod the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
--- drivers/raw/ntb/ntb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/raw/ntb/ntb.c +2 -0
@@ -1398,6 +1398,8 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)/* Init doorbell. */ hw->db_valid_mask =RTE_LEN2MASK (hw->db_cnt, uint64_t); +/* Clear all valid doorbell bits before registering intr handler*/ + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask); intr_handle = pci_dev->intr_handle;/* Register callback func to eal lib */
Signature · 1 line
2.25.1
PATCH v2 1/1 raw/ntb: clear all valid DB bits when DB init
Before registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
--- drivers/raw/ntb/ntb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/raw/ntb/ntb.c +2 -0
@@ -1398,6 +1398,8 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)/* Init doorbell. */ hw->db_valid_mask =RTE_LEN2MASK (hw->db_cnt, uint64_t); +/* Clear all valid doorbell bits before registering intr handler*/ + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask); intr_handle = pci_dev->intr_handle;/* Register callback func to eal lib */
Signature · 1 line
2.25.1
PATCH v3 1/1 raw/ntb: clear all valid DB bits when DB init
Before registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
--- drivers/raw/ntb/ntb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/raw/ntb/ntb.c +2 -0
@@ -1398,6 +1398,8 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)/* Init doorbell. */ hw->db_valid_mask =RTE_LEN2MASK (hw->db_cnt, uint64_t); +/* Clear all valid doorbell bits before registering intr handler */ + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask); intr_handle = pci_dev->intr_handle;/* Register callback func to eal lib */
Signature · 1 line
2.25.1
Quoted 14 lines
-----Original Message-----
From: Guo, Junfeng <[email protected]>
Sent: Wednesday, February 9, 2022 12:47 PM
To: Wu, Jingjing <[email protected]>
Cc: [email protected]; [email protected]; Guo, Junfeng <[email protected]>
Subject: [PATCH v3] raw/ntb: clear all valid DB bits when DB initBefore registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
Quoted 8 lines
Fixes 62012a76811e ("raw/ntb: add handshake process")Signed-off-by Junfeng Guo <[email protected]>--- drivers/raw/ntb/ntb.c | 2 ++ 1 file changed, 2 insertions(+)
Better to add changes compared to previous version, which would help reviewers.
drivers/raw/ntb/ntb.c ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device · line 1403
Quoted 11 lines
drivers/raw/ntb/ntb.c +2
-0@@ -1398,6 +1398,8 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)/* Init doorbell. */ hw->db_valid_mask =RTE_LEN2MASK (hw->db_cnt, uint64_t); +/* Clear all valid doorbell bits before registering intr handler */ + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask);
Check if hw->ntb_ops->db_clear is NULL before call it.
Quoted 5 lines
drivers/raw/ntb/ntb.c +0
-1intr_handle = pci_dev->intr_handle;/* Register callback func to eal lib */ --2.25.1
Quoted 27 lines
-----Original Message-----
From: Wu, Jingjing <[email protected]>
Sent: Thursday, February 10, 2022 14:51
To: Guo, Junfeng <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v3] raw/ntb: clear all valid DB bits when DB initQuoted 5 lines
-----Original Message-----
From: Guo, Junfeng <[email protected]>
Sent: Wednesday, February 9, 2022 12:47 PM
To: Wu, Jingjing <[email protected]>
Cc: [email protected]; [email protected]; Guo, JunfengQuoted 10 lines
Subject: [PATCH v3] raw/ntb: clear all valid DB bits when DB init
Before registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
Fixes 62012a76811e ("raw/ntb: add handshake process")
Quoted 7 lines
Quoted 5 lines
Signed-off-by Junfeng Guo <[email protected]>--- drivers/raw/ntb/ntb.c | 2 ++ 1 file changed, 2 insertions(+)Better to add changes compared to previous version, which would help reviewers.
Sure, I'll add the version change commit in the coming version. Thanks!
Quoted 7 lines
drivers/raw/ntb/ntb.c ntb_init_hw(struct rte_rawdev *dev, struct
Quoted 6 lines
drivers/raw/ntb/ntb.c +0
-0@@ -1398,6 +1398,8 @@ ntb_init_hw(struct rte_rawdev *dev, struct
rte_pci_device
Quoted 8 lines
drivers/raw/ntb/ntb.c ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev) · line 1402
Quoted 6 lines
drivers/raw/ntb/ntb.c +2
-0*pci_dev)/* Init doorbell. */ hw->db_valid_mask =RTE_LEN2MASK (hw->db_cnt, uint64_t); +/* Clear all valid doorbell bits before registering intr handler */ + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask);Check if
hw->ntb_ops->db_clearis NULL before call it.
OK, will add it in the coming version. Thanks for review!
Quoted 6 lines
Quoted 6 lines
drivers/raw/ntb/ntb.c +0
-1intr_handle = pci_dev->intr_handle;/* Register callback func to eal lib */ --2.25.1
PATCH v4 1/1 raw/ntb: clear all valid DB bits when DB init
In reply to Junfeng GuoBefore registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
v2: fix typo
v3: fix coding style issue
v4: add ops check before calling it
--- drivers/raw/ntb/ntb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/raw/ntb/ntb.c +4 -0
@@ -1398,6 +1398,10 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)/* Init doorbell. */ hw->db_valid_mask =RTE_LEN2MASK (hw->db_cnt, uint64_t); +/* Clear all valid doorbell bits before registering intr handler */ +if (hw->ntb_ops->db_clear ==NULL ) +return -ENOTSUP ; + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask); intr_handle = pci_dev->intr_handle;/* Register callback func to eal lib */
Signature · 1 line
2.25.1
Quoted 14 lines
-----Original Message-----
From: Guo, Junfeng <[email protected]>
Sent: Thursday, February 10, 2022 3:07 PM
To: Wu, Jingjing <[email protected]>
Cc: [email protected]; [email protected]; Guo, Junfeng <[email protected]>
Subject: [PATCH v4] raw/ntb: clear all valid DB bits when DB initBefore registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
Quoted 8 lines
Fixes 62012a76811e ("raw/ntb: add handshake process")v2: fix typo
v3: fix coding style issue
v4: add ops check before calling itSigned-off-by Junfeng Guo <[email protected]>
Thomas Monjalon
AppliedQuoted 11 lines
Quoted 11 lines
Before registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode.
Fixes 62012a76811e ("raw/ntb: add handshake process")v2: fix typo
v3: fix coding style issue
v4: add ops check before calling it
The changelog should be below line of ---
Quoted 2 lines
Quoted 1 line
Signed-off-by Junfeng Guo <[email protected]>Acked-by Jingjing Wu <[email protected]>
Applied, thanks.