Skip to content

Commit

Permalink
net/smc: rework pnet table to support SMC-R failover
Browse files Browse the repository at this point in the history
The pnet table stored pnet ids in the smc device structures. When a
device is going down its smc device structure is freed, and when the
device is brought online again it no longer has a pnet id set.
Rework the pnet table implementation to store the device name with their
assigned pnet id and apply the pnet id to devices when they are
registered.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Karsten Graul authored and David S. Miller committed Apr 29, 2020
1 parent 21615ef commit fdff704
Show file tree
Hide file tree
Showing 4 changed files with 319 additions and 230 deletions.
5 changes: 3 additions & 2 deletions net/smc/smc_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,9 @@ static void smc_ib_add_dev(struct ib_device *ibdev)
i++) {
set_bit(i, &smcibdev->port_event_mask);
/* determine pnetids of the port */
smc_pnetid_by_dev_port(ibdev->dev.parent, i,
smcibdev->pnetid[i]);
if (smc_pnetid_by_dev_port(ibdev->dev.parent, i,
smcibdev->pnetid[i]))
smc_pnetid_by_table_ib(smcibdev, i + 1);
}
schedule_work(&smcibdev->port_event_work);
}
Expand Down
3 changes: 2 additions & 1 deletion net/smc/smc_ism.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
device_initialize(&smcd->dev);
dev_set_name(&smcd->dev, name);
smcd->ops = ops;
smc_pnetid_by_dev_port(parent, 0, smcd->pnetid);
if (smc_pnetid_by_dev_port(parent, 0, smcd->pnetid))
smc_pnetid_by_table_smcd(smcd);

spin_lock_init(&smcd->lock);
spin_lock_init(&smcd->lgr_lock);
Expand Down
Loading

0 comments on commit fdff704

Please sign in to comment.