From patchwork Mon May 10 14:51:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 52091 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 16546B7D1C for ; Tue, 11 May 2010 00:51:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751657Ab0EJOvJ (ORCPT ); Mon, 10 May 2010 10:51:09 -0400 Received: from mail-bw0-f219.google.com ([209.85.218.219]:50416 "EHLO mail-bw0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799Ab0EJOvH (ORCPT ); Mon, 10 May 2010 10:51:07 -0400 Received: by bwz19 with SMTP id 19so1816630bwz.21 for ; Mon, 10 May 2010 07:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=TCGH86riWqFMZ+3AerfGQXvBFRPPeEMX0LSlszT/6bs=; b=kUTjN1s3eac3THBsa5l3mXcD4QXRiPqfwH+90vxpd8QWBHlVMVsa9e98Nc09Irm6++ W4U2s2FngAZj1/MyKyCPHslrq/wOYh8JEPtUsEkmKoRYDa4oggGHiuEhiy3lSZXKFrvl wPcfBHDIatQKzGGrbRroeBhzi6Jm5xBxfXxog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=rUJojmEQQ5nNhWsqat0Jn0x3wsQSmNN1EG91US0AT/vU22NmJXQ/+r/72YYmPKsN3C iubRIe3k9ShPt8nSuZaG+21FP9VmVR+vUEL4R7Li5jJbdZEo1vw3cLAUFRnGLf5T7Buc XHNNLt9EbCKRWjPjjmb8pBqz2G3NX95HV0iE8= Received: by 10.204.33.16 with SMTP id f16mr2483246bkd.11.1273503066040; Mon, 10 May 2010 07:51:06 -0700 (PDT) Received: from [127.0.0.1] (gw1.cosmosbay.com [212.99.114.194]) by mx.google.com with ESMTPS id 15sm1567543bwz.0.2010.05.10.07.51.04 (version=SSLv3 cipher=RC4-MD5); Mon, 10 May 2010 07:51:05 -0700 (PDT) Subject: Re: VLAN I/F's and TX queue. From: Eric Dumazet To: Patrick McHardy , David Miller Cc: Joakim Tjernlund , netdev@vger.kernel.org In-Reply-To: <4BE81B24.4020601@trash.net> References: <1273222403.2261.26.camel@edumazet-laptop> <4BE81793.3060905@trash.net> <1273502195.2221.4.camel@edumazet-laptop> <4BE81B24.4020601@trash.net> Date: Mon, 10 May 2010 16:51:02 +0200 Message-ID: <1273503062.2221.10.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le lundi 10 mai 2010 à 16:41 +0200, Patrick McHardy a écrit : > Eric Dumazet wrote: > > Le lundi 10 mai 2010 à 16:26 +0200, Patrick McHardy a écrit : > > > >> Is the intention just to avoid accounting the packet as dropped? > >> That seems fine to me since in case of NET_XMIT_CN its actually > >> not the currently transmitted packet that was dropped. > >> > >> But part of the intention of the above mentioned patch was actually > >> to inform higher layers of congestion so they can take action if > >> desired, which would be defeated by this patch. > >> > > > > I see, so maybe we want following patch instead ? > > > > (letting NET_XMIT_CN be given to caller, but accounting current packet > > as transmitted ?) > > Perfect, thanks. I'd suggest to change macvlan in a similar fashion > for consistency though. > > In any case please feel free to add my > > Acked-by: Patrick McHardy Indeed, thanks ! [PATCH net-next-2.6] net: congestion notifications are not dropped packets vlan/macvlan start_xmit() can inform caller of congestion with NET_XMIT_CN return value. This doesnt mean packet was dropped. Increment normal stat counters instead of tx_dropped. Signed-off-by: Eric Dumazet Acked-by: Patrick McHardy --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 9a939d8..0f8cd95 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -243,7 +243,7 @@ netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, int ret; ret = macvlan_queue_xmit(skb, dev); - if (likely(ret == NET_XMIT_SUCCESS)) { + if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { txq->tx_packets++; txq->tx_bytes += len; } else diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index b5249c5..55be908 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -327,7 +327,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, len = skb->len; ret = dev_queue_xmit(skb); - if (likely(ret == NET_XMIT_SUCCESS)) { + if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { txq->tx_packets++; txq->tx_bytes += len; } else @@ -353,7 +353,7 @@ static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, len = skb->len; ret = dev_queue_xmit(skb); - if (likely(ret == NET_XMIT_SUCCESS)) { + if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { txq->tx_packets++; txq->tx_bytes += len; } else