tcp: clear blackbox logging union

Clear the black box logging containing union rather than the u_bbr
structure for clarity and consistency. Currently u_bbr, u_raw, and
u64_raw are the same size.
No functional change intended.

Reviewed by:	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 382af4d38b62675f00f64275793a6b5fccfe62fa)
This commit is contained in:
Peter Lei 2025-04-04 22:10:48 +02:00 committed by Franco Fichtner
parent 7f9c0c0fc9
commit 1c2b0605ef
3 changed files with 34 additions and 34 deletions

View File

@ -439,7 +439,7 @@ tcp_hpts_log(struct tcp_hpts_entry *hpts, struct tcpcb *tp, struct timeval *tv,
* 16 bit - cwnd_gain
* 8 bit - bbr_state, bbr_substate, inhpts;
*/
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = hpts->p_nxt_slot;
log.u_bbr.flex2 = hpts->p_cur_slot;
log.u_bbr.flex3 = hpts->p_prev_slot;

View File

@ -674,7 +674,7 @@ out:
struct newreno *ptr;
ptr = ((struct newreno *)tp->t_ccv.cc_data);
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = ptr->beta;
log.u_bbr.flex2 = ptr->beta_ecn;
@ -2645,7 +2645,7 @@ rack_log_retran_reason(struct tcp_rack *rack, struct rack_sendmap *rsm, uint32_t
return;
}
log_anyway:
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = tsused;
log.u_bbr.flex2 = thresh;
log.u_bbr.flex3 = rsm->r_flags;
@ -2674,7 +2674,7 @@ rack_log_to_start(struct tcp_rack *rack, uint32_t cts, uint32_t to, int32_t slot
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = rack->rc_tp->t_srtt;
log.u_bbr.flex2 = to;
log.u_bbr.flex3 = rack->r_ctl.rc_hpts_flags;
@ -2713,7 +2713,7 @@ rack_log_to_event(struct tcp_rack *rack, int32_t to_num, struct rack_sendmap *rs
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex8 = to_num;
log.u_bbr.flex1 = rack->r_ctl.rc_rack_min_rtt;
@ -2750,7 +2750,7 @@ rack_log_map_chg(struct tcpcb *tp, struct tcp_rack *rack,
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex8 = flag;
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.cur_del_rate = (uint64_t)prev;
@ -2795,7 +2795,7 @@ rack_log_rtt_upd(struct tcpcb *tp, struct tcp_rack *rack, uint32_t t, uint32_t l
if (tcp_bblogging_on(tp)) {
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = t;
log.u_bbr.flex2 = len;
@ -2967,7 +2967,7 @@ rack_log_progress_event(struct tcp_rack *rack, struct tcpcb *tp, uint32_t tick,
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = line;
log.u_bbr.flex2 = tick;
@ -2993,7 +2993,7 @@ rack_log_type_bbrsnd(struct tcp_rack *rack, uint32_t len, uint32_t slot, uint32_
if (rack_verbose_logging && tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = slot;
if (rack->rack_no_prr)
@ -3094,7 +3094,7 @@ rack_log_type_just_return(struct tcp_rack *rack, uint32_t cts, uint32_t tlen, ui
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = slot;
log.u_bbr.flex2 = rack->r_ctl.rc_hpts_flags;
@ -3127,7 +3127,7 @@ rack_log_to_cancel(struct tcp_rack *rack, int32_t hpts_removed, int line, uint32
if (tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = line;
log.u_bbr.flex2 = rack->r_ctl.rc_last_output_to;
@ -3169,7 +3169,7 @@ rack_log_alt_to_to_cancel(struct tcp_rack *rack,
/* No you can't use 1, its for the real to cancel */
return;
}
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = flex1;
log.u_bbr.flex2 = flex2;
@ -3194,7 +3194,7 @@ rack_log_to_processing(struct tcp_rack *rack, uint32_t cts, int32_t ret, int32_t
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = timers;
log.u_bbr.flex2 = ret;
log.u_bbr.flex3 = rack->r_ctl.rc_timer_exp;
@ -3224,7 +3224,7 @@ rack_log_to_prr(struct tcp_rack *rack, int frm, int orig_cwnd, int line)
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = rack->r_ctl.rc_prr_out;
log.u_bbr.flex2 = rack->r_ctl.rc_prr_recovery_fs;
if (rack->rack_no_prr)
@ -3258,7 +3258,7 @@ rack_log_sad(struct tcp_rack *rack, int event)
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = rack->r_ctl.sack_count;
log.u_bbr.flex2 = rack->r_ctl.ack_count;
log.u_bbr.flex3 = rack->r_ctl.sack_moved_extra;
@ -4098,7 +4098,7 @@ rack_log_rtt_shrinks(struct tcp_rack *rack, uint32_t us_cts,
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = line;
log.u_bbr.flex2 = rack->r_ctl.rc_time_probertt_starts;
log.u_bbr.flex3 = rack->r_ctl.rc_lower_rtt_us_cts;
@ -5395,7 +5395,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, uint32_t th_ack, uint
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = th_ack;
log.u_bbr.flex2 = tp->t_ccv.flags;
@ -5588,7 +5588,7 @@ do_rack_check_for_unclamp(struct tcpcb *tp, struct tcp_rack *rack)
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex3 = rnds;
log.u_bbr.flex4 = rack_unclamp_round_thresh;
@ -5769,7 +5769,7 @@ reset_to_iw:
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = new_cwnd;
log.u_bbr.flex2 = new_ssthresh;
@ -5836,7 +5836,7 @@ rack_post_recovery(struct tcpcb *tp, uint32_t th_ack)
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = th_ack;
log.u_bbr.flex2 = tp->t_ccv.flags;
@ -6677,7 +6677,7 @@ rack_log_hpts_diag(struct tcp_rack *rack, uint32_t cts,
if (rack_verbose_logging && tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = diag->p_nxt_slot;
log.u_bbr.flex2 = diag->p_cur_slot;
log.u_bbr.flex3 = diag->slot_req;
@ -6716,7 +6716,7 @@ rack_log_wakeup(struct tcpcb *tp, struct tcp_rack *rack, struct sockbuf *sb, uin
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = sb->sb_flags;
log.u_bbr.flex2 = len;
log.u_bbr.flex3 = sb->sb_state;
@ -9516,7 +9516,7 @@ do_rest_ofb:
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = end;
log.u_bbr.flex2 = start;
log.u_bbr.flex3 = rsm->r_end;
@ -14625,7 +14625,7 @@ rack_log_chg_info(struct tcpcb *tp, struct tcp_rack *rack, uint8_t mod,
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex8 = mod;
log.u_bbr.flex1 = flex1;
@ -15519,7 +15519,7 @@ rack_fini(struct tcpcb *tp, int32_t tcb_is_purged)
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.flex8 = 10;
log.u_bbr.flex1 = rack->r_ctl.rc_num_maps_alloced;
log.u_bbr.flex2 = rack->rc_free_cnt;
@ -15759,7 +15759,7 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent
tcp_req = tcp_req_find_req_for_seq(tp, ae->ack);
}
#endif
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr == 0)
log.u_bbr.flex1 = rack->r_ctl.rc_prr_sndcnt;
@ -16853,7 +16853,7 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
tcp_req = tcp_req_find_req_for_seq(tp, th->th_ack);
}
#endif
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr == 0)
log.u_bbr.flex1 = rack->r_ctl.rc_prr_sndcnt;
@ -18350,7 +18350,7 @@ rack_log_fsb(struct tcp_rack *rack, struct tcpcb *tp, struct socket *so, uint32_
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = error;
log.u_bbr.flex2 = flags;
@ -18615,7 +18615,7 @@ rack_log_queue_level(struct tcpcb *tp, struct tcp_rack *rack,
err = in_pcbquery_txrlevel(rack->rc_inp, &p_queue);
err = in_pcbquery_txrtlmt(rack->rc_inp, &p_rate);
#endif
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = p_rate;
log.u_bbr.flex2 = p_queue;
@ -19068,7 +19068,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma
counter_u64_add(rack_collapsed_win_rxt, 1);
counter_u64_add(rack_collapsed_win_rxt_bytes, (rsm->r_end - rsm->r_start));
}
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr)
log.u_bbr.flex1 = 0;
@ -19631,7 +19631,7 @@ again:
if (tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr)
log.u_bbr.flex1 = 0;
@ -22012,7 +22012,7 @@ send:
if (tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr)
log.u_bbr.flex1 = 0;

View File

@ -2155,7 +2155,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(tp);
log.u_bbr.flex8 = 4;
log.u_bbr.pkts_out = tp->t_maxseg;
@ -4388,7 +4388,7 @@ tcp_req_log_req_info(struct tcpcb *tp, struct tcp_sendfile_track *req,
union tcp_log_stackspecific log;
struct timeval tv;
memset(&log.u_bbr, 0, sizeof(log.u_bbr));
memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(tp);
log.u_bbr.flex8 = val;
log.u_bbr.rttProp = req->timestamp;