net: Generalize ndo_gso_check to ndo_features_check
authorJesse Gross <jesse@nicira.com>
Wed, 24 Dec 2014 06:37:26 +0000 (22:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Dec 2014 22:20:56 +0000 (17:20 -0500)
commit5f35227ea34bb616c436d9da47fc325866c428f3
treee6f997cb2f1f1bce1d2b5be613e1be667b9f927f
parent6e4ab361b6f3eb41ffe63224a8b5770fc68ef710
net: Generalize ndo_gso_check to ndo_features_check

GSO isn't the only offload feature with restrictions that
potentially can't be expressed with the current features mechanism.
Checksum is another although it's a general issue that could in
theory apply to anything. Even if it may be possible to
implement these restrictions in other ways, it can result in
duplicate code or inefficient per-packet behavior.

This generalizes ndo_gso_check so that drivers can remove any
features that don't make sense for a given packet, similar to
netif_skb_features(). It also converts existing driver
restrictions to the new format, completing the work that was
done to support tunnel protocols since the issues apply to
checksums as well.

By actually removing features from the set that are used to do
offloading, it solves another problem with the existing
interface. In these cases, GSO would run with the original set
of features and not do anything because it appears that
segmentation is not required.

CC: Tom Herbert <therbert@google.com>
CC: Joe Stringer <joestringer@nicira.com>
CC: Eric Dumazet <edumazet@google.com>
CC: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Tom Herbert <therbert@google.com>
Fixes: 04ffcb255f22 ("net: Add ndo_gso_check")
Tested-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
include/linux/netdevice.h
include/net/vxlan.h
net/core/dev.c