tcp_info: Add and export more FreeBSD-specific fields

This change adds struct tcp_info fields corresponding to the following
struct tcpcb ones:
- snd_una
- snd_max
- rcv_numsacks
- rcv_adv
- dupacks

Note that while both tcp_fill_info() and fill_tcp_info_from_tcb() are
extended accordingly, no counterpart of rcv_numsacks is available in
the cxgbe(4) TOE PCB, though.

Sponsored by:	NetApp, Inc. (originally)
This commit is contained in:
Marius Strobl 2023-08-22 20:12:59 +02:00
parent 8c6104c48e
commit dc485b968d
3 changed files with 16 additions and 1 deletions

View File

@ -730,9 +730,13 @@ fill_tcp_info_from_tcb(struct adapter *sc, uint64_t *tcb, struct tcp_info *ti)
ti->tcpi_snd_ssthresh = GET_TCB_FIELD(tcb, SND_SSTHRESH);
ti->tcpi_snd_cwnd = GET_TCB_FIELD(tcb, SND_CWND);
ti->tcpi_rcv_nxt = GET_TCB_FIELD(tcb, RCV_NXT);
ti->tcpi_rcv_adv = GET_TCB_FIELD(tcb, RCV_ADV);
ti->tcpi_dupacks = GET_TCB_FIELD(tcb, T_DUPACKS);
v = GET_TCB_FIELD(tcb, TX_MAX);
ti->tcpi_snd_nxt = v - GET_TCB_FIELD(tcb, SND_NXT_RAW);
ti->tcpi_snd_una = v - GET_TCB_FIELD(tcb, SND_UNA_RAW);
ti->tcpi_snd_max = v - GET_TCB_FIELD(tcb, SND_MAX_RAW);
/* Receive window being advertised by us. */
ti->tcpi_rcv_wscale = GET_TCB_FIELD(tcb, SND_SCALE); /* Yes, SND. */

View File

@ -427,8 +427,14 @@ struct tcp_info {
u_int32_t tcpi_total_tlp; /* tail loss probes sent */
u_int64_t tcpi_total_tlp_bytes; /* tail loss probe bytes sent */
u_int32_t tcpi_snd_una; /* Unacked seqno sent */
u_int32_t tcpi_snd_max; /* Highest seqno sent */
u_int32_t tcpi_rcv_numsacks; /* Distinct SACK blks present */
u_int32_t tcpi_rcv_adv; /* Peer advertised window */
u_int32_t tcpi_dupacks; /* Consecutive dup ACKs recvd */
/* Padding to grow without breaking ABI. */
u_int32_t __tcpi_pad[19]; /* Padding. */
u_int32_t __tcpi_pad[14]; /* Padding. */
};
/*

View File

@ -1591,6 +1591,11 @@ tcp_fill_info(const struct tcpcb *tp, struct tcp_info *ti)
ti->tcpi_snd_rexmitpack = tp->t_sndrexmitpack;
ti->tcpi_rcv_ooopack = tp->t_rcvoopack;
ti->tcpi_snd_zerowin = tp->t_sndzerowin;
ti->tcpi_snd_una = tp->snd_una;
ti->tcpi_snd_max = tp->snd_max;
ti->tcpi_rcv_numsacks = tp->rcv_numsacks;
ti->tcpi_rcv_adv = tp->rcv_adv;
ti->tcpi_dupacks = tp->t_dupacks;
#ifdef TCP_OFFLOAD
if (tp->t_flags & TF_TOE) {
ti->tcpi_options |= TCPI_OPT_TOE;