From owner-freebsd-net@FreeBSD.ORG Mon Feb 18 05:41:32 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1E5D16A418 for ; Mon, 18 Feb 2008 05:41:32 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.239]) by mx1.freebsd.org (Postfix) with ESMTP id 535F013C459 for ; Mon, 18 Feb 2008 05:41:32 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by qb-out-0506.google.com with SMTP id a10so1365726qbd.7 for ; Sun, 17 Feb 2008 21:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=balJ4I/NBIYSCRBIqWuW326c0HEI/3X216XFonSNKuY=; b=pLZbF3Ch1KtGnPdkThunNplfa93Wbn+YgEh4yhjCVanE27v26Chf7T9fMysLcXg4GK60Drl4wcS+RjgT5dDakGOw52ff0Z8RWfjIQYN0LHFChQlw/cHQkHCOpHMma/eqdGLEGxO3fc2QXBoRj11GMXlHTSMZVlGPlDKDZzWwdt4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZcjDfd9LZ6+nhbcb3kQIc8pKSjkseytepQ/10/54qBTFS7XBggHSHG58hPJ2ayoJ4aClGhmfbBlWY8m5NqSK5EkuY4AfCPhDK0xU3gMFdqT0123jaX9YuktBKB4Blr4uvjymiLYC8ucjzdoLjvN3iWHrE10k+4f+LhtguRkI5uI= Received: by 10.114.168.1 with SMTP id q1mr6372831wae.96.1203313291351; Sun, 17 Feb 2008 21:41:31 -0800 (PST) Received: by 10.115.22.10 with HTTP; Sun, 17 Feb 2008 21:41:31 -0800 (PST) Message-ID: Date: Sun, 17 Feb 2008 21:41:31 -0800 From: "Kip Macy" To: "Bjoern A. Zeeb" In-Reply-To: <20080217210205.A49429@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080106124517.G105@fledge.watson.org> <20080217210205.A49429@maildrop.int.zabbadoz.net> Cc: arch@freebsd.org, Robert Watson , kmacy@freebsd.org, net@freebsd.org Subject: Re: Network device driver KPI/ABI and TOE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 05:41:32 -0000 You might want to check out sys/modules/cxgb/tom/Makefile. -Kip On Feb 17, 2008 1:24 PM, Bjoern A. Zeeb wrote: > On Sun, 6 Jan 2008, Robert Watson wrote: > > Hi, > > [cutting a long mail short and randomly replying;-)] > > I came across dev/cxgb/ulp/tom/cxgb_tcp_subr.c vs. netinet/tcp_subr.c > and I am a bit worried with the way things are done atm. For those > functions copied over there are only changes like: > > - tp = cxgb_tcp_drop(tp, ECONNABORTED); > + tp = tcp_drop(tp, ECONNABORTED); > > - notify = cxgb_tcp_drop_syn_sent; > + notify = tcp_drop_syn_sent; > > - tcp_gen_listen_close(tp); > + tcp_offload_listen_close(tp); > > - (void) tcp_gen_reset(tp); > + (void) tcp_output_reset(tp); > > and SYSCTL stuff. > > > This is a "problem" for following reasons: > - code duplication > - if one changes netinet/tcp_subr.c one has to change foo4_tcp_subr.c > as well > - if more drivers are going to implement things that way it'll be > even more code duplication. > - developers will have to check lots of different places they might > not expect in first place. > - those things might interfere with our locking as well. > > I assume (without looking) the other files in the tom directory expose > similar behavior. So this is a more general problem: > > we need to seriously think about abstracting our tcp_subr.c (and > other) functions to avoid this duplication or at least integrate > things better by other ways. > > This is mostly asking networking people to think about this so we can > iteratively improve things. cxgb has done a good first step in that > direction, now is the time to further hone things. > > > /bz > > -- > Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT > Software is harder than hardware so better get it right the first time. > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" >