Module Name:    src
Committed By:   ozaki-r
Date:           Tue Dec 24 08:35:28 UTC 2024

Modified Files:
        src/sys/altq: altq.h
        src/usr.sbin/altq/libaltq: altq_qop.h qop.c qop_cbq.c qop_cbq.h

Log Message:
altq, cbq: support 10 Gbps bandwidth

Mostly just s/u_int/uint64_t/ for bandwidth and rate variables.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/altq/altq.h
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/altq/libaltq/altq_qop.h
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/altq/libaltq/qop.c \
    src/usr.sbin/altq/libaltq/qop_cbq.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/altq/libaltq/qop_cbq.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/altq/altq.h
diff -u src/sys/altq/altq.h:1.4 src/sys/altq/altq.h:1.5
--- src/sys/altq/altq.h:1.4	Thu Oct 12 19:59:08 2006
+++ src/sys/altq/altq.h	Tue Dec 24 08:35:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq.h,v 1.4 2006/10/12 19:59:08 peter Exp $ */
+/*	$NetBSD: altq.h,v 1.5 2024/12/24 08:35:28 ozaki-r Exp $ */
 /*	$KAME: altq.h,v 1.10 2003/07/10 12:07:47 kjc Exp $	*/
 
 /*
@@ -74,7 +74,7 @@ struct	altqreq {
 
 /* simple token backet meter profile */
 struct	tb_profile {
-	u_int	rate;	/* rate in bit-per-sec */
+	uint64_t	rate;	/* rate in bit-per-sec */
 	u_int	depth;	/* depth in bytes */
 };
 

Index: src/usr.sbin/altq/libaltq/altq_qop.h
diff -u src/usr.sbin/altq/libaltq/altq_qop.h:1.8 src/usr.sbin/altq/libaltq/altq_qop.h:1.9
--- src/usr.sbin/altq/libaltq/altq_qop.h:1.8	Sun May 22 11:27:37 2022
+++ src/usr.sbin/altq/libaltq/altq_qop.h	Tue Dec 24 08:35:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_qop.h,v 1.8 2022/05/22 11:27:37 andvar Exp $	*/
+/*	$NetBSD: altq_qop.h,v 1.9 2024/12/24 08:35:28 ozaki-r Exp $	*/
 /*	$KAME: altq_qop.h,v 1.5 2002/02/12 10:14:01 kjc Exp $	*/
 /*
  * Copyright (C) 1999-2000
@@ -72,7 +72,7 @@ struct qdisc_ops {
 struct ifinfo {
 	LIST_ENTRY(ifinfo)	next;		/* next entry on iflist */
 	char			*ifname;	/* interface name */
-	u_int			bandwidth;	/* bandwidth in bps */
+	uint64_t		bandwidth;	/* bandwidth in bps */
 	u_int			ifmtu;		/* mtu of the interface */
 	u_int			ifindex;	/* interface index */
 	int			enabled;	/* hfsc on/off state */
@@ -141,13 +141,13 @@ int qcmd_add_filter(const char *ifname, 
 		    const struct flow_filter *fltr);
 int qcmd_delete_filter(const char *ifname, const char *clname,
 		       const char *flname);
-int qcmd_tbr_register(const char *ifname, u_int rate, u_int size);
+int qcmd_tbr_register(const char *ifname, uint64_t rate, u_int size);
 int qop_enable(struct ifinfo *ifinfo);
 int qop_disable(struct ifinfo *ifinfo);
 int qop_delete_if(struct ifinfo *ifinfo);
 int qop_clear(struct ifinfo *ifinfo);
 
-int qop_add_if(struct ifinfo **rp, const char *ifname, u_int bandwidth,
+int qop_add_if(struct ifinfo **rp, const char *ifname, uint64_t bandwidth,
 	       struct qdisc_ops *qdisc_ops, void *if_private);
 int qop_delete_if(struct ifinfo *ifinfo);
 

Index: src/usr.sbin/altq/libaltq/qop.c
diff -u src/usr.sbin/altq/libaltq/qop.c:1.12 src/usr.sbin/altq/libaltq/qop.c:1.13
--- src/usr.sbin/altq/libaltq/qop.c:1.12	Tue Nov 12 21:28:50 2024
+++ src/usr.sbin/altq/libaltq/qop.c	Tue Dec 24 08:35:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: qop.c,v 1.12 2024/11/12 21:28:50 andvar Exp $	*/
+/*	$NetBSD: qop.c,v 1.13 2024/12/24 08:35:28 ozaki-r Exp $	*/
 /*	$KAME: qop.c,v 1.11 2001/10/26 04:57:59 kjc Exp $	*/
 /*
  * Copyright (C) 1999-2000
@@ -306,7 +306,7 @@ qcmd_delete_filter(const char *ifname, c
 }
 
 int
-qcmd_tbr_register(const char *ifname, u_int rate, u_int size)
+qcmd_tbr_register(const char *ifname, uint64_t rate, u_int size)
 {
 	struct tbrinfo *info;
 
@@ -326,7 +326,7 @@ qcmd_tbr_register(const char *ifname, u_
  */
 
 int
-qop_add_if(struct ifinfo **rp, const char *ifname, u_int bandwidth,
+qop_add_if(struct ifinfo **rp, const char *ifname, uint64_t bandwidth,
 	   struct qdisc_ops *qdisc_ops, void *if_private)
 {
 	struct ifinfo	*ifinfo;
@@ -788,7 +788,7 @@ struct classinfo *get_nextclass(struct c
 	return (next);
 }
 
-u_long
+uint64_t
 atobps(const char *s)
 {
 	double bandwidth;
@@ -805,7 +805,7 @@ atobps(const char *s)
 	}
 	if (bandwidth < 0)
 		bandwidth = 0;
-	return ((u_long)bandwidth);
+	return ((uint64_t)bandwidth);
 }
 
 u_long
Index: src/usr.sbin/altq/libaltq/qop_cbq.c
diff -u src/usr.sbin/altq/libaltq/qop_cbq.c:1.12 src/usr.sbin/altq/libaltq/qop_cbq.c:1.13
--- src/usr.sbin/altq/libaltq/qop_cbq.c:1.12	Wed Jul 21 06:36:33 2021
+++ src/usr.sbin/altq/libaltq/qop_cbq.c	Tue Dec 24 08:35:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: qop_cbq.c,v 1.12 2021/07/21 06:36:33 ozaki-r Exp $	*/
+/*	$NetBSD: qop_cbq.c,v 1.13 2024/12/24 08:35:28 ozaki-r Exp $	*/
 /*	$KAME: qop_cbq.c,v 1.7 2002/05/31 06:03:35 kjc Exp $	*/
 /*
  * Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved.
@@ -61,7 +61,7 @@ static int qop_cbq_enable_hook(struct if
 static int qop_cbq_delete_class_hook(struct classinfo *);
 
 static int cbq_class_spec(struct ifinfo *, u_long, u_long, u_int, int,
-			  u_int, u_int, u_int, u_int, u_int,
+			  uint64_t, u_int, u_int, u_int, u_int,
 			  u_int, cbq_class_spec_t *);
 
 static int cbq_attach(struct ifinfo *);
@@ -112,7 +112,7 @@ static struct qdisc_ops cbq_qdisc = {
 int
 cbq_interface_parser(const char *ifname, int argc, char **argv)
 {
-	u_int  	bandwidth = 100000000;	/* 100Mbps */
+	uint64_t  	bandwidth = 100000000;	/* 100Mbps */
 	u_int	tbrsize = 0;
 	u_int	is_efficient = 0;
 	u_int	is_wrr = 1;	/* weighted round-robin is default */
@@ -169,7 +169,7 @@ cbq_class_parser(const char *ifname, con
 	const char	*borrow = NULL;
 	u_int   pri = 1;
 	u_int	pbandwidth = 0;
-	u_int	bandwidth = 0;
+	uint64_t	bandwidth = 0;
 	u_int	maxdelay = 0;		/* 0 means default */
 	u_int	maxburst = 0;		/* 0 means default */
 	u_int	minburst = 0;		/* 0 means default */
@@ -309,7 +309,7 @@ cbq_class_parser(const char *ifname, con
  * qcmd api
  */
 int
-qcmd_cbq_add_if(const char *ifname, u_int bandwidth, int is_wrr, int efficient,
+qcmd_cbq_add_if(const char *ifname, uint64_t bandwidth, int is_wrr, int efficient,
     bool no_control)
 {
 	int error;
@@ -325,7 +325,7 @@ qcmd_cbq_add_if(const char *ifname, u_in
 int
 qcmd_cbq_add_class(const char *ifname, const char *class_name,
 		   const char *parent_name, const char *borrow_name,
-		   u_int pri, u_int bandwidth,
+		   u_int pri, uint64_t bandwidth,
 		   u_int maxdelay, u_int maxburst, u_int minburst,
 		   u_int av_pkt_size, u_int max_pkt_size,
 		   int admission_type, int flags)
@@ -333,7 +333,7 @@ qcmd_cbq_add_class(const char *ifname, c
 	struct ifinfo *ifinfo;
 	struct cbq_ifinfo *cbq_ifinfo;
 	struct classinfo *parent = NULL, *borrow = NULL;
-	u_int	ctl_bandwidth = 0;
+	uint64_t ctl_bandwidth = 0;
 	int	error = 0;
 
 	if ((ifinfo = ifname2ifinfo(ifname)) == NULL)
@@ -402,7 +402,7 @@ qcmd_cbq_add_class(const char *ifname, c
 
 int
 qcmd_cbq_modify_class(const char *ifname, const char *class_name,
-		      u_int pri, u_int bandwidth,
+		      u_int pri, uint64_t bandwidth,
 		      u_int maxdelay, u_int maxburst, u_int minburst,
 		      u_int av_pkt_size, u_int max_pkt_size, int flags)
 {
@@ -479,7 +479,7 @@ qcmd_cbq_add_ctl_filters(const char *ifn
  */
 int 
 qop_cbq_add_if(struct ifinfo **rp, const char *ifname,
-	       u_int bandwidth, int is_wrr, int efficient, bool no_control)
+	       uint64_t bandwidth, int is_wrr, int efficient, bool no_control)
 {
 	struct ifinfo *ifinfo = NULL;
 	struct cbq_ifinfo *cbq_ifinfo = NULL;
@@ -520,7 +520,7 @@ qop_cbq_add_if(struct ifinfo **rp, const
 int 
 qop_cbq_add_class(struct classinfo **rp, const char *class_name,
 		  struct ifinfo *ifinfo, struct classinfo *parent, 
-		  struct classinfo *borrow, u_int pri, u_int bandwidth,
+		  struct classinfo *borrow, u_int pri, uint64_t bandwidth,
 		  u_int maxdelay, u_int maxburst, u_int minburst,
 		  u_int av_pkt_size, u_int max_pkt_size,
 		  int admission_type, int flags)
@@ -668,14 +668,14 @@ qop_cbq_delete_class_hook(struct classin
 }
 
 int
-qop_cbq_modify_class(struct classinfo *clinfo, u_int pri, u_int bandwidth,
+qop_cbq_modify_class(struct classinfo *clinfo, u_int pri, uint64_t bandwidth,
 		     u_int maxdelay, u_int maxburst, u_int minburst,
 		     u_int av_pkt_size, u_int max_pkt_size, int flags)
 {
 	struct ifinfo *ifinfo;
 	struct cbq_classinfo *cbq_clinfo, *parent_clinfo;
 	u_int	parent_handle, borrow_handle;
-	u_int	old_bandwidth;
+	uint64_t	old_bandwidth;
 	int	error;
 
 	ifinfo = clinfo->ifinfo;
@@ -766,7 +766,7 @@ qop_cbq_enable_hook(struct ifinfo *ifinf
 static int
 cbq_class_spec(struct ifinfo *ifinfo, u_long parent_class,
 	       u_long borrow_class, u_int pri, int flags,
-	       u_int bandwidth, u_int maxdelay, u_int maxburst,
+	       uint64_t bandwidth, u_int maxdelay, u_int maxburst,
 	       u_int minburst, u_int av_pkt_size, u_int max_pkt_size,
 	       cbq_class_spec_t *cl_spec)
 {

Index: src/usr.sbin/altq/libaltq/qop_cbq.h
diff -u src/usr.sbin/altq/libaltq/qop_cbq.h:1.4 src/usr.sbin/altq/libaltq/qop_cbq.h:1.5
--- src/usr.sbin/altq/libaltq/qop_cbq.h:1.4	Wed Jul 21 06:36:33 2021
+++ src/usr.sbin/altq/libaltq/qop_cbq.h	Tue Dec 24 08:35:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: qop_cbq.h,v 1.4 2021/07/21 06:36:33 ozaki-r Exp $	*/
+/*	$NetBSD: qop_cbq.h,v 1.5 2024/12/24 08:35:28 ozaki-r Exp $	*/
 /*	$KAME: qop_cbq.h,v 1.2 2000/10/18 09:15:18 kjc Exp $	*/
 /*
  * Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved.
@@ -60,8 +60,8 @@ struct cbq_ifinfo {
  * cbq private classinfo structure
  */
 struct cbq_classinfo {
-	u_int	bandwidth;		/* bandwidth in bps */
-	u_int	allocated;		/* bandwidth used by children */
+	uint64_t	bandwidth;		/* bandwidth in bps */
+	uint64_t	allocated;		/* bandwidth used by children */
 
 	u_int	maxdelay;
 	u_int	maxburst;
@@ -76,28 +76,28 @@ int cbq_interface_parser(const char *ifn
 int cbq_class_parser(const char *ifname, const char *class_name,
 		     const char *parent_name, int argc, char **argv);
 
-int qcmd_cbq_add_if(const char *ifname, u_int bandwidth,
+int qcmd_cbq_add_if(const char *ifname, uint64_t bandwidth,
 		    int is_wrr, int efficient, bool no_control);
 int qcmd_cbq_add_class(const char *ifname, const char *class_name,
 		       const char *parent_name, const char *borrow_name,
-		       u_int pri, u_int bandwidth,
+		       u_int pri, uint64_t bandwidth,
 		       u_int maxdelay, u_int maxburst, u_int minburst,
 		       u_int av_pkt_size, u_int max_pkt_size,
 		       int admission_type, int flags);
 int qcmd_cbq_modify_class(const char *ifname, const char *class_name,
-			  u_int pri, u_int bandwidth,
+			  u_int pri, uint64_t bandwidth,
 			  u_int maxdelay, u_int maxburst, u_int minburst,
 			  u_int av_pkt_size, u_int max_pkt_size, int flags);
 
 int qop_cbq_add_if(struct ifinfo **rp, const char *ifname,
-		   u_int bandwidth, int is_wrr, int efficient, bool no_control);
+		   uint64_t bandwidth, int is_wrr, int efficient, bool no_control);
 int qop_cbq_add_class(struct classinfo **rp, const char *class_name,
 		      struct ifinfo *ifinfo, struct classinfo *parent, 
-		      struct classinfo *borrow, u_int pri, u_int bandwidth,
+		      struct classinfo *borrow, u_int pri, uint64_t bandwidth,
 		      u_int maxdelay, u_int maxburst, u_int minburst,
 		      u_int av_pkt_size, u_int max_pkt_size,
 		      int admission_type, int flags);
-int qop_cbq_modify_class(struct classinfo *clinfo, u_int pri, u_int bandwidth,
+int qop_cbq_modify_class(struct classinfo *clinfo, u_int pri, uint64_t bandwidth,
 			 u_int maxdelay, u_int maxburst, u_int minburst,
 			 u_int av_pkt_size, u_int max_pkt_size, int flags);
 	

Reply via email to