From patchwork Wed Jul 13 13:52:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Collins X-Patchwork-Id: 164268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 266BCB6FD7 for ; Tue, 12 Jun 2012 09:02:19 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SeDch-0003iO-15; Mon, 11 Jun 2012 23:02:11 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SeDcY-0003hC-3V for kernel-team@lists.ubuntu.com; Mon, 11 Jun 2012 23:02:02 +0000 Received: by mail-pz0-f49.google.com with SMTP id m1so6348994dad.8 for ; Mon, 11 Jun 2012 16:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:in-reply-to:references:from:date:subject:to; bh=sxi5KRIJCc2b+vyzt2Cd1DK/I6HPv8CcCdrYDGAkYJo=; b=NFQvcb0GNWmI0GxsJynLsz1wUvbqCFvtTSzx0OZyZYiUB3I1eoCW/kCGA+op5ELNJY k6g/pRY772GgwxOQ/6LZyCdAC04JREG2FmT/5Uxb2iOFdMQ2nii3FlzaAND5gCQH8/0Q VaQY4T7eQCJ1maPRAyixgE7y0TPCyo3ElvKqlPu4UU2iNN00shRHIougTuyhxkf64U6Y bLanZz++jNY8sTHNJyGaclE195GyWnFY3tuJ2SWIboRReEjM6saizy8fxyBOVEm28OJ7 cWk0LQLUejnqdF6gvkjvPyu/z2ZSCIpjyVQr1FLO1QIVwx4KcIxhJHRqFeTQ+c4DPfTs buvg== Received: by 10.68.134.163 with SMTP id pl3mr31875425pbb.167.1339455721659; Mon, 11 Jun 2012 16:02:01 -0700 (PDT) Received: from localhost (ip68-13-200-36.hr.hr.cox.net. [68.13.200.36]) by mx.google.com with ESMTPS id hc7sm19925271pbc.54.2012.06.11.16.01.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jun 2012 16:02:00 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Mon, 11 Jun 2012 19:01:56 -0400 Message-Id: In-Reply-To: References: From: Andy Fleming Date: Wed, 13 Jul 2011 08:52:04 -0500 Subject: [PATCH 12/27] UBUNTU: SAUCE: net: Add support for handling queueing in hardware To: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com The QDisc code does a bunch of locking which is unnecessary if you have hardware which handles all of the queueing. Add support for this, and skip over all of the queueing code if the feature is enabled on a given device. This code breaks QDisc support on dpaa_eth, and also coopts the FCOE feature bit. This patch is being maintained and will eventually be merged upstream by Freescale directly. The powerpc-e500mc flavour uses this. Signed-off-by: Andy Fleming Signed-off-by: Ben Collins --- include/linux/netdev_features.h | 2 ++ net/core/dev.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 5ac3212..0de1a9a 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -56,6 +56,7 @@ enum { NETIF_F_LOOPBACK_BIT, /* Enable loopback */ NETIF_F_RXFCS_BIT, /* Append FCS to skb pkt data */ NETIF_F_RXALL_BIT, /* Receive errored frames too */ + NETIF_F_HW_QDISC_BIT, /* Supports hardware Qdisc */ /* * Add your fresh new feature above and remember to update @@ -80,6 +81,7 @@ enum { #define NETIF_F_GSO_ROBUST __NETIF_F(GSO_ROBUST) #define NETIF_F_HIGHDMA __NETIF_F(HIGHDMA) #define NETIF_F_HW_CSUM __NETIF_F(HW_CSUM) +#define NETIF_F_HW_QDISC __NETIF_F(HW_QDISC) #define NETIF_F_HW_VLAN_FILTER __NETIF_F(HW_VLAN_FILTER) #define NETIF_F_HW_VLAN_RX __NETIF_F(HW_VLAN_RX) #define NETIF_F_HW_VLAN_TX __NETIF_F(HW_VLAN_TX) diff --git a/net/core/dev.c b/net/core/dev.c index cd09819..0d78fa5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2514,6 +2514,12 @@ int dev_queue_xmit(struct sk_buff *skb) skb_update_prio(skb); + if (dev->features & NETIF_F_HW_QDISC) { + txq = dev_pick_tx(dev, skb); + rc = dev_hard_start_xmit(skb, dev, txq); + goto out; + } + txq = dev_pick_tx(dev, skb); q = rcu_dereference_bh(txq->qdisc);