~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/dccp/ccids/lib/loss_interval.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 #ifndef _DCCP_LI_HIST_
  3 #define _DCCP_LI_HIST_
  4 /*
  5  *  Copyright (c) 2007   The University of Aberdeen, Scotland, UK
  6  *  Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand.
  7  *  Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz>
  8  *  Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  9  */
 10 #include <linux/ktime.h>
 11 #include <linux/list.h>
 12 #include <linux/slab.h>
 13 
 14 /*
 15  * Number of loss intervals (RFC 4342, 8.6.1). The history size is one more than
 16  * NINTERVAL, since the `open' interval I_0 is always stored as the first entry.
 17  */
 18 #define NINTERVAL       8
 19 #define LIH_SIZE        (NINTERVAL + 1)
 20 
 21 /**
 22  *  tfrc_loss_interval  -  Loss history record for TFRC-based protocols
 23  *  @li_seqno:          Highest received seqno before the start of loss
 24  *  @li_ccval:          The CCVal belonging to @li_seqno
 25  *  @li_is_closed:      Whether @li_seqno is older than 1 RTT
 26  *  @li_length:         Loss interval sequence length
 27  */
 28 struct tfrc_loss_interval {
 29         u64              li_seqno:48,
 30                          li_ccval:4,
 31                          li_is_closed:1;
 32         u32              li_length;
 33 };
 34 
 35 /**
 36  *  tfrc_loss_hist  -  Loss record database
 37  *  @ring:      Circular queue managed in LIFO manner
 38  *  @counter:   Current count of entries (can be more than %LIH_SIZE)
 39  *  @i_mean:    Current Average Loss Interval [RFC 3448, 5.4]
 40  */
 41 struct tfrc_loss_hist {
 42         struct tfrc_loss_interval       *ring[LIH_SIZE];
 43         u8                              counter;
 44         u32                             i_mean;
 45 };
 46 
 47 static inline void tfrc_lh_init(struct tfrc_loss_hist *lh)
 48 {
 49         memset(lh, 0, sizeof(struct tfrc_loss_hist));
 50 }
 51 
 52 static inline u8 tfrc_lh_is_initialised(struct tfrc_loss_hist *lh)
 53 {
 54         return lh->counter > 0;
 55 }
 56 
 57 static inline u8 tfrc_lh_length(struct tfrc_loss_hist *lh)
 58 {
 59         return min(lh->counter, (u8)LIH_SIZE);
 60 }
 61 
 62 struct tfrc_rx_hist;
 63 
 64 int tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *,
 65                          u32 (*first_li)(struct sock *), struct sock *);
 66 u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *);
 67 void tfrc_lh_cleanup(struct tfrc_loss_hist *lh);
 68 
 69 #endif /* _DCCP_LI_HIST_ */
 70 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php