From owner-svn-src-projects@FreeBSD.ORG Thu Feb 4 03:19:32 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E2F106566C; Thu, 4 Feb 2010 03:19:32 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE9748FC16; Thu, 4 Feb 2010 03:19:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o143JWdu091367; Thu, 4 Feb 2010 03:19:32 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o143JWNV091360; Thu, 4 Feb 2010 03:19:32 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201002040319.o143JWNV091360@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 4 Feb 2010 03:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203470 - in projects/tcp_cc_head/sys: conf netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2010 03:19:32 -0000 Author: lstewart Date: Thu Feb 4 03:19:32 2010 New Revision: 203470 URL: http://svn.freebsd.org/changeset/base/203470 Log: Helpers aren't and don't need to be TCP specific. Added: projects/tcp_cc_head/sys/netinet/helper.c - copied, changed from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.c projects/tcp_cc_head/sys/netinet/helper.h - copied unchanged from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.h projects/tcp_cc_head/sys/netinet/helper_module.h - copied unchanged from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper_module.h Deleted: projects/tcp_cc_head/sys/netinet/tcp_helper.c projects/tcp_cc_head/sys/netinet/tcp_helper.h projects/tcp_cc_head/sys/netinet/tcp_helper_module.h Modified: projects/tcp_cc_head/sys/conf/files projects/tcp_cc_head/sys/netinet/ertt.c projects/tcp_cc_head/sys/netinet/tcp_subr.c Modified: projects/tcp_cc_head/sys/conf/files ============================================================================== --- projects/tcp_cc_head/sys/conf/files Thu Feb 4 03:07:48 2010 (r203469) +++ projects/tcp_cc_head/sys/conf/files Thu Feb 4 03:19:32 2010 (r203470) @@ -2435,6 +2435,7 @@ netgraph/ng_vlan.c optional netgraph_vl netinet/accf_data.c optional accept_filter_data inet netinet/accf_dns.c optional accept_filter_dns inet netinet/accf_http.c optional accept_filter_http inet +netinet/helper.c optional inet netinet/if_atm.c optional atm netinet/if_ether.c optional inet ether netinet/igmp.c optional inet @@ -2485,7 +2486,6 @@ netinet/sctp_timer.c optional inet sctp netinet/sctp_usrreq.c optional inet sctp netinet/sctputil.c optional inet sctp netinet/tcp_debug.c optional tcpdebug -netinet/tcp_helper.c optional inet netinet/tcp_hostcache.c optional inet netinet/tcp_input.c optional inet netinet/tcp_lro.c optional inet Modified: projects/tcp_cc_head/sys/netinet/ertt.c ============================================================================== --- projects/tcp_cc_head/sys/netinet/ertt.c Thu Feb 4 03:07:48 2010 (r203469) +++ projects/tcp_cc_head/sys/netinet/ertt.c Thu Feb 4 03:19:32 2010 (r203470) @@ -44,12 +44,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include #include -#include -#include struct ertt { int test; Copied and modified: projects/tcp_cc_head/sys/netinet/helper.c (from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.c) ============================================================================== --- projects/tcp_cc_head/sys/netinet/tcp_helper.c Wed Feb 3 04:58:08 2010 (r203416, copy source) +++ projects/tcp_cc_head/sys/netinet/helper.c Thu Feb 4 03:19:32 2010 (r203470) @@ -38,8 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include struct hlpr_head helpers = STAILQ_HEAD_INITIALIZER(helpers); Copied: projects/tcp_cc_head/sys/netinet/helper.h (from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/tcp_cc_head/sys/netinet/helper.h Thu Feb 4 03:19:32 2010 (r203470, copy of r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.h) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2010 Lawrence Stewart + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart, + * made possible in part by a grant from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TCP_HELPER_H +#define _TCP_HELPER_H + + +struct helper { + /* Init global module state on kldload. */ + int (*mod_init) (void); + + /* Cleanup global module state on kldunload. */ + int (*mod_destroy) (void); + + int (*block_init) (uintptr_t *data); + int (*block_destroy) (uintptr_t *data); + + uint16_t flags; + + //STAILQ hooks; /* which hooks does this helper want to be called from */ + //STAILQ struct helper_data; + int dynamic_id; /* ID assigned by system to this hlpr's data in the + dynamic array */ + + + STAILQ_ENTRY(helper) entries; +}; + +/* Helper flags */ +#define HLPR_NEEDS_DATABLOCK 0x0001 + +extern STAILQ_HEAD(hlpr_head, helper) helpers; + +int init_datablocks(uintptr_t **array_head, int *nblocks); +int destroy_datablocks(uintptr_t **array_head, int nblocks); +int register_helper(struct helper *h); +int deregister_helper(struct helper *h); + +#endif /* _TCP_HELPER_H */ Copied: projects/tcp_cc_head/sys/netinet/helper_module.h (from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper_module.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/tcp_cc_head/sys/netinet/helper_module.h Thu Feb 4 03:19:32 2010 (r203470, copy of r203416, projects/tcp_cc_head/sys/netinet/tcp_helper_module.h) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2010 Lawrence Stewart + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart, + * made possible in part by a grant from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_TCP_HELPER_MODULE_H_ +#define _NETINET_TCP_HELPER_MODULE_H_ + +#define DECLARE_HELPER(hlprname, hlpr_data) \ + static moduledata_t hlpr_##hlprname = { \ + #hlprname, \ + hlpr_modevent, \ + hlpr_data \ + }; \ + DECLARE_MODULE(hlprname, hlpr_##hlprname, SI_SUB_PROTO_IFATTACHDOMAIN, \ + SI_ORDER_ANY) + +int hlpr_modevent(module_t mod, int type, void *data); + +MALLOC_DECLARE(M_HLPR); +MALLOC_DEFINE(M_HLPR, "helper data", "Blah"); + + +#endif Modified: projects/tcp_cc_head/sys/netinet/tcp_subr.c ============================================================================== --- projects/tcp_cc_head/sys/netinet/tcp_subr.c Thu Feb 4 03:07:48 2010 (r203469) +++ projects/tcp_cc_head/sys/netinet/tcp_subr.c Thu Feb 4 03:19:32 2010 (r203470) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -85,7 +86,6 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include #include #include #include