hfi: bases for user_exp_rcv
This implements a skeleton setup function and call it on ioctl Many missing points: - missing pci mapping to make setup work - no clear (passed to linux, so will likely bug out) - missing locks/safe-guards Conflicts: kernel/Makefile.build.in
This commit is contained in:
committed by
Balazs Gerofi
parent
7366da4390
commit
e64d89cd48
58
kernel/include/hfi1/chip.h
Normal file
58
kernel/include/hfi1/chip.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef _CHIP_H
|
||||
#define _CHIP_H
|
||||
/*
|
||||
* Copyright(c) 2015, 2016 Intel Corporation.
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
* redistributing this file, you may do so under either license.
|
||||
*
|
||||
* GPL LICENSE SUMMARY
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* - Neither the name of Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains all of the defines that is specific to the HFI chip
|
||||
*/
|
||||
|
||||
void hfi1_put_tid(struct hfi1_devdata *dd, u32 index,
|
||||
u32 type, unsigned long pa, u16 order);
|
||||
void hfi1_clear_tids(struct hfi1_ctxtdata *rcd);
|
||||
|
||||
#endif /* _CHIP_H */
|
||||
64
kernel/include/hfi1/chip_registers.h
Normal file
64
kernel/include/hfi1/chip_registers.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef DEF_CHIP_REG
|
||||
#define DEF_CHIP_REG
|
||||
|
||||
/*
|
||||
* Copyright(c) 2015, 2016 Intel Corporation.
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
* redistributing this file, you may do so under either license.
|
||||
*
|
||||
* GPL LICENSE SUMMARY
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* - Neither the name of Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define CORE 0x000000000000
|
||||
|
||||
|
||||
#define RXE (CORE + 0x000001000000)
|
||||
|
||||
|
||||
#define RCV_ARRAY (RXE + 0x000000200000)
|
||||
#define RCV_ARRAY_CNT (RXE + 0x000000000018)
|
||||
#define RCV_ARRAY_RT_ADDR_MASK 0xFFFFFFFFFull
|
||||
#define RCV_ARRAY_RT_ADDR_SHIFT 0
|
||||
#define RCV_ARRAY_RT_BUF_SIZE_SHIFT 36
|
||||
#define RCV_ARRAY_RT_WRITE_ENABLE_SMASK 0x8000000000000000ull
|
||||
|
||||
#endif /* DEF_CHIP_REG */
|
||||
@@ -192,11 +192,13 @@ struct ctxt_eager_bufs {
|
||||
} *rcvtids;
|
||||
};
|
||||
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
struct exp_tid_set {
|
||||
struct list_head list;
|
||||
u32 count;
|
||||
};
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
struct tid_queue {
|
||||
struct list_head queue_head;
|
||||
/* queue head for QP TID resource waiters */
|
||||
@@ -372,9 +374,26 @@ struct hfi1_ctxtdata {
|
||||
//TODO: Fix hfi1_ctxtdata and pport
|
||||
#ifndef __HFI1_ORIG__
|
||||
struct hfi1_ctxtdata {
|
||||
char __padding0[152];
|
||||
unsigned ctxt;
|
||||
char __padding1[180-156];
|
||||
/* number of RcvArray groups for this context. */
|
||||
u32 rcv_array_groups;
|
||||
/* index of first eager TID entry. */
|
||||
u32 eager_base;
|
||||
/* number of expected TID entries */
|
||||
u32 expected_count;
|
||||
/* index of first expected TID entry. */
|
||||
u32 expected_base;
|
||||
|
||||
struct exp_tid_set tid_group_list;
|
||||
struct exp_tid_set tid_used_list;
|
||||
struct exp_tid_set tid_full_list;
|
||||
|
||||
char __padding2[440-272];
|
||||
struct hfi1_devdata *dd;
|
||||
};
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
#endif /* !__HFI1_ORIG__ */
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
/*
|
||||
@@ -842,12 +861,15 @@ typedef void (*opcode_handler)(struct hfi1_packet *packet);
|
||||
#define RHF_RCV_DONE 1 /* stop, this packet processed */
|
||||
#define RHF_RCV_REPROCESS 2 /* stop. retain this packet */
|
||||
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
|
||||
struct rcv_array_data {
|
||||
u8 group_size;
|
||||
u16 ngroups;
|
||||
u16 nctxt_extra;
|
||||
};
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
struct per_vl_data {
|
||||
u16 mtu;
|
||||
struct send_context *sc;
|
||||
@@ -1471,7 +1493,7 @@ struct hfi1_devdata {
|
||||
|
||||
u64 gi_mask[CCE_NUM_INT_CSRS];
|
||||
|
||||
char rcv_entries[6]; //struct rcv_array_data rcv_entries
|
||||
struct rcv_array_data rcv_entries;
|
||||
|
||||
|
||||
u16 psxmitwait_check_rate;
|
||||
@@ -2086,6 +2108,8 @@ struct cc_state *get_cc_state_protected(struct hfi1_pportdata *ppd)
|
||||
lockdep_is_held(&ppd->cc_state_lock));
|
||||
}
|
||||
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
|
||||
/*
|
||||
* values for dd->flags (_device_ related flags)
|
||||
*/
|
||||
@@ -2096,6 +2120,7 @@ struct cc_state *get_cc_state_protected(struct hfi1_pportdata *ppd)
|
||||
#define HFI1_HAS_SEND_DMA 0x10 /* Supports Send DMA */
|
||||
#define HFI1_FORCED_FREEZE 0x80 /* driver forced freeze mode */
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
/* IB dword length mask in PBC (lower 11 bits); same for all chips */
|
||||
#define HFI1_PBC_LENGTH_MASK ((1 << 11) - 1)
|
||||
|
||||
@@ -2217,6 +2242,7 @@ const char *get_unit_name(int unit);
|
||||
const char *get_card_name(struct rvt_dev_info *rdi);
|
||||
struct pci_dev *get_pci_dev(struct rvt_dev_info *rdi);
|
||||
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
/*
|
||||
* Flush write combining store buffers (if present) and perform a write
|
||||
* barrier.
|
||||
@@ -2226,6 +2252,7 @@ static inline void flush_wc(void)
|
||||
asm volatile("sfence" : : : "memory");
|
||||
}
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
void handle_eflags(struct hfi1_packet *packet);
|
||||
int process_receive_ib(struct hfi1_packet *packet);
|
||||
int process_receive_bypass(struct hfi1_packet *packet);
|
||||
|
||||
@@ -46,9 +46,7 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
#ifdef __HFI1_ORIG__
|
||||
#include "hfi.h"
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
#include "hfi1/hfi.h"
|
||||
|
||||
#define EXP_TID_TIDLEN_MASK 0x7FFULL
|
||||
#define EXP_TID_TIDLEN_SHIFT 0
|
||||
@@ -71,7 +69,6 @@
|
||||
(tid) |= EXP_TID_SET(field, (value)); \
|
||||
} while (0)
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
struct tid_group {
|
||||
struct list_head list;
|
||||
unsigned base;
|
||||
@@ -147,15 +144,17 @@ static inline void tid_group_move(struct tid_group *group,
|
||||
tid_group_add_tail(group, s2);
|
||||
}
|
||||
|
||||
#ifdef __HFI1_ORIG__
|
||||
u32 find_phys_blocks(struct page **, unsigned, struct tid_pageset *);
|
||||
int alloc_ctxt_rcv_groups(struct hfi1_ctxtdata *rcd);
|
||||
void free_ctxt_rcv_groups(struct hfi1_ctxtdata *rcd);
|
||||
int hfi1_user_exp_rcv_init(struct file *);
|
||||
int hfi1_user_exp_rcv_free(struct hfi1_filedata *);
|
||||
int hfi1_user_exp_rcv_setup(struct file *, struct hfi1_tid_info *);
|
||||
int hfi1_user_exp_rcv_clear(struct file *, struct hfi1_tid_info *);
|
||||
int hfi1_user_exp_rcv_invalid(struct file *, struct hfi1_tid_info *);
|
||||
|
||||
#endif /* __HFI1_ORIG__ */
|
||||
|
||||
int hfi1_user_exp_rcv_setup(struct hfi1_filedata *, struct hfi1_tid_info *);
|
||||
int hfi1_user_exp_rcv_clear(struct hfi1_filedata *, struct hfi1_tid_info *);
|
||||
int hfi1_user_exp_rcv_invalid(struct hfi1_filedata *, struct hfi1_tid_info *);
|
||||
|
||||
#endif /* _HFI1_USER_EXP_RCV_H */
|
||||
|
||||
Reference in New Issue
Block a user