mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-16 14:35:34 +08:00
1157a6fc36
For high speed adapter like Mellanox CX-5 card, it can reach upto 100 Gbits per second bandwidth. Currently htb already supports 64bit rate in tc utility. However police action rate and peakrate are still limited to 32bit value (upto 32 Gbits per second). Taking advantage of the 2 new attributes TCA_POLICE_RATE64 and TCA_POLICE_PEAKRATE64 from kernel, tc can use them to break the 32bit limit, and still keep the backward binary compatibility. Tested-by: David Dai <zdai@linux.vnet.ibm.com> Signed-off-by: David Dai <zdai@linux.vnet.ibm.com> Signed-off-by: David Ahern <dsahern@gmail.com>
37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TC_CORE_H_
|
|
#define _TC_CORE_H_ 1
|
|
|
|
#include <asm/types.h>
|
|
#include <linux/pkt_sched.h>
|
|
|
|
enum link_layer {
|
|
LINKLAYER_UNSPEC,
|
|
LINKLAYER_ETHERNET,
|
|
LINKLAYER_ATM,
|
|
};
|
|
|
|
|
|
int tc_core_time2big(unsigned time);
|
|
unsigned tc_core_time2tick(unsigned time);
|
|
unsigned tc_core_tick2time(unsigned tick);
|
|
unsigned tc_core_time2ktime(unsigned time);
|
|
unsigned tc_core_ktime2time(unsigned ktime);
|
|
unsigned tc_calc_xmittime(__u64 rate, unsigned size);
|
|
unsigned tc_calc_xmitsize(__u64 rate, unsigned ticks);
|
|
int tc_calc_rtable(struct tc_ratespec *r, __u32 *rtab,
|
|
int cell_log, unsigned mtu, enum link_layer link_layer);
|
|
int tc_calc_rtable_64(struct tc_ratespec *r, __u32 *rtab,
|
|
int cell_log, unsigned mtu, enum link_layer link_layer,
|
|
__u64 rate);
|
|
int tc_calc_size_table(struct tc_sizespec *s, __u16 **stab);
|
|
|
|
int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
|
|
|
|
int tc_core_init(void);
|
|
|
|
extern struct rtnl_handle g_rth;
|
|
extern int is_batch_mode;
|
|
|
|
#endif
|