cxgbetool(8): Add the ability to decode hardware TCBs.

Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2018-03-14 00:04:58 +00:00
parent 576157b3ec
commit ae9b401786
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330887
10 changed files with 6583 additions and 0 deletions

View File

@ -2,6 +2,11 @@
PROG= cxgbetool
MAN= cxgbetool.8
SRCS= cxgbetool.c
SRCS+= tcb_common.c
SRCS+= tcbinfot4.c tcbshowt4.c
SRCS+= tcbinfot5.c tcbshowt5.c
SRCS+= tcbinfot6.c tcbshowt6.c
CFLAGS+= -I${SRCTOP}/sys/dev/cxgbe -I${SRCTOP}/sys -I.
WARNS?= 2

View File

@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "t4_ioctl.h"
#include "tcb_common.h"
#define in_range(val, lo, hi) ( val < 0 || (val <= hi && val >= lo))
#define max(x, y) ((x) > (y) ? (x) : (y))
@ -2102,6 +2103,7 @@ memdump(int argc, const char *argv[])
static void
show_tcb(uint32_t *buf, uint32_t len)
{
unsigned char *tcb = (unsigned char *)buf;
const char *s;
int i, n = 8;
@ -2112,6 +2114,10 @@ show_tcb(uint32_t *buf, uint32_t len)
}
printf("\n");
}
set_tcb_info(TIDTYPE_TCB, chip_id);
set_print_style(PRNTSTYL_COMP);
swizzle_tcb(tcb);
parse_n_display_xcb(tcb);
}
#define A_TP_CMM_TCB_BASE 0x7d10

View File

@ -0,0 +1,703 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2018 Chelsio Communications, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "tcb_common.h"
/***:-----------------------------------------------------------------------
***: externals
***:-----------------------------------------------------------------------
*/
extern _TCBVAR g_tcb_info4[];
extern _TCBVAR g_scb_info4[];
extern _TCBVAR g_fcb_info4[];
extern void t4_display_tcb_aux_0(_TCBVAR *tvp,int aux);
extern void t4_display_tcb_aux_1(_TCBVAR *tvp,int aux);
extern void t4_display_tcb_aux_2(_TCBVAR *tvp,int aux);
extern void t4_display_tcb_aux_3(_TCBVAR *tvp,int aux);
extern _TCBVAR g_tcb_info5[];
extern _TCBVAR g_scb_info5[];
extern _TCBVAR g_fcb_info5[];
extern void t5_display_tcb_aux_0(_TCBVAR *tvp,int aux);
extern void t5_display_tcb_aux_1(_TCBVAR *tvp,int aux);
extern void t5_display_tcb_aux_2(_TCBVAR *tvp,int aux);
extern void t5_display_tcb_aux_3(_TCBVAR *tvp,int aux);
extern _TCBVAR g_tcb_info6[];
extern _TCBVAR g_scb_info6[];
extern _TCBVAR g_fcb_info6[];
extern void t6_display_tcb_aux_0(_TCBVAR *tvp,int aux);
extern void t6_display_tcb_aux_1(_TCBVAR *tvp,int aux);
extern void t6_display_tcb_aux_2(_TCBVAR *tvp,int aux);
extern void t6_display_tcb_aux_3(_TCBVAR *tvp,int aux);
extern void t6_display_tcb_aux_4(_TCBVAR *tvp,int aux);
/***:-----------------------------------------------------------------------
***: globals
***:-----------------------------------------------------------------------
*/
_TCBVAR *g_tcb_info=g_tcb_info5;
_TCBVAR *g_scb_info=g_scb_info5;
_TCBVAR *g_fcb_info=g_fcb_info5;
static int g_tN=0;
static int g_prntstyl=PRNTSTYL_COMP;
static int g_got_scb=0;
static int g_got_fcb=0;
/***:-----------------------------------------------------------------------
***: error exit functions
***:-----------------------------------------------------------------------
*/
/**: err_exit functions
*: ------------------
*/
void tcb_prflush(void)
{
fflush(stdout);
fflush(stderr);
}
void tcb_code_err_exit(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
printf("Coding Error in: ");
vprintf(fmt, args);
printf("\n");
tcb_prflush();
va_end(args);
exit(1);
}
/***:-----------------------------------------------------------------------
***: tcb_hexdump functions
***:-----------------------------------------------------------------------
*/
void
tcb_hexdump(unsigned base, unsigned char *buf, unsigned int size)
{
unsigned offset;
for (offset = 0; offset < size; ++offset) {
if (!(offset % 16)) printf("\n0x%4.4x: ", base + offset);
else if (!(offset % 8)) printf(" ");
printf("%2.2x ", (unsigned char)buf[offset]);
}
}
int tcb_strmatch_nc(char *cs, char *ct) {
while (*cs)
if (tolower(*cs++) != tolower(*ct++)) return (FALSE);
return (!(*ct)); /*return TRUE if *ct NULL at same time as *cs==NULL*/
}
/*: -------------------------------------------------------------------------
string functions
tcb_strmatch_nc: Similar to exact match, but case insensitive.
*/
int
tcb_strncmp_nc(char *cs, char *ct, int n)
{
/*case insensitive version of the standard strncmp() function */
int i = 0;
int ret;
ret = 0;
for (i = 0; i < n && 0 == ret && !(EOS == *cs && EOS == *ct); ++i) {
/* this is weird, but it matched GCC linux when strings don't
* have any upper case characters.
*/
ret = tolower(*cs++) - tolower(*ct++);
}
return ret;
}
int
tcb_startswith_nc(char *cs, char *ct)
{ /* return true if cs start with ct */
return (0 == tcb_strncmp_nc(cs, ct, (int)strlen(ct)));
}
/***:-----------------------------------------------------------------------
***: START OF WINDOWS FUNCTIONS
***:-----------------------------------------------------------------------
*/
/***:-----------------------------------------------------------------------
***: print utilties
***:-----------------------------------------------------------------------
*/
static int g_PR_indent=1;
void PR(char *fmt, ...)
{
int fmt_len;
va_list args;
va_start(args,fmt);
if (g_PR_indent) printf(" ");
g_PR_indent=0;
fmt_len=(int) strlen(fmt);
if (fmt_len>0 && fmt[fmt_len-1]=='\n') g_PR_indent=1;
vprintf(fmt,args);
tcb_prflush();
va_end(args);
}
/***:-----------------------------------------------------------------------
***: val()
***:-----------------------------------------------------------------------
*/
_TCBVAR *
lu_tcbvar(char *name)
{
_TCBVAR *tvp=g_tcb_info;
while (tvp->name!=NULL) {
if (tcb_strmatch_nc(name,tvp->name)) return tvp;
else if (tcb_strmatch_nc(name,tvp->aka )) return tvp;
tvp+=1;
}
tcb_code_err_exit("lu_tcbvar: bad name %s\n",name);
return NULL;
}
unsigned
val(char *name)
{
_TCBVAR *tvp;
tvp=lu_tcbvar(name);
return tvp->val;
}
ui64
val64(char *name)
{
_TCBVAR *tvp;
tvp=lu_tcbvar(name);
return tvp->rawval;
}
/***:-----------------------------------------------------------------------
***: get_tcb_bits
***:-----------------------------------------------------------------------
*/
static int
get_tcb_bit(unsigned char *A, int bit)
{
int ret=0;
int ix,shift;
ix = 127 - (bit>>3);
shift=bit&0x7;
/* prdbg(" ix: %u, shift=%u\n",ix,shift); */
ret=(A[ix] >> shift) & 1;
return ret;
}
static ui64
get_tcb_bits (unsigned char *A, int hi, int lo)
{
ui64 ret=0;
if (lo>hi) {
int temp=lo;
lo=hi;
hi=temp;
}
while (hi>=lo) {
ret = (ret<<1) | get_tcb_bit(A,hi);
--hi;
}
return ret;
}
void
decompress_val(_TCBVAR *tvp,unsigned ulp_type,unsigned tx_max,
unsigned rcv_nxt,unsigned rx_frag0_start_idx_raw)
{
unsigned rawval=(unsigned) tvp->rawval;
switch(tvp->comp) {
case COMP_NONE: tvp->val=rawval; break;
case COMP_ULP: tvp->val=rawval; break;
case COMP_TX_MAX:
tvp->val=(tx_max - rawval) & 0xFFFFFFFF;
break;
case COMP_RCV_NXT:
if (tcb_startswith_nc(tvp->name,"rx_frag")) {
unsigned fragx=0;
if (!tcb_strmatch_nc(tvp->name,"rx_frag0_start_idx_raw"))
fragx=rawval;
tvp->val=(rcv_nxt+rx_frag0_start_idx_raw+fragx) & 0xFFFFFFFF;
} else {
tvp->val=(rcv_nxt - rawval) & 0xFFFFFFFF;
}
break;
case COMP_PTR: tvp->val=rawval; break;
case COMP_LEN:
{
tvp->val=rawval;
if (PM_MODE_RDDP==ulp_type || PM_MODE_DDP==ulp_type ||
PM_MODE_IANDP==ulp_type) {
/* TP does this internally. Not sure if I should show the
* unaltered value or the raw value. For now I
* will diplay the raw value. For now I've added the code
* mainly to stop windows compiler from warning about ulp_type
* being an unreferenced parameter.
*/
tvp->val=0;
tvp->val=rawval; /* comment this out to display altered value */
}
}
break;
default:
tcb_code_err_exit("decompress_val, bad switch: %d",tvp->comp);
break;
}
}
void
get_tcb_field(_TCBVAR *tvp,unsigned char *buf)
{
assert(tvp->hi-tvp->lo+1<=64);
assert(tvp->hi>=tvp->lo);
tvp->rawval=get_tcb_bits(buf,tvp->lo,tvp->hi);
/* assume no compression and 32-bit value for now */
tvp->val=(unsigned) (tvp->rawval & 0xFFFFFFFF);
}
/***:-----------------------------------------------------------------------
***: spr_* functions
***:-----------------------------------------------------------------------
*/
char *
spr_tcp_state (unsigned state)
{
char *ret="UNKNOWN";
if ( 0 == state) {ret = "CLOSED";}
else if ( 1 == state) {ret = "LISTEN";}
else if ( 2 == state) {ret = "SYN_SENT";}
else if ( 3 == state) {ret = "SYN_RCVD";}
else if ( 4 == state) {ret = "ESTABLISHED";}
else if ( 5 == state) {ret = "CLOSE_WAIT";}
else if ( 6 == state) {ret = "FIN_WAIT_1";}
else if ( 7 == state) {ret = "CLOSING";}
else if ( 8 == state) {ret = "LAST_ACK";}
else if ( 9 == state) {ret = "FIN_WAIT_2";}
else if (10 == state) {ret = "TIME_WAIT";}
else if (11 == state) {ret = "ESTABLISHED_RX";}
else if (12 == state) {ret = "ESTABLISHED_TX";}
else if (13 == state) {ret = "SYN_PEND";}
else if (14 == state) {ret = "ESC_1_STATE";}
else if (15 == state) {ret = "ESC_2_STATE";}
return ret;
}
char *
spr_cctrl_sel(unsigned sel0,unsigned sel1)
{
unsigned sel=(sel1<<1) | sel0;
char *ret="UNKNOWN";
if ( 0 == sel) {ret = "Reno";}
else if ( 1 == sel) {ret = "Tahoe";}
else if ( 2 == sel) {ret = "NewReno";}
else if ( 3 == sel) {ret = "HighSpeed";}
return ret;
}
char *
spr_ulp_type(unsigned ulp_type)
{
char *ret="UNKNOWN";
/*The tp.h PM_MODE_XXX call 1 DDP and 5 IANDP, but external
* documentation (tcb.h" calls 5 ddp, and doesn't mention 1 or 3.
*/
if ( PM_MODE_PASS == ulp_type) {ret = "TOE";}
else if ( PM_MODE_DDP == ulp_type) {ret = "DDP";}
else if ( PM_MODE_ISCSI == ulp_type) {ret = "ISCSI";}
else if ( PM_MODE_IWARP == ulp_type) {ret = "IWARP";}
else if ( PM_MODE_RDDP == ulp_type) {ret = "RDMA";}
else if ( PM_MODE_IANDP == ulp_type) {ret = "IANDP_DDP";}
else if ( PM_MODE_FCOE == ulp_type) {ret = "FCoE";}
else if ( PM_MODE_USER == ulp_type) {ret = "USER";}
else if ( PM_MODE_TLS == ulp_type) {ret = "TLS";}
else if ( PM_MODE_DTLS == ulp_type) {ret = "DTLS";}
return ret;
}
char *
spr_ip_version(unsigned ip_version)
{
char *ret="UNKNOWN";
if ( 0 == ip_version) {ret = "IPv4";}
else if ( 1 == ip_version) {ret = "IPv6";}
return ret;
}
/***:-----------------------------------------------------------------------
***: display_tcb()
***:-----------------------------------------------------------------------
*/
void
display_tcb_compressed(_TCBVAR *tvp,int aux)
{
if (g_tN==4) {
t4_display_tcb_aux_0(tvp,aux);
if (1==aux) t4_display_tcb_aux_1(tvp,aux);
else if (2==aux) t4_display_tcb_aux_2(tvp,aux);
else if (3==aux) t4_display_tcb_aux_3(tvp,aux);
} else if (g_tN==5) {
t5_display_tcb_aux_0(tvp,aux);
if (1==aux) t5_display_tcb_aux_1(tvp,aux);
else if (2==aux) t5_display_tcb_aux_2(tvp,aux);
else if (3==aux) t5_display_tcb_aux_3(tvp,aux);
} else if (g_tN==6) {
t6_display_tcb_aux_0(tvp,aux);
if (1==aux) t6_display_tcb_aux_1(tvp,aux);
else if (2==aux) t6_display_tcb_aux_2(tvp,aux);
else if (3==aux) t6_display_tcb_aux_3(tvp,aux);
else if (4==aux) t6_display_tcb_aux_4(tvp,aux);
}
}
/***:-----------------------------------------------------------------------
***: parse_n_decode_tcb
***:-----------------------------------------------------------------------
*/
unsigned
parse_tcb( _TCBVAR *base_tvp, unsigned char *buf)
{ /* parse the TCB */
_TCBVAR *tvp=base_tvp;
unsigned ulp_type;
int aux=1; /* assume TOE or iSCSI */
unsigned tx_max=0, rcv_nxt=0, rx_frag0_start_idx_raw=0;
int got_tx_max=0, got_rcv_nxt=0, got_rx_frag0_start_idx_raw=0;
/* parse the TCB */
while (tvp->name!=NULL) {
get_tcb_field(tvp,buf);
if (!got_tx_max && tcb_strmatch_nc("tx_max",tvp->name)) {
tx_max=tvp->val;
got_tx_max=1;
}
if (!got_rcv_nxt && tcb_strmatch_nc("rcv_nxt",tvp->name)) {
rcv_nxt=tvp->val;
got_rcv_nxt=1;
}
if (!got_rx_frag0_start_idx_raw &&
tcb_strmatch_nc("rx_frag0_start_idx_raw",tvp->name)) {
rx_frag0_start_idx_raw=tvp->val;
got_rx_frag0_start_idx_raw=1;
}
tvp+=1;
}
tvp=base_tvp;
ulp_type=tvp->val; /* ULP type is always first variable in TCB */
if (PM_MODE_IANDP==ulp_type || PM_MODE_FCOE==ulp_type) aux=3;
else if (PM_MODE_RDDP==ulp_type) aux=2;
else if (6==g_tN && (PM_MODE_TLS==ulp_type || PM_MODE_DTLS==ulp_type)) aux=4;
else aux=1;
assert(got_tx_max && got_rcv_nxt && got_rx_frag0_start_idx_raw);
/* decompress the compressed values */
tvp=base_tvp;
while (tvp->name!=NULL) {
decompress_val(tvp,ulp_type,tx_max,rcv_nxt,rx_frag0_start_idx_raw);
tvp+=1;
}
return aux;
}
void
parse_scb( _TCBVAR *base_tvp, unsigned char *buf)
{ /* parse the SCB */
_TCBVAR *tvp=base_tvp;
while (tvp->name!=NULL) {
if (tcb_strmatch_nc("scb_slush",tvp->name)) {
/* the scb_slush field is all of remaining memory */
tvp->rawval=0;
tvp->val=0;
} else {
get_tcb_field(tvp,buf);
}
tvp+=1;
}
}
void
parse_fcb( _TCBVAR *base_tvp, unsigned char *buf)
{ /* parse the FCB */
_TCBVAR *tvp=base_tvp;
while (tvp->name!=NULL) {
get_tcb_field(tvp,buf);
tvp+=1;
}
}
void
display_list_tcb(_TCBVAR *base_tvp,int aux)
{
_TCBVAR *tvp=base_tvp;
while (tvp->name!=NULL) {
if (tvp->aux==0 || tvp->aux==aux) {
if (tvp->hi-tvp->lo+1<=32) {
printf(" %4d:%4d %31s: %10u (0x%1x)",tvp->lo,tvp->hi,tvp->name,
(unsigned) tvp->rawval,(unsigned) tvp->rawval);
if (COMP_TX_MAX==tvp->comp || COMP_RCV_NXT==tvp->comp)
printf(" -> %1u (0x%x)", tvp->val,tvp->val);
} else {
printf(" %4d:%4d %31s: 0x%1llx",tvp->lo,tvp->hi,tvp->name,
tvp->rawval);
}
printf("\n");
}
tvp+=1;
}
}
void
display_tcb(_TCBVAR *tvp,unsigned char *buf,int aux)
{
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_RAW) {
tcb_hexdump(0,buf,128);
printf("\n");
}
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_LIST) {
display_list_tcb(tvp,aux);
}
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_COMP) {
display_tcb_compressed(tvp,aux);
}
}
void
parse_n_display_tcb(unsigned char *buf)
{
_TCBVAR *tvp=g_tcb_info;
int aux;
aux=parse_tcb(tvp,buf);
display_tcb(tvp,buf,aux);
}
void
parse_n_display_scb(unsigned char *buf)
{
_TCBVAR *tvp=g_scb_info;
parse_scb(tvp,buf);
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_RAW) {
tcb_hexdump(0,buf,128);
printf("\n");
}
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_LIST ||
g_prntstyl==PRNTSTYL_COMP) {
display_list_tcb(tvp,0);
}
}
void
parse_n_display_fcb(unsigned char *buf)
{
_TCBVAR *tvp=g_fcb_info;
parse_fcb(tvp,buf);
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_RAW) {
tcb_hexdump(0,buf,128);
printf("\n");
}
if (g_prntstyl==PRNTSTYL_VERBOSE ||
g_prntstyl==PRNTSTYL_LIST ||
g_prntstyl==PRNTSTYL_COMP) {
display_list_tcb(tvp,0);
}
}
void
parse_n_display_xcb(unsigned char *buf)
{
if (g_got_scb) parse_n_display_scb(buf);
else if (g_got_fcb) parse_n_display_fcb(buf);
else parse_n_display_tcb(buf);
}
/***:-----------------------------------------------------------------------
***: swizzle_tcb
***:-----------------------------------------------------------------------
*/
void
swizzle_tcb(unsigned char *buf)
{
int i,j,k;
for (i=0, j=128-16 ; i<j ; i+=16, j-=16) {
unsigned char temp;
for (k=0; k<16; ++k) {
temp=buf[i+k];
buf[i+k]=buf[j+k];
buf[j+k]=temp;
}
}
}
/***:-----------------------------------------------------------------------
***: END OF WINDOWS FUNCTIONS
***:-----------------------------------------------------------------------
*/
void set_tidtype(unsigned int tidtype)
{
if (tidtype == TIDTYPE_SCB)
{
g_got_scb = 1;
}
else if (tidtype == TIDTYPE_FCB)
{
g_got_fcb = 1;
}
else
{
g_got_scb = 0;
g_got_fcb = 0;
}
}
void
set_tcb_info(unsigned int tidtype, unsigned int cardtype)
{
set_tidtype(tidtype);
g_tN = cardtype;
if (4 == g_tN) {
g_tcb_info = g_tcb_info4;
g_scb_info = g_scb_info4;
g_fcb_info = g_fcb_info4;
}
else if (5 == g_tN) {
g_tcb_info = g_tcb_info5;
g_scb_info = g_scb_info5;
g_fcb_info = g_fcb_info5;
}
else if (6 == g_tN) {
g_tcb_info = g_tcb_info6;
g_scb_info = g_scb_info6;
g_fcb_info = g_fcb_info6;
}
}
void
set_print_style(unsigned int prntstyl)
{
g_prntstyl=prntstyl;
}

View File

@ -0,0 +1,160 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2018 Chelsio Communications, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*
*/
#ifndef __tcb_common_h
#define __tcb_common_h
/* ANSI C standard includes */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#ifndef FALSE
#define FALSE 0
#endif
#ifndef EOS
#define EOS '\0'
#endif
#ifndef __variable_sizes
/* windows has _UI64_MAX. C99 has ULLONG_MAX, but I don't compile
with C99 for portability with windows, so the ui64 is a guess.
I'll add an assert to cl_main to confirm these sizes are accurate.
*/
#ifdef _UI64_MAX /* windows */
#if (_UI64_MAX == 0xFFFFFFFFFFFFFFFF)
typedef __int64 si64;
typedef unsigned __int64 ui64;
#endif
#else /*else of #ifdef _UI64_MAX */
typedef long long int si64;
typedef unsigned long long int ui64;
#endif /*endif of #ifdef _UI64_MAX */
#endif /* endif of #ifndef __variable_sizes */
typedef struct tcb_var {
char *name;
int aux;
int lo;
int hi;
char *faka;
int flo;
int fhi;
char *aka;
int comp;
char *desc;
char *akadesc;
ui64 rawval;
unsigned val;
} _TCBVAR;
enum comp_types {
COMP_NONE=0,
COMP_ULP,
COMP_TX_MAX,
COMP_RCV_NXT,
COMP_PTR,
COMP_LEN,
};
enum tidtypes {
TIDTYPE_TCB=0,
TIDTYPE_SCB=1,
TIDTYPE_FCB=2,
};
enum prntstyls {
PRNTSTYL_VERBOSE=0,
PRNTSTYL_LIST=1,
PRNTSTYL_COMP=2,
PRNTSTYL_RAW=3,
};
/* from tp/src/tp.h */
#define PM_MODE_PASS 0
#define PM_MODE_DDP 1
#define PM_MODE_ISCSI 2
#define PM_MODE_IWARP 3
#define PM_MODE_RDDP 4
#define PM_MODE_IANDP 5
#define PM_MODE_FCOE 6
#define PM_MODE_USER 7
#define PM_MODE_TLS 8
#define PM_MODE_DTLS 9
#define SEQ_ADD(a,b) (((a)+(b)) & 0xFFFFFFFF)
#define SEQ_SUB(a,b) (((a)-(b)) & 0xFFFFFFFF)
///* functions needed by the tcbshowtN.c code */
extern unsigned val(char *name);
extern ui64 val64(char *name);
extern void PR(char *fmt, ...);
extern char *spr_tcp_state(unsigned state);
extern char *spr_ip_version(unsigned ipver);
extern char *spr_cctrl_sel(unsigned cctrl_sel0,unsigned cctrl_sel1);
extern char *spr_ulp_type(unsigned ulp_type);
extern unsigned parse_tcb( _TCBVAR *base_tvp, unsigned char *buf);
extern void display_tcb(_TCBVAR *tvp,unsigned char *buf,int aux);
extern void parse_n_display_xcb(unsigned char *buf);
extern void swizzle_tcb(unsigned char *buf);
extern void set_tidtype(unsigned int tidtype);
extern void set_tcb_info(unsigned int tidtype, unsigned int cardtype);
extern void set_print_style(unsigned int prntstyl);
#endif /* __tcb_common_h */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,416 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2018 Chelsio Communications, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* Auto-generated file. Avoid direct editing. */
/* Edits will be lost when file regenerated. */
#include <stdio.h>
#include "tcb_common.h"
void t4_display_tcb_aux_0 (_TCBVAR *tvp, int aux)
{
PR("STATE:\n");
PR(" %-12s (%-2u), %s, lock_tid %u, init %u\n",
spr_tcp_state(val("t_state")),
val("t_state"),
spr_ip_version(val("ip_version")),
val("lock_tid"),
val("init")
);
PR(" l2t_ix 0x%x, smac sel 0x%x, tos 0x%x\n",
val("l2t_ix"),
val("smac_sel"),
val("tos")
);
PR(" maxseg %u, recv_scaleflag %u, recv_tstmp %u, recv_sack %u\n",
val("t_maxseg"), val("recv_scale"),
val("recv_tstmp"), val("recv_sack"));
PR("TIMERS:\n"); /* **************************************** */
PR(" timer %u, dack_timer %u\n",
val("timer"), val("dack_timer"));
PR(" mod_schd: tx: %u, rx: %u, reason 0x%1x\n",
val("mod_schd_tx"),
val("mod_schd_rx"),
((val("mod_schd_reason2")<<2) | (val("mod_schd_reason1")<<1) |
val("mod_schd_reason0"))
);
PR(" max_rt %-2u, rxtshift %u, keepalive %u\n",
val("max_rt"), val("t_rxtshift"),
val("keepalive"));
PR(" timestamp_offset 0x%x, timestamp 0x%x\n",
val("timestamp_offset"),val("timestamp"));
PR(" t_rtt_ts_recent_age %u t_rttseq_recent %u\n",
val("t_rtt_ts_recent_age"), val("t_rtseq_recent"));
PR(" t_srtt %u, t_rttvar %u\n",
val("t_srtt"),val("t_rttvar"));
PR("TRANSMIT BUFFER:\n"); /* *************************** */
PR(" snd_una %u, snd_nxt %u, snd_max %u, tx_max %u\n",
val("snd_una"),val("snd_nxt"),
val("snd_max"),val("tx_max"));
PR(" core_fin %u, tx_hdr_offset %u\n",
val("core_fin"), SEQ_SUB(val("tx_max"),val("snd_una"))
);
if (val("recv_scale") && !val("active_open")) {
PR(" rcv_adv %-5u << %-2u == %u (recv_scaleflag %u rcv_scale %u active open %u)\n",
val("rcv_adv"), val("rcv_scale"),
val("rcv_adv") << val("rcv_scale"),
val("recv_scale"), val("rcv_scale"), val("active_open"));
} else {
PR(" rcv_adv %-5u (rcv_scale %-2u recv_scaleflag %u active_open %u)\n",
val("rcv_adv"), val("rcv_scale"),
val("recv_scale"), val("active_open"));
}
PR(" snd_cwnd %-5u snd_ssthresh %u snd_rec %u\n",
val("snd_cwnd") , val("snd_ssthresh"), val("snd_rec")
);
PR(" cctrl: sel %s, ecn %u, ece %u, cwr %u, rfr %u\n",
spr_cctrl_sel(val("cctrl_sel0"),val("cctrl_sel1")),
val("cctrl_ecn"), val("cctrl_ece"), val("cctrl_cwr"),
val("cctrl_rfr"));
PR(" t_dupacks %u, dupack_count_odd %u, fast_recovery %u\n",
val("t_dupacks"), val("dupack_count_odd"),val("fast_recovery"));
PR(" core_more %u, core_urg, %u core_push %u,",
val("core_more"),val("core_urg"),val("core_push"));
PR(" core_flush %u\n",val("core_flush"));
PR(" nagle %u, ssws_disable %u, turbo %u,",
val("nagle"), val("ssws_disabled"), val("turbo"));
PR(" tx_pdu_out %u\n",val("tx_pdu_out"));
PR(" tx_pace_auto %u, tx_pace_fixed %u, tx_queue %u",
val("tx_pace_auto"),val("tx_pace_fixed"),val("tx_queue"));
PR(" tx_quiesce %u\n",val("tx_quiesce"));
PR(" tx_channel %u, tx_channel1 %u, tx_channel0 %u\n",
val("tx_channel"),
(val("tx_channel")>>1)&1,
val("tx_channel")&1
);
PR(" tx_hdr_ptr 0x%-6x tx_last_ptr 0x%-6x tx_compact %u\n",
val("tx_hdr_ptr"),val("tx_last_ptr"),val("tx_compact"));
PR("RECEIVE BUFFER:\n"); /* *************************** */
PR(" last_ack_sent %-10u rx_compact %u\n",
val("ts_last_ack_sent"),val("rx_compact"));
PR(" rcv_nxt %-10u hdr_off %-10u\n",
val("rcv_nxt"), val("rx_hdr_offset"));
PR(" frag0_idx %-10u length %-10u frag0_ptr 0x%-8x\n",
val("rx_frag0_start_idx"),
val("rx_frag0_len"),
val("rx_ptr"));
PR(" frag1_idx %-10u length %-10u ",
val("rx_frag1_start_idx_offset"),
val("rx_frag1_len"));
if (val("ulp_type")!=4) { /* RDMA has FRAG1 idx && len, but no ptr? Should I not display frag1 at all? */
PR("frag1_ptr 0x%-8x\n",val("rx_frag1_ptr"));
} else {
PR("\n");
}
if (val("ulp_type") !=6 && val("ulp_type") != 5 && val("ulp_type") !=4) {
PR(" frag2_idx %-10u length %-10u frag2_ptr 0x%-8x\n",
val("rx_frag2_start_idx_offset"),
val("rx_frag2_len"),
val("rx_frag2_ptr"));
PR(" frag3_idx %-10u length %-10u frag3_ptr 0x%-8x\n",
val("rx_frag3_start_idx_offset"),
val("rx_frag3_len"),
val("rx_frag3_ptr"));
}
PR(" peer_fin %u, rx_pdu_out %u, pdu_len %u\n",
val("peer_fin"),val("rx_pdu_out"), val("pdu_len"));
if (val("recv_scale")) {
PR(" rcv_wnd %u >> snd_scale %u == %u, recv_scaleflag = %u\n",
val("rcv_wnd"), val("snd_scale"),
val("rcv_wnd") >> val("snd_scale"),
val("recv_scale"));
} else {
PR(" rcv_wnd %u. (snd_scale %u, recv_scaleflag = %u)\n",
val("rcv_wnd"), val("snd_scale"),
val("recv_scale"));
}
PR(" dack_mss %u dack %u, dack_not_acked: %u\n",
val("dack_mss"),val("dack"),val("dack_not_acked"));
PR(" rcv_coal %u rcv_co_psh %u rcv_co_last_psh %u heart %u\n",
val("rcv_coalesce_enable"),
val("rcv_coalesce_push"),
val("rcv_coalesce_last_psh"),
val("rcv_coalesce_heartbeat"));
PR(" rx_channel %u rx_quiesce %u rx_flow_ctrl_dis %u,",
val("rx_channel"), val("rx_quiesce"),
val("rx_flow_control_disable"));
PR(" rx_flow_ctrl_ddp %u\n",
val("rx_flow_control_ddp"));
PR("MISCELANEOUS:\n"); /* *************************** */
PR(" pend_ctl: 0x%1x, unused_flags: 0x%x, main_slush: 0x%x\n",
((val("pend_ctl2")<<2) | (val("pend_ctl1")<<1) |
val("pend_ctl0")),
val("unused"),val("main_slush"));
PR(" Migrating %u, ask_mode %u, non_offload %u, rss_info %u\n",
val("migrating"),
val("ask_mode"), val("non_offload"), val("rss_info"));
PR(" ULP: ulp_type %u (%s), ulp_raw %u\n",
val("ulp_type"), spr_ulp_type(val("ulp_type")),val("ulp_raw"));
PR(" RDMA: error %u, flm_err %u\n",
val("rdma_error"), val("rdma_flm_error"));
}
void t4_display_tcb_aux_1 (_TCBVAR *tvp, int aux)
{
PR(" aux1_slush0: 0x%x aux1_slush1 0x%x\n",
val("aux1_slush0"), val("aux1_slush1"));
PR(" pdu_hdr_len %u\n",val("pdu_hdr_len"));
}
void t4_display_tcb_aux_2 (_TCBVAR *tvp, int aux)
{
PR(" qp_id %u, pd_id %u, stag %u\n",
val("qp_id"), val("pd_id"),val("stag"));
PR(" irs_ulp %u, iss_ulp %u\n",
val("irs_ulp"),val("iss_ulp"));
PR(" tx_pdu_len %u\n",
val("tx_pdu_len"));
PR(" cq_idx_sq %u, cq_idx_rq %u\n",
val("cq_idx_sq"),val("cq_idx_rq"));
PR(" rq_start %u, rq_MSN %u, rq_max_off %u, rq_write_ptr %u\n",
val("rq_start"),val("rq_msn"),val("rq_max_offset"),
val("rq_write_ptr"));
PR(" L_valid %u, rdmap opcode %u\n",
val("ord_l_bit_vld"),val("rdmap_opcode"));
PR(" tx_flush: %u, tx_oos_rxmt %u, tx_oos_txmt %u\n",
val("tx_flush"),val("tx_oos_rxmt"),val("tx_oos_txmt"));
}
void t4_display_tcb_aux_3 (_TCBVAR *tvp, int aux)
{
PR(" aux3_slush: 0x%x, unused: buf0 0x%x, buf1: 0x%x, main: 0x%x\n",
val("aux3_slush"),val("ddp_buf0_unused"),val("ddp_buf1_unused"),
val("ddp_main_unused"));
PR(" DDP: DDPOFF ActBuf IndOut WaitFrag Rx2Tx BufInf\n");
PR(" %u %u %u %u %u %u\n",
val("ddp_off"),val("ddp_active_buf"),val("ddp_indicate_out"),
val("ddp_wait_frag"),val("ddp_rx2tx"),val("ddp_buf_inf")
);
PR(" Ind PshfEn PushDis Flush NoInvalidate\n");
PR(" Buf0: %u %u %u %u %u\n",
val("ddp_buf0_indicate"),
val("ddp_pshf_enable_0"), val("ddp_push_disable_0"),
val("ddp_buf0_flush"), val("ddp_psh_no_invalidate0")
);
PR(" Buf1: %u %u %u %u %u\n",
val("ddp_buf1_indicate"),
val("ddp_pshf_enable_1"), val("ddp_push_disable_1"),
val("ddp_buf1_flush"), val("ddp_psh_no_invalidate1")
);
PR(" Valid Offset Length Tag\n");
PR(" Buf0: %u 0x%6.6x 0x%6.6x 0x%8.8x",
val("ddp_buf0_valid"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_tag")
);
if (0==val("ddp_off") && 1==val("ddp_buf0_valid") && 0==val("ddp_active_buf")) {
PR(" (Active)\n");
} else {
PR(" (Inactive)\n");
}
PR(" Buf1: %u 0x%6.6x 0x%6.6x 0x%8.8x",
val("ddp_buf1_valid"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_tag")
);
if (0==val("ddp_off") && 1==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" (Active)\n");
} else {
PR(" (Inactive)\n");
}
if (1==val("ddp_off")) {
PR(" DDP is off (which also disables indicate)\n");
} else if (1==val("ddp_buf0_valid") && 0==val("ddp_active_buf")) {
PR(" Data being DDP'ed to buf 0, ");
PR("which has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len")-val("rx_ddp_buf0_offset")
);
if (1==val("ddp_buf1_valid")) {
PR(" And buf1, which is also valid, has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len")-val("rx_ddp_buf1_offset")
);
}
} else if (1==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" Data being DDP'ed to buf 1, ");
PR("which has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len")-val("rx_ddp_buf1_offset")
);
if (1==val("ddp_buf0_valid")) {
PR(" And buf0, which is also valid, has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len")-val("rx_ddp_buf0_offset")
);
}
} else if (0==val("ddp_buf0_valid") && 1==val("ddp_buf1_valid") && 0==val("ddp_active_buf")) {
PR(" !!! Invalid DDP buf 1 valid, but buf 0 active.\n");
} else if (1==val("ddp_buf0_valid") && 0==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" !!! Invalid DDP buf 0 valid, but buf 1 active.\n");
} else {
PR(" DDP is enabled, but no buffers are active && valid.\n");
if (0==val("ddp_indicate_out")) {
if (0==val("ddp_buf0_indicate") && 0==val("ddp_buf1_indicate")) {
PR(" 0 length Indicate buffers ");
if (0==val("rx_hdr_offset")) {
PR("will cause new data to be held in PMRX.\n");
} else {
PR("is causing %u bytes to be held in PMRX\n",
val("rx_hdr_offset"));
}
} else {
PR(" Data being indicated to host\n");
}
} else if (1==val("ddp_indicate_out")) {
PR(" Indicate is off, which ");
if (0==val("rx_hdr_offset")) {
PR("will cause new data to be held in PMRX.\n");
} else {
PR("is causing %u bytes to be held in PMRX\n",
val("rx_hdr_offset"));
}
}
}
}

View File

@ -0,0 +1,427 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2018 Chelsio Communications, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* Auto-generated file. Avoid direct editing. */
/* Edits will be lost when file regenerated. */
#include <stdio.h>
#include "tcb_common.h"
void t5_display_tcb_aux_0 (_TCBVAR *tvp, int aux)
{
PR("STATE:\n");
PR(" %-12s (%-2u), %s, lock_tid %u, rss_fw %u\n",
spr_tcp_state(val("t_state")),
val("t_state"),
spr_ip_version(val("ip_version")),
val("lock_tid"),
val("rss_fw")
);
PR(" l2t_ix 0x%x, smac sel 0x%x, tos 0x%x\n",
val("l2t_ix"),
val("smac_sel"),
val("tos")
);
PR(" maxseg %u, recv_scaleflag %u, recv_tstmp %u, recv_sack %u\n",
val("t_maxseg"), val("recv_scale"),
val("recv_tstmp"), val("recv_sack"));
PR("TIMERS:\n"); /* **************************************** */
PR(" timer %u, dack_timer %u\n",
val("timer"), val("dack_timer"));
PR(" mod_schd: tx: %u, rx: %u, reason 0x%1x\n",
val("mod_schd_tx"),
val("mod_schd_rx"),
((val("mod_schd_reason2")<<2) | (val("mod_schd_reason1")<<1) |
val("mod_schd_reason0"))
);
PR(" max_rt %-2u, rxtshift %u, keepalive %u\n",
val("max_rt"), val("t_rxtshift"),
val("keepalive"));
PR(" timestamp_offset 0x%x, timestamp 0x%x\n",
val("timestamp_offset"),val("timestamp"));
PR(" t_rtt_ts_recent_age %u t_rttseq_recent %u\n",
val("t_rtt_ts_recent_age"), val("t_rtseq_recent"));
PR(" t_srtt %u, t_rttvar %u\n",
val("t_srtt"),val("t_rttvar"));
PR("TRANSMIT BUFFER:\n"); /* *************************** */
PR(" snd_una %u, snd_nxt %u, snd_max %u, tx_max %u\n",
val("snd_una"),val("snd_nxt"),
val("snd_max"),val("tx_max"));
PR(" core_fin %u, tx_hdr_offset %u\n",
val("core_fin"), SEQ_SUB(val("tx_max"),val("snd_una"))
);
if (val("recv_scale") && !val("active_open")) {
PR(" rcv_adv %-5u << %-2u == %u (recv_scaleflag %u rcv_scale %u active open %u)\n",
val("rcv_adv"), val("rcv_scale"),
val("rcv_adv") << val("rcv_scale"),
val("recv_scale"), val("rcv_scale"), val("active_open"));
} else {
PR(" rcv_adv %-5u (rcv_scale %-2u recv_scaleflag %u active_open %u)\n",
val("rcv_adv"), val("rcv_scale"),
val("recv_scale"), val("active_open"));
}
PR(" snd_cwnd %-5u snd_ssthresh %u snd_rec %u\n",
val("snd_cwnd") , val("snd_ssthresh"), val("snd_rec")
);
PR(" cctrl: sel %s, ecn %u, ece %u, cwr %u, rfr %u\n",
spr_cctrl_sel(val("cctrl_sel0"),val("cctrl_sel1")),
val("cctrl_ecn"), val("cctrl_ece"), val("cctrl_cwr"),
val("cctrl_rfr"));
PR(" t_dupacks %u, dupack_count_odd %u, fast_recovery %u\n",
val("t_dupacks"), val("dupack_count_odd"),val("fast_recovery"));
PR(" core_more %u, core_urg, %u core_push %u,",
val("core_more"),val("core_urg"),val("core_push"));
PR(" core_flush %u\n",val("core_flush"));
PR(" nagle %u, ssws_disable %u, turbo %u,",
val("nagle"), val("ssws_disabled"), val("turbo"));
PR(" tx_pdu_out %u\n",val("tx_pdu_out"));
PR(" tx_pace_auto %u, tx_pace_fixed %u, tx_queue %u",
val("tx_pace_auto"),val("tx_pace_fixed"),val("tx_queue"));
PR(" tx_quiesce %u\n",val("tx_quiesce"));
PR(" tx_channel %u, tx_channel1 %u, tx_channel0 %u\n",
val("tx_channel"),
(val("tx_channel")>>1)&1,
val("tx_channel")&1
);
PR(" tx_hdr_ptr 0x%-6x tx_last_ptr 0x%-6x tx_compact %u\n",
val("tx_hdr_ptr"),val("tx_last_ptr"),val("tx_compact"));
PR("RECEIVE BUFFER:\n"); /* *************************** */
PR(" last_ack_sent %-10u rx_compact %u\n",
val("ts_last_ack_sent"),val("rx_compact"));
PR(" rcv_nxt %-10u hdr_off %-10u\n",
val("rcv_nxt"), val("rx_hdr_offset"));
PR(" frag0_idx %-10u length %-10u rx_ptr 0x%-8x\n",
val("rx_frag0_start_idx"),
val("rx_frag0_len"),
val("rx_ptr"));
PR(" frag1_idx %-10u length %-10u ",
val("rx_frag1_start_idx_offset"),
val("rx_frag1_len"));
if (val("ulp_type")!=4) { /* RDMA has FRAG1 idx && len, but no ptr? Should I not display frag1 at all? */
PR("frag1_ptr 0x%-8x\n",val("rx_frag1_ptr"));
} else {
PR("\n");
}
if (val("ulp_type") !=6 && val("ulp_type") != 5 && val("ulp_type") !=4) {
PR(" frag2_idx %-10u length %-10u frag2_ptr 0x%-8x\n",
val("rx_frag2_start_idx_offset"),
val("rx_frag2_len"),
val("rx_frag2_ptr"));
PR(" frag3_idx %-10u length %-10u frag3_ptr 0x%-8x\n",
val("rx_frag3_start_idx_offset"),
val("rx_frag3_len"),
val("rx_frag3_ptr"));
}
PR(" peer_fin %u, rx_pdu_out %u, pdu_len %u\n",
val("peer_fin"),val("rx_pdu_out"), val("pdu_len"));
if (val("recv_scale")) {
PR(" rcv_wnd %u >> snd_scale %u == %u, recv_scaleflag = %u\n",
val("rcv_wnd"), val("snd_scale"),
val("rcv_wnd") >> val("snd_scale"),
val("recv_scale"));
} else {
PR(" rcv_wnd %u. (snd_scale %u, recv_scaleflag = %u)\n",
val("rcv_wnd"), val("snd_scale"),
val("recv_scale"));
}
PR(" dack_mss %u dack %u, dack_not_acked: %u\n",
val("dack_mss"),val("dack"),val("dack_not_acked"));
PR(" rcv_coal %u rcv_co_psh %u rcv_co_last_psh %u heart %u\n",
val("rcv_coalesce_enable"),
val("rcv_coalesce_push"),
val("rcv_coalesce_last_psh"),
val("rcv_coalesce_heartbeat"));
PR(" rx_channel %u rx_quiesce %u rx_flow_ctrl_dis %u,",
val("rx_channel"), val("rx_quiesce"),
val("rx_flow_control_disable"));
PR(" rx_flow_ctrl_ddp %u\n",
val("rx_flow_control_ddp"));
PR("MISCELANEOUS:\n"); /* *************************** */
PR(" pend_ctl: 0x%1x, unused_flags: 0x%x, main_slush: 0x%x\n",
((val("pend_ctl2")<<2) | (val("pend_ctl1")<<1) |
val("pend_ctl0")),
val("unused"),val("main_slush"));
PR(" Migrating %u, ask_mode %u, non_offload %u, rss_info %u\n",
val("migrating"),
val("ask_mode"), val("non_offload"), val("rss_info"));
PR(" ULP: ulp_type %u (%s), ulp_raw %u",
val("ulp_type"), spr_ulp_type(val("ulp_type")),
val("ulp_raw"));
if (aux==1) {
PR(", ulp_ext %u",val("ulp_ext"));
}
PR("\n");
PR(" RDMA: error %u, flm_err %u\n",
val("rdma_error"), val("rdma_flm_error"));
}
void t5_display_tcb_aux_1 (_TCBVAR *tvp, int aux)
{
PR(" aux1_slush0: 0x%x aux1_slush1 0x%x\n",
val("aux1_slush0"), val("aux1_slush1"));
PR(" pdu_hdr_len %u\n",val("pdu_hdr_len"));
}
void t5_display_tcb_aux_2 (_TCBVAR *tvp, int aux)
{
PR(" qp_id %u, pd_id %u, stag %u\n",
val("qp_id"), val("pd_id"),val("stag"));
PR(" irs_ulp %u, iss_ulp %u\n",
val("irs_ulp"),val("iss_ulp"));
PR(" tx_pdu_len %u\n",
val("tx_pdu_len"));
PR(" cq_idx_sq %u, cq_idx_rq %u\n",
val("cq_idx_sq"),val("cq_idx_rq"));
PR(" rq_start %u, rq_MSN %u, rq_max_off %u, rq_write_ptr %u\n",
val("rq_start"),val("rq_msn"),val("rq_max_offset"),
val("rq_write_ptr"));
PR(" L_valid %u, rdmap opcode %u\n",
val("ord_l_bit_vld"),val("rdmap_opcode"));
PR(" tx_flush: %u, tx_oos_rxmt %u, tx_oos_txmt %u\n",
val("tx_flush"),val("tx_oos_rxmt"),val("tx_oos_txmt"));
}
void t5_display_tcb_aux_3 (_TCBVAR *tvp, int aux)
{
PR(" aux3_slush: 0x%x, unused: buf0 0x%x, buf1: 0x%x, main: 0x%x\n",
val("aux3_slush"),val("ddp_buf0_unused"),val("ddp_buf1_unused"),
val("ddp_main_unused"));
PR(" DDP: DDPOFF ActBuf IndOut WaitFrag Rx2Tx BufInf\n");
PR(" %u %u %u %u %u %u\n",
val("ddp_off"),val("ddp_active_buf"),val("ddp_indicate_out"),
val("ddp_wait_frag"),val("ddp_rx2tx"),val("ddp_buf_inf")
);
PR(" Ind PshfEn PushDis Flush NoInvalidate\n");
PR(" Buf0: %u %u %u %u %u\n",
val("ddp_buf0_indicate"),
val("ddp_pshf_enable_0"), val("ddp_push_disable_0"),
val("ddp_buf0_flush"), val("ddp_psh_no_invalidate0")
);
PR(" Buf1: %u %u %u %u %u\n",
val("ddp_buf1_indicate"),
val("ddp_pshf_enable_1"), val("ddp_push_disable_1"),
val("ddp_buf1_flush"), val("ddp_psh_no_invalidate1")
);
PR(" Valid Offset Length Tag\n");
PR(" Buf0: %u 0x%6.6x 0x%6.6x 0x%8.8x",
val("ddp_buf0_valid"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_tag")
);
if (0==val("ddp_off") && 1==val("ddp_buf0_valid") && 0==val("ddp_active_buf")) {
PR(" (Active)\n");
} else {
PR(" (Inactive)\n");
}
PR(" Buf1: %u 0x%6.6x 0x%6.6x 0x%8.8x",
val("ddp_buf1_valid"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_tag")
);
if (0==val("ddp_off") && 1==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" (Active)\n");
} else {
PR(" (Inactive)\n");
}
if (1==val("ddp_off")) {
PR(" DDP is off (which also disables indicate)\n");
} else if (1==val("ddp_buf0_valid") && 0==val("ddp_active_buf")) {
PR(" Data being DDP'ed to buf 0, ");
PR("which has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len")-val("rx_ddp_buf0_offset")
);
if (1==val("ddp_buf1_valid")) {
PR(" And buf1, which is also valid, has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len")-val("rx_ddp_buf1_offset")
);
}
} else if (1==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" Data being DDP'ed to buf 1, ");
PR("which has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len")-val("rx_ddp_buf1_offset")
);
if (1==val("ddp_buf0_valid")) {
PR(" And buf0, which is also valid, has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len")-val("rx_ddp_buf0_offset")
);
}
} else if (0==val("ddp_buf0_valid") && 1==val("ddp_buf1_valid") && 0==val("ddp_active_buf")) {
PR(" !!! Invalid DDP buf 1 valid, but buf 0 active.\n");
} else if (1==val("ddp_buf0_valid") && 0==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" !!! Invalid DDP buf 0 valid, but buf 1 active.\n");
} else {
PR(" DDP is enabled, but no buffers are active && valid.\n");
if (0==val("ddp_indicate_out")) {
if (0==val("ddp_buf0_indicate") && 0==val("ddp_buf1_indicate")) {
PR(" 0 length Indicate buffers ");
if (0==val("rx_hdr_offset")) {
PR("will cause new data to be held in PMRX.\n");
} else {
PR("is causing %u bytes to be held in PMRX\n",
val("rx_hdr_offset"));
}
} else {
PR(" Data being indicated to host\n");
}
} else if (1==val("ddp_indicate_out")) {
PR(" Indicate is off, which ");
if (0==val("rx_hdr_offset")) {
PR("will cause new data to be held in PMRX.\n");
} else {
PR("is causing %u bytes to be held in PMRX\n",
val("rx_hdr_offset"));
}
}
}
}

View File

@ -0,0 +1,443 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2018 Chelsio Communications, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* Auto-generated file. Avoid direct editing. */
/* Edits will be lost when file regenerated. */
#include <stdio.h>
#include "tcb_common.h"
void t6_display_tcb_aux_0 (_TCBVAR *tvp, int aux)
{
PR("STATE:\n");
PR(" %-12s (%-2u), %s, lock_tid %u, rss_fw %u\n",
spr_tcp_state(val("t_state")),
val("t_state"),
spr_ip_version(val("ip_version")),
val("lock_tid"),
val("rss_fw")
);
PR(" l2t_ix 0x%x, smac sel 0x%x, tos 0x%x\n",
val("l2t_ix"),
val("smac_sel"),
val("tos")
);
PR(" maxseg %u, recv_scaleflag %u, recv_tstmp %u, recv_sack %u\n",
val("t_maxseg"), val("recv_scale"),
val("recv_tstmp"), val("recv_sack"));
PR("TIMERS:\n"); /* **************************************** */
PR(" timer %u, dack_timer %u\n",
val("timer"), val("dack_timer"));
PR(" mod_schd: tx: %u, rx: %u, reason 0x%1x\n",
val("mod_schd_tx"),
val("mod_schd_rx"),
((val("mod_schd_reason2")<<2) | (val("mod_schd_reason1")<<1) |
val("mod_schd_reason0"))
);
PR(" max_rt %-2u, rxtshift %u, keepalive %u\n",
val("max_rt"), val("t_rxtshift"),
val("keepalive"));
PR(" timestamp_offset 0x%x, timestamp 0x%x\n",
val("timestamp_offset"),val("timestamp"));
PR(" t_rtt_ts_recent_age %u t_rttseq_recent %u\n",
val("t_rtt_ts_recent_age"), val("t_rtseq_recent"));
PR(" t_srtt %u, t_rttvar %u\n",
val("t_srtt"),val("t_rttvar"));
PR("TRANSMIT BUFFER:\n"); /* *************************** */
PR(" snd_una %u, snd_nxt %u, snd_max %u, tx_max %u\n",
val("snd_una"),val("snd_nxt"),
val("snd_max"),val("tx_max"));
PR(" core_fin %u, tx_hdr_offset %u\n",
val("core_fin"), SEQ_SUB(val("tx_max"),val("snd_una"))
);
if (val("recv_scale") && !val("active_open")) {
PR(" rcv_adv %-5u << %-2u == %u (recv_scaleflag %u rcv_scale %u active open %u)\n",
val("rcv_adv"), val("rcv_scale"),
val("rcv_adv") << val("rcv_scale"),
val("recv_scale"), val("rcv_scale"), val("active_open"));
} else {
PR(" rcv_adv %-5u (rcv_scale %-2u recv_scaleflag %u active_open %u)\n",
val("rcv_adv"), val("rcv_scale"),
val("recv_scale"), val("active_open"));
}
PR(" snd_cwnd %-5u snd_ssthresh %u snd_rec %u\n",
val("snd_cwnd") , val("snd_ssthresh"), val("snd_rec")
);
PR(" cctrl: sel %s, ecn %u, ece %u, cwr %u, rfr %u\n",
spr_cctrl_sel(val("cctrl_sel0"),val("cctrl_sel1")),
val("cctrl_ecn"), val("cctrl_ece"), val("cctrl_cwr"),
val("cctrl_rfr"));
PR(" t_dupacks %u, dupack_count_odd %u, fast_recovery %u\n",
val("t_dupacks"), val("dupack_count_odd"),val("fast_recovery"));
PR(" core_more %u, core_urg, %u core_push %u,",
val("core_more"),val("core_urg"),val("core_push"));
PR(" core_flush %u\n",val("core_flush"));
PR(" nagle %u, ssws_disable %u, turbo %u,",
val("nagle"), val("ssws_disabled"), val("turbo"));
PR(" tx_pdu_out %u\n",val("tx_pdu_out"));
PR(" tx_pace_auto %u, tx_pace_fixed %u, tx_queue %u",
val("tx_pace_auto"),val("tx_pace_fixed"),val("tx_queue"));
PR(" tx_quiesce %u\n",val("tx_quiesce"));
PR(" tx_channel %u, tx_channel1 %u, tx_channel0 %u\n",
val("tx_channel"),
(val("tx_channel")>>1)&1,
val("tx_channel")&1
);
PR(" tx_hdr_ptr 0x%-6x tx_last_ptr 0x%-6x tx_compact %u\n",
val("tx_hdr_ptr"),val("tx_last_ptr"),val("tx_compact"));
PR("RECEIVE BUFFER:\n"); /* *************************** */
PR(" last_ack_sent %-10u rx_compact %u\n",
val("ts_last_ack_sent"),val("rx_compact"));
PR(" rcv_nxt %-10u hdr_off %-10u\n",
val("rcv_nxt"), val("rx_hdr_offset"));
PR(" frag0_idx %-10u length %-10u frag0_ptr 0x%-8x\n",
val("rx_frag0_start_idx"),
val("rx_frag0_len"),
val("rx_ptr"));
PR(" frag1_idx %-10u length %-10u ",
val("rx_frag1_start_idx_offset"),
val("rx_frag1_len"));
if (val("ulp_type")!=4) { /* RDMA has FRAG1 idx && len, but no ptr? Should I not display frag1 at all? */
PR("frag1_ptr 0x%-8x\n",val("rx_frag1_ptr"));
} else {
PR("\n");
}
if (val("ulp_type") != 9 && val("ulp_type")!=8 && val("ulp_type") !=6 &&
val("ulp_type") != 5 && val("ulp_type") !=4) {
PR(" frag2_idx %-10u length %-10u frag2_ptr 0x%-8x\n",
val("rx_frag2_start_idx_offset"),
val("rx_frag2_len"),
val("rx_frag2_ptr"));
PR(" frag3_idx %-10u length %-10u frag3_ptr 0x%-8x\n",
val("rx_frag3_start_idx_offset"),
val("rx_frag3_len"),
val("rx_frag3_ptr"));
}
PR(" peer_fin %u, rx_pdu_out %u, pdu_len %u\n",
val("peer_fin"),val("rx_pdu_out"), val("pdu_len"));
if (val("recv_scale")) {
PR(" rcv_wnd %u >> snd_scale %u == %u, recv_scaleflag = %u\n",
val("rcv_wnd"), val("snd_scale"),
val("rcv_wnd") >> val("snd_scale"),
val("recv_scale"));
} else {
PR(" rcv_wnd %u. (snd_scale %u, recv_scaleflag = %u)\n",
val("rcv_wnd"), val("snd_scale"),
val("recv_scale"));
}
PR(" dack_mss %u dack %u, dack_not_acked: %u\n",
val("dack_mss"),val("dack"),val("dack_not_acked"));
PR(" rcv_coal %u rcv_co_psh %u rcv_co_last_psh %u heart %u\n",
val("rcv_coalesce_enable"),
val("rcv_coalesce_push"),
val("rcv_coalesce_last_psh"),
val("rcv_coalesce_heartbeat"));
PR(" rx_channel %u rx_quiesce %u rx_flow_ctrl_dis %u,",
val("rx_channel"), val("rx_quiesce"),
val("rx_flow_control_disable"));
PR(" rx_flow_ctrl_ddp %u\n",
val("rx_flow_control_ddp"));
PR("MISCELANEOUS:\n"); /* *************************** */
PR(" pend_ctl: 0x%1x, core_bypass: 0x%x, main_slush: 0x%x\n",
((val("pend_ctl2")<<2) | (val("pend_ctl1")<<1) |
val("pend_ctl0")),
val("core_bypass"),val("main_slush"));
PR(" Migrating %u, ask_mode %u, non_offload %u, rss_info %u\n",
val("migrating"),
val("ask_mode"), val("non_offload"), val("rss_info"));
PR(" ULP: ulp_type %u (%s), ulp_raw %u",
val("ulp_type"), spr_ulp_type(val("ulp_type")),
val("ulp_raw"));
if (aux==1) {
PR(", ulp_ext %u",val("ulp_ext"));
}
PR("\n");
PR(" RDMA: error %u, flm_err %u\n",
val("rdma_error"), val("rdma_flm_error"));
}
void t6_display_tcb_aux_1 (_TCBVAR *tvp, int aux)
{
PR(" aux1_slush0: 0x%x aux1_slush1 0x%x\n",
val("aux1_slush0"), val("aux1_slush1"));
PR(" pdu_hdr_len %u\n",val("pdu_hdr_len"));
}
void t6_display_tcb_aux_2 (_TCBVAR *tvp, int aux)
{
PR(" qp_id %u, pd_id %u, stag %u\n",
val("qp_id"), val("pd_id"),val("stag"));
PR(" irs_ulp %u, iss_ulp %u\n",
val("irs_ulp"),val("iss_ulp"));
PR(" tx_pdu_len %u\n",
val("tx_pdu_len"));
PR(" cq_idx_sq %u, cq_idx_rq %u\n",
val("cq_idx_sq"),val("cq_idx_rq"));
PR(" rq_start %u, rq_MSN %u, rq_max_off %u, rq_write_ptr %u\n",
val("rq_start"),val("rq_msn"),val("rq_max_offset"),
val("rq_write_ptr"));
PR(" L_valid %u, rdmap opcode %u\n",
val("ord_l_bit_vld"),val("rdmap_opcode"));
PR(" tx_flush: %u, tx_oos_rxmt %u, tx_oos_txmt %u\n",
val("tx_flush"),val("tx_oos_rxmt"),val("tx_oos_txmt"));
}
void t6_display_tcb_aux_3 (_TCBVAR *tvp, int aux)
{
PR(" aux3_slush: 0x%x, unused: buf0 0x%x, buf1: 0x%x\n",
val("aux3_slush"),val("ddp_buf0_unused"),val("ddp_buf1_unused"));
PR(" ind_full: %u, tls_key_mode: %u\n",
val("ddp_indicate_fll"),val("tls_key_mode"));
PR(" DDP: DDPOFF ActBuf IndOut WaitFrag Rx2Tx BufInf\n");
PR(" %u %u %u %u %u %u\n",
val("ddp_off"),val("ddp_active_buf"),val("ddp_indicate_out"),
val("ddp_wait_frag"),val("ddp_rx2tx"),val("ddp_buf_inf")
);
PR(" Ind PshfEn PushDis Flush NoInvalidate\n");
PR(" Buf0: %u %u %u %u %u\n",
val("ddp_buf0_indicate"),
val("ddp_pshf_enable_0"), val("ddp_push_disable_0"),
val("ddp_buf0_flush"), val("ddp_psh_no_invalidate0")
);
PR(" Buf1: %u %u %u %u %u\n",
val("ddp_buf1_indicate"),
val("ddp_pshf_enable_1"), val("ddp_push_disable_1"),
val("ddp_buf1_flush"), val("ddp_psh_no_invalidate1")
);
PR(" Valid Offset Length Tag\n");
PR(" Buf0: %u 0x%6.6x 0x%6.6x 0x%8.8x",
val("ddp_buf0_valid"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_tag")
);
if (0==val("ddp_off") && 1==val("ddp_buf0_valid") && 0==val("ddp_active_buf")) {
PR(" (Active)\n");
} else {
PR(" (Inactive)\n");
}
PR(" Buf1: %u 0x%6.6x 0x%6.6x 0x%8.8x",
val("ddp_buf1_valid"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_tag")
);
if (0==val("ddp_off") && 1==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" (Active)\n");
} else {
PR(" (Inactive)\n");
}
if (1==val("ddp_off")) {
PR(" DDP is off (which also disables indicate)\n");
} else if (1==val("ddp_buf0_valid") && 0==val("ddp_active_buf")) {
PR(" Data being DDP'ed to buf 0, ");
PR("which has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len")-val("rx_ddp_buf0_offset")
);
if (1==val("ddp_buf1_valid")) {
PR(" And buf1, which is also valid, has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len")-val("rx_ddp_buf1_offset")
);
}
} else if (1==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" Data being DDP'ed to buf 1, ");
PR("which has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf1_len"),val("rx_ddp_buf1_offset"),
val("rx_ddp_buf1_len")-val("rx_ddp_buf1_offset")
);
if (1==val("ddp_buf0_valid")) {
PR(" And buf0, which is also valid, has %u - %u = %u bytes of space left\n",
val("rx_ddp_buf0_len"),val("rx_ddp_buf0_offset"),
val("rx_ddp_buf0_len")-val("rx_ddp_buf0_offset")
);
}
} else if (0==val("ddp_buf0_valid") && 1==val("ddp_buf1_valid") && 0==val("ddp_active_buf")) {
PR(" !!! Invalid DDP buf 1 valid, but buf 0 active.\n");
} else if (1==val("ddp_buf0_valid") && 0==val("ddp_buf1_valid") && 1==val("ddp_active_buf")) {
PR(" !!! Invalid DDP buf 0 valid, but buf 1 active.\n");
} else {
PR(" DDP is enabled, but no buffers are active && valid.\n");
if (0==val("ddp_indicate_out")) {
if (0==val("ddp_buf0_indicate") && 0==val("ddp_buf1_indicate")) {
PR(" 0 length Indicate buffers ");
if (0==val("rx_hdr_offset")) {
PR("will cause new data to be held in PMRX.\n");
} else {
PR("is causing %u bytes to be held in PMRX\n",
val("rx_hdr_offset"));
}
} else {
PR(" Data being indicated to host\n");
}
} else if (1==val("ddp_indicate_out")) {
PR(" Indicate is off, which ");
if (0==val("rx_hdr_offset")) {
PR("will cause new data to be held in PMRX.\n");
} else {
PR("is causing %u bytes to be held in PMRX\n",
val("rx_hdr_offset"));
}
}
}
}
void t6_display_tcb_aux_4 (_TCBVAR *tvp, int aux)
{
PR("TLS: offset: 0x%6.6x, len:0x%6.6x, flags: 0x%4.4x\n",
val("rx_tls_buf_offset"),val("rx_tls_buf_len"),
val("rx_tls_flags"));
PR(" seq: 0x%llx \n",val64("rx_tls_seq"));
PR(" tag: 0x%8.8x, key:0x%8.8x\n",
val("rx_tls_buf_tag"),val("rx_tls_key_tag"));
}