aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_exch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libfc/fc_exch.c')
-rw-r--r--drivers/scsi/libfc/fc_exch.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index ee6031e24c14..751a485685d9 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1134,6 +1134,15 @@ static void fc_exch_recv_req(struct fc_lport *lp, struct fc_exch_mgr *mp,
1134 u32 f_ctl; 1134 u32 f_ctl;
1135 enum fc_pf_rjt_reason reject; 1135 enum fc_pf_rjt_reason reject;
1136 1136
1137 /* We can have the wrong fc_lport at this point with NPIV, which is a
1138 * problem now that we know a new exchange needs to be allocated
1139 */
1140 lp = fc_vport_id_lookup(lp, ntoh24(fh->fh_d_id));
1141 if (!lp) {
1142 fc_frame_free(fp);
1143 return;
1144 }
1145
1137 fr_seq(fp) = NULL; 1146 fr_seq(fp) = NULL;
1138 reject = fc_seq_lookup_recip(lp, mp, fp); 1147 reject = fc_seq_lookup_recip(lp, mp, fp);
1139 if (reject == FC_RJT_NONE) { 1148 if (reject == FC_RJT_NONE) {
@@ -1900,6 +1909,26 @@ void fc_exch_mgr_del(struct fc_exch_mgr_anchor *ema)
1900} 1909}
1901EXPORT_SYMBOL(fc_exch_mgr_del); 1910EXPORT_SYMBOL(fc_exch_mgr_del);
1902 1911
1912/**
1913 * fc_exch_mgr_list_clone() - share all exchange manager objects
1914 * @src: source lport to clone exchange managers from
1915 * @dst: new lport that takes references to all the exchange managers
1916 */
1917int fc_exch_mgr_list_clone(struct fc_lport *src, struct fc_lport *dst)
1918{
1919 struct fc_exch_mgr_anchor *ema, *tmp;
1920
1921 list_for_each_entry(ema, &src->ema_list, ema_list) {
1922 if (!fc_exch_mgr_add(dst, ema->mp, ema->match))
1923 goto err;
1924 }
1925 return 0;
1926err:
1927 list_for_each_entry_safe(ema, tmp, &dst->ema_list, ema_list)
1928 fc_exch_mgr_del(ema);
1929 return -ENOMEM;
1930}
1931
1903struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, 1932struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp,
1904 enum fc_class class, 1933 enum fc_class class,
1905 u16 min_xid, u16 max_xid, 1934 u16 min_xid, u16 max_xid,