aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c3
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c7
-rw-r--r--drivers/net/vxlan.c3
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--net/bridge/br_fdb.c5
-rw-r--r--net/bridge/br_private.h2
-rw-r--r--net/core/rtnetlink.c9
8 files changed, 24 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index e49352d68ede..2899f783ee1d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7095,13 +7095,14 @@ static int i40e_ndo_fdb_del(struct ndmsg *ndm,
7095static int i40e_ndo_fdb_dump(struct sk_buff *skb, 7095static int i40e_ndo_fdb_dump(struct sk_buff *skb,
7096 struct netlink_callback *cb, 7096 struct netlink_callback *cb,
7097 struct net_device *dev, 7097 struct net_device *dev,
7098 struct net_device *filter_dev,
7098 int idx) 7099 int idx)
7099{ 7100{
7100 struct i40e_netdev_priv *np = netdev_priv(dev); 7101 struct i40e_netdev_priv *np = netdev_priv(dev);
7101 struct i40e_pf *pf = np->vsi->back; 7102 struct i40e_pf *pf = np->vsi->back;
7102 7103
7103 if (pf->flags & I40E_FLAG_SRIOV_ENABLED) 7104 if (pf->flags & I40E_FLAG_SRIOV_ENABLED)
7104 idx = ndo_dflt_fdb_dump(skb, cb, dev, idx); 7105 idx = ndo_dflt_fdb_dump(skb, cb, dev, filter_dev, idx);
7105 7106
7106 return idx; 7107 return idx;
7107} 7108}
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index f8de2ae01a5a..0fdbcc8319f7 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -427,16 +427,17 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
427} 427}
428 428
429static int qlcnic_fdb_dump(struct sk_buff *skb, struct netlink_callback *ncb, 429static int qlcnic_fdb_dump(struct sk_buff *skb, struct netlink_callback *ncb,
430 struct net_device *netdev, int idx) 430 struct net_device *netdev,
431 struct net_device *filter_dev, int idx)
431{ 432{
432 struct qlcnic_adapter *adapter = netdev_priv(netdev); 433 struct qlcnic_adapter *adapter = netdev_priv(netdev);
433 434
434 if (!adapter->fdb_mac_learn) 435 if (!adapter->fdb_mac_learn)
435 return ndo_dflt_fdb_dump(skb, ncb, netdev, idx); 436 return ndo_dflt_fdb_dump(skb, ncb, netdev, filter_dev, idx);
436 437
437 if ((adapter->flags & QLCNIC_ESWITCH_ENABLED) || 438 if ((adapter->flags & QLCNIC_ESWITCH_ENABLED) ||
438 qlcnic_sriov_check(adapter)) 439 qlcnic_sriov_check(adapter))
439 idx = ndo_dflt_fdb_dump(skb, ncb, netdev, idx); 440 idx = ndo_dflt_fdb_dump(skb, ncb, netdev, filter_dev, idx);
440 441
441 return idx; 442 return idx;
442} 443}
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index c2d360150804..e6808f7e4e32 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -933,7 +933,8 @@ out:
933 933
934/* Dump forwarding table */ 934/* Dump forwarding table */
935static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, 935static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
936 struct net_device *dev, int idx) 936 struct net_device *dev,
937 struct net_device *filter_dev, int idx)
937{ 938{
938 struct vxlan_dev *vxlan = netdev_priv(dev); 939 struct vxlan_dev *vxlan = netdev_priv(dev);
939 unsigned int h; 940 unsigned int h;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8b43a28ee0bc..3a320db96180 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -943,7 +943,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
943 * const unsigned char *addr) 943 * const unsigned char *addr)
944 * Deletes the FDB entry from dev coresponding to addr. 944 * Deletes the FDB entry from dev coresponding to addr.
945 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, 945 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
946 * struct net_device *dev, int idx) 946 * struct net_device *dev, struct net_device *filter_dev,
947 * int idx)
947 * Used to add FDB entries to dump requests. Implementers should add 948 * Used to add FDB entries to dump requests. Implementers should add
948 * entries to skb and update idx with the number of entries. 949 * entries to skb and update idx with the number of entries.
949 * 950 *
@@ -1114,6 +1115,7 @@ struct net_device_ops {
1114 int (*ndo_fdb_dump)(struct sk_buff *skb, 1115 int (*ndo_fdb_dump)(struct sk_buff *skb,
1115 struct netlink_callback *cb, 1116 struct netlink_callback *cb,
1116 struct net_device *dev, 1117 struct net_device *dev,
1118 struct net_device *filter_dev,
1117 int idx); 1119 int idx);
1118 1120
1119 int (*ndo_bridge_setlink)(struct net_device *dev, 1121 int (*ndo_bridge_setlink)(struct net_device *dev,
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 953937ea5233..167bae7bdfa4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -78,6 +78,7 @@ extern void __rtnl_unlock(void);
78extern int ndo_dflt_fdb_dump(struct sk_buff *skb, 78extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
79 struct netlink_callback *cb, 79 struct netlink_callback *cb,
80 struct net_device *dev, 80 struct net_device *dev,
81 struct net_device *filter_dev,
81 int idx); 82 int idx);
82extern int ndo_dflt_fdb_add(struct ndmsg *ndm, 83extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
83 struct nlattr *tb[], 84 struct nlattr *tb[],
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 7be33667a839..6edecd11ecf0 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -676,6 +676,7 @@ errout:
676int br_fdb_dump(struct sk_buff *skb, 676int br_fdb_dump(struct sk_buff *skb,
677 struct netlink_callback *cb, 677 struct netlink_callback *cb,
678 struct net_device *dev, 678 struct net_device *dev,
679 struct net_device *filter_dev,
679 int idx) 680 int idx)
680{ 681{
681 struct net_bridge *br = netdev_priv(dev); 682 struct net_bridge *br = netdev_priv(dev);
@@ -691,6 +692,10 @@ int br_fdb_dump(struct sk_buff *skb,
691 if (idx < cb->args[0]) 692 if (idx < cb->args[0])
692 goto skip; 693 goto skip;
693 694
695 if (filter_dev && (!f->dst || !f->dst->dev ||
696 f->dst->dev != filter_dev))
697 goto skip;
698
694 if (fdb_fill_info(skb, br, f, 699 if (fdb_fill_info(skb, br, f,
695 NETLINK_CB(cb->skb).portid, 700 NETLINK_CB(cb->skb).portid,
696 cb->nlh->nlmsg_seq, 701 cb->nlh->nlmsg_seq,
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 23caf5b0309e..62a7fa2e3569 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -399,7 +399,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
399int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev, 399int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev,
400 const unsigned char *addr, u16 nlh_flags); 400 const unsigned char *addr, u16 nlh_flags);
401int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, 401int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
402 struct net_device *dev, int idx); 402 struct net_device *dev, struct net_device *fdev, int idx);
403int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p); 403int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p);
404void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p); 404void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p);
405 405
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 27acaf7ff6d7..90a906e7ac26 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2517,6 +2517,7 @@ skip:
2517int ndo_dflt_fdb_dump(struct sk_buff *skb, 2517int ndo_dflt_fdb_dump(struct sk_buff *skb,
2518 struct netlink_callback *cb, 2518 struct netlink_callback *cb,
2519 struct net_device *dev, 2519 struct net_device *dev,
2520 struct net_device *filter_dev,
2520 int idx) 2521 int idx)
2521{ 2522{
2522 int err; 2523 int err;
@@ -2547,13 +2548,15 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
2547 br_dev = netdev_master_upper_dev_get(dev); 2548 br_dev = netdev_master_upper_dev_get(dev);
2548 ops = br_dev->netdev_ops; 2549 ops = br_dev->netdev_ops;
2549 if (ops->ndo_fdb_dump) 2550 if (ops->ndo_fdb_dump)
2550 idx = ops->ndo_fdb_dump(skb, cb, dev, idx); 2551 idx = ops->ndo_fdb_dump(skb, cb, dev, NULL,
2552 idx);
2551 } 2553 }
2552 2554
2553 if (dev->netdev_ops->ndo_fdb_dump) 2555 if (dev->netdev_ops->ndo_fdb_dump)
2554 idx = dev->netdev_ops->ndo_fdb_dump(skb, cb, dev, idx); 2556 idx = dev->netdev_ops->ndo_fdb_dump(skb, cb, dev, NULL,
2557 idx);
2555 else 2558 else
2556 idx = ndo_dflt_fdb_dump(skb, cb, dev, idx); 2559 idx = ndo_dflt_fdb_dump(skb, cb, dev, NULL, idx);
2557 } 2560 }
2558 rcu_read_unlock(); 2561 rcu_read_unlock();
2559 2562