18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci * 38c2ecf20Sopenharmony_ci * Copyright (c) 2019 Facebook 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or 68c2ecf20Sopenharmony_ci * modify it under the terms of version 2 of the GNU General Public 78c2ecf20Sopenharmony_ci * License as published by the Free Software Foundation. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * Include file for Host Bandwidth Management (HBM) programs 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_cistruct hbm_vqueue { 128c2ecf20Sopenharmony_ci struct bpf_spin_lock lock; 138c2ecf20Sopenharmony_ci /* 4 byte hole */ 148c2ecf20Sopenharmony_ci unsigned long long lasttime; /* In ns */ 158c2ecf20Sopenharmony_ci int credit; /* In bytes */ 168c2ecf20Sopenharmony_ci unsigned int rate; /* In bytes per NS << 20 */ 178c2ecf20Sopenharmony_ci}; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_cistruct hbm_queue_stats { 208c2ecf20Sopenharmony_ci unsigned long rate; /* in Mbps*/ 218c2ecf20Sopenharmony_ci unsigned long stats:1, /* get HBM stats (marked, dropped,..) */ 228c2ecf20Sopenharmony_ci loopback:1, /* also limit flows using loopback */ 238c2ecf20Sopenharmony_ci no_cn:1; /* do not use cn flags */ 248c2ecf20Sopenharmony_ci unsigned long long pkts_marked; 258c2ecf20Sopenharmony_ci unsigned long long bytes_marked; 268c2ecf20Sopenharmony_ci unsigned long long pkts_dropped; 278c2ecf20Sopenharmony_ci unsigned long long bytes_dropped; 288c2ecf20Sopenharmony_ci unsigned long long pkts_total; 298c2ecf20Sopenharmony_ci unsigned long long bytes_total; 308c2ecf20Sopenharmony_ci unsigned long long firstPacketTime; 318c2ecf20Sopenharmony_ci unsigned long long lastPacketTime; 328c2ecf20Sopenharmony_ci unsigned long long pkts_ecn_ce; 338c2ecf20Sopenharmony_ci unsigned long long returnValCount[4]; 348c2ecf20Sopenharmony_ci unsigned long long sum_cwnd; 358c2ecf20Sopenharmony_ci unsigned long long sum_rtt; 368c2ecf20Sopenharmony_ci unsigned long long sum_cwnd_cnt; 378c2ecf20Sopenharmony_ci long long sum_credit; 388c2ecf20Sopenharmony_ci}; 39