From owner-freebsd-net@FreeBSD.ORG Sun Feb 17 21:43:56 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 EEDFD16A418; Sun, 17 Feb 2008 21:43:56 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id A24AC13C43E; Sun, 17 Feb 2008 21:43:56 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4A47A41C7AC; Sun, 17 Feb 2008 22:24:47 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 5V7m8Uu0v6BZ; Sun, 17 Feb 2008 22:24:46 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id EF16A41C7AB; Sun, 17 Feb 2008 22:24:46 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 3986744487F; Sun, 17 Feb 2008 21:24:26 +0000 (UTC) Date: Sun, 17 Feb 2008 21:24:26 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Robert Watson In-Reply-To: <20080106124517.G105@fledge.watson.org> Message-ID: <20080217210205.A49429@maildrop.int.zabbadoz.net> References: <20080106124517.G105@fledge.watson.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@FreeBSD.org, 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: Sun, 17 Feb 2008 21:43:57 -0000 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.