summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMichael J. Ruhl <michael.j.ruhl@intel.com>2017-05-04 08:14:39 -0400
committerDoug Ledford <dledford@redhat.com>2017-05-04 19:31:46 -0400
commitf4cd876529194b2d3f653c645ba203688e9e4ba3 (patch)
treefdbaf7a8996b996e7b8e005c5a7c67c90dd41194 /drivers/infiniband
parent224d71f910102c966cdcd782c97e096d5e26e4da (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.c8
-rw-r--r--drivers/infiniband/hw/hfi1/chip.h6
-rw-r--r--drivers/infiniband/hw/hfi1/driver.c4
-rw-r--r--drivers/infiniband/hw/hfi1/file_ops.c54
-rw-r--r--drivers/infiniband/hw/hfi1/hfi.h72
-rw-r--r--drivers/infiniband/hw/hfi1/init.c2
-rw-r--r--drivers/infiniband/hw/hfi1/user_exp_rcv.c30
-rw-r--r--drivers/infiniband/hw/hfi1/user_exp_rcv.h12
-rw-r--r--drivers/infiniband/hw/hfi1/user_sdma.c62
-rw-r--r--drivers/infiniband/hw/hfi1/user_sdma.h13
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);
1055static void handle_sdma_err(struct hfi1_devdata *dd, u32 unused, u64 reg); 1055static void handle_sdma_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
1056static void handle_egress_err(struct hfi1_devdata *dd, u32 unused, u64 reg); 1056static void handle_egress_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
1057static void handle_txe_err(struct hfi1_devdata *dd, u32 unused, u64 reg); 1057static void handle_txe_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
1058static void set_partition_keys(struct hfi1_pportdata *); 1058static void set_partition_keys(struct hfi1_pportdata *ppd);
1059static const char *link_state_name(u32 state); 1059static const char *link_state_name(u32 state);
1060static const char *link_state_reason_name(struct hfi1_pportdata *ppd, 1060static 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);
1069static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc); 1069static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc);
1070static void read_link_down_reason(struct hfi1_devdata *dd, u8 *ldr); 1070static void read_link_down_reason(struct hfi1_devdata *dd, u8 *ldr);
1071static void handle_temp_err(struct hfi1_devdata *); 1071static void handle_temp_err(struct hfi1_devdata *dd);
1072static void dc_shutdown(struct hfi1_devdata *); 1072static void dc_shutdown(struct hfi1_devdata *dd);
1073static void dc_start(struct hfi1_devdata *); 1073static void dc_start(struct hfi1_devdata *dd);
1074static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp, 1074static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp,
1075 unsigned int *np); 1075 unsigned int *np);
1076static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd); 1076static 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
639u64 create_pbc(struct hfi1_pportdata *ppd, u64, int, u32, u32); 639u64 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);
728void set_intr_state(struct hfi1_devdata *dd, u32 enable); 729void set_intr_state(struct hfi1_devdata *dd, u32 enable);
729void apply_link_downgrade_policy(struct hfi1_pportdata *ppd, 730void apply_link_downgrade_policy(struct hfi1_pportdata *ppd,
730 int refresh_widths); 731 int refresh_widths);
731void update_usrhead(struct hfi1_ctxtdata *, u32, u32, u32, u32, u32); 732void update_usrhead(struct hfi1_ctxtdata *rcd, u32 hd, u32 updegr, u32 egrhd,
733 u32 intr_adjust, u32 npkts);
732int stop_drain_data_vls(struct hfi1_devdata *dd); 734int stop_drain_data_vls(struct hfi1_devdata *dd);
733int open_fill_data_vls(struct hfi1_devdata *dd); 735int open_fill_data_vls(struct hfi1_devdata *dd);
734u32 ns_to_cclock(struct hfi1_devdata *dd, u32 ns); 736u32 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);
85MODULE_PARM_DESC(cu, "Credit return units"); 85MODULE_PARM_DESC(cu, "Credit return units");
86 86
87unsigned long hfi1_cap_mask = HFI1_CAP_MASK_DEFAULT; 87unsigned long hfi1_cap_mask = HFI1_CAP_MASK_DEFAULT;
88static int hfi1_caps_set(const char *, const struct kernel_param *); 88static int hfi1_caps_set(const char *val, const struct kernel_param *kp);
89static int hfi1_caps_get(char *, const struct kernel_param *); 89static int hfi1_caps_get(char *buffer, const struct kernel_param *kp);
90static const struct kernel_param_ops cap_ops = { 90static 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 */
73static int hfi1_file_open(struct inode *, struct file *); 73static int hfi1_file_open(struct inode *inode, struct file *fp);
74static int hfi1_file_close(struct inode *, struct file *); 74static int hfi1_file_close(struct inode *inode, struct file *fp);
75static ssize_t hfi1_write_iter(struct kiocb *, struct iov_iter *); 75static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from);
76static unsigned int hfi1_poll(struct file *, struct poll_table_struct *); 76static unsigned int hfi1_poll(struct file *fp, struct poll_table_struct *pt);
77static int hfi1_file_mmap(struct file *, struct vm_area_struct *); 77static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma);
78 78
79static u64 kvirt_to_phys(void *); 79static u64 kvirt_to_phys(void *addr);
80static int assign_ctxt(struct file *, struct hfi1_user_info *); 80static int assign_ctxt(struct file *fp, struct hfi1_user_info *uinfo);
81static int init_subctxts(struct hfi1_ctxtdata *, const struct hfi1_user_info *); 81static int init_subctxts(struct hfi1_ctxtdata *uctxt,
82static int user_init(struct file *); 82 const struct hfi1_user_info *uinfo);
83static int get_ctxt_info(struct file *, void __user *, __u32); 83static int user_init(struct file *fp);
84static int get_base_info(struct file *, void __user *, __u32); 84static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len);
85static int setup_ctxt(struct file *); 85static int get_base_info(struct file *fp, void __user *ubase, __u32 len);
86static int setup_subctxt(struct hfi1_ctxtdata *); 86static int setup_ctxt(struct file *fp);
87static int get_user_context(struct file *, struct hfi1_user_info *, int); 87static int setup_subctxt(struct hfi1_ctxtdata *uctxt);
88static int find_shared_ctxt(struct file *, const struct hfi1_user_info *); 88static int get_user_context(struct file *fp, struct hfi1_user_info *uinfo,
89static int allocate_ctxt(struct file *, struct hfi1_devdata *, 89 int devno);
90 struct hfi1_user_info *); 90static int find_shared_ctxt(struct file *fp,
91static unsigned int poll_urgent(struct file *, struct poll_table_struct *); 91 const struct hfi1_user_info *uinfo);
92static unsigned int poll_next(struct file *, struct poll_table_struct *); 92static int allocate_ctxt(struct file *fp, struct hfi1_devdata *dd,
93static int user_event_ack(struct hfi1_ctxtdata *, int, unsigned long); 93 struct hfi1_user_info *uinfo);
94static int set_ctxt_pkey(struct hfi1_ctxtdata *, unsigned, u16); 94static unsigned int poll_urgent(struct file *fp, struct poll_table_struct *pt);
95static int manage_rcvq(struct hfi1_ctxtdata *, unsigned, int); 95static unsigned int poll_next(struct file *fp, struct poll_table_struct *pt);
96static int vma_fault(struct vm_fault *); 96static int user_event_ack(struct hfi1_ctxtdata *uctxt, int subctxt,
97 unsigned long events);
98static int set_ctxt_pkey(struct hfi1_ctxtdata *uctxt, unsigned subctxt,
99 u16 pkey);
100static int manage_rcvq(struct hfi1_ctxtdata *uctxt, unsigned subctxt,
101 int start_stop);
102static int vma_fault(struct vm_fault *vmf);
97static long hfi1_file_ioctl(struct file *fp, unsigned int cmd, 103static 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);
1263extern u32 hfi1_cpulist_count; 1263extern u32 hfi1_cpulist_count;
1264extern unsigned long *hfi1_cpulist; 1264extern unsigned long *hfi1_cpulist;
1265 1265
1266int hfi1_init(struct hfi1_devdata *, int); 1266int hfi1_init(struct hfi1_devdata *dd, int reinit);
1267int hfi1_count_units(int *npresentp, int *nupp); 1267int hfi1_count_units(int *npresentp, int *nupp);
1268int hfi1_count_active_units(void); 1268int hfi1_count_active_units(void);
1269 1269
1270int hfi1_diag_add(struct hfi1_devdata *); 1270int hfi1_diag_add(struct hfi1_devdata *dd);
1271void hfi1_diag_remove(struct hfi1_devdata *); 1271void hfi1_diag_remove(struct hfi1_devdata *dd);
1272void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup); 1272void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup);
1273 1273
1274void handle_user_interrupt(struct hfi1_ctxtdata *rcd); 1274void handle_user_interrupt(struct hfi1_ctxtdata *rcd);
1275 1275
1276int hfi1_create_rcvhdrq(struct hfi1_devdata *, struct hfi1_ctxtdata *); 1276int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd);
1277int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *); 1277int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd);
1278int hfi1_create_ctxts(struct hfi1_devdata *dd); 1278int hfi1_create_ctxts(struct hfi1_devdata *dd);
1279struct hfi1_ctxtdata *hfi1_create_ctxtdata(struct hfi1_pportdata *, u32, int); 1279struct hfi1_ctxtdata *hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, u32 ctxt,
1280void hfi1_init_pportdata(struct pci_dev *, struct hfi1_pportdata *, 1280 int numa);
1281 struct hfi1_devdata *, u8, u8); 1281void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
1282void hfi1_free_ctxtdata(struct hfi1_devdata *, struct hfi1_ctxtdata *); 1282 struct hfi1_devdata *dd, u8 hw_pidx, u8 port);
1283 1283void hfi1_free_ctxtdata(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd);
1284int handle_receive_interrupt(struct hfi1_ctxtdata *, int); 1284
1285int handle_receive_interrupt_nodma_rtail(struct hfi1_ctxtdata *, int); 1285int handle_receive_interrupt(struct hfi1_ctxtdata *rcd, int thread);
1286int handle_receive_interrupt_dma_rtail(struct hfi1_ctxtdata *, int); 1286int handle_receive_interrupt_nodma_rtail(struct hfi1_ctxtdata *rcd, int thread);
1287int handle_receive_interrupt_dma_rtail(struct hfi1_ctxtdata *rcd, int thread);
1287void set_all_slowpath(struct hfi1_devdata *dd); 1288void set_all_slowpath(struct hfi1_devdata *dd);
1288void hfi1_vnic_synchronize_irq(struct hfi1_devdata *dd); 1289void hfi1_vnic_synchronize_irq(struct hfi1_devdata *dd);
1289void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd); 1290void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd);
@@ -1580,7 +1581,7 @@ bad:
1580 1581
1581u32 lrh_max_header_bytes(struct hfi1_devdata *dd); 1582u32 lrh_max_header_bytes(struct hfi1_devdata *dd);
1582int mtu_to_enum(u32 mtu, int default_if_bad); 1583int mtu_to_enum(u32 mtu, int default_if_bad);
1583u16 enum_to_mtu(int); 1584u16 enum_to_mtu(int mtu);
1584static inline int valid_ib_mtu(unsigned int mtu) 1585static 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
1597int set_mtu(struct hfi1_pportdata *); 1598int set_mtu(struct hfi1_pportdata *ppd);
1598 1599
1599int hfi1_set_lid(struct hfi1_pportdata *, u32, u8); 1600int hfi1_set_lid(struct hfi1_pportdata *ppd, u32 lid, u8 lmc);
1600void hfi1_disable_after_error(struct hfi1_devdata *); 1601void hfi1_disable_after_error(struct hfi1_devdata *dd);
1601int hfi1_set_uevent_bits(struct hfi1_pportdata *, const int); 1602int hfi1_set_uevent_bits(struct hfi1_pportdata *ppd, const int evtbit);
1602int hfi1_rcvbuf_validate(u32, u8, u16 *); 1603int hfi1_rcvbuf_validate(u32 size, u8 type, u16 *encode);
1603 1604
1604int fm_get_table(struct hfi1_pportdata *, int, void *); 1605int fm_get_table(struct hfi1_pportdata *ppd, int which, void *t);
1605int fm_set_table(struct hfi1_pportdata *, int, void *); 1606int fm_set_table(struct hfi1_pportdata *ppd, int which, void *t);
1606 1607
1607void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf); 1608void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf);
1608void reset_link_credits(struct hfi1_devdata *dd); 1609void 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 */
1737struct hfi1_devdata *hfi1_init_dd(struct pci_dev *, 1738struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
1738 const struct pci_device_id *); 1739 const struct pci_device_id *ent);
1739void hfi1_free_devdata(struct hfi1_devdata *); 1740void hfi1_free_devdata(struct hfi1_devdata *dd);
1740struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra); 1741struct 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
1812extern const char ib_hfi1_version[]; 1813extern const char ib_hfi1_version[];
1813 1814
1814int hfi1_device_create(struct hfi1_devdata *); 1815int hfi1_device_create(struct hfi1_devdata *dd);
1815void hfi1_device_remove(struct hfi1_devdata *); 1816void hfi1_device_remove(struct hfi1_devdata *dd);
1816 1817
1817int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num, 1818int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num,
1818 struct kobject *kobj); 1819 struct kobject *kobj);
1819int hfi1_verbs_register_sysfs(struct hfi1_devdata *); 1820int hfi1_verbs_register_sysfs(struct hfi1_devdata *dd);
1820void hfi1_verbs_unregister_sysfs(struct hfi1_devdata *); 1821void hfi1_verbs_unregister_sysfs(struct hfi1_devdata *dd);
1821/* Hook for sysfs read of QSFP */ 1822/* Hook for sysfs read of QSFP */
1822int qsfp_dump(struct hfi1_pportdata *ppd, char *buf, int len); 1823int qsfp_dump(struct hfi1_pportdata *ppd, char *buf, int len);
1823 1824
1824int hfi1_pcie_init(struct pci_dev *, const struct pci_device_id *); 1825int hfi1_pcie_init(struct pci_dev *pdev, const struct pci_device_id *ent);
1825void hfi1_pcie_cleanup(struct pci_dev *); 1826void hfi1_pcie_cleanup(struct pci_dev *pdev);
1826int hfi1_pcie_ddinit(struct hfi1_devdata *, struct pci_dev *); 1827int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev);
1827void hfi1_pcie_ddcleanup(struct hfi1_devdata *); 1828void hfi1_pcie_ddcleanup(struct hfi1_devdata *);
1828void hfi1_pcie_flr(struct hfi1_devdata *); 1829void hfi1_pcie_flr(struct hfi1_devdata *dd);
1829int pcie_speeds(struct hfi1_devdata *); 1830int pcie_speeds(struct hfi1_devdata *dd);
1830void request_msix(struct hfi1_devdata *, u32 *, struct hfi1_msix_entry *); 1831void request_msix(struct hfi1_devdata *dd, u32 *nent,
1831void hfi1_enable_intx(struct pci_dev *); 1832 struct hfi1_msix_entry *entry);
1833void hfi1_enable_intx(struct pci_dev *pdev);
1832void restore_pci_variables(struct hfi1_devdata *dd); 1834void restore_pci_variables(struct hfi1_devdata *dd);
1833int do_pcie_gen3_transition(struct hfi1_devdata *dd); 1835int do_pcie_gen3_transition(struct hfi1_devdata *dd);
1834int parse_platform_config(struct hfi1_devdata *dd); 1836int 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% */
118module_param(user_credit_return_threshold, uint, S_IRUGO); 118module_param(user_credit_return_threshold, uint, S_IRUGO);
119MODULE_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)"); 119MODULE_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
121static inline u64 encode_rcv_header_entry_size(u16); 121static inline u64 encode_rcv_header_entry_size(u16 size);
122 122
123static struct idr hfi1_unit_table; 123static struct idr hfi1_unit_table;
124u32 hfi1_cpulist_count; 124u32 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
85static void unlock_exp_tids(struct hfi1_ctxtdata *, struct exp_tid_set *, 85static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt,
86 struct hfi1_filedata *); 86 struct exp_tid_set *set,
87static u32 find_phys_blocks(struct page **, unsigned, struct tid_pageset *); 87 struct hfi1_filedata *fd);
88static int set_rcvarray_entry(struct file *, unsigned long, u32, 88static u32 find_phys_blocks(struct page **pages, unsigned npages,
89 struct tid_group *, struct page **, unsigned); 89 struct tid_pageset *list);
90static int tid_rb_insert(void *, struct mmu_rb_node *); 90static int set_rcvarray_entry(struct file *fp, unsigned long vaddr,
91 u32 rcventry, struct tid_group *grp,
92 struct page **pages, unsigned npages);
93static int tid_rb_insert(void *arg, struct mmu_rb_node *node);
91static void cacheless_tid_rb_remove(struct hfi1_filedata *fdata, 94static void cacheless_tid_rb_remove(struct hfi1_filedata *fdata,
92 struct tid_rb_node *tnode); 95 struct tid_rb_node *tnode);
93static void tid_rb_remove(void *, struct mmu_rb_node *); 96static void tid_rb_remove(void *arg, struct mmu_rb_node *node);
94static int tid_rb_invalidate(void *, struct mmu_rb_node *); 97static int tid_rb_invalidate(void *arg, struct mmu_rb_node *mnode);
95static int program_rcvarray(struct file *, unsigned long, struct tid_group *, 98static 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,
98static int unprogram_rcvarray(struct file *, u32, struct tid_group **); 101 unsigned start, u16 count, struct page **pages,
102 u32 *tidlist, unsigned *tididx, unsigned *pmapped);
103static int unprogram_rcvarray(struct file *fp, u32 tidinfo,
104 struct tid_group **grp);
99static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); 105static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node);
100 106
101static struct mmu_rb_ops tid_rb_ops = { 107static 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
73void hfi1_user_exp_rcv_grp_free(struct hfi1_ctxtdata *uctxt); 73void hfi1_user_exp_rcv_grp_free(struct hfi1_ctxtdata *uctxt);
74int hfi1_user_exp_rcv_init(struct file *); 74int hfi1_user_exp_rcv_init(struct file *fp);
75int hfi1_user_exp_rcv_free(struct hfi1_filedata *); 75int hfi1_user_exp_rcv_free(struct hfi1_filedata *fd);
76int hfi1_user_exp_rcv_setup(struct file *, struct hfi1_tid_info *); 76int hfi1_user_exp_rcv_setup(struct file *fp, struct hfi1_tid_info *tinfo);
77int hfi1_user_exp_rcv_clear(struct file *, struct hfi1_tid_info *); 77int hfi1_user_exp_rcv_clear(struct file *fp, struct hfi1_tid_info *tinfo);
78int hfi1_user_exp_rcv_invalid(struct file *, struct hfi1_tid_info *); 78int 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
283static int user_sdma_send_pkts(struct user_sdma_request *, unsigned); 283static int user_sdma_send_pkts(struct user_sdma_request *req,
284static int num_user_pages(const struct iovec *); 284 unsigned maxpkts);
285static void user_sdma_txreq_cb(struct sdma_txreq *, int); 285static int num_user_pages(const struct iovec *iov);
286static inline void pq_update(struct hfi1_user_sdma_pkt_q *); 286static void user_sdma_txreq_cb(struct sdma_txreq *txreq, int status);
287static void user_sdma_free_request(struct user_sdma_request *, bool); 287static inline void pq_update(struct hfi1_user_sdma_pkt_q *pq);
288static int pin_vector_pages(struct user_sdma_request *, 288static void user_sdma_free_request(struct user_sdma_request *req, bool unpin);
289 struct user_sdma_iovec *); 289static int pin_vector_pages(struct user_sdma_request *req,
290static void unpin_vector_pages(struct mm_struct *, struct page **, unsigned, 290 struct user_sdma_iovec *iovec);
291 unsigned); 291static void unpin_vector_pages(struct mm_struct *mm, struct page **pages,
292static int check_header_template(struct user_sdma_request *, 292 unsigned start, unsigned npages);
293 struct hfi1_pkt_header *, u32, u32); 293static int check_header_template(struct user_sdma_request *req,
294static 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);
296static int set_txreq_header_ahg(struct user_sdma_request *, 296static int set_txreq_header(struct user_sdma_request *req,
297 struct user_sdma_txreq *, u32); 297 struct user_sdma_txreq *tx, u32 datalen);
298static inline void set_comp_state(struct hfi1_user_sdma_pkt_q *, 298static 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); 300static inline void set_comp_state(struct hfi1_user_sdma_pkt_q *pq,
301static 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);
304static inline u32 set_pkt_bth_psn(__be32 bthpsn, u8 expct, u32 frags);
302static inline u32 get_lrh_len(struct hfi1_pkt_header, u32 len); 305static inline u32 get_lrh_len(struct hfi1_pkt_header, u32 len);
303 306
304static int defer_packet_queue( 307static 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);
309static void activate_packet_queue(struct iowait *, int); 312static void activate_packet_queue(struct iowait *wait, int reason);
310static bool sdma_rb_filter(struct mmu_rb_node *, unsigned long, unsigned long); 313static bool sdma_rb_filter(struct mmu_rb_node *node, unsigned long addr,
311static int sdma_rb_insert(void *, struct mmu_rb_node *); 314 unsigned long len);
315static int sdma_rb_insert(void *arg, struct mmu_rb_node *mnode);
312static int sdma_rb_evict(void *arg, struct mmu_rb_node *mnode, 316static int sdma_rb_evict(void *arg, struct mmu_rb_node *mnode,
313 void *arg2, bool *stop); 317 void *arg2, bool *stop);
314static void sdma_rb_remove(void *, struct mmu_rb_node *); 318static void sdma_rb_remove(void *arg, struct mmu_rb_node *mnode);
315static int sdma_rb_invalidate(void *, struct mmu_rb_node *); 319static int sdma_rb_invalidate(void *arg, struct mmu_rb_node *mnode);
316 320
317static struct mmu_rb_ops sdma_rb_ops = { 321static 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
81int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *, struct file *); 83int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp);
82int hfi1_user_sdma_free_queues(struct hfi1_filedata *); 84int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd);
83int hfi1_user_sdma_process_request(struct file *, struct iovec *, unsigned long, 85int 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 */