aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-12 21:57:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-12 21:57:02 -0500
commitaee3bfa3307cd0da2126bdc0ea359dabea5ee8f7 (patch)
tree3d35c69e8fa835098bb90f77f30abed120681651 /net/switchdev/switchdev.c
parentc597b6bcd5c624534afc3df65cdc42bb05173bca (diff)
parent415b6f19e87e350b13585591859d4fdf50772229 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from Davic Miller: 1) Support busy polling generically, for all NAPI drivers. From Eric Dumazet. 2) Add byte/packet counter support to nft_ct, from Floriani Westphal. 3) Add RSS/XPS support to mvneta driver, from Gregory Clement. 4) Implement IPV6_HDRINCL socket option for raw sockets, from Hannes Frederic Sowa. 5) Add support for T6 adapter to cxgb4 driver, from Hariprasad Shenai. 6) Add support for VLAN device bridging to mlxsw switch driver, from Ido Schimmel. 7) Add driver for Netronome NFP4000/NFP6000, from Jakub Kicinski. 8) Provide hwmon interface to mlxsw switch driver, from Jiri Pirko. 9) Reorganize wireless drivers into per-vendor directories just like we do for ethernet drivers. From Kalle Valo. 10) Provide a way for administrators "destroy" connected sockets via the SOCK_DESTROY socket netlink diag operation. From Lorenzo Colitti. 11) Add support to add/remove multicast routes via netlink, from Nikolay Aleksandrov. 12) Make TCP keepalive settings per-namespace, from Nikolay Borisov. 13) Add forwarding and packet duplication facilities to nf_tables, from Pablo Neira Ayuso. 14) Dead route support in MPLS, from Roopa Prabhu. 15) TSO support for thunderx chips, from Sunil Goutham. 16) Add driver for IBM's System i/p VNIC protocol, from Thomas Falcon. 17) Rationalize, consolidate, and more completely document the checksum offloading facilities in the networking stack. From Tom Herbert. 18) Support aborting an ongoing scan in mac80211/cfg80211, from Vidyullatha Kanchanapally. 19) Use per-bucket spinlock for bpf hash facility, from Tom Leiming. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1375 commits) net: bnxt: always return values from _bnxt_get_max_rings net: bpf: reject invalid shifts phonet: properly unshare skbs in phonet_rcv() dwc_eth_qos: Fix dma address for multi-fragment skbs phy: remove an unneeded condition mdio: remove an unneed condition mdio_bus: NULL dereference on allocation error net: Fix typo in netdev_intersect_features net: freescale: mac-fec: Fix build error from phy_device API change net: freescale: ucc_geth: Fix build error from phy_device API change bonding: Prevent IPv6 link local address on enslaved devices IB/mlx5: Add flow steering support net/mlx5_core: Export flow steering API net/mlx5_core: Make ipv4/ipv6 location more clear net/mlx5_core: Enable flow steering support for the IB driver net/mlx5_core: Initialize namespaces only when supported by device net/mlx5_core: Set priority attributes net/mlx5_core: Connect flow tables net/mlx5_core: Introduce modify flow table command net/mlx5_core: Managing root flow table ...
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index f34e535e93bd..ebc661d3b6e3 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -345,6 +345,8 @@ static size_t switchdev_obj_size(const struct switchdev_obj *obj)
345 return sizeof(struct switchdev_obj_ipv4_fib); 345 return sizeof(struct switchdev_obj_ipv4_fib);
346 case SWITCHDEV_OBJ_ID_PORT_FDB: 346 case SWITCHDEV_OBJ_ID_PORT_FDB:
347 return sizeof(struct switchdev_obj_port_fdb); 347 return sizeof(struct switchdev_obj_port_fdb);
348 case SWITCHDEV_OBJ_ID_PORT_MDB:
349 return sizeof(struct switchdev_obj_port_mdb);
348 default: 350 default:
349 BUG(); 351 BUG();
350 } 352 }
@@ -723,6 +725,7 @@ static int switchdev_port_vlan_fill(struct sk_buff *skb, struct net_device *dev,
723 u32 filter_mask) 725 u32 filter_mask)
724{ 726{
725 struct switchdev_vlan_dump dump = { 727 struct switchdev_vlan_dump dump = {
728 .vlan.obj.orig_dev = dev,
726 .vlan.obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN, 729 .vlan.obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN,
727 .skb = skb, 730 .skb = skb,
728 .filter_mask = filter_mask, 731 .filter_mask = filter_mask,
@@ -757,6 +760,7 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
757 int nlflags) 760 int nlflags)
758{ 761{
759 struct switchdev_attr attr = { 762 struct switchdev_attr attr = {
763 .orig_dev = dev,
760 .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS, 764 .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
761 }; 765 };
762 u16 mode = BRIDGE_MODE_UNDEF; 766 u16 mode = BRIDGE_MODE_UNDEF;
@@ -778,6 +782,7 @@ static int switchdev_port_br_setflag(struct net_device *dev,
778 unsigned long brport_flag) 782 unsigned long brport_flag)
779{ 783{
780 struct switchdev_attr attr = { 784 struct switchdev_attr attr = {
785 .orig_dev = dev,
781 .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS, 786 .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
782 }; 787 };
783 u8 flag = nla_get_u8(nlattr); 788 u8 flag = nla_get_u8(nlattr);
@@ -853,6 +858,7 @@ static int switchdev_port_br_afspec(struct net_device *dev,
853 struct nlattr *attr; 858 struct nlattr *attr;
854 struct bridge_vlan_info *vinfo; 859 struct bridge_vlan_info *vinfo;
855 struct switchdev_obj_port_vlan vlan = { 860 struct switchdev_obj_port_vlan vlan = {
861 .obj.orig_dev = dev,
856 .obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN, 862 .obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN,
857 }; 863 };
858 int rem; 864 int rem;
@@ -975,6 +981,7 @@ int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
975 u16 vid, u16 nlm_flags) 981 u16 vid, u16 nlm_flags)
976{ 982{
977 struct switchdev_obj_port_fdb fdb = { 983 struct switchdev_obj_port_fdb fdb = {
984 .obj.orig_dev = dev,
978 .obj.id = SWITCHDEV_OBJ_ID_PORT_FDB, 985 .obj.id = SWITCHDEV_OBJ_ID_PORT_FDB,
979 .vid = vid, 986 .vid = vid,
980 }; 987 };
@@ -1000,6 +1007,7 @@ int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
1000 u16 vid) 1007 u16 vid)
1001{ 1008{
1002 struct switchdev_obj_port_fdb fdb = { 1009 struct switchdev_obj_port_fdb fdb = {
1010 .obj.orig_dev = dev,
1003 .obj.id = SWITCHDEV_OBJ_ID_PORT_FDB, 1011 .obj.id = SWITCHDEV_OBJ_ID_PORT_FDB,
1004 .vid = vid, 1012 .vid = vid,
1005 }; 1013 };
@@ -1077,6 +1085,7 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
1077 struct net_device *filter_dev, int idx) 1085 struct net_device *filter_dev, int idx)
1078{ 1086{
1079 struct switchdev_fdb_dump dump = { 1087 struct switchdev_fdb_dump dump = {
1088 .fdb.obj.orig_dev = dev,
1080 .fdb.obj.id = SWITCHDEV_OBJ_ID_PORT_FDB, 1089 .fdb.obj.id = SWITCHDEV_OBJ_ID_PORT_FDB,
1081 .dev = dev, 1090 .dev = dev,
1082 .skb = skb, 1091 .skb = skb,
@@ -1135,6 +1144,7 @@ static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
1135 if (!dev) 1144 if (!dev)
1136 return NULL; 1145 return NULL;
1137 1146
1147 attr.orig_dev = dev;
1138 if (switchdev_port_attr_get(dev, &attr)) 1148 if (switchdev_port_attr_get(dev, &attr))
1139 return NULL; 1149 return NULL;
1140 1150
@@ -1194,6 +1204,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
1194 if (!dev) 1204 if (!dev)
1195 return 0; 1205 return 0;
1196 1206
1207 ipv4_fib.obj.orig_dev = dev;
1197 err = switchdev_port_obj_add(dev, &ipv4_fib.obj); 1208 err = switchdev_port_obj_add(dev, &ipv4_fib.obj);
1198 if (!err) 1209 if (!err)
1199 fi->fib_flags |= RTNH_F_OFFLOAD; 1210 fi->fib_flags |= RTNH_F_OFFLOAD;
@@ -1238,6 +1249,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
1238 if (!dev) 1249 if (!dev)
1239 return 0; 1250 return 0;
1240 1251
1252 ipv4_fib.obj.orig_dev = dev;
1241 err = switchdev_port_obj_del(dev, &ipv4_fib.obj); 1253 err = switchdev_port_obj_del(dev, &ipv4_fib.obj);
1242 if (!err) 1254 if (!err)
1243 fi->fib_flags &= ~RTNH_F_OFFLOAD; 1255 fi->fib_flags &= ~RTNH_F_OFFLOAD;
@@ -1270,10 +1282,12 @@ static bool switchdev_port_same_parent_id(struct net_device *a,
1270 struct net_device *b) 1282 struct net_device *b)
1271{ 1283{
1272 struct switchdev_attr a_attr = { 1284 struct switchdev_attr a_attr = {
1285 .orig_dev = a,
1273 .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID, 1286 .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
1274 .flags = SWITCHDEV_F_NO_RECURSE, 1287 .flags = SWITCHDEV_F_NO_RECURSE,
1275 }; 1288 };
1276 struct switchdev_attr b_attr = { 1289 struct switchdev_attr b_attr = {
1290 .orig_dev = b,
1277 .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID, 1291 .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
1278 .flags = SWITCHDEV_F_NO_RECURSE, 1292 .flags = SWITCHDEV_F_NO_RECURSE,
1279 }; 1293 };