From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Edwards Subject: Re: Change in alloc_skb() behavior in 3.2+ kernels? Date: Wed, 6 Jun 2012 20:26:25 +0000 (UTC) Message-ID: References: <20120606.115130.1091814494251887552.davem@davemloft.net> <1339011742.26966.44.camel@edumazet-glaptop> To: netdev@vger.kernel.org Return-path: Received: from plane.gmane.org ([80.91.229.3]:40035 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758320Ab2FFUaQ (ORCPT ); Wed, 6 Jun 2012 16:30:16 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ScMrl-0002gH-93 for netdev@vger.kernel.org; Wed, 06 Jun 2012 22:30:05 +0200 Received: from dsl.comtrol.com ([64.122.56.22]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jun 2012 22:30:05 +0200 Received: from grant.b.edwards by dsl.comtrol.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jun 2012 22:30:05 +0200 Sender: netdev-owner@vger.kernel.org List-ID: On 2012-06-06, Eric Dumazet wrote: > On Wed, 2012-06-06 at 11:51 -0700, David Miller wrote: >> From: Grant Edwards >> Date: Wed, 6 Jun 2012 18:32:57 +0000 (UTC) >> >> > The kernel module that's started failing fills the allocated sk_buff >> > until tailroom() indicates it is full and then sends it. The problem >> > is that sending a packet with a length of 1850 won't work (it's a >> > MAC-layer Ethernet packet). >> >> The amount of tailroom an SKB has is implementation dependent. >> >> It's incredibly poor form to rely upon it to determine whether a >> fully sized frame has been constructed or not. >> >> Please fix the code that does this. > > By the way, we had a similar problem, and the fix was : > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=a21d45726acacc963d8baddf74607d9b74e2b723 > > Grant, depending on the context, you might use skb->avail_size and > skb_availroom() as well. > > Beware skb->avail_size is unioned with skb->{mark|dropcount} Thanks for the pointer. -- Grant Edwards grant.b.edwards Yow! ANN JILLIAN'S HAIR at makes LONI ANDERSON'S gmail.com HAIR look like RICARDO MONTALBAN'S HAIR!