Skip to content

Commit fe25c56

Browse files
Yossi EtiginRoland Dreier
authored andcommitted
IPoIB: Don't enable NAPI when it's already enabled
If a P_Key is not present when an interface is created, ipoib_open() will return after doing napi_enable(). ipoib_open() will be called again from ipoib_pkey_poll() when the P_Key appears, after NAPI has already been enabled, and try to enable it again. This triggers a BUG_ON() in napi_enable(). Fix this by moving the call to napi_enable() to after the test for P_Key presence. Signed-off-by: Yossi Etigin <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent 332edc2 commit fe25c56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,13 @@ int ipoib_open(struct net_device *dev)
106106

107107
ipoib_dbg(priv, "bringing up interface\n");
108108

109-
napi_enable(&priv->napi);
110109
set_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags);
111110

112111
if (ipoib_pkey_dev_delay_open(dev))
113112
return 0;
114113

114+
napi_enable(&priv->napi);
115+
115116
if (ipoib_ib_dev_open(dev)) {
116117
napi_disable(&priv->napi);
117118
return -EINVAL;

0 commit comments

Comments
 (0)