File tree Expand file tree Collapse file tree 2 files changed +30
-18
lines changed
drivers/infiniband/sw/rdmavt Expand file tree Collapse file tree 2 files changed +30
-18
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ int rvt_check_ah(struct ib_device *ibdev,
83
83
!(ah_attr -> ah_flags & IB_AH_GRH ))
84
84
return - EINVAL ;
85
85
}
86
- if (rdi -> driver_f .check_ah ( ibdev , ah_attr ) )
87
- return - EINVAL ;
86
+ if (rdi -> driver_f .check_ah )
87
+ return rdi -> driver_f . check_ah ( ibdev , ah_attr ) ;
88
88
return 0 ;
89
89
}
90
90
EXPORT_SYMBOL (rvt_check_ah );
@@ -123,6 +123,9 @@ struct ib_ah *rvt_create_ah(struct ib_pd *pd,
123
123
ah -> attr = * ah_attr ;
124
124
atomic_set (& ah -> refcount , 0 );
125
125
126
+ if (dev -> driver_f .notify_new_ah )
127
+ dev -> driver_f .notify_new_ah (pd -> device , ah_attr , ah );
128
+
126
129
return & ah -> ibah ;
127
130
}
128
131
Original file line number Diff line number Diff line change @@ -467,9 +467,21 @@ struct rvt_driver_params {
467
467
int nports ;
468
468
};
469
469
470
- /*
471
- * Functions that drivers are required to support
472
- */
470
+ /* Protection domain */
471
+ struct rvt_pd {
472
+ struct ib_pd ibpd ;
473
+ int user ; /* non-zero if created from user space */
474
+ };
475
+
476
+ /* Address handle */
477
+ struct rvt_ah {
478
+ struct ib_ah ibah ;
479
+ struct ib_ah_attr attr ;
480
+ atomic_t refcount ;
481
+ u8 vl ;
482
+ u8 log_pmtu ;
483
+ };
484
+
473
485
struct rvt_dev_info ;
474
486
struct rvt_driver_provided {
475
487
/*
@@ -478,23 +490,20 @@ struct rvt_driver_provided {
478
490
* instead drivers are responsible for setting the correct callback for
479
491
* this.
480
492
*/
493
+
494
+ /* -------------------*/
495
+ /* Required functions */
496
+ /* -------------------*/
481
497
int (* port_callback )(struct ib_device * , u8 , struct kobject * );
482
498
const char * (* get_card_name )(struct rvt_dev_info * rdi );
483
499
struct pci_dev * (* get_pci_dev )(struct rvt_dev_info * rdi );
484
- int (* check_ah )(struct ib_device * , struct ib_ah_attr * );
485
- };
486
500
487
- /* Protection domain */
488
- struct rvt_pd {
489
- struct ib_pd ibpd ;
490
- int user ; /* non-zero if created from user space */
491
- };
492
-
493
- /* Address handle */
494
- struct rvt_ah {
495
- struct ib_ah ibah ;
496
- struct ib_ah_attr attr ;
497
- atomic_t refcount ;
501
+ /*--------------------*/
502
+ /* Optional functions */
503
+ /*--------------------*/
504
+ int (* check_ah )(struct ib_device * , struct ib_ah_attr * );
505
+ void (* notify_new_ah )(struct ib_device * , struct ib_ah_attr * ,
506
+ struct rvt_ah * );
498
507
};
499
508
500
509
struct rvt_dev_info {
You can’t perform that action at this time.
0 commit comments