Page MenuHomeFreeBSD

tcp: don't define and use BBLog function when TCP_BLACKBOX is not defined
AcceptedPublic

Authored by tuexen on Sat, Nov 2, 2:03 PM.
Tags
None
Referenced Files
F102602134: D47401.diff
Thu, Nov 14, 3:51 PM
F102588683: D47401.diff
Thu, Nov 14, 11:25 AM
F102585333: D47401.diff
Thu, Nov 14, 10:03 AM
Unknown Object (File)
Tue, Nov 5, 11:40 AM
Subscribers

Details

Summary

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

tuexen requested review of this revision.Sat, Nov 2, 2:03 PM

Wouldn't it be possible to #define tcp_lro_log in a #else of the first block, such that this scattering of #ifdef's throughout the file could be avoided?

#ifdef TCP_BLACKBOX
static void
tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc,
    const struct lro_entry *le, const struct mbuf *m,
    int frm, int32_t tcp_data_len, uint32_t th_seq,
    uint32_t th_ack, uint16_t th_win)
{
:
}
#else
#define tcp_lro_log(tp, lc, le, m, frm, tcp_data_len, th_seq, th_ack, th_win)
#endif

Wouldn't it be possible to #define tcp_lro_log in a #else of the first block, such that this scattering of #ifdef's throughout the file could be avoided?

#ifdef TCP_BLACKBOX
static void
tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc,
    const struct lro_entry *le, const struct mbuf *m,
    int frm, int32_t tcp_data_len, uint32_t th_seq,
    uint32_t th_ack, uint16_t th_win)
{
:
}
#else
#define tcp_lro_log(tp, lc, le, m, frm, tcp_data_len, th_seq, th_ack, th_win)
#endif

That is possible. However, I prefer to see that the code is not executed compared to look up the definition of tcp_lro_log() a couple of times. This this is a subjective preference...

This revision is now accepted and ready to land.Thu, Nov 14, 5:14 PM