misc: mic: SCIF RMA nodeqp and minor miscellaneous changes
This patch adds the SCIF kernel node QP control messages required to enable SCIF RMAs. Examples of such node QP control messages include registration, unregistration, remote memory allocation requests, remote memory unmap and SCIF remote fence requests. The patch also updates the SCIF driver with minor changes required to enable SCIF RMAs by adding the new files to the build, initializing RMA specific information during SCIF endpoint creation, reserving SCIF DMA channels, initializing SCIF RMA specific global data structures, adding the IOCTL hooks required for SCIF RMAs and updating RMA specific debugfs hooks. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
564c8d8dfc
commit
d18243293a
@@ -98,6 +98,8 @@ struct scif_endpt_qp_info {
|
||||
* @conn_async_state: Async connection
|
||||
* @conn_pend_wq: Used by poll while waiting for incoming connections
|
||||
* @conn_list: List of async connection requests
|
||||
* @rma_info: Information for triggering SCIF RMA and DMA operations
|
||||
* @mmu_list: link to list of MMU notifier cleanup work
|
||||
* @anon: anonymous file for use in kernel mode scif poll
|
||||
*/
|
||||
struct scif_endpt {
|
||||
@@ -129,6 +131,8 @@ struct scif_endpt {
|
||||
int conn_async_state;
|
||||
wait_queue_head_t conn_pend_wq;
|
||||
struct list_head conn_list;
|
||||
struct scif_endpt_rma_info rma_info;
|
||||
struct list_head mmu_list;
|
||||
struct file *anon;
|
||||
};
|
||||
|
||||
@@ -137,6 +141,27 @@ static inline int scifdev_alive(struct scif_endpt *ep)
|
||||
return _scifdev_alive(ep->remote_dev);
|
||||
}
|
||||
|
||||
/*
|
||||
* scif_verify_epd:
|
||||
* ep: SCIF endpoint
|
||||
*
|
||||
* Checks several generic error conditions and returns the
|
||||
* appropriate error.
|
||||
*/
|
||||
static inline int scif_verify_epd(struct scif_endpt *ep)
|
||||
{
|
||||
if (ep->state == SCIFEP_DISCONNECTED)
|
||||
return -ECONNRESET;
|
||||
|
||||
if (ep->state != SCIFEP_CONNECTED)
|
||||
return -ENOTCONN;
|
||||
|
||||
if (!scifdev_alive(ep))
|
||||
return -ENODEV;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int scif_anon_inode_getfile(scif_epd_t epd)
|
||||
{
|
||||
epd->anon = anon_inode_getfile("scif", &scif_anon_fops, NULL, 0);
|
||||
@@ -177,6 +202,9 @@ void scif_clientsend(struct scif_dev *scifdev, struct scifmsg *msg);
|
||||
void scif_clientrcvd(struct scif_dev *scifdev, struct scifmsg *msg);
|
||||
int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block);
|
||||
int __scif_flush(scif_epd_t epd);
|
||||
int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd);
|
||||
unsigned int __scif_pollfd(struct file *f, poll_table *wait,
|
||||
struct scif_endpt *ep);
|
||||
int __scif_pin_pages(void *addr, size_t len, int *out_prot,
|
||||
int map_flags, scif_pinned_pages_t *pages);
|
||||
#endif /* SCIF_EPD_H */
|
||||
|
Reference in New Issue
Block a user