Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbYLLTiI (ORCPT ); Fri, 12 Dec 2008 14:38:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751267AbYLLThu (ORCPT ); Fri, 12 Dec 2008 14:37:50 -0500 Received: from accolon.hansenpartnership.com ([76.243.235.52]:35430 "EHLO accolon.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751093AbYLLTht (ORCPT ); Fri, 12 Dec 2008 14:37:49 -0500 Subject: Re: [PATCH][RFC 23/23]: Support for zero-copy TCP transmit of user space data From: James Bottomley To: Vladislav Bolkhovitin Cc: Evgeniy Polyakov , linux-scsi@vger.kernel.org, Andrew Morton , FUJITA Tomonori , Mike Christie , Jeff Garzik , Boaz Harrosh , Linus Torvalds , linux-kernel@vger.kernel.org, scst-devel@lists.sourceforge.net, Bart Van Assche , "Nicholas A. Bellinger" , netdev@vger.kernel.org In-Reply-To: <4942BAB8.4050007@vlnb.net> References: <494009D7.4020602@vlnb.net> <494012C4.7090304@vlnb.net> <20081210214500.GA24212@ioremap.net> <4941590F.3070705@vlnb.net> <1229022734.3266.67.camel@localhost.localdomain> <4942BAB8.4050007@vlnb.net> Content-Type: text/plain Date: Fri, 12 Dec 2008 13:37:53 -0600 Message-Id: <1229110673.3262.94.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1974 Lines: 40 On Fri, 2008-12-12 at 22:25 +0300, Vladislav Bolkhovitin wrote: > > One thing that leaps immediately to mind is that you could isolate this > > to the net layer by putting it in skb_frag_struct. However, such a move > > would require a proper API for this in net ... > > To have net_priv analog in skb was the first idea I was tried. But I > quickly gave up, because it would required that all the pages in each > skb_frag_struct be from the same originator, i.e. with the same > net_priv. It is unpractical to change all the operations with skb's to > forbid merging them, if they have different net_priv. There are too many > such places in very not obvious code pieces. Actually, I said carry in skb_frag_struct not skb ... that allows for merging of skbs with different page sources. The API changes would have to allow setting at this level. > > right now it looks like > > you're using the struct page addition to carry this information from > > SCSI to net, which is a bit of a layering violation. > > I don't think there is any layering violation here. Just lower layer > notifies upper layer that transmission of a page has finished. It's done > a bit not straightforward, but still basically the same as, for > instance, on_free_cmd() callbacks which SCST core uses to notify target > drivers and dev handlers that the corresponding command is about to be > freed, so they can free associated with it data as well. The way you transmit the information you want notification is done by a private tag in struct page, so you're carrying the information on an object that belongs to neither layer ... that's the violation. It's essentially an extension of the net API that goes via the mm layer. James -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/