Enabled _sdma_txadd_daddr()
This commit is contained in:
committed by
Balazs Gerofi
parent
fa6db686b4
commit
076e6b9b12
@ -48,6 +48,7 @@
|
|||||||
#include <hfi1/file_ops.h>
|
#include <hfi1/file_ops.h>
|
||||||
#include <hfi1/hfi.h>
|
#include <hfi1/hfi.h>
|
||||||
#include <hfi1/user_sdma.h>
|
#include <hfi1/user_sdma.h>
|
||||||
|
#include <hfi1/sdma.h>
|
||||||
#include <hfi1/ihk_hfi1_common.h>
|
#include <hfi1/ihk_hfi1_common.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -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_pkt_q *pq = fd->pq;
|
||||||
struct hfi1_user_sdma_comp_q *cq = fd->cq;
|
struct hfi1_user_sdma_comp_q *cq = fd->cq;
|
||||||
int done = 0, reqs = 0;
|
int done = 0, reqs = 0;
|
||||||
|
|
||||||
/* Double check the sizes */
|
/* Double check the sizes */
|
||||||
WARN_IF_SIZE_DIFFERENT(struct hfi1_filedata, 96);
|
WARN_IF_SIZE_DIFFERENT(struct hfi1_filedata, 96);
|
||||||
WARN_IF_SIZE_DIFFERENT(struct hfi1_devdata, 7360);
|
WARN_IF_SIZE_DIFFERENT(struct hfi1_devdata, 7360);
|
||||||
|
|||||||
@ -369,6 +369,7 @@ struct hfi1_ctxtdata {
|
|||||||
|
|
||||||
#endif /* __HFI1_ORIG__ */
|
#endif /* __HFI1_ORIG__ */
|
||||||
|
|
||||||
|
//TODO: Fix hfi1_ctxtdata and pport
|
||||||
#ifndef __HFI1_ORIG__
|
#ifndef __HFI1_ORIG__
|
||||||
struct hfi1_ctxtdata {
|
struct hfi1_ctxtdata {
|
||||||
unsigned ctxt;
|
unsigned ctxt;
|
||||||
@ -1267,7 +1268,8 @@ struct hfi1_devdata {
|
|||||||
struct hfi1_devdata {
|
struct hfi1_devdata {
|
||||||
char verbs_dev[2688]; //struct hfi1_ibdev verbs_dev
|
char verbs_dev[2688]; //struct hfi1_ibdev verbs_dev
|
||||||
struct list_head list;
|
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 user_cdev[104]; //struct cdev user_cdev
|
||||||
char diag_cdev[104]; //struct cdev diag_cdev
|
char diag_cdev[104]; //struct cdev diag_cdev
|
||||||
char ui_cdev[104]; //struct cdev ui_cdev
|
char ui_cdev[104]; //struct cdev ui_cdev
|
||||||
|
|||||||
@ -90,9 +90,12 @@ typedef ihk_spinlock_t spinlock_t;
|
|||||||
#define __iomem
|
#define __iomem
|
||||||
#define __rcu
|
#define __rcu
|
||||||
#define __percpu
|
#define __percpu
|
||||||
#define GFP_KERNEL 0
|
|
||||||
#define send_routine void *
|
#define send_routine void *
|
||||||
|
|
||||||
|
#define GFP_KERNEL 0
|
||||||
|
// TODO: double check GFP_ATOMIC
|
||||||
|
#define GFP_ATOMIC 0
|
||||||
|
|
||||||
/* hfi1 pio.h */
|
/* hfi1 pio.h */
|
||||||
#define SC_MAX 4 /* count of send context types */
|
#define SC_MAX 4 /* count of send context types */
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include <hfi1/hfi.h>
|
||||||
#include <hfi1/ihk_hfi1_common.h>
|
#include <hfi1/ihk_hfi1_common.h>
|
||||||
#include <hfi1/sdma_txreq.h>
|
#include <hfi1/sdma_txreq.h>
|
||||||
|
|
||||||
@ -691,7 +691,6 @@ static inline void sdma_txclean(struct hfi1_devdata *dd, struct sdma_txreq *tx)
|
|||||||
if (tx->num_desc)
|
if (tx->num_desc)
|
||||||
__sdma_txclean(dd, tx);
|
__sdma_txclean(dd, tx);
|
||||||
}
|
}
|
||||||
#ifdef __HFI1_ORIG__
|
|
||||||
int _pad_sdma_tx_descs(struct hfi1_devdata *, struct sdma_txreq *);
|
int _pad_sdma_tx_descs(struct hfi1_devdata *, struct sdma_txreq *);
|
||||||
|
|
||||||
/* helpers used by public routines */
|
/* helpers used by public routines */
|
||||||
@ -708,7 +707,6 @@ static inline void _sdma_close_tx(struct hfi1_devdata *dd,
|
|||||||
SDMA_DESC1_INT_REQ_FLAG);
|
SDMA_DESC1_INT_REQ_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __HFI1_ORIG__ */
|
|
||||||
static inline int _sdma_txadd_daddr(
|
static inline int _sdma_txadd_daddr(
|
||||||
struct hfi1_devdata *dd,
|
struct hfi1_devdata *dd,
|
||||||
int type,
|
int type,
|
||||||
@ -727,13 +725,11 @@ static inline int _sdma_txadd_daddr(
|
|||||||
/* special cases for last */
|
/* special cases for last */
|
||||||
if (!tx->tlen) {
|
if (!tx->tlen) {
|
||||||
if (tx->packet_len & (sizeof(u32) - 1)) {
|
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)
|
if (rval)
|
||||||
return rval;
|
return rval;
|
||||||
} else {
|
} else {
|
||||||
//TODO: _sdma_close_tx
|
_sdma_close_tx(dd, tx);
|
||||||
//_sdma_close_tx(dd, tx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tx->num_desc++;
|
tx->num_desc++;
|
||||||
|
|||||||
@ -51,9 +51,7 @@
|
|||||||
|
|
||||||
#include <hfi1/ihk_hfi1_common.h>
|
#include <hfi1/ihk_hfi1_common.h>
|
||||||
#include <hfi1/iowait.h>
|
#include <hfi1/iowait.h>
|
||||||
#include <hfi1/sdma.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <hfi1/hfi.h>
|
|
||||||
#include <hfi1/hfi1_user.h>
|
#include <hfi1/hfi1_user.h>
|
||||||
#include <uio.h>
|
#include <uio.h>
|
||||||
|
|
||||||
|
|||||||
@ -3089,6 +3089,8 @@ static void __sdma_process_event(struct sdma_engine *sde,
|
|||||||
sdma_make_progress(sde, 0);
|
sdma_make_progress(sde, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __HFI1_ORIG__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _extend_sdma_tx_descs() - helper to extend txreq
|
* _extend_sdma_tx_descs() - helper to extend txreq
|
||||||
*
|
*
|
||||||
@ -3143,7 +3145,6 @@ enomem:
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __HFI1_ORIG__ */
|
|
||||||
/*
|
/*
|
||||||
* ext_coal_sdma_tx_descs() - extend or coalesce sdma tx descriptors
|
* 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);
|
write_sde_csr(sde, SD(CHECK_SLID), sreg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* __HFI1_ORIG__ */
|
||||||
|
|
||||||
/* tx not dword sized - pad */
|
/* tx not dword sized - pad */
|
||||||
int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)
|
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;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __HFI1_ORIG__ */
|
|
||||||
/*
|
/*
|
||||||
* Add ahg to the sdma_txreq
|
* Add ahg to the sdma_txreq
|
||||||
*
|
*
|
||||||
|
|||||||
@ -45,6 +45,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <hfi1/hfi.h>
|
||||||
|
#include <hfi1/sdma.h>
|
||||||
#include <hfi1/user_sdma.h>
|
#include <hfi1/user_sdma.h>
|
||||||
#include <hfi1/user_exp_rcv.h>
|
#include <hfi1/user_exp_rcv.h>
|
||||||
#include <hfi1/common.h>
|
#include <hfi1/common.h>
|
||||||
@ -1166,8 +1168,10 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts)
|
|||||||
*/
|
*/
|
||||||
while (queued < datalen &&
|
while (queued < datalen &&
|
||||||
(req->sent + data_sent) < req->data_len) {
|
(req->sent + data_sent) < req->data_len) {
|
||||||
unsigned long base, offset;
|
|
||||||
unsigned pageidx, len;
|
unsigned pageidx, len;
|
||||||
|
//TODO: sdma_txadd_page
|
||||||
|
#ifdef __HFI1_ORIG__
|
||||||
|
unsigned long base, offset;
|
||||||
|
|
||||||
base = (unsigned long)iovec->iov.iov_base;
|
base = (unsigned long)iovec->iov.iov_base;
|
||||||
offset = offset_in_page(base + iovec->offset +
|
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);
|
ret);
|
||||||
goto free_txreq;
|
goto free_txreq;
|
||||||
}
|
}
|
||||||
|
//TODO: len may not be initialized
|
||||||
iov_offset += len;
|
iov_offset += len;
|
||||||
queued += len;
|
queued += len;
|
||||||
data_sent += 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)
|
struct user_sdma_txreq *tx, u32 len)
|
||||||
{
|
{
|
||||||
int diff = 0;
|
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;
|
struct hfi1_pkt_header *hdr = &req->hdr;
|
||||||
u16 pbclen = le16_to_cpu(hdr->pbc[0]);
|
u16 pbclen = le16_to_cpu(hdr->pbc[0]);
|
||||||
u32 val32, tidval = 0, lrhlen = get_lrh_len(*hdr, pad_len(len));
|
u32 val32, tidval = 0, lrhlen = get_lrh_len(*hdr, pad_len(len));
|
||||||
|
|||||||
Reference in New Issue
Block a user