Skip to content

Commit 35dcf7e

Browse files
karstengrdavem330
authored andcommitted
net/smc: remember PNETID of IB device for later device matching
The PNETID is needed to find an alternate link for a link group. Save the PNETID of the link that is used to create the link group for later device matching. 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 d550066 commit 35dcf7e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

net/smc/smc_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini)
413413
lgr->role = smc->listen_smc ? SMC_SERV : SMC_CLNT;
414414
memcpy(lgr->peer_systemid, ini->ib_lcl->id_for_peer,
415415
SMC_SYSTEMID_LEN);
416+
memcpy(lgr->pnet_id, ini->ib_dev->pnetid[ini->ib_port - 1],
417+
SMC_MAX_PNETID_LEN);
416418
smc_llc_lgr_init(lgr, smc);
417419

418420
link_idx = SMC_SINGLE_LINK;

net/smc/smc_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ struct smc_link_group {
244244
u8 next_link_id;
245245
enum smc_lgr_type type;
246246
/* redundancy state */
247+
u8 pnet_id[SMC_MAX_PNETID_LEN + 1];
248+
/* pnet id of this lgr */
247249
struct list_head llc_event_q;
248250
/* queue for llc events */
249251
spinlock_t llc_event_q_lock;

0 commit comments

Comments
 (0)