From patchwork Sun Aug 24 13:42:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 382503 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 012B81400A3 for ; Sun, 24 Aug 2014 23:42:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752712AbaHXNmb (ORCPT ); Sun, 24 Aug 2014 09:42:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46799 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbaHXNmY (ORCPT ); Sun, 24 Aug 2014 09:42:24 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7ODgNe3012258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 24 Aug 2014 09:42:24 -0400 Received: from localhost (vpn1-7-202.ams2.redhat.com [10.36.7.202]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7ODgMu4032512; Sun, 24 Aug 2014 09:42:23 -0400 From: Daniel Borkmann To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [RFC PATCH net-next 2/3] net: add __netdev_xmit_{only, flush} helpers Date: Sun, 24 Aug 2014 15:42:17 +0200 Message-Id: <1408887738-7661-3-git-send-email-dborkman@redhat.com> In-Reply-To: <1408887738-7661-1-git-send-email-dborkman@redhat.com> References: <1408887738-7661-1-git-send-email-dborkman@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This adds two helpers to use xmit and flushing separately from each other as opposed to netdev_start_xmit(). Signed-off-by: Daniel Borkmann --- include/linux/netdevice.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1d05932..33faa33 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3393,6 +3393,21 @@ static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_devi return __netdev_start_xmit(ops, skb, dev); } +static inline netdev_tx_t __netdev_xmit_only(struct sk_buff *skb, struct net_device *dev) +{ + const struct net_device_ops *ops = dev->netdev_ops; + + return ops->ndo_start_xmit(skb, dev); +} + +static inline void __netdev_xmit_flush(struct net_device *dev, u16 queue) +{ + const struct net_device_ops *ops = dev->netdev_ops; + + if (ops->ndo_xmit_flush) + ops->ndo_xmit_flush(dev, queue); +} + int netdev_class_create_file_ns(struct class_attribute *class_attr, const void *ns); void netdev_class_remove_file_ns(struct class_attribute *class_attr,