Skip to content

Commit fdff704

Browse files
karstengrdavem330
authored andcommitted
net/smc: rework pnet table to support SMC-R failover
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>
1 parent 21615ef commit fdff704

4 files changed

Lines changed: 319 additions & 230 deletions

File tree

‎net/smc/smc_ib.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,9 @@ static void smc_ib_add_dev(struct ib_device *ibdev)
579579
i++) {
580580
set_bit(i, &smcibdev->port_event_mask);
581581
/* determine pnetids of the port */
582-
smc_pnetid_by_dev_port(ibdev->dev.parent, i,
583-
smcibdev->pnetid[i]);
582+
if (smc_pnetid_by_dev_port(ibdev->dev.parent, i,
583+
smcibdev->pnetid[i]))
584+
smc_pnetid_by_table_ib(smcibdev, i + 1);
584585
}
585586
schedule_work(&smcibdev->port_event_work);
586587
}

‎net/smc/smc_ism.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
296296
device_initialize(&smcd->dev);
297297
dev_set_name(&smcd->dev, name);
298298
smcd->ops = ops;
299-
smc_pnetid_by_dev_port(parent, 0, smcd->pnetid);
299+
if (smc_pnetid_by_dev_port(parent, 0, smcd->pnetid))
300+
smc_pnetid_by_table_smcd(smcd);
300301

301302
spin_lock_init(&smcd->lock);
302303
spin_lock_init(&smcd->lgr_lock);

0 commit comments

Comments
 (0)