]> Pileus Git - ~andy/linux/blobdiff - drivers/net/veth.c
veth: extend features to support tunneling
[~andy/linux] / drivers / net / veth.c
index 54187b9c0efc2508a6fc88b3d89fa699568e78b3..b24db7acbf1207e6e1d905111cf5a59108744743 100644 (file)
@@ -188,6 +188,11 @@ static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
        return tot;
 }
 
+/* fake multicast ability */
+static void veth_set_multicast_list(struct net_device *dev)
+{
+}
+
 static int veth_open(struct net_device *dev)
 {
        struct veth_priv *priv = netdev_priv(dev);
@@ -250,11 +255,14 @@ static const struct net_device_ops veth_netdev_ops = {
        .ndo_start_xmit      = veth_xmit,
        .ndo_change_mtu      = veth_change_mtu,
        .ndo_get_stats64     = veth_get_stats64,
+       .ndo_set_rx_mode     = veth_set_multicast_list,
        .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_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL |           \
+                      NETIF_F_GSO_IPIP | NETIF_F_GSO_SIT | NETIF_F_UFO |   \
                       NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | \
                       NETIF_F_HW_VLAN_STAG_TX | NETIF_F_HW_VLAN_STAG_RX )
 
@@ -273,6 +281,7 @@ static void veth_setup(struct net_device *dev)
        dev->destructor = veth_dev_free;
 
        dev->hw_features = VETH_FEATURES;
+       dev->hw_enc_features = VETH_FEATURES;
 }
 
 /*
@@ -434,25 +443,6 @@ static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = {
        [VETH_INFO_PEER]        = { .len = sizeof(struct ifinfomsg) },
 };
 
-static size_t veth_get_size(const struct net_device *dev)
-{
-       return nla_total_size(sizeof(u64)) + /* VETH_INFO_PEER */
-               0;
-}
-
-static int veth_fill_info(struct sk_buff *skb, const struct net_device *dev)
-{
-       struct veth_priv *priv = netdev_priv(dev);
-       struct net_device *peer = rtnl_dereference(priv->peer);
-       u64 peer_ifindex;
-
-       peer_ifindex = peer ? peer->ifindex : 0;
-       if (nla_put_u64(skb, VETH_INFO_PEER, peer_ifindex))
-               return -EMSGSIZE;
-
-       return 0;
-}
-
 static struct rtnl_link_ops veth_link_ops = {
        .kind           = DRV_NAME,
        .priv_size      = sizeof(struct veth_priv),
@@ -462,8 +452,6 @@ static struct rtnl_link_ops veth_link_ops = {
        .dellink        = veth_dellink,
        .policy         = veth_policy,
        .maxtype        = VETH_INFO_MAX,
-       .get_size       = veth_get_size,
-       .fill_info      = veth_fill_info,
 };
 
 /*