From patchwork Wed Jan 6 14:53:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 563964 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 2222114009B for ; Thu, 7 Jan 2016 01:53:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=jDhK5HGR; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbcAFOxx (ORCPT ); Wed, 6 Jan 2016 09:53:53 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34297 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751620AbcAFOxw (ORCPT ); Wed, 6 Jan 2016 09:53:52 -0500 Received: by mail-pa0-f50.google.com with SMTP id uo6so216058556pac.1 for ; Wed, 06 Jan 2016 06:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; bh=la7jFGV1o3BeI0zaUJZ2jttaOU3oKoxG/5IK7U8WF8Q=; b=jDhK5HGRIU/ytukxdSz4ySfFp0WoYEG8Z4jjIKaJrCn/7JBfivTlA8FdPZXivoS5Ai 4A7NWnPvHFBhKE7dFgkIrgzDEkwYJ7loGmBdvP/w65n5HulPWhWWfl0s0bwdIykOTOQE Qtm3/hxk2rqGdd2FrQc45/MehcFvwatRoJgMZETteC6aQeOWRT6ZZIQHDB5oZu+HZtn3 8dHVwu9Hpxs6yurx7n54BNF849/qwAuRIv6pLBB4s9HisDxYKuP64eB90LTAQ9ZFAcrv 8f0Fx0gYNSm2ZO4Xo4C8xAQcotsEoS8gcjZMQO3nX+iMjYSh9PKyqOjhlio5wMgKKPH0 13Vg== X-Received: by 10.66.155.197 with SMTP id vy5mr142243480pab.109.1452092031969; Wed, 06 Jan 2016 06:53:51 -0800 (PST) Received: from [172.29.166.22] ([172.29.166.22]) by smtp.gmail.com with ESMTPSA id sg4sm141461817pac.48.2016.01.06.06.53.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jan 2016 06:53:51 -0800 (PST) Message-ID: <1452092030.8255.178.camel@edumazet-glaptop2.roam.corp.google.com> Subject: [PATCH net-next] net: move ndo_features_check() close to ndo_start_xmit() From: Eric Dumazet To: David Miller Cc: netdev Date: Wed, 06 Jan 2016 06:53:50 -0800 X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet TX fast path uses ndo_start_xmit(), ndo_features_check() and ndo_select_queue(). Move ndo_features_check() close to ndo_start_xmit() to increase data locality. All "struct net_device_ops" should now be using C99 initializers. Signed-off-by: Eric Dumazet --- include/linux/netdevice.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 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/include/linux/netdevice.h b/include/linux/netdevice.h index c20b814e46a0..8d8e5ca951b4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -812,6 +812,12 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev, * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) * Required can not be NULL. * + * netdev_features_t (*ndo_fix_features)(struct net_device *dev, + * netdev_features_t features); + * Adjusts the requested feature flags according to device-specific + * constraints, and returns the resulting flags. Must not modify + * the device state. + * * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, * void *accel_priv, select_queue_fallback_t fallback); * Called to decide which queue to when device supports multiple @@ -959,12 +965,6 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev, * Called to release previously enslaved netdev. * * Feature/offload setting functions. - * netdev_features_t (*ndo_fix_features)(struct net_device *dev, - * netdev_features_t features); - * Adjusts the requested feature flags according to device-specific - * constraints, and returns the resulting flags. Must not modify - * the device state. - * * int (*ndo_set_features)(struct net_device *dev, netdev_features_t features); * Called to update device configuration to new features. Passed * feature set might be less than what was returned by ndo_fix_features()). @@ -1081,8 +1081,11 @@ struct net_device_ops { void (*ndo_uninit)(struct net_device *dev); int (*ndo_open)(struct net_device *dev); int (*ndo_stop)(struct net_device *dev); - netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, - struct net_device *dev); + netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, + struct net_device *dev); + netdev_features_t (*ndo_features_check)(struct sk_buff *skb, + struct net_device *dev, + netdev_features_t features); u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, void *accel_priv, @@ -1245,9 +1248,6 @@ struct net_device_ops { struct net_device *dev, void *priv); int (*ndo_get_lock_subclass)(struct net_device *dev); - netdev_features_t (*ndo_features_check) (struct sk_buff *skb, - struct net_device *dev, - netdev_features_t features); int (*ndo_set_tx_maxrate)(struct net_device *dev, int queue_index, u32 maxrate);