From nobody Sat Feb 24 16:15:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThsRt61J3z5B524; Sat, 24 Feb 2024 16:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThsRt5kBcz4Yh0; Sat, 24 Feb 2024 16:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708791338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H8iPjnpipwLeLU+M1OAN3dXJXkdqh0Bf8eCWtHDQqqc=; b=VW7gWb1IaqgK6PMKXPuGTafAO6m1VUpVOCt5Mdrx6bJ+DWWYc1PuAsE/X1Xk0dwXrnNSni HSciOOJmXUg7+vc06VD5q4L8WKpdFT95Qi7Atqle0Sf7E37b9tFs5kBPgybDh9bGGUQT2J CbiqfCepUA8nXfjCCLFYvd0XyYJ+9c4Snut9oc3vBfkJT5uMCFD+O3AEcqJCPOJW1k5i1K +2IeTWVT82S6zl3H1+cdsHaeLzDhPbKgXszfqysvX/SxW5uhWOXk87XeaRzK6CmN6HaaZF NsDqWke0e07zyjBxUwjnHRX+nFxRKWXh8DVyx47dRNS5OEVaAEBQ8yK+5HY6kQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708791338; a=rsa-sha256; cv=none; b=Tet5Lg2uPobQsBKU73m2zR/pIz6/4s2DIqQuVlpn8E0lUkdqPXNo94HTqimFODThlutUKh pZI0e/b9DtmjNY4JNX3K/SbmmC96IOL8ROb62T14RRFBlBgO7Y/Gr7dflRZvBS0rZJIYte QkrRVc8vhOlvbUjK9EBuB5fkJxH0vIpAJ0KuFkxLNK+JyPa9E779dDlIDFXQ4bUAR0bnWo I3g9a+vtDebhSa1V6P1zhyPwWvJxpjg6BAcvvhGA+cuv75iSo3Ub7VqJ1NnyG8N7MnqxxD n8Nj7DNHsJvxapNq4n2aYF7zIOG7nQHxwJyBTU/ASBAl4f0PPSKBAgFzMAgYwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708791338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H8iPjnpipwLeLU+M1OAN3dXJXkdqh0Bf8eCWtHDQqqc=; b=gX4xsJ6OlMGyk09pyTdULrovAIoL55zsZ15WiiRVabsINsF6iDHyLdUYRrLWGcbuWwZtpV w6RgJq0WZPImzwh2BD1t8OTJxYg1iK9C4uLbY7AfV/I6pXgPG3OTonXNDIcpwW9g+mFbQD ssIC/kn3mFTOxayDRujkjy5MJZFG5vWhWw6U4KMlo0keqiBtHvh4oSz+G5q0pTgsbkwEdM bsPPXPxNlvMYc6gM/9cJKyNjkNA1xu9Xe7cP1W420ZkvwlaOvGy8srGA1Ywi9swzfXJ80x 94R2P2JnydMKlXeysvTLAthyvCtDybGPzc5hLUyRsEZwenGdEoBRJB3JEYGGWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ThsRt4p8gz1680; Sat, 24 Feb 2024 16:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41OGFcM3091759; Sat, 24 Feb 2024 16:15:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41OGFcg7091756; Sat, 24 Feb 2024 16:15:38 GMT (envelope-from git) Date: Sat, 24 Feb 2024 16:15:38 GMT Message-Id: <202402241615.41OGFcg7091756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: f74352fbcf15 - main - tcp: use enum for all congestion control signals List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f74352fbcf15341accaf5a92240871f98323215d Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=f74352fbcf15341accaf5a92240871f98323215d commit f74352fbcf15341accaf5a92240871f98323215d Author: Richard Scheffenegger AuthorDate: 2024-02-24 15:41:31 +0000 Commit: Richard Scheffenegger CommitDate: 2024-02-24 15:41:48 +0000 tcp: use enum for all congestion control signals Facilitate easier troubleshooting by enumerating all congestion control signals. Typecast the enum to int, when a congestion control module uses private signals. No external change. Reviewed By: glebius, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43838 --- sys/netinet/cc/cc.c | 2 +- sys/netinet/cc/cc.h | 42 +++++++++++++++++++++--------------------- sys/netinet/cc/cc_cdg.c | 10 +++++----- sys/netinet/cc/cc_chd.c | 11 ++++++----- sys/netinet/cc/cc_cubic.c | 10 ++++++---- sys/netinet/cc/cc_dctcp.c | 10 ++++++---- sys/netinet/cc/cc_hd.c | 4 ++-- sys/netinet/cc/cc_htcp.c | 10 ++++++---- sys/netinet/cc/cc_newreno.c | 10 ++++++---- sys/netinet/cc/cc_vegas.c | 13 +++++++------ 10 files changed, 66 insertions(+), 56 deletions(-) diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index c2965b1e6a48..9308b5f8d764 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -505,7 +505,7 @@ newreno_cc_cong_signal(struct cc_var *ccv, uint32_t type) } void -newreno_cc_ack_received(struct cc_var *ccv, uint16_t type) +newreno_cc_ack_received(struct cc_var *ccv, ccsignal_t type) { if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && (ccv->flags & CCF_CWND_LIMITED)) { diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index 9571da50b2c7..5b2cb58a24a0 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -121,25 +121,25 @@ struct cc_var { #define CCF_HYSTART_CAN_SH_CWND 0x0800 /* Can hystart when going CSS -> CA slam the cwnd */ #define CCF_HYSTART_CONS_SSTH 0x1000 /* Should hystart use the more conservative ssthresh */ -/* ACK types passed to the ack_received() hook. */ -#define CC_ACK 0x0001 /* Regular in sequence ACK. */ -#define CC_DUPACK 0x0002 /* Duplicate ACK. */ -#define CC_PARTIALACK 0x0004 /* Not yet. */ -#define CC_SACK 0x0008 /* Not yet. */ +typedef enum { + /* ACK types passed to the ack_received() hook. */ + CC_ACK = 0x0001, /* Regular in sequence ACK. */ + CC_DUPACK = 0x0002, /* Duplicate ACK. */ + CC_PARTIALACK = 0x0004, /* Not yet. */ + CC_SACK = 0x0008, /* Not yet. */ + /* Congestion signal types passed to the cong_signal() hook. */ + CC_ECN = 0x0100, /* ECN marked packet received. */ + CC_RTO = 0x0200, /* RTO fired. */ + CC_RTO_ERR = 0x0400, /* RTO fired in error. */ + CC_NDUPACK = 0x0800, /* Threshold of dupack's reached. */ + /* + * The highest order 8 bits (0x01000000 - 0x80000000) are reserved + * for CC algos to declare their own congestion signal types. + */ + CC_SIGPRIVMASK = 0xFF000000 /* Mask to check if sig is private. */ +} ccsignal_t; #endif /* defined(_KERNEL) || defined(_WANT_TCPCB) */ -/* - * Congestion signal types passed to the cong_signal() hook. The highest order 8 - * bits (0x01000000 - 0x80000000) are reserved for CC algos to declare their own - * congestion signal types. - */ -#define CC_ECN 0x00000001 /* ECN marked packet received. */ -#define CC_RTO 0x00000002 /* RTO fired. */ -#define CC_RTO_ERR 0x00000004 /* RTO fired in error. */ -#define CC_NDUPACK 0x00000008 /* Threshold of dupack's reached. */ - -#define CC_SIGPRIVMASK 0xFF000000 /* Mask to check if sig is private. */ - #ifdef _KERNEL /* * Structure to hold data and function pointers that together represent a @@ -175,10 +175,10 @@ struct cc_algo { void (*conn_init)(struct cc_var *ccv); /* Called on receipt of an ack. */ - void (*ack_received)(struct cc_var *ccv, uint16_t type); + void (*ack_received)(struct cc_var *ccv, ccsignal_t type); /* Called on detection of a congestion signal. */ - void (*cong_signal)(struct cc_var *ccv, uint32_t type); + void (*cong_signal)(struct cc_var *ccv, ccsignal_t type); /* Called after exiting congestion recovery. */ void (*post_recovery)(struct cc_var *ccv); @@ -236,8 +236,8 @@ extern struct rwlock cc_list_lock; */ void newreno_cc_post_recovery(struct cc_var *); void newreno_cc_after_idle(struct cc_var *); -void newreno_cc_cong_signal(struct cc_var *, uint32_t ); -void newreno_cc_ack_received(struct cc_var *, uint16_t); +void newreno_cc_cong_signal(struct cc_var *, ccsignal_t); +void newreno_cc_ack_received(struct cc_var *, ccsignal_t); /* Called to temporarily keep an algo from going away during change */ void cc_refer(struct cc_algo *algo); diff --git a/sys/netinet/cc/cc_cdg.c b/sys/netinet/cc/cc_cdg.c index 3f23c4091170..1e9236f878d4 100644 --- a/sys/netinet/cc/cc_cdg.c +++ b/sys/netinet/cc/cc_cdg.c @@ -221,8 +221,8 @@ static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv, void *ptr); static void cdg_cb_destroy(struct cc_var *ccv); -static void cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type); -static void cdg_ack_received(struct cc_var *ccv, uint16_t ack_type); +static void cdg_cong_signal(struct cc_var *ccv, ccsignal_t signal_type); +static void cdg_ack_received(struct cc_var *ccv, ccsignal_t ack_type); static size_t cdg_data_sz(void); struct cc_algo cdg_cc_algo = { @@ -450,11 +450,11 @@ cdg_window_increase(struct cc_var *ccv, int new_measurement) } static void -cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) +cdg_cong_signal(struct cc_var *ccv, ccsignal_t signal_type) { struct cdg *cdg_data = ccv->cc_data; - switch(signal_type) { + switch((int)signal_type) { case CC_CDG_DELAY: CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), V_cdg_beta_delay); @@ -571,7 +571,7 @@ calc_moving_average(struct cdg *cdg_data, long qdiff_max, long qdiff_min) } static void -cdg_ack_received(struct cc_var *ccv, uint16_t ack_type) +cdg_ack_received(struct cc_var *ccv, ccsignal_t ack_type) { struct cdg *cdg_data; struct ertt *e_t; diff --git a/sys/netinet/cc/cc_chd.c b/sys/netinet/cc/cc_chd.c index c644d9b2cdb8..52048a7c05ae 100644 --- a/sys/netinet/cc/cc_chd.c +++ b/sys/netinet/cc/cc_chd.c @@ -88,10 +88,10 @@ /* Largest possible number returned by random(). */ #define RANDOM_MAX INT_MAX -static void chd_ack_received(struct cc_var *ccv, uint16_t ack_type); +static void chd_ack_received(struct cc_var *ccv, ccsignal_t ack_type); static void chd_cb_destroy(struct cc_var *ccv); static int chd_cb_init(struct cc_var *ccv, void *ptr); -static void chd_cong_signal(struct cc_var *ccv, uint32_t signal_type); +static void chd_cong_signal(struct cc_var *ccv, ccsignal_t signal_type); static void chd_conn_init(struct cc_var *ccv); static int chd_mod_init(void); static size_t chd_data_sz(void); @@ -235,7 +235,7 @@ chd_window_increase(struct cc_var *ccv, int new_measurement) * ack_type == CC_ACK. */ static void -chd_ack_received(struct cc_var *ccv, uint16_t ack_type) +chd_ack_received(struct cc_var *ccv, ccsignal_t ack_type) { struct chd *chd_data; struct ertt *e_t; @@ -336,7 +336,7 @@ chd_cb_init(struct cc_var *ccv, void *ptr) } static void -chd_cong_signal(struct cc_var *ccv, uint32_t signal_type) +chd_cong_signal(struct cc_var *ccv, ccsignal_t signal_type) { struct ertt *e_t; struct chd *chd_data; @@ -346,7 +346,7 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_type) chd_data = ccv->cc_data; qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt; - switch(signal_type) { + switch((int)signal_type) { case CC_CHD_DELAY: chd_window_decrease(ccv); /* Set new ssthresh. */ CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); @@ -387,6 +387,7 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_type) default: newreno_cc_cong_signal(ccv, signal_type); + break; } } diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index eb1587d44427..a9c7592b80ca 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -73,10 +73,10 @@ #include #include -static void cubic_ack_received(struct cc_var *ccv, uint16_t type); +static void cubic_ack_received(struct cc_var *ccv, ccsignal_t type); static void cubic_cb_destroy(struct cc_var *ccv); static int cubic_cb_init(struct cc_var *ccv, void *ptr); -static void cubic_cong_signal(struct cc_var *ccv, uint32_t type); +static void cubic_cong_signal(struct cc_var *ccv, ccsignal_t type); static void cubic_conn_init(struct cc_var *ccv); static int cubic_mod_init(void); static void cubic_post_recovery(struct cc_var *ccv); @@ -233,7 +233,7 @@ cubic_does_slow_start(struct cc_var *ccv, struct cubic *cubicd) } static void -cubic_ack_received(struct cc_var *ccv, uint16_t type) +cubic_ack_received(struct cc_var *ccv, ccsignal_t type) { struct cubic *cubic_data; unsigned long W_est, W_cubic; @@ -417,7 +417,7 @@ cubic_cb_init(struct cc_var *ccv, void *ptr) * Perform any necessary tasks before we enter congestion recovery. */ static void -cubic_cong_signal(struct cc_var *ccv, uint32_t type) +cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) { struct cubic *cubic_data; uint32_t mss, pipe; @@ -503,6 +503,8 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_data->cwnd_epoch = cubic_data->undo_cwnd_epoch; cubic_data->t_epoch = cubic_data->undo_t_epoch; break; + default: + break; } } diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c index ae0a56839449..374db98c5e60 100644 --- a/sys/netinet/cc/cc_dctcp.c +++ b/sys/netinet/cc/cc_dctcp.c @@ -79,11 +79,11 @@ struct dctcp { uint32_t num_cong_events; /* # of congestion events */ }; -static void dctcp_ack_received(struct cc_var *ccv, uint16_t type); +static void dctcp_ack_received(struct cc_var *ccv, ccsignal_t type); static void dctcp_after_idle(struct cc_var *ccv); static void dctcp_cb_destroy(struct cc_var *ccv); static int dctcp_cb_init(struct cc_var *ccv, void *ptr); -static void dctcp_cong_signal(struct cc_var *ccv, uint32_t type); +static void dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type); static void dctcp_conn_init(struct cc_var *ccv); static void dctcp_post_recovery(struct cc_var *ccv); static void dctcp_ecnpkt_handler(struct cc_var *ccv); @@ -104,7 +104,7 @@ struct cc_algo dctcp_cc_algo = { }; static void -dctcp_ack_received(struct cc_var *ccv, uint16_t type) +dctcp_ack_received(struct cc_var *ccv, ccsignal_t type) { struct dctcp *dctcp_data; int bytes_acked = 0; @@ -237,7 +237,7 @@ dctcp_cb_init(struct cc_var *ccv, void *ptr) * Perform any necessary tasks before we enter congestion recovery. */ static void -dctcp_cong_signal(struct cc_var *ccv, uint32_t type) +dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type) { struct dctcp *dctcp_data; uint32_t cwin, mss, pipe; @@ -308,6 +308,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; break; + default: + break; } } else newreno_cc_cong_signal(ccv, type); diff --git a/sys/netinet/cc/cc_hd.c b/sys/netinet/cc/cc_hd.c index 1a8b62ccf426..82486563f97e 100644 --- a/sys/netinet/cc/cc_hd.c +++ b/sys/netinet/cc/cc_hd.c @@ -80,7 +80,7 @@ /* Largest possible number returned by random(). */ #define RANDOM_MAX INT_MAX -static void hd_ack_received(struct cc_var *ccv, uint16_t ack_type); +static void hd_ack_received(struct cc_var *ccv, ccsignal_t ack_type); static int hd_mod_init(void); static size_t hd_data_sz(void); @@ -138,7 +138,7 @@ should_backoff(int qdly, int maxqdly) * as NewReno in all other circumstances. */ static void -hd_ack_received(struct cc_var *ccv, uint16_t ack_type) +hd_ack_received(struct cc_var *ccv, ccsignal_t ack_type) { struct ertt *e_t; int qdly; diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c index 43224446fd84..41c552a3bfa0 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -136,10 +136,10 @@ (((diff) / hz) * (((diff) << HTCP_ALPHA_INC_SHIFT) / (4 * hz))) \ ) >> HTCP_ALPHA_INC_SHIFT) -static void htcp_ack_received(struct cc_var *ccv, uint16_t type); +static void htcp_ack_received(struct cc_var *ccv, ccsignal_t type); static void htcp_cb_destroy(struct cc_var *ccv); static int htcp_cb_init(struct cc_var *ccv, void *ptr); -static void htcp_cong_signal(struct cc_var *ccv, uint32_t type); +static void htcp_cong_signal(struct cc_var *ccv, ccsignal_t type); static int htcp_mod_init(void); static void htcp_post_recovery(struct cc_var *ccv); static void htcp_recalc_alpha(struct cc_var *ccv); @@ -190,7 +190,7 @@ struct cc_algo htcp_cc_algo = { }; static void -htcp_ack_received(struct cc_var *ccv, uint16_t type) +htcp_ack_received(struct cc_var *ccv, ccsignal_t type) { struct htcp *htcp_data; @@ -278,7 +278,7 @@ htcp_cb_init(struct cc_var *ccv, void *ptr) * Perform any necessary tasks before we enter congestion recovery. */ static void -htcp_cong_signal(struct cc_var *ccv, uint32_t type) +htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) { struct htcp *htcp_data; uint32_t mss, pipe; @@ -345,6 +345,8 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) if (CCV(ccv, t_rxtshift) >= 2) htcp_data->t_last_cong = ticks; break; + default: + break; } } diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 71f2764ef4bc..aa20e2c64f7d 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -84,9 +84,9 @@ #include static void newreno_cb_destroy(struct cc_var *ccv); -static void newreno_ack_received(struct cc_var *ccv, uint16_t type); +static void newreno_ack_received(struct cc_var *ccv, ccsignal_t type); static void newreno_after_idle(struct cc_var *ccv); -static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); +static void newreno_cong_signal(struct cc_var *ccv, ccsignal_t type); static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf); static void newreno_newround(struct cc_var *ccv, uint32_t round_cnt); static void newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas); @@ -212,7 +212,7 @@ newreno_cb_destroy(struct cc_var *ccv) } static void -newreno_ack_received(struct cc_var *ccv, uint16_t type) +newreno_ack_received(struct cc_var *ccv, ccsignal_t type) { struct newreno *nreno; @@ -363,7 +363,7 @@ newreno_after_idle(struct cc_var *ccv) * Perform any necessary tasks before we enter congestion recovery. */ static void -newreno_cong_signal(struct cc_var *ccv, uint32_t type) +newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) { struct newreno *nreno; uint32_t beta, beta_ecn, cwin, factor, mss, pipe; @@ -442,6 +442,8 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) } CCV(ccv, snd_cwnd) = mss; break; + default: + break; } } diff --git a/sys/netinet/cc/cc_vegas.c b/sys/netinet/cc/cc_vegas.c index aac9c9ce77ff..ecd42c1a0f53 100644 --- a/sys/netinet/cc/cc_vegas.c +++ b/sys/netinet/cc/cc_vegas.c @@ -84,12 +84,12 @@ * Private signal type for rate based congestion signal. * See for appropriate bit-range to use for private signals. */ -#define CC_VEGAS_RATE 0x01000000 +#define CC_VEGAS_RATE 0x04000000 -static void vegas_ack_received(struct cc_var *ccv, uint16_t ack_type); +static void vegas_ack_received(struct cc_var *ccv, ccsignal_t ack_type); static void vegas_cb_destroy(struct cc_var *ccv); static int vegas_cb_init(struct cc_var *ccv, void *ptr); -static void vegas_cong_signal(struct cc_var *ccv, uint32_t signal_type); +static void vegas_cong_signal(struct cc_var *ccv, ccsignal_t signal_type); static void vegas_conn_init(struct cc_var *ccv); static int vegas_mod_init(void); static size_t vegas_data_sz(void); @@ -124,7 +124,7 @@ struct cc_algo vegas_cc_algo = { * has been used. */ static void -vegas_ack_received(struct cc_var *ccv, uint16_t ack_type) +vegas_ack_received(struct cc_var *ccv, ccsignal_t ack_type) { struct ertt *e_t; struct vegas *vegas_data; @@ -203,7 +203,7 @@ vegas_cb_init(struct cc_var *ccv, void *ptr) * handled here, otherwise it falls back to newreno's congestion handling. */ static void -vegas_cong_signal(struct cc_var *ccv, uint32_t signal_type) +vegas_cong_signal(struct cc_var *ccv, ccsignal_t signal_type) { struct vegas *vegas_data; int presignalrecov; @@ -215,7 +215,7 @@ vegas_cong_signal(struct cc_var *ccv, uint32_t signal_type) else presignalrecov = 0; - switch(signal_type) { + switch((int)signal_type) { case CC_VEGAS_RATE: if (!IN_RECOVERY(CCV(ccv, t_flags))) { CCV(ccv, snd_cwnd) = max(2 * CCV(ccv, t_maxseg), @@ -228,6 +228,7 @@ vegas_cong_signal(struct cc_var *ccv, uint32_t signal_type) default: newreno_cc_cong_signal(ccv, signal_type); + break; } if (IN_RECOVERY(CCV(ccv, t_flags)) && !presignalrecov)