diff --git a/kernel/file_ops.c b/kernel/file_ops.c index 733815d3..e84c9957 100644 --- a/kernel/file_ops.c +++ b/kernel/file_ops.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -433,7 +434,7 @@ ssize_t hfi1_aio_write(void *private_data, const struct iovec *iovec, unsigned l struct hfi1_user_sdma_pkt_q *pq = fd->pq; struct hfi1_user_sdma_comp_q *cq = fd->cq; int done = 0, reqs = 0; - + /* Double check the sizes */ WARN_IF_SIZE_DIFFERENT(struct hfi1_filedata, 96); WARN_IF_SIZE_DIFFERENT(struct hfi1_devdata, 7360); diff --git a/kernel/include/hfi1/hfi.h b/kernel/include/hfi1/hfi.h index d9dcfa71..b59f2a57 100644 --- a/kernel/include/hfi1/hfi.h +++ b/kernel/include/hfi1/hfi.h @@ -369,6 +369,7 @@ struct hfi1_ctxtdata { #endif /* __HFI1_ORIG__ */ +//TODO: Fix hfi1_ctxtdata and pport #ifndef __HFI1_ORIG__ struct hfi1_ctxtdata { unsigned ctxt; @@ -1267,7 +1268,8 @@ struct hfi1_devdata { struct hfi1_devdata { char verbs_dev[2688]; //struct hfi1_ibdev verbs_dev struct list_head list; - struct pci_dev *pcidev; + //TODO: pcidev + void *pcidev; // struct pci_dev *pcidev; char user_cdev[104]; //struct cdev user_cdev char diag_cdev[104]; //struct cdev diag_cdev char ui_cdev[104]; //struct cdev ui_cdev diff --git a/kernel/include/hfi1/ihk_hfi1_common.h b/kernel/include/hfi1/ihk_hfi1_common.h index 8f7659eb..43a20196 100644 --- a/kernel/include/hfi1/ihk_hfi1_common.h +++ b/kernel/include/hfi1/ihk_hfi1_common.h @@ -90,9 +90,12 @@ typedef ihk_spinlock_t spinlock_t; #define __iomem #define __rcu #define __percpu -#define GFP_KERNEL 0 #define send_routine void * +#define GFP_KERNEL 0 +// TODO: double check GFP_ATOMIC +#define GFP_ATOMIC 0 + /* hfi1 pio.h */ #define SC_MAX 4 /* count of send context types */ diff --git a/kernel/include/hfi1/sdma.h b/kernel/include/hfi1/sdma.h index 590f8d8f..6a8b88bc 100644 --- a/kernel/include/hfi1/sdma.h +++ b/kernel/include/hfi1/sdma.h @@ -46,7 +46,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - +#include #include #include @@ -691,7 +691,6 @@ static inline void sdma_txclean(struct hfi1_devdata *dd, struct sdma_txreq *tx) if (tx->num_desc) __sdma_txclean(dd, tx); } -#ifdef __HFI1_ORIG__ int _pad_sdma_tx_descs(struct hfi1_devdata *, struct sdma_txreq *); /* helpers used by public routines */ @@ -708,7 +707,6 @@ static inline void _sdma_close_tx(struct hfi1_devdata *dd, SDMA_DESC1_INT_REQ_FLAG); } -#endif /* __HFI1_ORIG__ */ static inline int _sdma_txadd_daddr( struct hfi1_devdata *dd, int type, @@ -727,13 +725,11 @@ static inline int _sdma_txadd_daddr( /* special cases for last */ if (!tx->tlen) { if (tx->packet_len & (sizeof(u32) - 1)) { - //TODO: _pad_sdma_tx_descs - //rval = _pad_sdma_tx_descs(dd, tx); + rval = _pad_sdma_tx_descs(dd, tx); if (rval) return rval; } else { - //TODO: _sdma_close_tx - //_sdma_close_tx(dd, tx); + _sdma_close_tx(dd, tx); } } tx->num_desc++; diff --git a/kernel/include/hfi1/user_sdma.h b/kernel/include/hfi1/user_sdma.h index a3027abe..a404e98d 100644 --- a/kernel/include/hfi1/user_sdma.h +++ b/kernel/include/hfi1/user_sdma.h @@ -51,9 +51,7 @@ #include #include -#include #include -#include #include #include diff --git a/kernel/sdma.c b/kernel/sdma.c index f74c1c1e..0fa583ab 100644 --- a/kernel/sdma.c +++ b/kernel/sdma.c @@ -3089,6 +3089,8 @@ static void __sdma_process_event(struct sdma_engine *sde, sdma_make_progress(sde, 0); } +#endif /* __HFI1_ORIG__ */ + /* * _extend_sdma_tx_descs() - helper to extend txreq * @@ -3143,7 +3145,6 @@ enomem: return -ENOMEM; } -#endif /* __HFI1_ORIG__ */ /* * ext_coal_sdma_tx_descs() - extend or coalesce sdma tx descriptors * @@ -3249,6 +3250,7 @@ void sdma_update_lmc(struct hfi1_devdata *dd, u64 mask, u32 lid) write_sde_csr(sde, SD(CHECK_SLID), sreg); } } +#endif /* __HFI1_ORIG__ */ /* tx not dword sized - pad */ int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx) @@ -3273,7 +3275,6 @@ int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx) return rval; } -#endif /* __HFI1_ORIG__ */ /* * Add ahg to the sdma_txreq * diff --git a/kernel/user_sdma.c b/kernel/user_sdma.c index c05f6e76..490a6754 100644 --- a/kernel/user_sdma.c +++ b/kernel/user_sdma.c @@ -45,6 +45,8 @@ * */ +#include +#include #include #include #include @@ -1166,8 +1168,10 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts) */ while (queued < datalen && (req->sent + data_sent) < req->data_len) { - unsigned long base, offset; unsigned pageidx, len; +//TODO: sdma_txadd_page +#ifdef __HFI1_ORIG__ + unsigned long base, offset; base = (unsigned long)iovec->iov.iov_base; offset = offset_in_page(base + iovec->offset + @@ -1185,6 +1189,7 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts) ret); goto free_txreq; } + //TODO: len may not be initialized iov_offset += len; queued += len; data_sent += len; @@ -1549,7 +1554,7 @@ static int set_txreq_header_ahg(struct user_sdma_request *req, struct user_sdma_txreq *tx, u32 len) { int diff = 0; - struct hfi1_user_sdma_pkt_q *pq = req->pq; + // struct hfi1_user_sdma_pkt_q *pq = req->pq; struct hfi1_pkt_header *hdr = &req->hdr; u16 pbclen = le16_to_cpu(hdr->pbc[0]); u32 val32, tidval = 0, lrhlen = get_lrh_len(*hdr, pad_len(len));