Compare commits
4 Commits
1.5.0-knl+
...
1.5.1-knl+
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f117cc0dc | ||
|
|
0b9a657a01 | ||
|
|
c2d6651cd2 | ||
|
|
d979444049 |
@@ -344,41 +344,41 @@ if ! grep ihk_smp_@ARCH@ /proc/modules &>/dev/null; then
|
|||||||
error_exit "ihk_loaded"
|
error_exit "ihk_loaded"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Offline-reonline RAM (special case for OFP SNC-4 flat mode)
|
# # Offline-reonline RAM (special case for OFP SNC-4 flat mode)
|
||||||
if [ "`hostname | grep "c[0-9][0-9][0-9][0-9].ofp"`" != "" ] && [ "`cat /sys/devices/system/node/online`" == "0-7" ]; then
|
# if [ "`hostname | grep "c[0-9][0-9][0-9][0-9].ofp"`" != "" ] && [ "`cat /sys/devices/system/node/online`" == "0-7" ]; then
|
||||||
for i in 0 1 2 3; do
|
# for i in 0 1 2 3; do
|
||||||
find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
# find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
||||||
echo 0 > $f 2>&1 > /dev/null;
|
# echo 0 | tee $f 2>/dev/null 1>/dev/null
|
||||||
done
|
# done
|
||||||
find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
# find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
||||||
echo 1 > $f 2>&1 > /dev/null;
|
# echo 1 | tee $f 2>/dev/null 1>/dev/null
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
for i in 4 5 6 7; do
|
# for i in 4 5 6 7; do
|
||||||
find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
# find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
||||||
echo 0 > $f 2>&1 > /dev/null;
|
# echo 0 | tee $f 2>/dev/null 1>/dev/null
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
for i in 4 5 6 7; do
|
# for i in 4 5 6 7; do
|
||||||
find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
# find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
||||||
echo 1 > $f 2>&1 > /dev/null;
|
# echo 1 | tee $f 2>/dev/null 1>/dev/null
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
# Offline-reonline RAM (special case for OFP Quadrant flat mode)
|
# # Offline-reonline RAM (special case for OFP Quadrant flat mode)
|
||||||
if [ "`hostname | grep "c[0-9][0-9][0-9][0-9].ofp"`" != "" ] && [ "`cat /sys/devices/system/node/online`" == "0-1" ]; then
|
# if [ "`hostname | grep "c[0-9][0-9][0-9][0-9].ofp"`" != "" ] && [ "`cat /sys/devices/system/node/online`" == "0-1" ]; then
|
||||||
for i in 1; do
|
# for i in 1; do
|
||||||
find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
# find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
||||||
echo 0 > $f 2>&1 > /dev/null;
|
# echo 0 | tee $f 2>/dev/null 1>/dev/null
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
for i in 1; do
|
# for i in 1; do
|
||||||
find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
# find /sys/devices/system/node/node$i/memory*/ -name "online" | while read f; do
|
||||||
echo 1 > $f 2>&1 > /dev/null;
|
# echo 1 | tee $f 2>/dev/null 1>/dev/null
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
if ! ${SBINDIR}/ihkconfig 0 reserve mem ${mem}; then
|
if ! ${SBINDIR}/ihkconfig 0 reserve mem ${mem}; then
|
||||||
echo "error: reserving memory" >&2
|
echo "error: reserving memory" >&2
|
||||||
|
|||||||
26
configure
vendored
26
configure
vendored
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for mckernel 1.5.0-knl+hfi.
|
# Generated by GNU Autoconf 2.69 for mckernel 1.5.1-knl+hfi.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||||
@@ -577,8 +577,8 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='mckernel'
|
PACKAGE_NAME='mckernel'
|
||||||
PACKAGE_TARNAME='mckernel'
|
PACKAGE_TARNAME='mckernel'
|
||||||
PACKAGE_VERSION='1.5.0-knl+hfi'
|
PACKAGE_VERSION='1.5.1-knl+hfi'
|
||||||
PACKAGE_STRING='mckernel 1.5.0-knl+hfi'
|
PACKAGE_STRING='mckernel 1.5.1-knl+hfi'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
@@ -1262,7 +1262,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures mckernel 1.5.0-knl+hfi to adapt to many kinds of systems.
|
\`configure' configures mckernel 1.5.1-knl+hfi to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1323,7 +1323,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of mckernel 1.5.0-knl+hfi:";;
|
short | recursive ) echo "Configuration of mckernel 1.5.1-knl+hfi:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@@ -1431,7 +1431,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
mckernel configure 1.5.0-knl+hfi
|
mckernel configure 1.5.1-knl+hfi
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
@@ -1729,7 +1729,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by mckernel $as_me 1.5.0-knl+hfi, which was
|
It was created by mckernel $as_me 1.5.1-knl+hfi, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@@ -2082,11 +2082,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
IHK_VERSION=1.5.0-knl+hfi
|
IHK_VERSION=1.5.1-knl+hfi
|
||||||
MCKERNEL_VERSION=1.5.0-knl+hfi
|
MCKERNEL_VERSION=1.5.1-knl+hfi
|
||||||
DCFA_VERSION=DCFA_VERSION_m4
|
DCFA_VERSION=DCFA_VERSION_m4
|
||||||
IHK_RELEASE_DATE=2018-06-20
|
IHK_RELEASE_DATE=2019-05-14
|
||||||
MCKERNEL_RELEASE_DATE=2018-06-20
|
MCKERNEL_RELEASE_DATE=2019-05-14
|
||||||
DCFA_RELEASE_DATE=DCFA_RELEASE_DATE_m4
|
DCFA_RELEASE_DATE=DCFA_RELEASE_DATE_m4
|
||||||
|
|
||||||
|
|
||||||
@@ -5585,7 +5585,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by mckernel $as_me 1.5.0-knl+hfi, which was
|
This file was extended by mckernel $as_me 1.5.1-knl+hfi, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -5647,7 +5647,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
mckernel config.status 1.5.0-knl+hfi
|
mckernel config.status 1.5.1-knl+hfi
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# configure.ac COPYRIGHT FUJITSU LIMITED 2015-2016
|
# configure.ac COPYRIGHT FUJITSU LIMITED 2015-2016
|
||||||
AC_PREREQ(2.63)
|
AC_PREREQ(2.63)
|
||||||
m4_define([IHK_VERSION_m4],[1.5.0-knl+hfi])dnl
|
m4_define([IHK_VERSION_m4],[1.5.1-knl+hfi])dnl
|
||||||
m4_define([MCKERNEL_VERSION_m4],[1.5.0-knl+hfi])dnl
|
m4_define([MCKERNEL_VERSION_m4],[1.5.1-knl+hfi])dnl
|
||||||
m4_define([IHK_RELEASE_DATE_m4],[2018-06-20])dnl
|
m4_define([IHK_RELEASE_DATE_m4],[2019-05-14])dnl
|
||||||
m4_define([MCKERNEL_RELEASE_DATE_m4],[2018-06-20])dnl
|
m4_define([MCKERNEL_RELEASE_DATE_m4],[2019-05-14])dnl
|
||||||
|
|
||||||
AC_INIT([mckernel], MCKERNEL_VERSION_m4)
|
AC_INIT([mckernel], MCKERNEL_VERSION_m4)
|
||||||
|
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ long hfi1_file_ioctl(void *private_data, unsigned int cmd,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
dkprintf("%s: HFI1_IOCTL_CTXT_RESET \n", __FUNCTION__);
|
dkprintf("%s: HFI1_IOCTL_CTXT_RESET \n", __FUNCTION__);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case HFI1_IOCTL_GET_VERS:
|
case HFI1_IOCTL_GET_VERS:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
struct hfi1_ctxtdata {
|
struct hfi1_ctxtdata {
|
||||||
union {
|
union {
|
||||||
char whole_struct[1408];
|
char whole_struct[1160];
|
||||||
struct {
|
struct {
|
||||||
char padding0[144];
|
char padding0[144];
|
||||||
u16 ctxt;
|
u16 ctxt;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
struct hfi1_devdata {
|
struct hfi1_devdata {
|
||||||
union {
|
union {
|
||||||
char whole_struct[7872];
|
char whole_struct[7808];
|
||||||
struct {
|
struct {
|
||||||
char padding0[3368];
|
char padding0[3368];
|
||||||
u8 *kregbase1;
|
u8 *kregbase1;
|
||||||
@@ -46,19 +46,19 @@ struct hfi1_devdata {
|
|||||||
u32 chip_rcv_array_count;
|
u32 chip_rcv_array_count;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding11[7392];
|
char padding11[7264];
|
||||||
struct hfi1_pportdata *pport;
|
struct hfi1_pportdata *pport;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding12[7416];
|
char padding12[7296];
|
||||||
u16 flags;
|
u16 flags;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding13[7419];
|
char padding13[7299];
|
||||||
u8 first_dyn_alloc_ctxt;
|
u8 first_dyn_alloc_ctxt;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding14[7432];
|
char padding14[7368];
|
||||||
u64 sc2vl[4];
|
u64 sc2vl[4];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ struct hfi1_user_sdma_pkt_q {
|
|||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding5[288];
|
char padding5[288];
|
||||||
unsigned int state;
|
enum pkt_q_sdma_state state;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
struct hfi1_pportdata {
|
struct hfi1_pportdata {
|
||||||
union {
|
union {
|
||||||
char whole_struct[12928];
|
char whole_struct[12992];
|
||||||
struct {
|
struct {
|
||||||
char padding0[2113];
|
char padding0[2113];
|
||||||
u8 vls_operational;
|
u8 vls_operational;
|
||||||
|
|||||||
@@ -50,47 +50,39 @@ struct user_sdma_request {
|
|||||||
u64 seqsubmitted;
|
u64 seqsubmitted;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding12[144];
|
char padding12[192];
|
||||||
int status;
|
|
||||||
};
|
|
||||||
struct {
|
|
||||||
char padding13[192];
|
|
||||||
struct list_head txps;
|
struct list_head txps;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding14[208];
|
char padding13[208];
|
||||||
u64 seqnum;
|
u64 seqnum;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding15[216];
|
char padding14[216];
|
||||||
u32 tidoffset;
|
u32 tidoffset;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding16[220];
|
char padding15[220];
|
||||||
u32 koffset;
|
u32 koffset;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding17[224];
|
char padding16[224];
|
||||||
u32 sent;
|
u32 sent;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding18[228];
|
char padding17[228];
|
||||||
u16 tididx;
|
u16 tididx;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding19[230];
|
char padding18[230];
|
||||||
u8 iov_idx;
|
u8 iov_idx;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding20[231];
|
char padding19[231];
|
||||||
u8 done;
|
|
||||||
};
|
|
||||||
struct {
|
|
||||||
char padding21[232];
|
|
||||||
u8 has_error;
|
u8 has_error;
|
||||||
};
|
};
|
||||||
struct {
|
struct {
|
||||||
char padding22[240];
|
char padding20[232];
|
||||||
struct user_sdma_iovec iovs[8];
|
struct user_sdma_iovec iovs[8];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -114,6 +114,11 @@ extern uint extended_psn;
|
|||||||
#define KDETH_OM_LARGE_SHIFT 6
|
#define KDETH_OM_LARGE_SHIFT 6
|
||||||
#define KDETH_OM_MAX_SIZE (1 << ((KDETH_OM_LARGE / KDETH_OM_SMALL) + 1))
|
#define KDETH_OM_MAX_SIZE (1 << ((KDETH_OM_LARGE / KDETH_OM_SMALL) + 1))
|
||||||
|
|
||||||
|
enum pkt_q_sdma_state {
|
||||||
|
SDMA_PKT_Q_ACTIVE,
|
||||||
|
SDMA_PKT_Q_DEFERRED,
|
||||||
|
};
|
||||||
|
|
||||||
#include <hfi1/hfi1_generated_hfi1_user_sdma_pkt_q.h>
|
#include <hfi1/hfi1_generated_hfi1_user_sdma_pkt_q.h>
|
||||||
|
|
||||||
struct hfi1_user_sdma_comp_q {
|
struct hfi1_user_sdma_comp_q {
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ HFI1_KO="${1-$(modinfo -n hfi1)}" || \
|
|||||||
> "${HDR_PREFIX}sdma_engine.h"
|
> "${HDR_PREFIX}sdma_engine.h"
|
||||||
|
|
||||||
"$DES_BIN" "$HFI1_KO" user_sdma_request \
|
"$DES_BIN" "$HFI1_KO" user_sdma_request \
|
||||||
data_iovs pq cq status txps info hdr tidoffset data_len \
|
data_iovs pq cq txps info hdr tidoffset data_len \
|
||||||
iov_idx sent seqnum done has_error koffset tididx \
|
iov_idx sent seqnum has_error koffset tididx \
|
||||||
tids n_tids sde ahg_idx iovs seqcomp seqsubmitted \
|
tids n_tids sde ahg_idx iovs seqcomp seqsubmitted \
|
||||||
> "${HDR_PREFIX}user_sdma_request.h"
|
> "${HDR_PREFIX}user_sdma_request.h"
|
||||||
|
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ static uint hfi1_sdma_comp_ring_size = 128;
|
|||||||
#define SDMA_REQ_HAS_ERROR 4
|
#define SDMA_REQ_HAS_ERROR 4
|
||||||
#define SDMA_REQ_DONE_ERROR 5
|
#define SDMA_REQ_DONE_ERROR 5
|
||||||
|
|
||||||
#define SDMA_PKT_Q_INACTIVE BIT(0)
|
|
||||||
#define SDMA_PKT_Q_ACTIVE BIT(1)
|
|
||||||
#define SDMA_PKT_Q_DEFERRED BIT(2)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum retry attempts to submit a TX request
|
* Maximum retry attempts to submit a TX request
|
||||||
@@ -549,7 +546,6 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
|
|||||||
struct sdma_req_info info;
|
struct sdma_req_info info;
|
||||||
struct user_sdma_request *req;
|
struct user_sdma_request *req;
|
||||||
u8 opcode, sc, vl;
|
u8 opcode, sc, vl;
|
||||||
int req_queued = 0;
|
|
||||||
u16 dlid;
|
u16 dlid;
|
||||||
u32 selector;
|
u32 selector;
|
||||||
unsigned long size_info = sizeof(info);
|
unsigned long size_info = sizeof(info);
|
||||||
@@ -620,7 +616,6 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
|
|||||||
req->data_len = 0;
|
req->data_len = 0;
|
||||||
req->pq = pq;
|
req->pq = pq;
|
||||||
req->cq = cq;
|
req->cq = cq;
|
||||||
req->status = -1;
|
|
||||||
req->ahg_idx = -1;
|
req->ahg_idx = -1;
|
||||||
req->iov_idx = 0;
|
req->iov_idx = 0;
|
||||||
req->sent = 0;
|
req->sent = 0;
|
||||||
@@ -628,13 +623,15 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
|
|||||||
req->seqcomp = 0;
|
req->seqcomp = 0;
|
||||||
req->seqsubmitted = 0;
|
req->seqsubmitted = 0;
|
||||||
req->tids = NULL;
|
req->tids = NULL;
|
||||||
req->done = 0;
|
|
||||||
req->has_error = 0;
|
req->has_error = 0;
|
||||||
INIT_LIST_HEAD(&req->txps);
|
INIT_LIST_HEAD(&req->txps);
|
||||||
|
|
||||||
|
|
||||||
fast_memcpy(&req->info, &info, size_info);
|
fast_memcpy(&req->info, &info, size_info);
|
||||||
|
|
||||||
|
/* The request is initialized, count it */
|
||||||
|
ihk_atomic_inc(&pq->n_reqs);
|
||||||
|
|
||||||
if (req_opcode(info.ctrl) == EXPECTED) {
|
if (req_opcode(info.ctrl) == EXPECTED) {
|
||||||
/* expected must have a TID info and at least one data vector */
|
/* expected must have a TID info and at least one data vector */
|
||||||
if (req->data_iovs < 2) {
|
if (req->data_iovs < 2) {
|
||||||
@@ -841,25 +838,14 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_comp_state(pq, cq, info.comp_idx, QUEUED, 0);
|
set_comp_state(pq, cq, info.comp_idx, QUEUED, 0);
|
||||||
atomic_inc(&pq->n_reqs);
|
pq->state = SDMA_PKT_Q_ACTIVE;
|
||||||
req_queued = 1;
|
|
||||||
|
|
||||||
/* Send the first N packets in the request to buy us some time */
|
/* Send the first N packets in the request to buy us some time */
|
||||||
ret = user_sdma_send_pkts(req, pcount, txreq_cache);
|
ret = user_sdma_send_pkts(req, pcount, txreq_cache);
|
||||||
if (unlikely(ret < 0 && ret != -EBUSY)) {
|
if (unlikely(ret < 0 && ret != -EBUSY)) {
|
||||||
req->status = ret;
|
|
||||||
goto free_req;
|
goto free_req;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* It is possible that the SDMA engine would have processed all the
|
|
||||||
* submitted packets by the time we get here. Therefore, only set
|
|
||||||
* packet queue state to ACTIVE if there are still uncompleted
|
|
||||||
* requests.
|
|
||||||
*/
|
|
||||||
if (atomic_read(&pq->n_reqs))
|
|
||||||
xchg(&pq->state, SDMA_PKT_Q_ACTIVE);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a somewhat blocking send implementation.
|
* This is a somewhat blocking send implementation.
|
||||||
* The driver will block the caller until all packets of the
|
* The driver will block the caller until all packets of the
|
||||||
@@ -870,16 +856,12 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
|
|||||||
ret = user_sdma_send_pkts(req, pcount, txreq_cache);
|
ret = user_sdma_send_pkts(req, pcount, txreq_cache);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret != -EBUSY) {
|
if (ret != -EBUSY) {
|
||||||
req->status = ret;
|
goto free_req;
|
||||||
WRITE_ONCE(req->has_error, 1);
|
|
||||||
if (ACCESS_ONCE(req->seqcomp) ==
|
|
||||||
req->seqsubmitted - 1)
|
|
||||||
goto free_req;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
unsigned long ts = rdtsc();
|
unsigned long ts = rdtsc();
|
||||||
while (pq->state != SDMA_PKT_Q_ACTIVE) {
|
while (ihk_atomic_read(&pq->n_reqs) > 0 &&
|
||||||
|
pq->state != SDMA_PKT_Q_ACTIVE) {
|
||||||
cpu_pause();
|
cpu_pause();
|
||||||
}
|
}
|
||||||
kprintf("%s: waited %lu cycles for SDMA_PKT_Q_ACTIVE\n",
|
kprintf("%s: waited %lu cycles for SDMA_PKT_Q_ACTIVE\n",
|
||||||
@@ -891,9 +873,26 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
|
|||||||
return 0;
|
return 0;
|
||||||
free_req:
|
free_req:
|
||||||
user_sdma_free_request(req, true);
|
user_sdma_free_request(req, true);
|
||||||
if (req_queued)
|
/*
|
||||||
|
* If the submitted seqsubmitted == npkts, the completion routine
|
||||||
|
* controls the final state. If sequbmitted < npkts, wait for any
|
||||||
|
* outstanding packets to finish before cleaning up.
|
||||||
|
*/
|
||||||
|
if (req->seqsubmitted < req->info.npkts) {
|
||||||
|
if (req->seqsubmitted) {
|
||||||
|
{
|
||||||
|
unsigned long ts = rdtsc();
|
||||||
|
while (req->seqcomp != req->seqsubmitted - 1) {
|
||||||
|
cpu_pause();
|
||||||
|
}
|
||||||
|
kprintf("%s: waited %lu cycles for req->seqcomp\n",
|
||||||
|
__FUNCTION__, rdtsc() - ts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
user_sdma_free_request(req, true);
|
||||||
pq_update(pq);
|
pq_update(pq);
|
||||||
set_comp_state(pq, cq, info.comp_idx, ERROR, req->status);
|
set_comp_state(pq, cq, info.comp_idx, ERROR, ret);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1263,7 +1262,6 @@ dosend:
|
|||||||
&req->txps, &count);
|
&req->txps, &count);
|
||||||
req->seqsubmitted += count;
|
req->seqsubmitted += count;
|
||||||
if (req->seqsubmitted == req->info.npkts) {
|
if (req->seqsubmitted == req->info.npkts) {
|
||||||
WRITE_ONCE(req->done, 1);
|
|
||||||
/*
|
/*
|
||||||
* The txreq has already been submitted to the HW queue
|
* The txreq has already been submitted to the HW queue
|
||||||
* so we can free the AHG entry now. Corruption will not
|
* so we can free the AHG entry now. Corruption will not
|
||||||
@@ -1572,7 +1570,7 @@ static void user_sdma_txreq_cb(struct sdma_txreq *txreq, int status)
|
|||||||
struct user_sdma_request *req;
|
struct user_sdma_request *req;
|
||||||
struct hfi1_user_sdma_pkt_q *pq;
|
struct hfi1_user_sdma_pkt_q *pq;
|
||||||
struct hfi1_user_sdma_comp_q *cq;
|
struct hfi1_user_sdma_comp_q *cq;
|
||||||
u16 idx;
|
enum hfi1_sdma_comp_state state = COMPLETE;
|
||||||
|
|
||||||
if (!tx->req)
|
if (!tx->req)
|
||||||
return;
|
return;
|
||||||
@@ -1585,37 +1583,24 @@ static void user_sdma_txreq_cb(struct sdma_txreq *txreq, int status)
|
|||||||
SDMA_DBG(req, "SDMA completion with error %d",
|
SDMA_DBG(req, "SDMA completion with error %d",
|
||||||
status);
|
status);
|
||||||
WRITE_ONCE(req->has_error, 1);
|
WRITE_ONCE(req->has_error, 1);
|
||||||
|
state = ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
req->seqcomp = tx->seqnum;
|
req->seqcomp = tx->seqnum;
|
||||||
kmalloc_cache_free(tx);
|
kmalloc_cache_free(tx);
|
||||||
tx = NULL;
|
|
||||||
|
|
||||||
idx = req->info.comp_idx;
|
/* sequence isn't complete? We are done */
|
||||||
if (req->status == -1 && status == SDMA_TXREQ_S_OK) {
|
if (req->seqcomp != req->info.npkts - 1)
|
||||||
if (req->seqcomp == req->info.npkts - 1) {
|
return;
|
||||||
req->status = 0;
|
|
||||||
user_sdma_free_request(req, false);
|
user_sdma_free_request(req, false);
|
||||||
pq_update(pq);
|
set_comp_state(pq, cq, req->info.comp_idx, state, status);
|
||||||
set_comp_state(pq, cq, idx, COMPLETE, 0);
|
pq_update(pq);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (status != SDMA_TXREQ_S_OK)
|
|
||||||
req->status = status;
|
|
||||||
if (req->seqcomp == (ACCESS_ONCE(req->seqsubmitted) - 1) &&
|
|
||||||
(READ_ONCE(req->done) ||
|
|
||||||
READ_ONCE(req->has_error))) {
|
|
||||||
user_sdma_free_request(req, false);
|
|
||||||
pq_update(pq);
|
|
||||||
set_comp_state(pq, cq, idx, ERROR, req->status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void pq_update(struct hfi1_user_sdma_pkt_q *pq)
|
static inline void pq_update(struct hfi1_user_sdma_pkt_q *pq)
|
||||||
{
|
{
|
||||||
if (atomic_dec_and_test(&pq->n_reqs)) {
|
if (atomic_dec_and_test(&pq->n_reqs)) {
|
||||||
xchg(&pq->state, SDMA_PKT_Q_INACTIVE);
|
|
||||||
//TODO: pq_update wake_up
|
//TODO: pq_update wake_up
|
||||||
//wake_up(&pq->wait);
|
//wake_up(&pq->wait);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user