summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-02 14:05:02 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-02 14:05:02 -0400
commite4a924f5768c55002c02ceba9b9f86824c35f956 (patch)
treeae8db8c41d5950644db9d4f5e609f228df958e57 /include/linux
parent033f46b3c13d4072d8ee6b26dd1e90fdd06895d0 (diff)
parenta45253bf32bf49cdb2807bad212b84f5ab51ac26 (diff)
downloadop-kernel-dev-e4a924f5768c55002c02ceba9b9f86824c35f956.zip
op-kernel-dev-e4a924f5768c55002c02ceba9b9f86824c35f956.tar.gz
Merge branch 'netdev_iflink_remove'
Nicolas Dichtel says: ==================== Remove iflink field from the net_device structure The first goal of this series was to advertise the veth peer via the IFLA_LINK attribute, but iflink was not ready for network namespaces. The iflink of an interface should be set to its ifindex for a physical interface and to another value (0 if not relevant) for a virtual interface. This was not the case for some interfaces, like vxlan, bond, or bridge for example. There is also a risk, if the targeted interface moves to another netns, that the ifindex changes without updating corresponding iflink fields (eg. vlan). Moving the management of this property into virtual interface drivers allows to better handle this last case because most of virtual interface drivers have a pointer to the link netdevice. Anyway, dev->iflink value was always a copy of some internal data of the virtual interface driver, thus let's use these internal data directly. So, this series removes the iflink field and let the drivers manage it. Only the last patch was present in the v1, but I fully rework it. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netdevice.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 967bb4c..846a1f5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1030,6 +1030,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
* int queue_index, u32 maxrate);
* Called when a user wants to set a max-rate limitation of specific
* TX queue.
+ * int (*ndo_get_iflink)(const struct net_device *dev);
+ * Called to get the iflink value of this device.
*/
struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
@@ -1191,6 +1193,7 @@ struct net_device_ops {
int (*ndo_set_tx_maxrate)(struct net_device *dev,
int queue_index,
u32 maxrate);
+ int (*ndo_get_iflink)(const struct net_device *dev);
};
/**
@@ -1535,7 +1538,7 @@ struct net_device {
netdev_features_t mpls_features;
int ifindex;
- int iflink;
+ int group;
struct net_device_stats stats;
@@ -1738,7 +1741,6 @@ struct net_device {
#endif
struct phy_device *phydev;
struct lock_class_key *qdisc_tx_busylock;
- int group;
struct pm_qos_request pm_qos_req;
};
#define to_net_dev(d) container_of(d, struct net_device, dev)
@@ -2149,6 +2151,7 @@ void __dev_remove_pack(struct packet_type *pt);
void dev_add_offload(struct packet_offload *po);
void dev_remove_offload(struct packet_offload *po);
+int dev_get_iflink(const struct net_device *dev);
struct net_device *__dev_get_by_flags(struct net *net, unsigned short flags,
unsigned short mask);
struct net_device *dev_get_by_name(struct net *net, const char *name);
OpenPOWER on IntegriCloud