Skip to contentSkip to conversation

qedr: Avoid DB recover entry deletion when device is not active.

PATCH New Sudarsana Reddy Kalluru 2 participants 2 messages Apr 30, 2020 – May 1, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qedr: Avoid DB recover entry deletion when device is not active.

The doorbell (DB) recovery entries gets deleted by the QED driver when QEDR device transition to non-active or dead state (e.g., during the AER recovery phase). The patch adds driver changes to skip deleting DB recovery entries from QEDR when the device is in non-active state.

Fixes 731815e720ae ("qede: Add support for handling the pcie errors.")
---
 drivers/infiniband/hw/qedr/verbs.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/infiniband/hw/qedr/verbs.c +6 -0
index a5bd3ad..7e10f3b 100644
@@ -672,6 +672,12 @@ static void qedr_db_recovery_del(struct qedr_dev *dev,
 				 void __iomem *db_addr,
 				 void *db_data)
 {
+	if (QEDR_DEAD(dev)) {
+		DP_VERBOSE(dev, QEDR_MSG_FAIL,
+			   "avoiding db rec since device is dead\n");
+		return 0;
+	}
+
 	if (!db_data) {
 		DP_DEBUG(dev, QEDR_MSG_INIT, "avoiding db rec since old lib\n");
 		return;
Signature · 1 line
1.8.3.1
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi Sudarsana,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Sudarsana-Reddy-Kalluru/qedr-Avoid-DB-recover-entry-deletion-when-device-is-not-active/20200501-033426
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 323e395f197fd0bc1bf7a7a7e4c67d3d7410f24f
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=riscv

If you fix the issue, kindly add following tag as appropriate

All error/warnings (new ones prefixed by >>):

drivers/infiniband/hw/qedr/verbs.c: In function 'qedr_db_recovery_del':

>> drivers/infiniband/hw/qedr/verbs.c:675:6: error: implicit declaration of function 'QEDR_DEAD' [-Werror=implicit-function-declaration]
     675 |  if (QEDR_DEAD(dev)) {
         |      ^~~~~~~~~
   In file included from include/linux/string.h:6,
                    from include/linux/dma-mapping.h:6,
                    from drivers/infiniband/hw/qedr/verbs.c:32:
>> drivers/infiniband/hw/qedr/verbs.c:676:19: error: 'QEDR_MSG_FAIL' undeclared (first use in this function); did you mean 'QEDR_MSG_INIT'?
     676 |   DP_VERBOSE(dev, QEDR_MSG_FAIL,
         |                   ^~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
>> drivers/infiniband/hw/qedr/verbs.c:676:3: note: in expansion of macro 'DP_VERBOSE'
     676 |   DP_VERBOSE(dev, QEDR_MSG_FAIL,
         |   ^~~~~~~~~~
   drivers/infiniband/hw/qedr/verbs.c:676:19: note: each undeclared identifier is reported only once for each function it appears in
     676 |   DP_VERBOSE(dev, QEDR_MSG_FAIL,
         |                   ^~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
>> drivers/infiniband/hw/qedr/verbs.c:676:3: note: in expansion of macro 'DP_VERBOSE'
     676 |   DP_VERBOSE(dev, QEDR_MSG_FAIL,
         |   ^~~~~~~~~~
>> drivers/infiniband/hw/qedr/verbs.c:678:10: warning: 'return' with a value, in function returning void [-Wreturn-type]
     678 |   return 0;
         |          ^

drivers/infiniband/hw/qedr/verbs.c:671:13: note: declared here
671 | static void qedr_db_recovery_del(struct qedr_dev *dev,
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/QEDR_DEAD +675 drivers/infiniband/hw/qedr/verbs.c

670
671 static void qedr_db_recovery_del(struct qedr_dev *dev,
672 void __iomem *db_addr,
673 void *db_data)
674 {

 > 675		if (QEDR_DEAD(dev)) {
 > 676			DP_VERBOSE(dev, QEDR_MSG_FAIL,
   677				   "avoiding db rec since device is dead\n");
 > 678			return 0;

679 }
680
681 if (!db_data) {
682 DP_DEBUG(dev, QEDR_MSG_INIT, "avoiding db rec since old lib\n");
683 return;
684 }
685
686 /* Ignore return code as there is not much we can do about it. Error
687 * log will be printed inside.
688 */
689 dev->ops->common->db_recovery_del(dev->cdev, db_addr, db_data);
690 }
691

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org