diff options
author | Michael J. Ruhl <michael.j.ruhl@intel.com> | 2017-05-04 08:14:39 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-05-04 19:31:46 -0400 |
commit | f4cd876529194b2d3f653c645ba203688e9e4ba3 (patch) | |
tree | fdbaf7a8996b996e7b8e005c5a7c67c90dd41194 /drivers/infiniband | |
parent | 224d71f910102c966cdcd782c97e096d5e26e4da (diff) |
IB/hfi1: Name function prototype parameters
To improve the readability of function prototypes, give the parameters
names.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/hfi1/chip.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/chip.h | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/driver.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/file_ops.c | 54 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/hfi.h | 72 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/init.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_exp_rcv.c | 30 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_exp_rcv.h | 12 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_sdma.c | 62 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_sdma.h | 13 |
10 files changed, 143 insertions, 120 deletions
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index c96bb3a0c788..5aa95dac7c4f 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c | |||
@@ -1055,7 +1055,7 @@ static void handle_pio_err(struct hfi1_devdata *dd, u32 unused, u64 reg); | |||
1055 | static void handle_sdma_err(struct hfi1_devdata *dd, u32 unused, u64 reg); | 1055 | static void handle_sdma_err(struct hfi1_devdata *dd, u32 unused, u64 reg); |
1056 | static void handle_egress_err(struct hfi1_devdata *dd, u32 unused, u64 reg); | 1056 | static void handle_egress_err(struct hfi1_devdata *dd, u32 unused, u64 reg); |
1057 | static void handle_txe_err(struct hfi1_devdata *dd, u32 unused, u64 reg); | 1057 | static void handle_txe_err(struct hfi1_devdata *dd, u32 unused, u64 reg); |
1058 | static void set_partition_keys(struct hfi1_pportdata *); | 1058 | static void set_partition_keys(struct hfi1_pportdata *ppd); |
1059 | static const char *link_state_name(u32 state); | 1059 | static const char *link_state_name(u32 state); |
1060 | static const char *link_state_reason_name(struct hfi1_pportdata *ppd, | 1060 | static const char *link_state_reason_name(struct hfi1_pportdata *ppd, |
1061 | u32 state); | 1061 | u32 state); |
@@ -1068,9 +1068,9 @@ static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state, | |||
1068 | int msecs); | 1068 | int msecs); |
1069 | static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc); | 1069 | static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc); |
1070 | static void read_link_down_reason(struct hfi1_devdata *dd, u8 *ldr); | 1070 | static void read_link_down_reason(struct hfi1_devdata *dd, u8 *ldr); |
1071 | static void handle_temp_err(struct hfi1_devdata *); | 1071 | static void handle_temp_err(struct hfi1_devdata *dd); |
1072 | static void dc_shutdown(struct hfi1_devdata *); | 1072 | static void dc_shutdown(struct hfi1_devdata *dd); |
1073 | static void dc_start(struct hfi1_devdata *); | 1073 | static void dc_start(struct hfi1_devdata *dd); |
1074 | static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp, | 1074 | static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp, |
1075 | unsigned int *np); | 1075 | unsigned int *np); |
1076 | static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd); | 1076 | static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd); |
diff --git a/drivers/infiniband/hw/hfi1/chip.h b/drivers/infiniband/hw/hfi1/chip.h index b9dbf16d7703..4c3c88d7ec65 100644 --- a/drivers/infiniband/hw/hfi1/chip.h +++ b/drivers/infiniband/hw/hfi1/chip.h | |||
@@ -636,7 +636,8 @@ static inline void write_uctxt_csr(struct hfi1_devdata *dd, int ctxt, | |||
636 | write_csr(dd, offset0 + (0x1000 * ctxt), value); | 636 | write_csr(dd, offset0 + (0x1000 * ctxt), value); |
637 | } | 637 | } |
638 | 638 | ||
639 | u64 create_pbc(struct hfi1_pportdata *ppd, u64, int, u32, u32); | 639 | u64 create_pbc(struct hfi1_pportdata *ppd, u64 flags, int srate_mbs, u32 vl, |
640 | u32 dw_len); | ||
640 | 641 | ||
641 | /* firmware.c */ | 642 | /* firmware.c */ |
642 | #define SBUS_MASTER_BROADCAST 0xfd | 643 | #define SBUS_MASTER_BROADCAST 0xfd |
@@ -728,7 +729,8 @@ int bringup_serdes(struct hfi1_pportdata *ppd); | |||
728 | void set_intr_state(struct hfi1_devdata *dd, u32 enable); | 729 | void set_intr_state(struct hfi1_devdata *dd, u32 enable); |
729 | void apply_link_downgrade_policy(struct hfi1_pportdata *ppd, | 730 | void apply_link_downgrade_policy(struct hfi1_pportdata *ppd, |
730 | int refresh_widths); | 731 | int refresh_widths); |
731 | void update_usrhead(struct hfi1_ctxtdata *, u32, u32, u32, u32, u32); | 732 | void update_usrhead(struct hfi1_ctxtdata *rcd, u32 hd, u32 updegr, u32 egrhd, |
733 | u32 intr_adjust, u32 npkts); | ||
732 | int stop_drain_data_vls(struct hfi1_devdata *dd); | 734 | int stop_drain_data_vls(struct hfi1_devdata *dd); |
733 | int open_fill_data_vls(struct hfi1_devdata *dd); | 735 | int open_fill_data_vls(struct hfi1_devdata *dd); |
734 | u32 ns_to_cclock(struct hfi1_devdata *dd, u32 ns); | 736 | u32 ns_to_cclock(struct hfi1_devdata *dd, u32 ns); |
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index 527895487175..fb319d2a579e 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c | |||
@@ -85,8 +85,8 @@ module_param_named(cu, hfi1_cu, uint, S_IRUGO); | |||
85 | MODULE_PARM_DESC(cu, "Credit return units"); | 85 | MODULE_PARM_DESC(cu, "Credit return units"); |
86 | 86 | ||
87 | unsigned long hfi1_cap_mask = HFI1_CAP_MASK_DEFAULT; | 87 | unsigned long hfi1_cap_mask = HFI1_CAP_MASK_DEFAULT; |
88 | static int hfi1_caps_set(const char *, const struct kernel_param *); | 88 | static int hfi1_caps_set(const char *val, const struct kernel_param *kp); |
89 | static int hfi1_caps_get(char *, const struct kernel_param *); | 89 | static int hfi1_caps_get(char *buffer, const struct kernel_param *kp); |
90 | static const struct kernel_param_ops cap_ops = { | 90 | static const struct kernel_param_ops cap_ops = { |
91 | .set = hfi1_caps_set, | 91 | .set = hfi1_caps_set, |
92 | .get = hfi1_caps_get | 92 | .get = hfi1_caps_get |
diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c index afdf3ef8c069..0b77283078e5 100644 --- a/drivers/infiniband/hw/hfi1/file_ops.c +++ b/drivers/infiniband/hw/hfi1/file_ops.c | |||
@@ -70,30 +70,36 @@ | |||
70 | /* | 70 | /* |
71 | * File operation functions | 71 | * File operation functions |
72 | */ | 72 | */ |
73 | static int hfi1_file_open(struct inode *, struct file *); | 73 | static int hfi1_file_open(struct inode *inode, struct file *fp); |
74 | static int hfi1_file_close(struct inode *, struct file *); | 74 | static int hfi1_file_close(struct inode *inode, struct file *fp); |
75 | static ssize_t hfi1_write_iter(struct kiocb *, struct iov_iter *); | 75 | static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from); |
76 | static unsigned int hfi1_poll(struct file *, struct poll_table_struct *); | 76 | static unsigned int hfi1_poll(struct file *fp, struct poll_table_struct *pt); |
77 | static int hfi1_file_mmap(struct file *, struct vm_area_struct *); | 77 | static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma); |
78 | 78 | ||
79 | static u64 kvirt_to_phys(void *); | 79 | static u64 kvirt_to_phys(void *addr); |
80 | static int assign_ctxt(struct file *, struct hfi1_user_info *); | 80 | static int assign_ctxt(struct file *fp, struct hfi1_user_info *uinfo); |
81 | static int init_subctxts(struct hfi1_ctxtdata *, const struct hfi1_user_info *); | 81 | static int init_subctxts(struct hfi1_ctxtdata *uctxt, |
82 | static int user_init(struct file *); | 82 | const struct hfi1_user_info *uinfo); |
83 | static int get_ctxt_info(struct file *, void __user *, __u32); | 83 | static int user_init(struct file *fp); |
84 | static int get_base_info(struct file *, void __user *, __u32); | 84 | static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len); |
85 | static int setup_ctxt(struct file *); | 85 | static int get_base_info(struct file *fp, void __user *ubase, __u32 len); |
86 | static int setup_subctxt(struct hfi1_ctxtdata *); | 86 | static int setup_ctxt(struct file *fp); |
87 | static int get_user_context(struct file *, struct hfi1_user_info *, int); | 87 | static int setup_subctxt(struct hfi1_ctxtdata *uctxt); |
88 | static int find_shared_ctxt(struct file *, const struct hfi1_user_info *); | 88 | static int get_user_context(struct file *fp, struct hfi1_user_info *uinfo, |
89 | static int allocate_ctxt(struct file *, struct hfi1_devdata *, | 89 | int devno); |
90 | struct hfi1_user_info *); | 90 | static int find_shared_ctxt(struct file *fp, |
91 | static unsigned int poll_urgent(struct file *, struct poll_table_struct *); | 91 | const struct hfi1_user_info *uinfo); |
92 | static unsigned int poll_next(struct file *, struct poll_table_struct *); | 92 | static int allocate_ctxt(struct file *fp, struct hfi1_devdata *dd, |
93 | static int user_event_ack(struct hfi1_ctxtdata *, int, unsigned long); | 93 | struct hfi1_user_info *uinfo); |
94 | static int set_ctxt_pkey(struct hfi1_ctxtdata *, unsigned, u16); | 94 | static unsigned int poll_urgent(struct file *fp, struct poll_table_struct *pt); |
95 | static int manage_rcvq(struct hfi1_ctxtdata *, unsigned, int); | 95 | static unsigned int poll_next(struct file *fp, struct poll_table_struct *pt); |
96 | static int vma_fault(struct vm_fault *); | 96 | static int user_event_ack(struct hfi1_ctxtdata *uctxt, int subctxt, |
97 | unsigned long events); | ||
98 | static int set_ctxt_pkey(struct hfi1_ctxtdata *uctxt, unsigned subctxt, | ||
99 | u16 pkey); | ||
100 | static int manage_rcvq(struct hfi1_ctxtdata *uctxt, unsigned subctxt, | ||
101 | int start_stop); | ||
102 | static int vma_fault(struct vm_fault *vmf); | ||
97 | static long hfi1_file_ioctl(struct file *fp, unsigned int cmd, | 103 | static long hfi1_file_ioctl(struct file *fp, unsigned int cmd, |
98 | unsigned long arg); | 104 | unsigned long arg); |
99 | 105 | ||
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index f06674317abf..a1e9b8b55c0a 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h | |||
@@ -1263,27 +1263,28 @@ struct hfi1_devdata *hfi1_lookup(int unit); | |||
1263 | extern u32 hfi1_cpulist_count; | 1263 | extern u32 hfi1_cpulist_count; |
1264 | extern unsigned long *hfi1_cpulist; | 1264 | extern unsigned long *hfi1_cpulist; |
1265 | 1265 | ||
1266 | int hfi1_init(struct hfi1_devdata *, int); | 1266 | int hfi1_init(struct hfi1_devdata *dd, int reinit); |
1267 | int hfi1_count_units(int *npresentp, int *nupp); | 1267 | int hfi1_count_units(int *npresentp, int *nupp); |
1268 | int hfi1_count_active_units(void); | 1268 | int hfi1_count_active_units(void); |
1269 | 1269 | ||
1270 | int hfi1_diag_add(struct hfi1_devdata *); | 1270 | int hfi1_diag_add(struct hfi1_devdata *dd); |
1271 | void hfi1_diag_remove(struct hfi1_devdata *); | 1271 | void hfi1_diag_remove(struct hfi1_devdata *dd); |
1272 | void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup); | 1272 | void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup); |
1273 | 1273 | ||
1274 | void handle_user_interrupt(struct hfi1_ctxtdata *rcd); | 1274 | void handle_user_interrupt(struct hfi1_ctxtdata *rcd); |
1275 | 1275 | ||
1276 | int hfi1_create_rcvhdrq(struct hfi1_devdata *, struct hfi1_ctxtdata *); | 1276 | int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd); |
1277 | int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *); | 1277 | int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd); |
1278 | int hfi1_create_ctxts(struct hfi1_devdata *dd); | 1278 | int hfi1_create_ctxts(struct hfi1_devdata *dd); |
1279 | struct hfi1_ctxtdata *hfi1_create_ctxtdata(struct hfi1_pportdata *, u32, int); | 1279 | struct hfi1_ctxtdata *hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, u32 ctxt, |
1280 | void hfi1_init_pportdata(struct pci_dev *, struct hfi1_pportdata *, | 1280 | int numa); |
1281 | struct hfi1_devdata *, u8, u8); | 1281 | void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd, |
1282 | void hfi1_free_ctxtdata(struct hfi1_devdata *, struct hfi1_ctxtdata *); | 1282 | struct hfi1_devdata *dd, u8 hw_pidx, u8 port); |
1283 | 1283 | void hfi1_free_ctxtdata(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd); | |
1284 | int handle_receive_interrupt(struct hfi1_ctxtdata *, int); | 1284 | |
1285 | int handle_receive_interrupt_nodma_rtail(struct hfi1_ctxtdata *, int); | 1285 | int handle_receive_interrupt(struct hfi1_ctxtdata *rcd, int thread); |
1286 | int handle_receive_interrupt_dma_rtail(struct hfi1_ctxtdata *, int); | 1286 | int handle_receive_interrupt_nodma_rtail(struct hfi1_ctxtdata *rcd, int thread); |
1287 | int handle_receive_interrupt_dma_rtail(struct hfi1_ctxtdata *rcd, int thread); | ||
1287 | void set_all_slowpath(struct hfi1_devdata *dd); | 1288 | void set_all_slowpath(struct hfi1_devdata *dd); |
1288 | void hfi1_vnic_synchronize_irq(struct hfi1_devdata *dd); | 1289 | void hfi1_vnic_synchronize_irq(struct hfi1_devdata *dd); |
1289 | void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd); | 1290 | void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd); |
@@ -1580,7 +1581,7 @@ bad: | |||
1580 | 1581 | ||
1581 | u32 lrh_max_header_bytes(struct hfi1_devdata *dd); | 1582 | u32 lrh_max_header_bytes(struct hfi1_devdata *dd); |
1582 | int mtu_to_enum(u32 mtu, int default_if_bad); | 1583 | int mtu_to_enum(u32 mtu, int default_if_bad); |
1583 | u16 enum_to_mtu(int); | 1584 | u16 enum_to_mtu(int mtu); |
1584 | static inline int valid_ib_mtu(unsigned int mtu) | 1585 | static inline int valid_ib_mtu(unsigned int mtu) |
1585 | { | 1586 | { |
1586 | return mtu == 256 || mtu == 512 || | 1587 | return mtu == 256 || mtu == 512 || |
@@ -1594,15 +1595,15 @@ static inline int valid_opa_max_mtu(unsigned int mtu) | |||
1594 | (valid_ib_mtu(mtu) || mtu == 8192 || mtu == 10240); | 1595 | (valid_ib_mtu(mtu) || mtu == 8192 || mtu == 10240); |
1595 | } | 1596 | } |
1596 | 1597 | ||
1597 | int set_mtu(struct hfi1_pportdata *); | 1598 | int set_mtu(struct hfi1_pportdata *ppd); |
1598 | 1599 | ||
1599 | int hfi1_set_lid(struct hfi1_pportdata *, u32, u8); | 1600 | int hfi1_set_lid(struct hfi1_pportdata *ppd, u32 lid, u8 lmc); |
1600 | void hfi1_disable_after_error(struct hfi1_devdata *); | 1601 | void hfi1_disable_after_error(struct hfi1_devdata *dd); |
1601 | int hfi1_set_uevent_bits(struct hfi1_pportdata *, const int); | 1602 | int hfi1_set_uevent_bits(struct hfi1_pportdata *ppd, const int evtbit); |
1602 | int hfi1_rcvbuf_validate(u32, u8, u16 *); | 1603 | int hfi1_rcvbuf_validate(u32 size, u8 type, u16 *encode); |
1603 | 1604 | ||
1604 | int fm_get_table(struct hfi1_pportdata *, int, void *); | 1605 | int fm_get_table(struct hfi1_pportdata *ppd, int which, void *t); |
1605 | int fm_set_table(struct hfi1_pportdata *, int, void *); | 1606 | int fm_set_table(struct hfi1_pportdata *ppd, int which, void *t); |
1606 | 1607 | ||
1607 | void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf); | 1608 | void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf); |
1608 | void reset_link_credits(struct hfi1_devdata *dd); | 1609 | void reset_link_credits(struct hfi1_devdata *dd); |
@@ -1734,9 +1735,9 @@ struct cc_state *get_cc_state_protected(struct hfi1_pportdata *ppd) | |||
1734 | #define HFI1_CTXT_WAITING_URG 5 | 1735 | #define HFI1_CTXT_WAITING_URG 5 |
1735 | 1736 | ||
1736 | /* free up any allocated data at closes */ | 1737 | /* free up any allocated data at closes */ |
1737 | struct hfi1_devdata *hfi1_init_dd(struct pci_dev *, | 1738 | struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev, |
1738 | const struct pci_device_id *); | 1739 | const struct pci_device_id *ent); |
1739 | void hfi1_free_devdata(struct hfi1_devdata *); | 1740 | void hfi1_free_devdata(struct hfi1_devdata *dd); |
1740 | struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra); | 1741 | struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra); |
1741 | 1742 | ||
1742 | /* LED beaconing functions */ | 1743 | /* LED beaconing functions */ |
@@ -1811,24 +1812,25 @@ static inline u32 get_rcvhdrtail(const struct hfi1_ctxtdata *rcd) | |||
1811 | 1812 | ||
1812 | extern const char ib_hfi1_version[]; | 1813 | extern const char ib_hfi1_version[]; |
1813 | 1814 | ||
1814 | int hfi1_device_create(struct hfi1_devdata *); | 1815 | int hfi1_device_create(struct hfi1_devdata *dd); |
1815 | void hfi1_device_remove(struct hfi1_devdata *); | 1816 | void hfi1_device_remove(struct hfi1_devdata *dd); |
1816 | 1817 | ||
1817 | int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num, | 1818 | int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num, |
1818 | struct kobject *kobj); | 1819 | struct kobject *kobj); |
1819 | int hfi1_verbs_register_sysfs(struct hfi1_devdata *); | 1820 | int hfi1_verbs_register_sysfs(struct hfi1_devdata *dd); |
1820 | void hfi1_verbs_unregister_sysfs(struct hfi1_devdata *); | 1821 | void hfi1_verbs_unregister_sysfs(struct hfi1_devdata *dd); |
1821 | /* Hook for sysfs read of QSFP */ | 1822 | /* Hook for sysfs read of QSFP */ |
1822 | int qsfp_dump(struct hfi1_pportdata *ppd, char *buf, int len); | 1823 | int qsfp_dump(struct hfi1_pportdata *ppd, char *buf, int len); |
1823 | 1824 | ||
1824 | int hfi1_pcie_init(struct pci_dev *, const struct pci_device_id *); | 1825 | int hfi1_pcie_init(struct pci_dev *pdev, const struct pci_device_id *ent); |
1825 | void hfi1_pcie_cleanup(struct pci_dev *); | 1826 | void hfi1_pcie_cleanup(struct pci_dev *pdev); |
1826 | int hfi1_pcie_ddinit(struct hfi1_devdata *, struct pci_dev *); | 1827 | int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev); |
1827 | void hfi1_pcie_ddcleanup(struct hfi1_devdata *); | 1828 | void hfi1_pcie_ddcleanup(struct hfi1_devdata *); |
1828 | void hfi1_pcie_flr(struct hfi1_devdata *); | 1829 | void hfi1_pcie_flr(struct hfi1_devdata *dd); |
1829 | int pcie_speeds(struct hfi1_devdata *); | 1830 | int pcie_speeds(struct hfi1_devdata *dd); |
1830 | void request_msix(struct hfi1_devdata *, u32 *, struct hfi1_msix_entry *); | 1831 | void request_msix(struct hfi1_devdata *dd, u32 *nent, |
1831 | void hfi1_enable_intx(struct pci_dev *); | 1832 | struct hfi1_msix_entry *entry); |
1833 | void hfi1_enable_intx(struct pci_dev *pdev); | ||
1832 | void restore_pci_variables(struct hfi1_devdata *dd); | 1834 | void restore_pci_variables(struct hfi1_devdata *dd); |
1833 | int do_pcie_gen3_transition(struct hfi1_devdata *dd); | 1835 | int do_pcie_gen3_transition(struct hfi1_devdata *dd); |
1834 | int parse_platform_config(struct hfi1_devdata *dd); | 1836 | int parse_platform_config(struct hfi1_devdata *dd); |
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index b2db77626fc5..e872644b0f10 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c | |||
@@ -118,7 +118,7 @@ unsigned int user_credit_return_threshold = 33; /* default is 33% */ | |||
118 | module_param(user_credit_return_threshold, uint, S_IRUGO); | 118 | module_param(user_credit_return_threshold, uint, S_IRUGO); |
119 | MODULE_PARM_DESC(user_credit_return_threshold, "Credit return threshold for user send contexts, return when unreturned credits passes this many blocks (in percent of allocated blocks, 0 is off)"); | 119 | MODULE_PARM_DESC(user_credit_return_threshold, "Credit return threshold for user send contexts, return when unreturned credits passes this many blocks (in percent of allocated blocks, 0 is off)"); |
120 | 120 | ||
121 | static inline u64 encode_rcv_header_entry_size(u16); | 121 | static inline u64 encode_rcv_header_entry_size(u16 size); |
122 | 122 | ||
123 | static struct idr hfi1_unit_table; | 123 | static struct idr hfi1_unit_table; |
124 | u32 hfi1_cpulist_count; | 124 | u32 hfi1_cpulist_count; |
diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c index c7f13df471c4..6090933d5171 100644 --- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c +++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c | |||
@@ -82,20 +82,26 @@ struct tid_pageset { | |||
82 | (unsigned long)(len) - 1) & PAGE_MASK) - \ | 82 | (unsigned long)(len) - 1) & PAGE_MASK) - \ |
83 | ((unsigned long)vaddr & PAGE_MASK)) >> PAGE_SHIFT)) | 83 | ((unsigned long)vaddr & PAGE_MASK)) >> PAGE_SHIFT)) |
84 | 84 | ||
85 | static void unlock_exp_tids(struct hfi1_ctxtdata *, struct exp_tid_set *, | 85 | static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt, |
86 | struct hfi1_filedata *); | 86 | struct exp_tid_set *set, |
87 | static u32 find_phys_blocks(struct page **, unsigned, struct tid_pageset *); | 87 | struct hfi1_filedata *fd); |
88 | static int set_rcvarray_entry(struct file *, unsigned long, u32, | 88 | static u32 find_phys_blocks(struct page **pages, unsigned npages, |
89 | struct tid_group *, struct page **, unsigned); | 89 | struct tid_pageset *list); |
90 | static int tid_rb_insert(void *, struct mmu_rb_node *); | 90 | static int set_rcvarray_entry(struct file *fp, unsigned long vaddr, |
91 | u32 rcventry, struct tid_group *grp, | ||
92 | struct page **pages, unsigned npages); | ||
93 | static int tid_rb_insert(void *arg, struct mmu_rb_node *node); | ||
91 | static void cacheless_tid_rb_remove(struct hfi1_filedata *fdata, | 94 | static void cacheless_tid_rb_remove(struct hfi1_filedata *fdata, |
92 | struct tid_rb_node *tnode); | 95 | struct tid_rb_node *tnode); |
93 | static void tid_rb_remove(void *, struct mmu_rb_node *); | 96 | static void tid_rb_remove(void *arg, struct mmu_rb_node *node); |
94 | static int tid_rb_invalidate(void *, struct mmu_rb_node *); | 97 | static int tid_rb_invalidate(void *arg, struct mmu_rb_node *mnode); |
95 | static int program_rcvarray(struct file *, unsigned long, struct tid_group *, | 98 | static int program_rcvarray(struct file *fp, unsigned long vaddr, |
96 | struct tid_pageset *, unsigned, u16, struct page **, | 99 | struct tid_group *grp, |
97 | u32 *, unsigned *, unsigned *); | 100 | struct tid_pageset *sets, |
98 | static int unprogram_rcvarray(struct file *, u32, struct tid_group **); | 101 | unsigned start, u16 count, struct page **pages, |
102 | u32 *tidlist, unsigned *tididx, unsigned *pmapped); | ||
103 | static int unprogram_rcvarray(struct file *fp, u32 tidinfo, | ||
104 | struct tid_group **grp); | ||
99 | static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); | 105 | static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); |
100 | 106 | ||
101 | static struct mmu_rb_ops tid_rb_ops = { | 107 | static struct mmu_rb_ops tid_rb_ops = { |
diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.h b/drivers/infiniband/hw/hfi1/user_exp_rcv.h index d1d7d3d3bd44..8a33a09493b1 100644 --- a/drivers/infiniband/hw/hfi1/user_exp_rcv.h +++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _HFI1_USER_EXP_RCV_H | 1 | #ifndef _HFI1_USER_EXP_RCV_H |
2 | #define _HFI1_USER_EXP_RCV_H | 2 | #define _HFI1_USER_EXP_RCV_H |
3 | /* | 3 | /* |
4 | * Copyright(c) 2015, 2016 Intel Corporation. | 4 | * Copyright(c) 2015 - 2017 Intel Corporation. |
5 | * | 5 | * |
6 | * This file is provided under a dual BSD/GPLv2 license. When using or | 6 | * This file is provided under a dual BSD/GPLv2 license. When using or |
7 | * redistributing this file, you may do so under either license. | 7 | * redistributing this file, you may do so under either license. |
@@ -71,10 +71,10 @@ | |||
71 | } while (0) | 71 | } while (0) |
72 | 72 | ||
73 | void hfi1_user_exp_rcv_grp_free(struct hfi1_ctxtdata *uctxt); | 73 | void hfi1_user_exp_rcv_grp_free(struct hfi1_ctxtdata *uctxt); |
74 | int hfi1_user_exp_rcv_init(struct file *); | 74 | int hfi1_user_exp_rcv_init(struct file *fp); |
75 | int hfi1_user_exp_rcv_free(struct hfi1_filedata *); | 75 | int hfi1_user_exp_rcv_free(struct hfi1_filedata *fd); |
76 | int hfi1_user_exp_rcv_setup(struct file *, struct hfi1_tid_info *); | 76 | int hfi1_user_exp_rcv_setup(struct file *fp, struct hfi1_tid_info *tinfo); |
77 | int hfi1_user_exp_rcv_clear(struct file *, struct hfi1_tid_info *); | 77 | int hfi1_user_exp_rcv_clear(struct file *fp, struct hfi1_tid_info *tinfo); |
78 | int hfi1_user_exp_rcv_invalid(struct file *, struct hfi1_tid_info *); | 78 | int hfi1_user_exp_rcv_invalid(struct file *fp, struct hfi1_tid_info *tinfo); |
79 | 79 | ||
80 | #endif /* _HFI1_USER_EXP_RCV_H */ | 80 | #endif /* _HFI1_USER_EXP_RCV_H */ |
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index 8adb6dfeb2eb..17142c526c62 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright(c) 2015, 2016 Intel Corporation. | 2 | * Copyright(c) 2015 - 2017 Intel Corporation. |
3 | * | 3 | * |
4 | * This file is provided under a dual BSD/GPLv2 license. When using or | 4 | * This file is provided under a dual BSD/GPLv2 license. When using or |
5 | * redistributing this file, you may do so under either license. | 5 | * redistributing this file, you may do so under either license. |
@@ -280,39 +280,43 @@ struct user_sdma_txreq { | |||
280 | hfi1_cdbg(SDMA, "[%u:%u:%u] " fmt, (pq)->dd->unit, (pq)->ctxt, \ | 280 | hfi1_cdbg(SDMA, "[%u:%u:%u] " fmt, (pq)->dd->unit, (pq)->ctxt, \ |
281 | (pq)->subctxt, ##__VA_ARGS__) | 281 | (pq)->subctxt, ##__VA_ARGS__) |
282 | 282 | ||
283 | static int user_sdma_send_pkts(struct user_sdma_request *, unsigned); | 283 | static int user_sdma_send_pkts(struct user_sdma_request *req, |
284 | static int num_user_pages(const struct iovec *); | 284 | unsigned maxpkts); |
285 | static void user_sdma_txreq_cb(struct sdma_txreq *, int); | 285 | static int num_user_pages(const struct iovec *iov); |
286 | static inline void pq_update(struct hfi1_user_sdma_pkt_q *); | 286 | static void user_sdma_txreq_cb(struct sdma_txreq *txreq, int status); |
287 | static void user_sdma_free_request(struct user_sdma_request *, bool); | 287 | static inline void pq_update(struct hfi1_user_sdma_pkt_q *pq); |
288 | static int pin_vector_pages(struct user_sdma_request *, | 288 | static void user_sdma_free_request(struct user_sdma_request *req, bool unpin); |
289 | struct user_sdma_iovec *); | 289 | static int pin_vector_pages(struct user_sdma_request *req, |
290 | static void unpin_vector_pages(struct mm_struct *, struct page **, unsigned, | 290 | struct user_sdma_iovec *iovec); |
291 | unsigned); | 291 | static void unpin_vector_pages(struct mm_struct *mm, struct page **pages, |
292 | static int check_header_template(struct user_sdma_request *, | 292 | unsigned start, unsigned npages); |
293 | struct hfi1_pkt_header *, u32, u32); | 293 | static int check_header_template(struct user_sdma_request *req, |
294 | static int set_txreq_header(struct user_sdma_request *, | 294 | struct hfi1_pkt_header *hdr, u32 lrhlen, |
295 | struct user_sdma_txreq *, u32); | 295 | u32 datalen); |
296 | static int set_txreq_header_ahg(struct user_sdma_request *, | 296 | static int set_txreq_header(struct user_sdma_request *req, |
297 | struct user_sdma_txreq *, u32); | 297 | struct user_sdma_txreq *tx, u32 datalen); |
298 | static inline void set_comp_state(struct hfi1_user_sdma_pkt_q *, | 298 | static int set_txreq_header_ahg(struct user_sdma_request *req, |
299 | struct hfi1_user_sdma_comp_q *, | 299 | struct user_sdma_txreq *tx, u32 len); |
300 | u16, enum hfi1_sdma_comp_state, int); | 300 | static inline void set_comp_state(struct hfi1_user_sdma_pkt_q *pq, |
301 | static inline u32 set_pkt_bth_psn(__be32, u8, u32); | 301 | struct hfi1_user_sdma_comp_q *cq, |
302 | u16 idx, enum hfi1_sdma_comp_state state, | ||
303 | int ret); | ||
304 | static inline u32 set_pkt_bth_psn(__be32 bthpsn, u8 expct, u32 frags); | ||
302 | static inline u32 get_lrh_len(struct hfi1_pkt_header, u32 len); | 305 | static inline u32 get_lrh_len(struct hfi1_pkt_header, u32 len); |
303 | 306 | ||
304 | static int defer_packet_queue( | 307 | static int defer_packet_queue( |
305 | struct sdma_engine *, | 308 | struct sdma_engine *sde, |
306 | struct iowait *, | 309 | struct iowait *wait, |
307 | struct sdma_txreq *, | 310 | struct sdma_txreq *txreq, |
308 | unsigned seq); | 311 | unsigned int seq); |
309 | static void activate_packet_queue(struct iowait *, int); | 312 | static void activate_packet_queue(struct iowait *wait, int reason); |
310 | static bool sdma_rb_filter(struct mmu_rb_node *, unsigned long, unsigned long); | 313 | static bool sdma_rb_filter(struct mmu_rb_node *node, unsigned long addr, |
311 | static int sdma_rb_insert(void *, struct mmu_rb_node *); | 314 | unsigned long len); |
315 | static int sdma_rb_insert(void *arg, struct mmu_rb_node *mnode); | ||
312 | static int sdma_rb_evict(void *arg, struct mmu_rb_node *mnode, | 316 | static int sdma_rb_evict(void *arg, struct mmu_rb_node *mnode, |
313 | void *arg2, bool *stop); | 317 | void *arg2, bool *stop); |
314 | static void sdma_rb_remove(void *, struct mmu_rb_node *); | 318 | static void sdma_rb_remove(void *arg, struct mmu_rb_node *mnode); |
315 | static int sdma_rb_invalidate(void *, struct mmu_rb_node *); | 319 | static int sdma_rb_invalidate(void *arg, struct mmu_rb_node *mnode); |
316 | 320 | ||
317 | static struct mmu_rb_ops sdma_rb_ops = { | 321 | static struct mmu_rb_ops sdma_rb_ops = { |
318 | .filter = sdma_rb_filter, | 322 | .filter = sdma_rb_filter, |
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.h b/drivers/infiniband/hw/hfi1/user_sdma.h index 39001714f551..95ec7832e5e9 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.h +++ b/drivers/infiniband/hw/hfi1/user_sdma.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef _HFI1_USER_SDMA_H | ||
2 | #define _HFI1_USER_SDMA_H | ||
1 | /* | 3 | /* |
2 | * Copyright(c) 2015, 2016 Intel Corporation. | 4 | * Copyright(c) 2015 - 2017 Intel Corporation. |
3 | * | 5 | * |
4 | * This file is provided under a dual BSD/GPLv2 license. When using or | 6 | * This file is provided under a dual BSD/GPLv2 license. When using or |
5 | * redistributing this file, you may do so under either license. | 7 | * redistributing this file, you may do so under either license. |
@@ -78,7 +80,8 @@ struct hfi1_user_sdma_comp_q { | |||
78 | struct hfi1_sdma_comp_entry *comps; | 80 | struct hfi1_sdma_comp_entry *comps; |
79 | }; | 81 | }; |
80 | 82 | ||
81 | int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *, struct file *); | 83 | int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp); |
82 | int hfi1_user_sdma_free_queues(struct hfi1_filedata *); | 84 | int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd); |
83 | int hfi1_user_sdma_process_request(struct file *, struct iovec *, unsigned long, | 85 | int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec, |
84 | unsigned long *); | 86 | unsigned long dim, unsigned long *count); |
87 | #endif /* _HFI1_USER_SDMA_H */ | ||