From patchwork Sun Dec 30 02:26:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 208707 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 F0C382C0089 for ; Sun, 30 Dec 2012 13:26:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922Ab2L3C0P (ORCPT ); Sat, 29 Dec 2012 21:26:15 -0500 Received: from mail-da0-f53.google.com ([209.85.210.53]:50896 "EHLO mail-da0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753587Ab2L3C0O (ORCPT ); Sat, 29 Dec 2012 21:26:14 -0500 Received: by mail-da0-f53.google.com with SMTP id x6so5299063dac.40 for ; Sat, 29 Dec 2012 18:26:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:from:to:cc:in-reply-to:references:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=Q0KDi3istHiMgW9QqL4GQpfUbSP05kSgRK8huF9tI34=; b=uE/urIlvtRBj2aLDDhPqVuyHh8QBRjaDJKZlFk9SFTZ/eoix7Csw9cEabYGrvfvK8/ N5i1Wi17s+z0ZyfT2MNl/ftIcBY+MN8qfr6b2OnZnQfq2GEwJ03c7jJHpWcfEdiHSraf JV/JA/tWXASPue+r3ny5D1OnKJB9f7bfah29x6mXwWf6MvndhhxXXBaj08+e7vG5sN1z aDqvKRoGPzoPpeVpiD3j3NBa0lwNhZp+24f0fABXcxiGFr4us7CPosqnjTMIPVrExB1X XS60r7r0WD5S2Ebn+O0uzxYRVpwPQAXucS1GNW0DQWoz4d8RR2GS67KXEvyiaf+2X7bb Kg5Q== X-Received: by 10.68.213.202 with SMTP id nu10mr118767716pbc.91.1356834373267; Sat, 29 Dec 2012 18:26:13 -0800 (PST) Received: from [172.26.54.30] ([172.26.54.30]) by mx.google.com with ESMTPS id oi2sm22320822pbb.62.2012.12.29.18.26.11 (version=SSLv3 cipher=OTHER); Sat, 29 Dec 2012 18:26:12 -0800 (PST) Subject: [PATCH] veth: extend device features From: Eric Dumazet To: =?UTF-8?Q?Micha=C5=82_Miros=C5=82aw?= , David Miller Cc: Andrew Vagin , netdev@vger.kernel.org, vvs@parallels.com, =?UTF-8?Q?Micha=C5=82_Miros=C5=82aw?= In-Reply-To: References: <20121229092417.GA4038@paralelels.com> <1356789203.21409.3923.camel@edumazet-glaptop> Date: Sat, 29 Dec 2012 18:26:10 -0800 Message-ID: <1356834370.21409.6234.camel@edumazet-glaptop> 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 From: Eric Dumazet veth is lacking most modern facilities, like SG, checksums, TSO. It makes sense to extend dev->features to get them, or GRO aggregation is defeated by a forced segmentation. Reported-by: Andrew Vagin Signed-off-by: Eric Dumazet Cc: Michał Mirosław --- drivers/net/veth.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 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/veth.c b/drivers/net/veth.c index 95814d9..ccf211f 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -259,6 +259,10 @@ static const struct net_device_ops veth_netdev_ops = { .ndo_set_mac_address = eth_mac_addr, }; +#define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ + NETIF_F_HW_CSUM | NETIF_F_RXCSUM | NETIF_F_HIGHDMA | \ + NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX) + static void veth_setup(struct net_device *dev) { ether_setup(dev); @@ -269,9 +273,10 @@ static void veth_setup(struct net_device *dev) dev->netdev_ops = &veth_netdev_ops; dev->ethtool_ops = &veth_ethtool_ops; dev->features |= NETIF_F_LLTX; + dev->features |= VETH_FEATURES; dev->destructor = veth_dev_free; - dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_RXCSUM; + dev->hw_features = VETH_FEATURES; } /*