AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/11/28 16:39 flow patch-triage
1m Args:
null

Results:
{
  "EnableConfigs": [
    "NET",
    "INET",
    "BRIDGE",
    "VLAN_8021Q",
    "BRIDGE_VLAN_FILTERING",
    "VXLAN",
    "MACVLAN"
  ],
  "FocusSymbols": [
    "rtnl_fdb_add",
    "rtnl_fdb_del",
    "rtnl_fdb_get",
    "ndo_dflt_fdb_add",
    "ndo_dflt_fdb_del",
    "br_fdb_add",
    "br_fdb_delete",
    "br_fdb_delete_bulk",
    "br_fdb_get",
    "br_fdb_flush",
    "br_fdb_external_learn_add",
    "vxlan_fdb_add",
    "vxlan_fdb_delete",
    "vxlan_fdb_delete_bulk",
    "vxlan_fdb_get",
    "vxlan_fdb_update",
    "__vxlan_fdb_delete",
    "macvlan_fdb_add",
    "macvlan_fdb_del"
  ],
  "KMSANReasoning": "The patch series refactors the FDB net_device_ops callbacks (ndo_fdb_add, ndo_fdb_del, ndo_fdb_get, ndo_dflt_fdb_add, ndo_dflt_fdb_del) to pass parameters via a new internal struct ndo_fdb_parms, and propagates the requester's netlink u32 portid (from NETLINK_CB(skb).portid, or 0 for internal/async notifications) through bridge, vxlan, and rtnetlink FDB notification paths so nlmsg_pid is populated instead of 0.\n\nThere are no uninitialized memory risks introduced by these changes:\n1. struct ndo_fdb_parms is strictly an internal kernel stack struct and is never copied directly to user space. Whenever \u0026parms is passed to callbacks (in rtnl_fdb_add, rtnl_fdb_del when !del_bulk, and rtnl_fdb_get), it is initialized with a C compound literal (struct ndo_fdb_parms) { ... } which explicitly initializes all read fields and zero-initializes any omitted fields (e.g., .flags in del/get). In rtnl_fdb_del, the del_bulk == true path never touches parms.\n2. In net/bridge/br_fdb.c, vparms is initialized by copying *parms before overriding vparms.vid.\n3. The u32 portid passed to fdb_fill_info(), vxlan_fdb_info(), and nlmsg_populate_fdb_fill() is always initialized (either NETLINK_CB(skb).portid or 0) and simply replaces a hardcoded 0 argument in nlmsg_put() for nlmsg_pid.\n4. No new netlink attributes or kernel-to-user structures with uninitialized fields or padding are added, and no bounds or length calculations are changed. Any potential issues in these paths (such as pointer/lifetime bugs in netdevice ops or bridge/vxlan FDB handling) would be caught by standard KASAN/LOCKDEP/UBSAN fuzzing rather than requiring KMSAN.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch series modifies executable code in core networking (net/core/rtnetlink.c) and virtual netdev subsystems (net/bridge/, drivers/net/vxlan/, drivers/net/macvlan.c) by refactoring ndo_fdb_{add,del,get,del_bulk} and ndo_dflt_fdb_{add,del} to pass struct ndo_fdb_parms and propagating netlink portid into FDB notifications. These paths are directly reachable via PF_BRIDGE RTM_NEWNEIGH/RTM_DELNEIGH/RTM_GETNEIGH netlink requests on virtual devices (bridge, vxlan, macvlan, dummy, veth) in QEMU/GCE environments.",
  "WorthFuzzing": true
}

1/1 2026/11/28 16:39 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit fcf7445aef94f88776486a38b7fb429aeb61c1ed\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Sat Nov 28 16:39:08 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/Documentation/netlink/specs/rt-neigh.yaml b/Documentation/netlink/specs/rt-neigh.yaml\nindex 7929e667cc7a64..4dd4e3d997f099 100644\n--- a/Documentation/netlink/specs/rt-neigh.yaml\n+++ b/Documentation/netlink/specs/rt-neigh.yaml\n@@ -380,7 +380,11 @@ operations:\n           value: 29\n           attributes:\n             - dst\n+            - lladdr\n+            - vlan\n             - ifindex\n+            - ndm-state-mask\n+            - ndm-flags-mask\n     -\n       name: delneigh-ntf\n       doc: Notify a neighbour deletion\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex abbc71e815ae34..c8337bef5dbf79 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -13022,28 +13022,24 @@ static int i40e_get_phys_port_id(struct net_device *netdev,\n  * i40e_ndo_fdb_add - add an entry to the hardware database\n  * @ndm: the input from the stack\n  * @tb: pointer to array of nladdr (unused)\n- * @dev: the net device pointer\n- * @addr: the MAC address entry being added\n- * @vid: VLAN ID\n- * @flags: instructions from stack about fdb operation\n+ * @parms: common FDB parameters\n  * @notified: whether notification was emitted\n  * @extack: netlink extended ack, unused currently\n  */\n static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t    struct net_device *dev,\n-\t\t\t    const unsigned char *addr, u16 vid,\n-\t\t\t    u16 flags, bool *notified,\n+\t\t\t    const struct ndo_fdb_parms *parms, bool *notified,\n \t\t\t    struct netlink_ext_ack *extack)\n {\n-\tstruct i40e_netdev_priv *np = netdev_priv(dev);\n+\tstruct i40e_netdev_priv *np = netdev_priv(parms-\u003edev);\n \tstruct i40e_pf *pf = np-\u003evsi-\u003eback;\n \tint err = 0;\n \n \tif (!test_bit(I40E_FLAG_SRIOV_ENA, pf-\u003eflags))\n \t\treturn -EOPNOTSUPP;\n \n-\tif (vid) {\n-\t\tpr_info(\"%s: vlans aren't supported yet for dev_uc|mc_add()\\n\", dev-\u003ename);\n+\tif (parms-\u003evid) {\n+\t\tpr_info(\"%s: vlans aren't supported yet for dev_uc|mc_add()\\n\",\n+\t\t\tparms-\u003edev-\u003ename);\n \t\treturn -EINVAL;\n \t}\n \n@@ -13051,19 +13047,20 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \t * ndm_state is given only allow permanent addresses\n \t */\n \tif (ndm-\u003endm_state \u0026\u0026 !(ndm-\u003endm_state \u0026 NUD_PERMANENT)) {\n-\t\tnetdev_info(dev, \"FDB only supports static addresses\\n\");\n+\t\tnetdev_info(parms-\u003edev, \"FDB only supports static addresses\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\tif (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))\n-\t\terr = dev_uc_add_excl(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_add_excl(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr) ||\n+\t    is_link_local_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_add_excl(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_add_excl(parms-\u003edev, parms-\u003eaddr);\n \telse\n \t\terr = -EINVAL;\n \n \t/* Only return duplicate errors if NLM_F_EXCL is set */\n-\tif (err == -EEXIST \u0026\u0026 !(flags \u0026 NLM_F_EXCL))\n+\tif (err == -EEXIST \u0026\u0026 !(parms-\u003eflags \u0026 NLM_F_EXCL))\n \t\terr = 0;\n \n \treturn err;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex c8f06c3d0fdf20..396299d5d7bd5b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -6108,39 +6108,37 @@ ice_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 maxrate)\n  * ice_fdb_add - add an entry to the hardware database\n  * @ndm: the input from the stack\n  * @tb: pointer to array of nladdr (unused)\n- * @dev: the net device pointer\n- * @addr: the MAC address entry being added\n- * @vid: VLAN ID\n- * @flags: instructions from stack about fdb operation\n+ * @parms: common FDB parameters\n  * @notified: whether notification was emitted\n  * @extack: netlink extended ack\n  */\n static int\n ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],\n-\t    struct net_device *dev, const unsigned char *addr, u16 vid,\n-\t    u16 flags, bool *notified,\n+\t    const struct ndo_fdb_parms *parms, bool *notified,\n \t    struct netlink_ext_ack __always_unused *extack)\n {\n \tint err;\n \n-\tif (vid) {\n-\t\tnetdev_err(dev, \"VLANs aren't supported yet for dev_uc|mc_add()\\n\");\n+\tif (parms-\u003evid) {\n+\t\tnetdev_err(parms-\u003edev,\n+\t\t\t   \"VLANs aren't supported yet for dev_uc|mc_add()\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif (ndm-\u003endm_state \u0026\u0026 !(ndm-\u003endm_state \u0026 NUD_PERMANENT)) {\n-\t\tnetdev_err(dev, \"FDB only supports static addresses\\n\");\n+\t\tnetdev_err(parms-\u003edev, \"FDB only supports static addresses\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\tif (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))\n-\t\terr = dev_uc_add_excl(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_add_excl(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr) ||\n+\t    is_link_local_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_add_excl(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_add_excl(parms-\u003edev, parms-\u003eaddr);\n \telse\n \t\terr = -EINVAL;\n \n \t/* Only return duplicate errors if NLM_F_EXCL is set */\n-\tif (err == -EEXIST \u0026\u0026 !(flags \u0026 NLM_F_EXCL))\n+\tif (err == -EEXIST \u0026\u0026 !(parms-\u003eflags \u0026 NLM_F_EXCL))\n \t\terr = 0;\n \n \treturn err;\n@@ -6150,29 +6148,26 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],\n  * ice_fdb_del - delete an entry from the hardware database\n  * @ndm: the input from the stack\n  * @tb: pointer to array of nladdr (unused)\n- * @dev: the net device pointer\n- * @addr: the MAC address entry being added\n- * @vid: VLAN ID\n+ * @parms: common FDB parameters (device, address, VLAN ID)\n  * @notified: whether notification was emitted\n  * @extack: netlink extended ack\n  */\n static int\n ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[],\n-\t    struct net_device *dev, const unsigned char *addr,\n-\t    __always_unused u16 vid, bool *notified,\n+\t    const struct ndo_fdb_parms *parms, bool *notified,\n \t    struct netlink_ext_ack *extack)\n {\n \tint err;\n \n \tif (ndm-\u003endm_state \u0026 NUD_PERMANENT) {\n-\t\tnetdev_err(dev, \"FDB only supports static addresses\\n\");\n+\t\tnetdev_err(parms-\u003edev, \"FDB only supports static addresses\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\tif (is_unicast_ether_addr(addr))\n-\t\terr = dev_uc_del(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_del(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_del(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_del(parms-\u003edev, parms-\u003eaddr);\n \telse\n \t\terr = -EINVAL;\n \ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex c75d78badf71f8..b2efa0a1fa071c 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -2517,21 +2517,21 @@ static int igb_set_features(struct net_device *netdev,\n }\n \n static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t   struct net_device *dev,\n-\t\t\t   const unsigned char *addr, u16 vid,\n-\t\t\t   u16 flags, bool *notified,\n+\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\n \t\t\t   struct netlink_ext_ack *extack)\n {\n \t/* guarantee we can provide a unique filter for the unicast address */\n-\tif (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {\n-\t\tstruct igb_adapter *adapter = netdev_priv(dev);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr) ||\n+\t    is_link_local_ether_addr(parms-\u003eaddr)) {\n+\t\tstruct igb_adapter *adapter = netdev_priv(parms-\u003edev);\n \t\tint vfn = adapter-\u003evfs_allocated_count;\n \n-\t\tif (netdev_uc_count(dev) \u003e= igb_available_rars(adapter, vfn))\n+\t\tif (netdev_uc_count(parms-\u003edev) \u003e=\n+\t\t    igb_available_rars(adapter, vfn))\n \t\t\treturn -ENOMEM;\n \t}\n \n-\treturn ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, flags);\n+\treturn ndo_dflt_fdb_add(ndm, tb, parms);\n }\n \n #define IGB_MAX_MAC_HDR_LEN\t127\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 6458cb2e511e7d..e444ebfe77fa5a 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -10603,21 +10603,21 @@ static int ixgbe_set_features(struct net_device *netdev,\n }\n \n static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t     struct net_device *dev,\n-\t\t\t     const unsigned char *addr, u16 vid,\n-\t\t\t     u16 flags, bool *notified,\n+\t\t\t     const struct ndo_fdb_parms *parms, bool *notified,\n \t\t\t     struct netlink_ext_ack *extack)\n {\n \t/* guarantee we can provide a unique filter for the unicast address */\n-\tif (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {\n-\t\tstruct ixgbe_adapter *adapter = ixgbe_from_netdev(dev);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr) ||\n+\t    is_link_local_ether_addr(parms-\u003eaddr)) {\n+\t\tstruct ixgbe_adapter *adapter = ixgbe_from_netdev(parms-\u003edev);\n \t\tu16 pool = VMDQ_P(0);\n \n-\t\tif (netdev_uc_count(dev) \u003e= ixgbe_available_rars(adapter, pool))\n+\t\tif (netdev_uc_count(parms-\u003edev) \u003e=\n+\t\t    ixgbe_available_rars(adapter, pool))\n \t\t\treturn -ENOMEM;\n \t}\n \n-\treturn ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, flags);\n+\treturn ndo_dflt_fdb_add(ndm, tb, parms);\n }\n \n /**\ndiff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c\nindex 4d45e136f08f5e..65f9dee62dc5b2 100644\n--- a/drivers/net/ethernet/mscc/ocelot_net.c\n+++ b/drivers/net/ethernet/mscc/ocelot_net.c\n@@ -765,30 +765,29 @@ static void ocelot_get_stats64(struct net_device *dev,\n }\n \n static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t       struct net_device *dev,\n-\t\t\t       const unsigned char *addr,\n-\t\t\t       u16 vid, u16 flags, bool *notified,\n-\t\t\t       struct netlink_ext_ack *extack)\n+\t\t\t       const struct ndo_fdb_parms *parms,\n+\t\t\t       bool *notified, struct netlink_ext_ack *extack)\n {\n-\tstruct ocelot_port_private *priv = netdev_priv(dev);\n+\tstruct ocelot_port_private *priv = netdev_priv(parms-\u003edev);\n \tstruct ocelot_port *ocelot_port = \u0026priv-\u003eport;\n \tstruct ocelot *ocelot = ocelot_port-\u003eocelot;\n \tint port = priv-\u003eport.index;\n \n-\treturn ocelot_fdb_add(ocelot, port, addr, vid, ocelot_port-\u003ebridge);\n+\treturn ocelot_fdb_add(ocelot, port, parms-\u003eaddr, parms-\u003evid,\n+\t\t\t      ocelot_port-\u003ebridge);\n }\n \n static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t       struct net_device *dev,\n-\t\t\t       const unsigned char *addr, u16 vid,\n+\t\t\t       const struct ndo_fdb_parms *parms,\n \t\t\t       bool *notified, struct netlink_ext_ack *extack)\n {\n-\tstruct ocelot_port_private *priv = netdev_priv(dev);\n+\tstruct ocelot_port_private *priv = netdev_priv(parms-\u003edev);\n \tstruct ocelot_port *ocelot_port = \u0026priv-\u003eport;\n \tstruct ocelot *ocelot = ocelot_port-\u003eocelot;\n \tint port = priv-\u003eport.index;\n \n-\treturn ocelot_fdb_del(ocelot, port, addr, vid, ocelot_port-\u003ebridge);\n+\treturn ocelot_fdb_del(ocelot, port, parms-\u003eaddr, parms-\u003evid,\n+\t\t\t      ocelot_port-\u003ebridge);\n }\n \n static int ocelot_port_fdb_do_dump(const unsigned char *addr, u16 vid,\ndiff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c\nindex 23ae76ca81dbe0..6c48cdaf25c0f3 100644\n--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c\n+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c\n@@ -366,24 +366,23 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)\n }\n \n static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\tstruct net_device *netdev,\n-\t\t\tconst unsigned char *addr, u16 vid, bool *notified,\n+\t\t\tconst struct ndo_fdb_parms *parms, bool *notified,\n \t\t\tstruct netlink_ext_ack *extack)\n {\n-\tstruct qlcnic_adapter *adapter = netdev_priv(netdev);\n+\tstruct qlcnic_adapter *adapter = netdev_priv(parms-\u003edev);\n \tint err = -EOPNOTSUPP;\n \n \tif (!adapter-\u003efdb_mac_learn)\n-\t\treturn ndo_dflt_fdb_del(ndm, tb, netdev, addr, vid);\n+\t\treturn ndo_dflt_fdb_del(ndm, tb, parms);\n \n \tif ((adapter-\u003eflags \u0026 QLCNIC_ESWITCH_ENABLED) ||\n \t    qlcnic_sriov_check(adapter)) {\n-\t\tif (is_unicast_ether_addr(addr)) {\n-\t\t\terr = dev_uc_del(netdev, addr);\n+\t\tif (is_unicast_ether_addr(parms-\u003eaddr)) {\n+\t\t\terr = dev_uc_del(parms-\u003edev, parms-\u003eaddr);\n \t\t\tif (!err)\n-\t\t\t\terr = qlcnic_nic_del_mac(adapter, addr);\n-\t\t} else if (is_multicast_ether_addr(addr)) {\n-\t\t\terr = dev_mc_del(netdev, addr);\n+\t\t\t\terr = qlcnic_nic_del_mac(adapter, parms-\u003eaddr);\n+\t\t} else if (is_multicast_ether_addr(parms-\u003eaddr)) {\n+\t\t\terr = dev_mc_del(parms-\u003edev, parms-\u003eaddr);\n \t\t} else {\n \t\t\terr =  -EINVAL;\n \t\t}\n@@ -392,15 +391,14 @@ static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\n }\n \n static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\tstruct net_device *netdev,\n-\t\t\tconst unsigned char *addr, u16 vid, u16 flags,\n-\t\t\tbool *notified, struct netlink_ext_ack *extack)\n+\t\t\tconst struct ndo_fdb_parms *parms, bool *notified,\n+\t\t\tstruct netlink_ext_ack *extack)\n {\n-\tstruct qlcnic_adapter *adapter = netdev_priv(netdev);\n+\tstruct qlcnic_adapter *adapter = netdev_priv(parms-\u003edev);\n \tint err = 0;\n \n \tif (!adapter-\u003efdb_mac_learn)\n-\t\treturn ndo_dflt_fdb_add(ndm, tb, netdev, addr, vid, flags);\n+\t\treturn ndo_dflt_fdb_add(ndm, tb, parms);\n \n \tif (!(adapter-\u003eflags \u0026 QLCNIC_ESWITCH_ENABLED) \u0026\u0026\n \t    !qlcnic_sriov_check(adapter)) {\n@@ -408,16 +406,16 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \t\treturn -EOPNOTSUPP;\n \t}\n \n-\tif (ether_addr_equal(addr, adapter-\u003emac_addr))\n+\tif (ether_addr_equal(parms-\u003eaddr, adapter-\u003emac_addr))\n \t\treturn err;\n \n-\tif (is_unicast_ether_addr(addr)) {\n-\t\tif (netdev_uc_count(netdev) \u003c adapter-\u003eahw-\u003emax_uc_count)\n-\t\t\terr = dev_uc_add_excl(netdev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr)) {\n+\t\tif (netdev_uc_count(parms-\u003edev) \u003c adapter-\u003eahw-\u003emax_uc_count)\n+\t\t\terr = dev_uc_add_excl(parms-\u003edev, parms-\u003eaddr);\n \t\telse\n \t\t\terr = -ENOMEM;\n-\t} else if (is_multicast_ether_addr(addr)) {\n-\t\terr = dev_mc_add_excl(netdev, addr);\n+\t} else if (is_multicast_ether_addr(parms-\u003eaddr)) {\n+\t\terr = dev_mc_add_excl(parms-\u003edev, parms-\u003eaddr);\n \t} else {\n \t\terr = -EINVAL;\n \t}\ndiff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c\nindex c7afa736c472bc..06079c69777242 100644\n--- a/drivers/net/macvlan.c\n+++ b/drivers/net/macvlan.c\n@@ -1054,49 +1054,46 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,\n }\n \n static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t   struct net_device *dev,\n-\t\t\t   const unsigned char *addr, u16 vid,\n-\t\t\t   u16 flags, bool *notified,\n+\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\n \t\t\t   struct netlink_ext_ack *extack)\n {\n-\tstruct macvlan_dev *vlan = netdev_priv(dev);\n+\tstruct macvlan_dev *vlan = netdev_priv(parms-\u003edev);\n \tint err = -EINVAL;\n \n \t/* Support unicast filter only on passthru devices.\n \t * Multicast filter should be allowed on all devices.\n \t */\n-\tif (!macvlan_passthru(vlan-\u003eport) \u0026\u0026 is_unicast_ether_addr(addr))\n+\tif (!macvlan_passthru(vlan-\u003eport) \u0026\u0026 is_unicast_ether_addr(parms-\u003eaddr))\n \t\treturn -EOPNOTSUPP;\n \n-\tif (flags \u0026 NLM_F_REPLACE)\n+\tif (parms-\u003eflags \u0026 NLM_F_REPLACE)\n \t\treturn -EOPNOTSUPP;\n \n-\tif (is_unicast_ether_addr(addr))\n-\t\terr = dev_uc_add_excl(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_add_excl(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_add_excl(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_add_excl(parms-\u003edev, parms-\u003eaddr);\n \n \treturn err;\n }\n \n static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t   struct net_device *dev,\n-\t\t\t   const unsigned char *addr, u16 vid, bool *notified,\n+\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\n \t\t\t   struct netlink_ext_ack *extack)\n {\n-\tstruct macvlan_dev *vlan = netdev_priv(dev);\n+\tstruct macvlan_dev *vlan = netdev_priv(parms-\u003edev);\n \tint err = -EINVAL;\n \n \t/* Support unicast filter only on passthru devices.\n \t * Multicast filter should be allowed on all devices.\n \t */\n-\tif (!macvlan_passthru(vlan-\u003eport) \u0026\u0026 is_unicast_ether_addr(addr))\n+\tif (!macvlan_passthru(vlan-\u003eport) \u0026\u0026 is_unicast_ether_addr(parms-\u003eaddr))\n \t\treturn -EOPNOTSUPP;\n \n-\tif (is_unicast_ether_addr(addr))\n-\t\terr = dev_uc_del(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_del(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_del(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_del(parms-\u003edev, parms-\u003eaddr);\n \n \treturn err;\n }\ndiff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c\nindex d11028b374721c..c300e0bd9b577c 100644\n--- a/drivers/net/vxlan/vxlan_core.c\n+++ b/drivers/net/vxlan/vxlan_core.c\n@@ -265,7 +265,7 @@ static inline size_t vxlan_nlmsg_size(void)\n }\n \n static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,\n-\t\t\t       struct vxlan_rdst *rd, int type)\n+\t\t\t       struct vxlan_rdst *rd, int type, u32 portid)\n {\n \tstruct net *net = dev_net(vxlan-\u003edev);\n \tstruct sk_buff *skb;\n@@ -275,7 +275,7 @@ static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,\n \tif (skb == NULL)\n \t\tgoto errout;\n \n-\terr = vxlan_fdb_info(skb, vxlan, fdb, 0, 0, type, 0, rd);\n+\terr = vxlan_fdb_info(skb, vxlan, fdb, portid, 0, type, 0, rd);\n \tif (err \u003c 0) {\n \t\t/* -EMSGSIZE implies BUG in vxlan_nlmsg_size() */\n \t\tWARN_ON(err == -EMSGSIZE);\n@@ -329,8 +329,8 @@ static int vxlan_fdb_switchdev_call_notifiers(struct vxlan_dev *vxlan,\n }\n \n static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,\n-\t\t\t    struct vxlan_rdst *rd, int type, bool swdev_notify,\n-\t\t\t    struct netlink_ext_ack *extack)\n+\t\t\t    struct vxlan_rdst *rd, int type, u32 portid,\n+\t\t\t    bool swdev_notify, struct netlink_ext_ack *extack)\n {\n \tint err;\n \n@@ -349,7 +349,7 @@ static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,\n \t\t}\n \t}\n \n-\t__vxlan_fdb_notify(vxlan, fdb, rd, type);\n+\t__vxlan_fdb_notify(vxlan, fdb, rd, type, portid);\n \treturn 0;\n }\n \n@@ -364,7 +364,7 @@ static void vxlan_ip_miss(struct net_device *dev, union vxlan_addr *ipa)\n \t\t.remote_vni = cpu_to_be32(VXLAN_N_VID),\n \t};\n \n-\tvxlan_fdb_notify(vxlan, \u0026f, \u0026remote, RTM_GETNEIGH, true, NULL);\n+\tvxlan_fdb_notify(vxlan, \u0026f, \u0026remote, RTM_GETNEIGH, 0, true, NULL);\n }\n \n static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN])\n@@ -376,7 +376,7 @@ static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN])\n \n \tmemcpy(f.key.eth_addr, eth_addr, ETH_ALEN);\n \n-\tvxlan_fdb_notify(vxlan, \u0026f, \u0026remote, RTM_GETNEIGH, true, NULL);\n+\tvxlan_fdb_notify(vxlan, \u0026f, \u0026remote, RTM_GETNEIGH, 0, true, NULL);\n }\n \n /* Look up Ethernet address in forwarding table */\n@@ -945,7 +945,7 @@ static void vxlan_fdb_free(struct rcu_head *head)\n }\n \n static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,\n-\t\t\t      bool do_notify, bool swdev_notify)\n+\t\t\t      bool do_notify, u32 portid, bool swdev_notify)\n {\n \tstruct vxlan_rdst *rd;\n \n@@ -955,11 +955,11 @@ static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,\n \tif (do_notify) {\n \t\tif (rcu_access_pointer(f-\u003enh))\n \t\t\tvxlan_fdb_notify(vxlan, f, NULL, RTM_DELNEIGH,\n-\t\t\t\t\t swdev_notify, NULL);\n+\t\t\t\t\t portid, swdev_notify, NULL);\n \t\telse\n \t\t\tlist_for_each_entry(rd, \u0026f-\u003eremotes, list)\n \t\t\t\tvxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH,\n-\t\t\t\t\t\t swdev_notify, NULL);\n+\t\t\t\t\t\t portid, swdev_notify, NULL);\n \t}\n \n \thlist_del_init_rcu(\u0026f-\u003efdb_node);\n@@ -983,7 +983,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,\n \t\t\t\t     __be16 port, __be32 vni,\n \t\t\t\t     __u32 ifindex, __u16 ndm_flags,\n \t\t\t\t     struct vxlan_fdb *f, u32 nhid,\n-\t\t\t\t     bool swdev_notify,\n+\t\t\t\t     u32 portid, bool swdev_notify,\n \t\t\t\t     struct netlink_ext_ack *extack)\n {\n \t__u16 fdb_flags = (ndm_flags \u0026 ~NTF_USE);\n@@ -1057,7 +1057,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,\n \n \t\tWRITE_ONCE(f-\u003eupdated, jiffies);\n \t\terr = vxlan_fdb_notify(vxlan, f, rd, RTM_NEWNEIGH,\n-\t\t\t\t       swdev_notify, extack);\n+\t\t\t\t       portid, swdev_notify, extack);\n \t\tif (err)\n \t\t\tgoto err_notify;\n \t}\n@@ -1081,7 +1081,7 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,\n \t\t\t\t   __u16 state, __u16 flags,\n \t\t\t\t   __be16 port, __be32 src_vni, __be32 vni,\n \t\t\t\t   __u32 ifindex, __u16 ndm_flags, u32 nhid,\n-\t\t\t\t   bool swdev_notify,\n+\t\t\t\t   u32 portid, bool swdev_notify,\n \t\t\t\t   struct netlink_ext_ack *extack)\n {\n \t__u16 fdb_flags = (ndm_flags \u0026 ~NTF_USE);\n@@ -1100,14 +1100,14 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,\n \t\treturn rc;\n \n \trc = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_NEWNEIGH,\n-\t\t\t      swdev_notify, extack);\n+\t\t\t      portid, swdev_notify, extack);\n \tif (rc)\n \t\tgoto err_notify;\n \n \treturn 0;\n \n err_notify:\n-\tvxlan_fdb_destroy(vxlan, f, false, false);\n+\tvxlan_fdb_destroy(vxlan, f, false, 0, false);\n \treturn rc;\n }\n \n@@ -1117,7 +1117,7 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan,\n \t\t     __u16 state, __u16 flags,\n \t\t     __be16 port, __be32 src_vni, __be32 vni,\n \t\t     __u32 ifindex, __u16 ndm_flags, u32 nhid,\n-\t\t     bool swdev_notify,\n+\t\t     u32 portid, bool swdev_notify,\n \t\t     struct netlink_ext_ack *extack)\n {\n \tstruct vxlan_fdb *f;\n@@ -1132,23 +1132,26 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan,\n \n \t\treturn vxlan_fdb_update_existing(vxlan, ip, state, flags, port,\n \t\t\t\t\t\t vni, ifindex, ndm_flags, f,\n-\t\t\t\t\t\t nhid, swdev_notify, extack);\n+\t\t\t\t\t\t nhid, portid, swdev_notify,\n+\t\t\t\t\t\t extack);\n \t} else {\n \t\tif (!(flags \u0026 NLM_F_CREATE))\n \t\t\treturn -ENOENT;\n \n \t\treturn vxlan_fdb_update_create(vxlan, mac, ip, state, flags,\n \t\t\t\t\t       port, src_vni, vni, ifindex,\n-\t\t\t\t\t       ndm_flags, nhid, swdev_notify,\n-\t\t\t\t\t       extack);\n+\t\t\t\t\t       ndm_flags, nhid, portid,\n+\t\t\t\t\t       swdev_notify, extack);\n \t}\n }\n \n static void vxlan_fdb_dst_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,\n-\t\t\t\t  struct vxlan_rdst *rd, bool swdev_notify)\n+\t\t\t\t  struct vxlan_rdst *rd, u32 portid,\n+\t\t\t\t  bool swdev_notify)\n {\n \tlist_del_rcu(\u0026rd-\u003elist);\n-\tvxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, swdev_notify, NULL);\n+\tvxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, portid, swdev_notify,\n+\t\t\t NULL);\n \tcall_rcu(\u0026rd-\u003ercu, vxlan_dst_free);\n }\n \n@@ -1241,12 +1244,11 @@ static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,\n \n /* Add static entry (via netlink) */\n static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t struct net_device *dev,\n-\t\t\t const unsigned char *addr, u16 vid, u16 flags,\n-\t\t\t bool *notified, struct netlink_ext_ack *extack)\n+\t\t\t const struct ndo_fdb_parms *parms, bool *notified,\n+\t\t\t struct netlink_ext_ack *extack)\n {\n \tconst struct vxlan_config *cfg;\n-\tstruct vxlan_dev *vxlan = netdev_priv(dev);\n+\tstruct vxlan_dev *vxlan = netdev_priv(parms-\u003edev);\n \t/* struct net *net = dev_net(vxlan-\u003edev); */\n \tunion vxlan_addr ip;\n \t__be16 port;\n@@ -1273,10 +1275,11 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \t\treturn -EAFNOSUPPORT;\n \n \tspin_lock_bh(\u0026vxlan-\u003ehash_lock);\n-\terr = vxlan_fdb_update(vxlan, addr, \u0026ip, ndm-\u003endm_state, flags,\n+\terr = vxlan_fdb_update(vxlan, parms-\u003eaddr, \u0026ip, ndm-\u003endm_state,\n+\t\t\t       parms-\u003eflags,\n \t\t\t       port, src_vni, vni, ifindex,\n \t\t\t       ndm-\u003endm_flags | NTF_VXLAN_ADDED_BY_USER,\n-\t\t\t       nhid, true, extack);\n+\t\t\t       nhid, parms-\u003eportid, true, extack);\n \tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \n \tif (!err)\n@@ -1288,7 +1291,7 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n int __vxlan_fdb_delete(struct vxlan_dev *vxlan,\n \t\t       const unsigned char *addr, union vxlan_addr ip,\n \t\t       __be16 port, __be32 src_vni, __be32 vni,\n-\t\t       u32 ifindex, bool swdev_notify)\n+\t\t       u32 ifindex, u32 portid, bool swdev_notify)\n {\n \tstruct vxlan_rdst *rd = NULL;\n \tstruct vxlan_fdb *f;\n@@ -1308,11 +1311,11 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,\n \t * otherwise destroy the fdb entry\n \t */\n \tif (rd \u0026\u0026 !list_is_singular(\u0026f-\u003eremotes)) {\n-\t\tvxlan_fdb_dst_destroy(vxlan, f, rd, swdev_notify);\n+\t\tvxlan_fdb_dst_destroy(vxlan, f, rd, portid, swdev_notify);\n \t\tgoto out;\n \t}\n \n-\tvxlan_fdb_destroy(vxlan, f, true, swdev_notify);\n+\tvxlan_fdb_destroy(vxlan, f, true, portid, swdev_notify);\n \n out:\n \treturn 0;\n@@ -1320,11 +1323,10 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,\n \n /* Delete entry (via netlink) */\n static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t\t    struct net_device *dev,\n-\t\t\t    const unsigned char *addr, u16 vid, bool *notified,\n+\t\t\t    const struct ndo_fdb_parms *parms, bool *notified,\n \t\t\t    struct netlink_ext_ack *extack)\n {\n-\tstruct vxlan_dev *vxlan = netdev_priv(dev);\n+\tstruct vxlan_dev *vxlan = netdev_priv(parms-\u003edev);\n \tunion vxlan_addr ip;\n \t__be32 src_vni, vni;\n \tu32 ifindex, nhid;\n@@ -1337,8 +1339,8 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],\n \t\treturn err;\n \n \tspin_lock_bh(\u0026vxlan-\u003ehash_lock);\n-\terr = __vxlan_fdb_delete(vxlan, addr, ip, port, src_vni, vni, ifindex,\n-\t\t\t\t true);\n+\terr = __vxlan_fdb_delete(vxlan, parms-\u003eaddr, ip, port, src_vni, vni,\n+\t\t\t\t ifindex, parms-\u003eportid, true);\n \tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \n \tif (!err)\n@@ -1400,12 +1402,10 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,\n \n static int vxlan_fdb_get(struct sk_buff *skb,\n \t\t\t struct nlattr *tb[],\n-\t\t\t struct net_device *dev,\n-\t\t\t const unsigned char *addr,\n-\t\t\t u16 vid, u32 portid, u32 seq,\n+\t\t\t const struct ndo_fdb_parms *parms, u32 seq,\n \t\t\t struct netlink_ext_ack *extack)\n {\n-\tstruct vxlan_dev *vxlan = netdev_priv(dev);\n+\tstruct vxlan_dev *vxlan = netdev_priv(parms-\u003edev);\n \tconst struct vxlan_config *cfg;\n \tstruct vxlan_fdb *f;\n \t__be32 vni;\n@@ -1420,14 +1420,14 @@ static int vxlan_fdb_get(struct sk_buff *skb,\n \n \trcu_read_lock();\n \n-\tf = vxlan_find_mac_rcu(vxlan, cfg, addr, vni);\n+\tf = vxlan_find_mac_rcu(vxlan, cfg, parms-\u003eaddr, vni);\n \tif (!f) {\n \t\tNL_SET_ERR_MSG(extack, \"Fdb entry not found\");\n \t\terr = -ENOENT;\n \t\tgoto errout;\n \t}\n \n-\terr = vxlan_fdb_info(skb, vxlan, f, portid, seq,\n+\terr = vxlan_fdb_info(skb, vxlan, f, parms-\u003eportid, seq,\n \t\t\t     RTM_NEWNEIGH, 0, first_remote_rcu(f));\n errout:\n \trcu_read_unlock();\n@@ -1483,7 +1483,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,\n \t\t\t\t    src_mac, \u0026rdst-\u003eremote_ip.sa, \u0026src_ip-\u003esa);\n \n \t\trdst-\u003eremote_ip = *src_ip;\n-\t\tvxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, true, NULL);\n+\t\tvxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, 0, true, NULL);\n \t} else {\n \t\t/* learned new entry */\n \t\tspin_lock(\u0026vxlan-\u003ehash_lock);\n@@ -1496,7 +1496,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,\n \t\t\t\t\t cfg-\u003edst_port,\n \t\t\t\t\t vni,\n \t\t\t\t\t cfg-\u003evni,\n-\t\t\t\t\t ifindex, NTF_SELF, 0, true, NULL);\n+\t\t\t\t\t ifindex, NTF_SELF, 0, 0, true, NULL);\n \t\tspin_unlock(\u0026vxlan-\u003ehash_lock);\n \t}\n \n@@ -2946,7 +2946,7 @@ static void vxlan_cleanup(struct timer_list *t)\n \t\t\t\tnetdev_dbg(vxlan-\u003edev, \"garbage collect %pM\\n\",\n \t\t\t\t\t   f-\u003ekey.eth_addr);\n \t\t\t\tf-\u003estate = NUD_STALE;\n-\t\t\t\tvxlan_fdb_destroy(vxlan, f, true, true);\n+\t\t\t\tvxlan_fdb_destroy(vxlan, f, true, 0, true);\n \t\t\t}\n \t\t\tspin_unlock(\u0026vxlan-\u003ehash_lock);\n \t\t} else if (time_before(timeout, next_timer)) {\n@@ -3141,7 +3141,7 @@ vxlan_fdb_flush_remote_matches(const struct vxlan_fdb_flush_desc *desc,\n static void\n vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan,\n \t\t\t      const struct vxlan_fdb_flush_desc *desc,\n-\t\t\t      bool *p_destroy_fdb)\n+\t\t\t      u32 portid, bool *p_destroy_fdb)\n {\n \tstruct vxlan_rdst *rd, *tmp;\n \n@@ -3154,13 +3154,13 @@ vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan,\n \t\t\treturn;\n \t\t}\n \n-\t\tvxlan_fdb_dst_destroy(vxlan, f, rd, true);\n+\t\tvxlan_fdb_dst_destroy(vxlan, f, rd, portid, true);\n \t}\n }\n \n /* Purge the forwarding table */\n static void vxlan_flush(struct vxlan_dev *vxlan,\n-\t\t\tconst struct vxlan_fdb_flush_desc *desc)\n+\t\t\tconst struct vxlan_fdb_flush_desc *desc, u32 portid)\n {\n \tbool match_remotes = vxlan_fdb_flush_should_match_remotes(desc);\n \tstruct vxlan_fdb *f;\n@@ -3177,14 +3177,14 @@ static void vxlan_flush(struct vxlan_dev *vxlan,\n \t\tif (match_remotes) {\n \t\t\tbool destroy_fdb = false;\n \n-\t\t\tvxlan_fdb_flush_match_remotes(f, vxlan, desc,\n+\t\t\tvxlan_fdb_flush_match_remotes(f, vxlan, desc, portid,\n \t\t\t\t\t\t      \u0026destroy_fdb);\n \n \t\t\tif (!destroy_fdb)\n \t\t\t\tgoto unlock;\n \t\t}\n \n-\t\tvxlan_fdb_destroy(vxlan, f, true, true);\n+\t\tvxlan_fdb_destroy(vxlan, f, true, portid, true);\n unlock:\n \t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \t}\n@@ -3208,7 +3208,7 @@ static const struct nla_policy vxlan_del_bulk_policy[NDA_MAX + 1] = {\n \t\t\t\t\t   NTF_ROUTER)\n \n static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,\n-\t\t\t\t struct netlink_ext_ack *extack)\n+\t\t\t\t u32 portid, struct netlink_ext_ack *extack)\n {\n \tstruct vxlan_dev *vxlan = netdev_priv(dev);\n \tstruct vxlan_fdb_flush_desc desc = {};\n@@ -3266,7 +3266,7 @@ static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,\n \t\tdesc.dst_ip = ip;\n \t}\n \n-\tvxlan_flush(vxlan, \u0026desc);\n+\tvxlan_flush(vxlan, \u0026desc, portid);\n \n \treturn 0;\n }\n@@ -3286,7 +3286,7 @@ static int vxlan_stop(struct net_device *dev)\n \n \ttimer_delete_sync(\u0026vxlan-\u003eage_timer);\n \n-\tvxlan_flush(vxlan, \u0026desc);\n+\tvxlan_flush(vxlan, \u0026desc, 0);\n \tvxlan_sock_release(vxlan);\n \n \treturn 0;\n@@ -4146,7 +4146,7 @@ static int vxlan_dev_create(struct net *net, struct net_device *dev,\n \t\t\t\t       cfg-\u003evni,\n \t\t\t\t       cfg-\u003evni,\n \t\t\t\t       cfg-\u003eremote_ifindex,\n-\t\t\t\t       NTF_SELF, 0, true, extack);\n+\t\t\t\t       NTF_SELF, 0, 0, true, extack);\n \t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \t\tif (err)\n \t\t\tgoto unlink;\n@@ -4609,7 +4609,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],\n \t\t\t\t\t       cfg-\u003edst_port,\n \t\t\t\t\t       conf.vni, conf.vni,\n \t\t\t\t\t       conf.remote_ifindex,\n-\t\t\t\t\t       NTF_SELF, 0, true, extack);\n+\t\t\t\t\t       NTF_SELF, 0, 0, true, extack);\n \t\t\tif (err) {\n \t\t\t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \t\t\t\tif (lowerdev_changed)\n@@ -4626,7 +4626,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],\n \t\t\t\t\t   cfg-\u003evni,\n \t\t\t\t\t   cfg-\u003evni,\n \t\t\t\t\t   cfg-\u003eremote_ifindex,\n-\t\t\t\t\t   true);\n+\t\t\t\t\t   0, true);\n \t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \n \t\t/* If vni filtering device, also update default fdb entries of\n@@ -4690,7 +4690,7 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)\n \tstruct vxlan_dev *vxlan = netdev_priv(dev);\n \tstruct vxlan_fdb_flush_desc desc = {};\n \n-\tvxlan_flush(vxlan, \u0026desc);\n+\tvxlan_flush(vxlan, \u0026desc, 0);\n \n \tlist_del(\u0026vxlan-\u003enext);\n \tunregister_netdevice_queue(dev, head);\n@@ -4964,7 +4964,7 @@ vxlan_fdb_external_learn_add(struct net_device *dev,\n \t\t\t       fdb_info-\u003eremote_vni,\n \t\t\t       fdb_info-\u003eremote_ifindex,\n \t\t\t       NTF_USE | NTF_SELF | NTF_EXT_LEARNED,\n-\t\t\t       0, false, extack);\n+\t\t\t       0, 0, false, extack);\n \tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \n \treturn err;\n@@ -4990,7 +4990,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev,\n \t\t\t\t\t fdb_info-\u003evni,\n \t\t\t\t\t fdb_info-\u003eremote_vni,\n \t\t\t\t\t fdb_info-\u003eremote_ifindex,\n-\t\t\t\t\t false);\n+\t\t\t\t\t 0, false);\n \n \tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \n@@ -5048,7 +5048,7 @@ static void vxlan_fdb_nh_flush(struct nexthop *nh)\n \t\tWARN_ON(!vxlan);\n \t\tspin_lock_bh(\u0026vxlan-\u003ehash_lock);\n \t\tif (!hlist_unhashed(\u0026fdb-\u003efdb_node))\n-\t\t\tvxlan_fdb_destroy(vxlan, fdb, false, false);\n+\t\t\tvxlan_fdb_destroy(vxlan, fdb, false, 0, false);\n \t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \t}\n \trcu_read_unlock();\ndiff --git a/drivers/net/vxlan/vxlan_private.h b/drivers/net/vxlan/vxlan_private.h\nindex f0ee85f83732a2..632e1880c0b912 100644\n--- a/drivers/net/vxlan/vxlan_private.h\n+++ b/drivers/net/vxlan/vxlan_private.h\n@@ -196,13 +196,14 @@ int vxlan_fdb_create(struct vxlan_dev *vxlan,\n int __vxlan_fdb_delete(struct vxlan_dev *vxlan,\n \t\t       const unsigned char *addr, union vxlan_addr ip,\n \t\t       __be16 port, __be32 src_vni, __be32 vni,\n-\t\t       u32 ifindex, bool swdev_notify);\n+\t\t       u32 ifindex, u32 portid, bool swdev_notify);\n int vxlan_fdb_update(struct vxlan_dev *vxlan,\n \t\t     const u8 *mac, union vxlan_addr *ip,\n \t\t     __u16 state, __u16 flags,\n \t\t     __be16 port, __be32 src_vni, __be32 vni,\n \t\t     __u32 ifindex, __u16 ndm_flags, u32 nhid,\n-\t\t     bool swdev_notify, struct netlink_ext_ack *extack);\n+\t\t     u32 portid, bool swdev_notify,\n+\t\t     struct netlink_ext_ack *extack);\n void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,\n \t\t    const struct vxlan_config *cfg,\n \t\t    __be32 default_vni, struct vxlan_rdst *rdst, bool did_rsc);\ndiff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c\nindex c5cc6cd085450a..927b63db3b5bf9 100644\n--- a/drivers/net/vxlan/vxlan_vnifilter.c\n+++ b/drivers/net/vxlan/vxlan_vnifilter.c\n@@ -550,7 +550,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni,\n \t\t\t\t       vni,\n \t\t\t\t       vni,\n \t\t\t\t       new_ifindex,\n-\t\t\t\t       NTF_SELF, 0, true, extack);\n+\t\t\t\t       NTF_SELF, 0, 0, true, extack);\n \t\tif (err \u0026\u0026 extack) {\n \t\t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \t\t\treturn err;\n@@ -563,7 +563,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni,\n \t\t\t\t   cfg-\u003edst_port,\n \t\t\t\t   vni, vni,\n \t\t\t\t   old_ifindex,\n-\t\t\t\t   true);\n+\t\t\t\t   0, true);\n \t}\n \tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \n@@ -727,7 +727,7 @@ static void vxlan_vni_delete_group(struct vxlan_dev *vxlan,\n \t\t\t\t   cfg-\u003edst_port,\n \t\t\t\t   vninode-\u003evni, vninode-\u003evni,\n \t\t\t\t   cfg-\u003eremote_ifindex,\n-\t\t\t\t   true);\n+\t\t\t\t   0, true);\n \t\tspin_unlock_bh(\u0026vxlan-\u003ehash_lock);\n \t}\n \ndiff --git a/include/linux/netdevice.h b/include/linux/netdevice.h\nindex 694b6d29f6807a..b2846b586a7f0d 100644\n--- a/include/linux/netdevice.h\n+++ b/include/linux/netdevice.h\n@@ -1087,6 +1087,22 @@ struct netdev_net_notifier {\n \tstruct notifier_block *nb;\n };\n \n+/**\n+ * struct ndo_fdb_parms - parameters for ndo_fdb_{add,del,get}\n+ * @dev: device the FDB entry is added to, deleted from or looked up on\n+ * @addr: MAC address of the FDB entry\n+ * @vid: VLAN ID of the FDB entry, 0 if none\n+ * @flags: netlink message flags (NLM_F_*) of the request\n+ * @portid: netlink port ID of the requester\n+ */\n+struct ndo_fdb_parms {\n+\tstruct net_device\t*dev;\n+\tconst unsigned char\t*addr;\n+\tu16\t\t\tvid;\n+\tu16\t\t\tflags;\n+\tu32\t\t\tportid;\n+};\n+\n /*\n  * This structure defines the management hooks for network devices.\n  * The following hooks can be defined; unless noted otherwise, they are\n@@ -1330,21 +1346,19 @@ struct netdev_net_notifier {\n  *\tMust return \u003e0 or -errno if it changed dev-\u003efeatures itself.\n  *\n  * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[],\n- *\t\t      struct net_device *dev,\n- *\t\t      const unsigned char *addr, u16 vid, u16 flags,\n+ *\t\t      const struct ndo_fdb_parms *parms,\n  *\t\t      bool *notified, struct netlink_ext_ack *extack);\n- *\tAdds an FDB entry to dev for addr.\n+ *\tAdds an FDB entry to parms-\u003edev for parms-\u003eaddr.\n  *\tCallee shall set *notified to true if it sent any appropriate\n  *\tnotification(s). Otherwise core will send a generic one.\n  * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[],\n- *\t\t      struct net_device *dev,\n- *\t\t      const unsigned char *addr, u16 vid\n+ *\t\t      const struct ndo_fdb_parms *parms,\n  *\t\t      bool *notified, struct netlink_ext_ack *extack);\n- *\tDeletes the FDB entry from dev corresponding to addr.\n+ *\tDeletes the FDB entry from parms-\u003edev corresponding to parms-\u003eaddr.\n  *\tCallee shall set *notified to true if it sent any appropriate\n  *\tnotification(s). Otherwise core will send a generic one.\n  * int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh, struct net_device *dev,\n- *\t\t\t   struct netlink_ext_ack *extack);\n+ *\t\t\t   u32 portid, struct netlink_ext_ack *extack);\n  * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,\n  *\t\t       struct net_device *dev, struct net_device *filter_dev,\n  *\t\t       int *idx)\n@@ -1614,21 +1628,17 @@ struct net_device_ops {\n \n \tint\t\t\t(*ndo_fdb_add)(struct ndmsg *ndm,\n \t\t\t\t\t       struct nlattr *tb[],\n-\t\t\t\t\t       struct net_device *dev,\n-\t\t\t\t\t       const unsigned char *addr,\n-\t\t\t\t\t       u16 vid,\n-\t\t\t\t\t       u16 flags,\n+\t\t\t\t\t       const struct ndo_fdb_parms *parms,\n \t\t\t\t\t       bool *notified,\n \t\t\t\t\t       struct netlink_ext_ack *extack);\n \tint\t\t\t(*ndo_fdb_del)(struct ndmsg *ndm,\n \t\t\t\t\t       struct nlattr *tb[],\n-\t\t\t\t\t       struct net_device *dev,\n-\t\t\t\t\t       const unsigned char *addr,\n-\t\t\t\t\t       u16 vid,\n+\t\t\t\t\t       const struct ndo_fdb_parms *parms,\n \t\t\t\t\t       bool *notified,\n \t\t\t\t\t       struct netlink_ext_ack *extack);\n \tint\t\t\t(*ndo_fdb_del_bulk)(struct nlmsghdr *nlh,\n \t\t\t\t\t\t    struct net_device *dev,\n+\t\t\t\t\t\t    u32 portid,\n \t\t\t\t\t\t    struct netlink_ext_ack *extack);\n \tint\t\t\t(*ndo_fdb_dump)(struct sk_buff *skb,\n \t\t\t\t\t\tstruct netlink_callback *cb,\n@@ -1637,9 +1647,8 @@ struct net_device_ops {\n \t\t\t\t\t\tint *idx);\n \tint\t\t\t(*ndo_fdb_get)(struct sk_buff *skb,\n \t\t\t\t\t       struct nlattr *tb[],\n-\t\t\t\t\t       struct net_device *dev,\n-\t\t\t\t\t       const unsigned char *addr,\n-\t\t\t\t\t       u16 vid, u32 portid, u32 seq,\n+\t\t\t\t\t       const struct ndo_fdb_parms *parms,\n+\t\t\t\t\t       u32 seq,\n \t\t\t\t\t       struct netlink_ext_ack *extack);\n \tint\t\t\t(*ndo_mdb_add)(struct net_device *dev,\n \t\t\t\t\t       struct nlattr *tb[],\ndiff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h\nindex a54ec40d095c04..e963b43bce7678 100644\n--- a/include/linux/rtnetlink.h\n+++ b/include/linux/rtnetlink.h\n@@ -211,15 +211,10 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,\n \t\t\t     int *idx);\n extern int ndo_dflt_fdb_add(struct ndmsg *ndm,\n \t\t\t    struct nlattr *tb[],\n-\t\t\t    struct net_device *dev,\n-\t\t\t    const unsigned char *addr,\n-\t\t\t    u16 vid,\n-\t\t\t    u16 flags);\n+\t\t\t    const struct ndo_fdb_parms *parms);\n extern int ndo_dflt_fdb_del(struct ndmsg *ndm,\n \t\t\t    struct nlattr *tb[],\n-\t\t\t    struct net_device *dev,\n-\t\t\t    const unsigned char *addr,\n-\t\t\t    u16 vid);\n+\t\t\t    const struct ndo_fdb_parms *parms);\n \n extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,\n \t\t\t\t   struct net_device *dev, u16 mode,\ndiff --git a/net/bridge/br.c b/net/bridge/br.c\nindex d9a39ff98868d1..76feb286acab05 100644\n--- a/net/bridge/br.c\n+++ b/net/bridge/br.c\n@@ -177,7 +177,7 @@ static int br_switchdev_event(struct notifier_block *unused,\n \t\tfdb_info = ptr;\n \t\terr = br_fdb_external_learn_add(br, p, fdb_info-\u003eaddr,\n \t\t\t\t\t\tfdb_info-\u003evid,\n-\t\t\t\t\t\tfdb_info-\u003elocked, false);\n+\t\t\t\t\t\tfdb_info-\u003elocked, 0, false);\n \t\tif (err) {\n \t\t\terr = notifier_from_errno(err);\n \t\t\tbreak;\ndiff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c\nindex b601245ad92399..6b1c067974ff68 100644\n--- a/net/bridge/br_fdb.c\n+++ b/net/bridge/br_fdb.c\n@@ -176,7 +176,7 @@ static inline size_t fdb_nlmsg_size(void)\n \n static void fdb_notify(struct net_bridge *br,\n \t\t       const struct net_bridge_fdb_entry *fdb, int type,\n-\t\t       bool swdev_notify)\n+\t\t       u32 portid, bool swdev_notify)\n {\n \tstruct net *net = dev_net(br-\u003edev);\n \tstruct sk_buff *skb;\n@@ -189,7 +189,7 @@ static void fdb_notify(struct net_bridge *br,\n \tif (skb == NULL)\n \t\tgoto errout;\n \n-\terr = fdb_fill_info(skb, br, fdb, 0, 0, type, 0);\n+\terr = fdb_fill_info(skb, br, fdb, portid, 0, type, 0);\n \tif (err \u003c 0) {\n \t\t/* -EMSGSIZE implies BUG in fdb_nlmsg_size() */\n \t\tWARN_ON(err == -EMSGSIZE);\n@@ -313,7 +313,7 @@ static void fdb_del_hw_addr(struct net_bridge *br, const unsigned char *addr)\n }\n \n static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,\n-\t\t       bool swdev_notify)\n+\t\t       u32 portid, bool swdev_notify)\n {\n \ttrace_fdb_delete(br, f, br_fdb_dst_port(f));\n \n@@ -325,7 +325,7 @@ static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,\n \t\t\t       br_fdb_rht_params);\n \tif (test_and_clear_bit(BR_FDB_DYNAMIC_LEARNED, \u0026f-\u003eflags))\n \t\tatomic_dec(\u0026br-\u003efdb_n_learned);\n-\tfdb_notify(br, f, RTM_DELNEIGH, swdev_notify);\n+\tfdb_notify(br, f, RTM_DELNEIGH, portid, swdev_notify);\n \tkfree_rcu(f, rcu);\n }\n \n@@ -366,7 +366,7 @@ static void fdb_delete_local(struct net_bridge *br,\n \t\treturn;\n \t}\n \n-\tfdb_delete(br, f, true);\n+\tfdb_delete(br, f, 0, true);\n }\n \n void br_fdb_find_delete_local(struct net_bridge *br,\n@@ -445,7 +445,7 @@ static int fdb_add_local(struct net_bridge *br, struct net_bridge_port *source,\n \t\t\treturn 0;\n \t\tbr_warn(br, \"adding interface %s with same address as a received packet (addr:%pM, vlan:%u)\\n\",\n \t\t\tsource ? source-\u003edev-\u003ename : br-\u003edev-\u003ename, addr, vid);\n-\t\tfdb_delete(br, fdb, true);\n+\t\tfdb_delete(br, fdb, 0, true);\n \t}\n \n \tfdb = fdb_create(br, br_port_to_dst(source), addr, vid,\n@@ -454,7 +454,7 @@ static int fdb_add_local(struct net_bridge *br, struct net_bridge_port *source,\n \t\treturn -ENOMEM;\n \n \tfdb_add_hw_addr(br, addr);\n-\tfdb_notify(br, fdb, RTM_NEWNEIGH, true);\n+\tfdb_notify(br, fdb, RTM_NEWNEIGH, 0, true);\n \treturn 0;\n }\n \n@@ -569,7 +569,8 @@ void br_fdb_cleanup(struct work_struct *work)\n \t\t\t\t\t\t\t this_timer - now);\n \t\t\t\telse if (!test_and_set_bit(BR_FDB_NOTIFY_INACTIVE,\n \t\t\t\t\t\t\t   \u0026f-\u003eflags))\n-\t\t\t\t\tfdb_notify(br, f, RTM_NEWNEIGH, false);\n+\t\t\t\t\tfdb_notify(br, f, RTM_NEWNEIGH, 0,\n+\t\t\t\t\t\t   false);\n \t\t\t}\n \t\t\tcontinue;\n \t\t}\n@@ -579,7 +580,7 @@ void br_fdb_cleanup(struct work_struct *work)\n \t\t} else {\n \t\t\tspin_lock_bh(\u0026br-\u003ehash_lock);\n \t\t\tif (!hlist_unhashed(\u0026f-\u003efdb_node))\n-\t\t\t\tfdb_delete(br, f, true);\n+\t\t\t\tfdb_delete(br, f, 0, true);\n \t\t\tspin_unlock_bh(\u0026br-\u003ehash_lock);\n \t\t}\n \t}\n@@ -711,7 +712,7 @@ static bool __fdb_flush_matches(const struct net_bridge *br,\n \n /* Flush forwarding database entries matching the description */\n void br_fdb_flush(struct net_bridge *br,\n-\t\t  const struct net_bridge_fdb_flush_desc *desc)\n+\t\t  const struct net_bridge_fdb_flush_desc *desc, u32 portid)\n {\n \tstruct net_bridge_fdb_entry *f;\n \n@@ -722,7 +723,7 @@ void br_fdb_flush(struct net_bridge *br,\n \n \t\tspin_lock_bh(\u0026br-\u003ehash_lock);\n \t\tif (!hlist_unhashed(\u0026f-\u003efdb_node))\n-\t\t\tfdb_delete(br, f, true);\n+\t\t\tfdb_delete(br, f, portid, true);\n \t\tspin_unlock_bh(\u0026br-\u003ehash_lock);\n \t}\n \trcu_read_unlock();\n@@ -796,7 +797,7 @@ static const struct nla_policy br_fdb_del_bulk_policy[NDA_MAX + 1] = {\n };\n \n int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,\n-\t\t       struct netlink_ext_ack *extack)\n+\t\t       u32 portid, struct netlink_ext_ack *extack)\n {\n \tstruct net_bridge_fdb_flush_desc desc = {};\n \tstruct ndmsg *ndm = nlmsg_data(nlh);\n@@ -863,7 +864,7 @@ int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,\n \tbr_debug(br, \"flushing port ifindex: %d vlan id: %u flags: 0x%lx flags mask: 0x%lx\\n\",\n \t\t desc.port_ifindex, desc.vlan_id, desc.flags, desc.flags_mask);\n \n-\tbr_fdb_flush(br, \u0026desc);\n+\tbr_fdb_flush(br, \u0026desc, portid);\n \n \treturn 0;\n }\n@@ -918,7 +919,7 @@ void br_fdb_cleanup_by_dst(struct net_bridge *br,\n \t\tif (test_bit(BR_FDB_LOCAL, \u0026f-\u003eflags))\n \t\t\tfdb_delete_local(br, p, f);\n \t\telse\n-\t\t\tfdb_delete(br, f, true);\n+\t\t\tfdb_delete(br, f, 0, true);\n \t}\n \tspin_unlock_bh(\u0026br-\u003ehash_lock);\n }\n@@ -1000,7 +1001,7 @@ static void __fdb_update(struct net_bridge *br,\n \t\t\t struct net_bridge_fdb_entry *fdb,\n \t\t\t struct net_bridge_port *source,\n \t\t\t struct net_bridge_dst dst,\n-\t\t\t unsigned long flags)\n+\t\t\t unsigned long flags, u32 portid)\n {\n \tstruct net_bridge_port *old_port;\n \tstruct net_bridge_dst old_dst;\n@@ -1057,13 +1058,15 @@ static void __fdb_update(struct net_bridge *br,\n \tif (unlikely(fdb_modified)) {\n \t\ttrace_br_fdb_update(br, source, fdb-\u003ekey.addr.addr,\n \t\t\t\t    fdb-\u003ekey.vlan_id, flags);\n-\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, true);\n+\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, portid, true);\n \t}\n }\n \n-void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,\n-\t\t   struct net_bridge_vlan *vlan, const unsigned char *addr,\n-\t\t   unsigned long flags)\n+static void __br_fdb_update(struct net_bridge *br,\n+\t\t\t    struct net_bridge_port *source,\n+\t\t\t    struct net_bridge_vlan *vlan,\n+\t\t\t    const unsigned char *addr, unsigned long flags,\n+\t\t\t    u32 portid)\n {\n \tstruct net_bridge_dst dst = vlan ? br_vlan_to_dst(vlan) :\n \t\t\t\t\t   br_port_to_dst(source);\n@@ -1076,18 +1079,25 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,\n \n \tfdb = fdb_find_rcu(\u0026br-\u003efdb_hash_tbl, addr, vid);\n \tif (likely(fdb)) {\n-\t\t__fdb_update(br, fdb, source, dst, flags);\n+\t\t__fdb_update(br, fdb, source, dst, flags, portid);\n \t} else {\n \t\tspin_lock(\u0026br-\u003ehash_lock);\n \t\tfdb = fdb_create(br, dst, addr, vid, flags);\n \t\tif (fdb) {\n \t\t\ttrace_br_fdb_update(br, source, addr, vid, flags);\n-\t\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, true);\n+\t\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, portid, true);\n \t\t}\n \t\tspin_unlock(\u0026br-\u003ehash_lock);\n \t}\n }\n \n+void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,\n+\t\t   struct net_bridge_vlan *vlan, const unsigned char *addr,\n+\t\t   unsigned long flags)\n+{\n+\t__br_fdb_update(br, source, vlan, addr, flags, 0);\n+}\n+\n /* Dump information about entries, in response to GETNEIGH */\n int br_fdb_dump(struct sk_buff *skb,\n \t\tstruct netlink_callback *cb,\n@@ -1146,25 +1156,22 @@ int br_fdb_dump(struct sk_buff *skb,\n \n int br_fdb_get(struct sk_buff *skb,\n \t       struct nlattr *tb[],\n-\t       struct net_device *dev,\n-\t       const unsigned char *addr,\n-\t       u16 vid, u32 portid, u32 seq,\n+\t       const struct ndo_fdb_parms *parms, u32 seq,\n \t       struct netlink_ext_ack *extack)\n {\n-\tstruct net_bridge *br = netdev_priv(dev);\n+\tstruct net_bridge *br = netdev_priv(parms-\u003edev);\n \tstruct net_bridge_fdb_entry *f;\n \tint err = 0;\n \n \trcu_read_lock();\n-\tf = br_fdb_find_rcu(br, addr, vid);\n+\tf = br_fdb_find_rcu(br, parms-\u003eaddr, parms-\u003evid);\n \tif (!f) {\n \t\tNL_SET_ERR_MSG(extack, \"Fdb entry not found\");\n \t\terr = -ENOENT;\n \t\tgoto errout;\n \t}\n \n-\terr = fdb_fill_info(skb, br, f, portid, seq,\n-\t\t\t    RTM_NEWNEIGH, 0);\n+\terr = fdb_fill_info(skb, br, f, parms-\u003eportid, seq, RTM_NEWNEIGH, 0);\n errout:\n \trcu_read_unlock();\n \treturn err;\n@@ -1212,7 +1219,7 @@ static bool fdb_update_dst(struct net_bridge_fdb_entry *fdb,\n \n /* Update (create or replace) forwarding database entry */\n static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,\n-\t\t\t const u8 *addr, struct ndmsg *ndm, u16 flags, u16 vid,\n+\t\t\t struct ndmsg *ndm, const struct ndo_fdb_parms *parms,\n \t\t\t struct nlattr *nfea_tb[])\n {\n \tstruct net_bridge_port *source = br_dst_port(dst);\n@@ -1245,12 +1252,12 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,\n \t\t\treturn -EINVAL;\n \t}\n \n-\tfdb = br_fdb_find(br, addr, vid);\n+\tfdb = br_fdb_find(br, parms-\u003eaddr, parms-\u003evid);\n \tif (fdb == NULL) {\n-\t\tif (!(flags \u0026 NLM_F_CREATE))\n+\t\tif (!(parms-\u003eflags \u0026 NLM_F_CREATE))\n \t\t\treturn -ENOENT;\n \n-\t\tfdb = fdb_create(br, dst, addr, vid,\n+\t\tfdb = fdb_create(br, dst, parms-\u003eaddr, parms-\u003evid,\n \t\t\t\t BIT(BR_FDB_ADDED_BY_USER));\n \t\tif (!fdb)\n \t\t\treturn -ENOMEM;\n@@ -1259,7 +1266,7 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,\n \t} else {\n \t\tstruct net_bridge_dst old_dst;\n \n-\t\tif (flags \u0026 NLM_F_EXCL)\n+\t\tif (parms-\u003eflags \u0026 NLM_F_EXCL)\n \t\t\treturn -EEXIST;\n \n \t\told_dst = br_fdb_dst_read(fdb);\n@@ -1274,15 +1281,15 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,\n \t\tif (state \u0026 NUD_PERMANENT) {\n \t\t\tset_bit(BR_FDB_LOCAL, \u0026fdb-\u003eflags);\n \t\t\tif (!test_and_set_bit(BR_FDB_STATIC, \u0026fdb-\u003eflags))\n-\t\t\t\tfdb_add_hw_addr(br, addr);\n+\t\t\t\tfdb_add_hw_addr(br, parms-\u003eaddr);\n \t\t} else if (state \u0026 NUD_NOARP) {\n \t\t\tclear_bit(BR_FDB_LOCAL, \u0026fdb-\u003eflags);\n \t\t\tif (!test_and_set_bit(BR_FDB_STATIC, \u0026fdb-\u003eflags))\n-\t\t\t\tfdb_add_hw_addr(br, addr);\n+\t\t\t\tfdb_add_hw_addr(br, parms-\u003eaddr);\n \t\t} else {\n \t\t\tclear_bit(BR_FDB_LOCAL, \u0026fdb-\u003eflags);\n \t\t\tif (test_and_clear_bit(BR_FDB_STATIC, \u0026fdb-\u003eflags))\n-\t\t\t\tfdb_del_hw_addr(br, addr);\n+\t\t\t\tfdb_del_hw_addr(br, parms-\u003eaddr);\n \t\t}\n \n \t\tmodified = true;\n@@ -1303,19 +1310,18 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,\n \tif (modified) {\n \t\tif (refresh)\n \t\t\tWRITE_ONCE(fdb-\u003eupdated, jiffies);\n-\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, true);\n+\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, parms-\u003eportid, true);\n \t}\n \n \treturn 0;\n }\n \n static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,\n-\t\t\tstruct net_bridge_port *p, const unsigned char *addr,\n-\t\t\tu16 nlh_flags, struct net_bridge_vlan *vlan,\n-\t\t\tstruct nlattr *nfea_tb[],\n+\t\t\tstruct net_bridge_port *p,\n+\t\t\tconst struct ndo_fdb_parms *parms,\n+\t\t\tstruct net_bridge_vlan *vlan, struct nlattr *nfea_tb[],\n \t\t\tbool *notified, struct netlink_ext_ack *extack)\n {\n-\tu16 vid = vlan ? vlan-\u003evid : 0;\n \tstruct net_bridge_dst dst;\n \tint err = 0;\n \n@@ -1330,7 +1336,8 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,\n \n \t\tlocal_bh_disable();\n \t\trcu_read_lock();\n-\t\tbr_fdb_update(br, p, vlan, addr, BIT(BR_FDB_ADDED_BY_USER));\n+\t\t__br_fdb_update(br, p, vlan, parms-\u003eaddr,\n+\t\t\t\tBIT(BR_FDB_ADDED_BY_USER), parms-\u003eportid);\n \t\trcu_read_unlock();\n \t\tlocal_bh_enable();\n \t} else if (ndm-\u003endm_flags \u0026 NTF_EXT_LEARNED) {\n@@ -1339,12 +1346,12 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,\n \t\t\t\t\t   \"FDB entry towards bridge must be permanent\");\n \t\t\treturn -EINVAL;\n \t\t}\n-\t\terr = br_fdb_external_learn_add(br, p, addr, vid, false, true);\n+\t\terr = br_fdb_external_learn_add(br, p, parms-\u003eaddr, parms-\u003evid,\n+\t\t\t\t\t\tfalse, parms-\u003eportid, true);\n \t} else {\n \t\tdst = p \u0026\u0026 vlan ? br_vlan_to_dst(vlan) : br_port_to_dst(p);\n \t\tspin_lock_bh(\u0026br-\u003ehash_lock);\n-\t\terr = fdb_add_entry(br, dst, addr, ndm, nlh_flags, vid,\n-\t\t\t\t    nfea_tb);\n+\t\terr = fdb_add_entry(br, dst, ndm, parms, nfea_tb);\n \t\tspin_unlock_bh(\u0026br-\u003ehash_lock);\n \t}\n \n@@ -1360,9 +1367,8 @@ static const struct nla_policy br_nda_fdb_pol[NFEA_MAX + 1] = {\n \n /* Add new permanent fdb entry with RTM_NEWNEIGH */\n int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n-\t       struct net_device *dev,\n-\t       const unsigned char *addr, u16 vid, u16 nlh_flags,\n-\t       bool *notified, struct netlink_ext_ack *extack)\n+\t       const struct ndo_fdb_parms *parms, bool *notified,\n+\t       struct netlink_ext_ack *extack)\n {\n \tstruct nlattr *nfea_tb[NFEA_MAX + 1], *attr;\n \tstruct net_bridge_vlan_group *vg;\n@@ -1372,26 +1378,27 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \tu32 ext_flags = 0;\n \tint err = 0;\n \n-\ttrace_br_fdb_add(ndm, dev, addr, vid, nlh_flags);\n+\ttrace_br_fdb_add(ndm, parms-\u003edev, parms-\u003eaddr, parms-\u003evid,\n+\t\t\t parms-\u003eflags);\n \n \tif (!(ndm-\u003endm_state \u0026 (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE))) {\n \t\tpr_info(\"bridge: RTM_NEWNEIGH with invalid state %#x\\n\", ndm-\u003endm_state);\n \t\treturn -EINVAL;\n \t}\n \n-\tif (is_zero_ether_addr(addr)) {\n+\tif (is_zero_ether_addr(parms-\u003eaddr)) {\n \t\tpr_info(\"bridge: RTM_NEWNEIGH with invalid ether address\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\tif (netif_is_bridge_master(dev)) {\n-\t\tbr = netdev_priv(dev);\n+\tif (netif_is_bridge_master(parms-\u003edev)) {\n+\t\tbr = netdev_priv(parms-\u003edev);\n \t\tvg = br_vlan_group(br);\n \t} else {\n-\t\tp = br_port_get_rtnl(dev);\n+\t\tp = br_port_get_rtnl(parms-\u003edev);\n \t\tif (!p) {\n \t\t\tpr_info(\"bridge: RTM_NEWNEIGH %s not a bridge port\\n\",\n-\t\t\t\tdev-\u003ename);\n+\t\t\t\tparms-\u003edev-\u003ename);\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tbr = p-\u003ebr;\n@@ -1416,19 +1423,20 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \t\tmemset(nfea_tb, 0, sizeof(struct nlattr *) * (NFEA_MAX + 1));\n \t}\n \n-\tif (vid) {\n-\t\tv = br_vlan_find(vg, vid);\n+\tif (parms-\u003evid) {\n+\t\tv = br_vlan_find(vg, parms-\u003evid);\n \t\tif (!v || !br_vlan_should_use(v)) {\n-\t\t\tpr_info(\"bridge: RTM_NEWNEIGH with unconfigured vlan %d on %s\\n\", vid, dev-\u003ename);\n+\t\t\tpr_info(\"bridge: RTM_NEWNEIGH with unconfigured vlan %d on %s\\n\",\n+\t\t\t\tparms-\u003evid, parms-\u003edev-\u003ename);\n \t\t\treturn -EINVAL;\n \t\t}\n \n \t\t/* VID was specified, so use it. */\n-\t\terr = __br_fdb_add(ndm, br, p, addr, nlh_flags, v, nfea_tb,\n-\t\t\t\t   notified, extack);\n+\t\terr = __br_fdb_add(ndm, br, p, parms, v, nfea_tb, notified,\n+\t\t\t\t   extack);\n \t} else {\n-\t\terr = __br_fdb_add(ndm, br, p, addr, nlh_flags, NULL, nfea_tb,\n-\t\t\t\t   notified, extack);\n+\t\terr = __br_fdb_add(ndm, br, p, parms, NULL, nfea_tb, notified,\n+\t\t\t\t   extack);\n \t\tif (err || !vg || !vg-\u003enum_vlans)\n \t\t\tgoto out;\n \n@@ -1437,10 +1445,13 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \t\t * vlan on this port.\n \t\t */\n \t\tlist_for_each_entry(v, \u0026vg-\u003evlan_list, vlist) {\n+\t\t\tstruct ndo_fdb_parms vparms = *parms;\n+\n \t\t\tif (!br_vlan_should_use(v))\n \t\t\t\tcontinue;\n-\t\t\terr = __br_fdb_add(ndm, br, p, addr, nlh_flags, v,\n-\t\t\t\t\t   nfea_tb, notified, extack);\n+\t\t\tvparms.vid = v-\u003evid;\n+\t\t\terr = __br_fdb_add(ndm, br, p, \u0026vparms, v, nfea_tb,\n+\t\t\t\t\t   notified, extack);\n \t\t\tif (err)\n \t\t\t\tgoto out;\n \t\t}\n@@ -1452,7 +1463,8 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n \n static int fdb_delete_by_addr_and_port(struct net_bridge *br,\n \t\t\t\t       const struct net_bridge_port *p,\n-\t\t\t\t       const u8 *addr, u16 vlan, bool *notified)\n+\t\t\t\t       const u8 *addr, u16 vlan, u32 portid,\n+\t\t\t\t       bool *notified)\n {\n \tstruct net_bridge_fdb_entry *fdb;\n \n@@ -1460,7 +1472,7 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br,\n \tif (!fdb || br_fdb_dst_port(fdb) != p)\n \t\treturn -ENOENT;\n \n-\tfdb_delete(br, fdb, true);\n+\tfdb_delete(br, fdb, portid, true);\n \t*notified = true;\n \n \treturn 0;\n@@ -1468,12 +1480,13 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br,\n \n static int __br_fdb_delete(struct net_bridge *br,\n \t\t\t   const struct net_bridge_port *p,\n-\t\t\t   const unsigned char *addr, u16 vid, bool *notified)\n+\t\t\t   const unsigned char *addr, u16 vid, u32 portid,\n+\t\t\t   bool *notified)\n {\n \tint err;\n \n \tspin_lock_bh(\u0026br-\u003ehash_lock);\n-\terr = fdb_delete_by_addr_and_port(br, p, addr, vid, notified);\n+\terr = fdb_delete_by_addr_and_port(br, p, addr, vid, portid, notified);\n \tspin_unlock_bh(\u0026br-\u003ehash_lock);\n \n \treturn err;\n@@ -1481,8 +1494,7 @@ static int __br_fdb_delete(struct net_bridge *br,\n \n /* Remove neighbor entry with RTM_DELNEIGH */\n int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t  struct net_device *dev,\n-\t\t  const unsigned char *addr, u16 vid, bool *notified,\n+\t\t  const struct ndo_fdb_parms *parms, bool *notified,\n \t\t  struct netlink_ext_ack *extack)\n {\n \tstruct net_bridge_vlan_group *vg;\n@@ -1490,34 +1502,37 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],\n \tstruct net_bridge *br;\n \tint err;\n \n-\tif (netif_is_bridge_master(dev)) {\n-\t\tbr = netdev_priv(dev);\n+\tif (netif_is_bridge_master(parms-\u003edev)) {\n+\t\tbr = netdev_priv(parms-\u003edev);\n \t\tvg = br_vlan_group(br);\n \t} else {\n-\t\tp = br_port_get_rtnl(dev);\n+\t\tp = br_port_get_rtnl(parms-\u003edev);\n \t\tif (!p) {\n \t\t\tpr_info(\"bridge: RTM_DELNEIGH %s not a bridge port\\n\",\n-\t\t\t\tdev-\u003ename);\n+\t\t\t\tparms-\u003edev-\u003ename);\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tvg = nbp_vlan_group(p);\n \t\tbr = p-\u003ebr;\n \t}\n \n-\tif (vid) {\n-\t\terr = __br_fdb_delete(br, p, addr, vid, notified);\n+\tif (parms-\u003evid) {\n+\t\terr = __br_fdb_delete(br, p, parms-\u003eaddr, parms-\u003evid,\n+\t\t\t\t      parms-\u003eportid, notified);\n \t} else {\n \t\tstruct net_bridge_vlan *v;\n \n \t\terr = -ENOENT;\n-\t\terr \u0026= __br_fdb_delete(br, p, addr, 0, notified);\n+\t\terr \u0026= __br_fdb_delete(br, p, parms-\u003eaddr, 0, parms-\u003eportid,\n+\t\t\t\t       notified);\n \t\tif (!vg || !vg-\u003enum_vlans)\n \t\t\treturn err;\n \n \t\tlist_for_each_entry(v, \u0026vg-\u003evlan_list, vlist) {\n \t\t\tif (!br_vlan_should_use(v))\n \t\t\t\tcontinue;\n-\t\t\terr \u0026= __br_fdb_delete(br, p, addr, v-\u003evid, notified);\n+\t\t\terr \u0026= __br_fdb_delete(br, p, parms-\u003eaddr, v-\u003evid,\n+\t\t\t\t\t       parms-\u003eportid, notified);\n \t\t}\n \t}\n \n@@ -1598,7 +1613,7 @@ static struct net_bridge_dst br_fdb_resolve_dst(const struct net_bridge_port *p,\n \n int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,\n \t\t\t      const unsigned char *addr, u16 vid, bool locked,\n-\t\t\t      bool swdev_notify)\n+\t\t\t      u32 portid, bool swdev_notify)\n {\n \tstruct net_bridge_dst dst = br_fdb_resolve_dst(p, vid);\n \tstruct net_bridge_fdb_entry *fdb;\n@@ -1630,7 +1645,7 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,\n \t\t\terr = -ENOMEM;\n \t\t\tgoto err_unlock;\n \t\t}\n-\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);\n+\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, portid, swdev_notify);\n \t} else {\n \t\tstruct net_bridge_dst old_dst;\n \n@@ -1669,7 +1684,7 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,\n \t\t\tatomic_dec(\u0026br-\u003efdb_n_learned);\n \n \t\tif (modified)\n-\t\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);\n+\t\t\tfdb_notify(br, fdb, RTM_NEWNEIGH, portid, swdev_notify);\n \t}\n \n err_unlock:\n@@ -1689,7 +1704,7 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,\n \n \tfdb = br_fdb_find(br, addr, vid);\n \tif (fdb \u0026\u0026 test_bit(BR_FDB_ADDED_BY_EXT_LEARN, \u0026fdb-\u003eflags))\n-\t\tfdb_delete(br, fdb, swdev_notify);\n+\t\tfdb_delete(br, fdb, 0, swdev_notify);\n \telse\n \t\terr = -ENOENT;\n \ndiff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c\nindex 79c4a54990e26b..0a1dd507bbff85 100644\n--- a/net/bridge/br_netlink.c\n+++ b/net/bridge/br_netlink.c\n@@ -1001,7 +1001,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[],\n \t\t\t.port_ifindex = p-\u003edev-\u003eifindex,\n \t\t};\n \n-\t\tbr_fdb_flush(p-\u003ebr, \u0026desc);\n+\t\tbr_fdb_flush(p-\u003ebr, \u0026desc, 0);\n \t}\n \n \tchanged_mask = old_flags ^ flags;\n@@ -1431,7 +1431,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],\n \t\t\t.flags_mask = BIT(BR_FDB_STATIC)\n \t\t};\n \n-\t\tbr_fdb_flush(br, \u0026desc);\n+\t\tbr_fdb_flush(br, \u0026desc, 0);\n \t}\n \n #ifdef CONFIG_BRIDGE_IGMP_SNOOPING\ndiff --git a/net/bridge/br_private.h b/net/bridge/br_private.h\nindex 014d0b8db8c732..83f2b77289476c 100644\n--- a/net/bridge/br_private.h\n+++ b/net/bridge/br_private.h\n@@ -992,7 +992,7 @@ void br_fdb_fini(void);\n int br_fdb_hash_init(struct net_bridge *br);\n void br_fdb_hash_fini(struct net_bridge *br);\n void br_fdb_flush(struct net_bridge *br,\n-\t\t  const struct net_bridge_fdb_flush_desc *desc);\n+\t\t  const struct net_bridge_fdb_flush_desc *desc, u32 portid);\n void br_fdb_find_delete_local(struct net_bridge *br,\n \t\t\t      const struct net_bridge_port *p,\n \t\t\t      const unsigned char *addr, u16 vid);\n@@ -1015,23 +1015,23 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,\n \t\t   unsigned long flags);\n \n int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],\n-\t\t  struct net_device *dev, const unsigned char *addr, u16 vid,\n-\t\t  bool *notified, struct netlink_ext_ack *extack);\n+\t\t  const struct ndo_fdb_parms *parms, bool *notified,\n+\t\t  struct netlink_ext_ack *extack);\n int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,\n-\t\t       struct netlink_ext_ack *extack);\n-int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev,\n-\t       const unsigned char *addr, u16 vid, u16 nlh_flags,\n-\t       bool *notified, struct netlink_ext_ack *extack);\n+\t\t       u32 portid, struct netlink_ext_ack *extack);\n+int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[],\n+\t       const struct ndo_fdb_parms *parms, bool *notified,\n+\t       struct netlink_ext_ack *extack);\n int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,\n \t\tstruct net_device *dev, struct net_device *fdev, int *idx);\n-int br_fdb_get(struct sk_buff *skb, struct nlattr *tb[], struct net_device *dev,\n-\t       const unsigned char *addr, u16 vid, u32 portid, u32 seq,\n+int br_fdb_get(struct sk_buff *skb, struct nlattr *tb[],\n+\t       const struct ndo_fdb_parms *parms, u32 seq,\n \t       struct netlink_ext_ack *extack);\n int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p);\n void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p);\n int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,\n \t\t\t      const unsigned char *addr, u16 vid,\n-\t\t\t      bool locked, bool swdev_notify);\n+\t\t\t      bool locked, u32 portid, bool swdev_notify);\n int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,\n \t\t\t      const unsigned char *addr, u16 vid,\n \t\t\t      bool swdev_notify);\ndiff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c\nindex d2993f187f5738..3a05764e607a16 100644\n--- a/net/bridge/br_sysfs_br.c\n+++ b/net/bridge/br_sysfs_br.c\n@@ -349,7 +349,7 @@ static int set_flush(struct net_bridge *br, unsigned long val,\n \t\t.flags_mask = BIT(BR_FDB_STATIC)\n \t};\n \n-\tbr_fdb_flush(br, \u0026desc);\n+\tbr_fdb_flush(br, \u0026desc, 0);\n \treturn 0;\n }\n \ndiff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c\nindex e141340172ce39..51713666f0e350 100644\n--- a/net/core/rtnetlink.c\n+++ b/net/core/rtnetlink.c\n@@ -4721,7 +4721,7 @@ static inline size_t rtnl_fdb_nlmsg_size(const struct net_device *dev)\n }\n \n static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,\n-\t\t\t    u16 ndm_state)\n+\t\t\t    u16 ndm_state, u32 portid)\n {\n \tstruct net *net = dev_net(dev);\n \tstruct sk_buff *skb;\n@@ -4732,7 +4732,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,\n \t\tgoto errout;\n \n \terr = nlmsg_populate_fdb_fill(skb, dev, addr, vid,\n-\t\t\t\t      0, 0, type, NTF_SELF, 0, ndm_state);\n+\t\t\t\t      portid, 0, type, NTF_SELF, 0, ndm_state);\n \tif (err \u003c 0) {\n \t\tkfree_skb(skb);\n \t\tgoto errout;\n@@ -4749,9 +4749,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,\n  */\n int ndo_dflt_fdb_add(struct ndmsg *ndm,\n \t\t     struct nlattr *tb[],\n-\t\t     struct net_device *dev,\n-\t\t     const unsigned char *addr, u16 vid,\n-\t\t     u16 flags)\n+\t\t     const struct ndo_fdb_parms *parms)\n {\n \tint err = -EINVAL;\n \n@@ -4759,27 +4757,28 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,\n \t * implement its own handler for this.\n \t */\n \tif (ndm-\u003endm_state \u0026\u0026 !(ndm-\u003endm_state \u0026 NUD_PERMANENT)) {\n-\t\tnetdev_info(dev, \"default FDB implementation only supports local addresses\\n\");\n+\t\tnetdev_info(parms-\u003edev, \"default FDB implementation only supports local addresses\\n\");\n \t\treturn err;\n \t}\n \n \tif (tb[NDA_FLAGS_EXT]) {\n-\t\tnetdev_info(dev, \"invalid flags given to default FDB implementation\\n\");\n+\t\tnetdev_info(parms-\u003edev, \"invalid flags given to default FDB implementation\\n\");\n \t\treturn err;\n \t}\n \n-\tif (vid) {\n-\t\tnetdev_info(dev, \"vlans aren't supported yet for dev_uc|mc_add()\\n\");\n+\tif (parms-\u003evid) {\n+\t\tnetdev_info(parms-\u003edev, \"vlans aren't supported yet for dev_uc|mc_add()\\n\");\n \t\treturn err;\n \t}\n \n-\tif (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))\n-\t\terr = dev_uc_add_excl(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_add_excl(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr) ||\n+\t    is_link_local_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_add_excl(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_add_excl(parms-\u003edev, parms-\u003eaddr);\n \n \t/* Only return duplicate errors if NLM_F_EXCL is set */\n-\tif (err == -EEXIST \u0026\u0026 !(flags \u0026 NLM_F_EXCL))\n+\tif (err == -EEXIST \u0026\u0026 !(parms-\u003eflags \u0026 NLM_F_EXCL))\n \t\terr = 0;\n \n \treturn err;\n@@ -4814,6 +4813,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\n \tstruct net *net = sock_net(skb-\u003esk);\n \tstruct ndmsg *ndm;\n \tstruct nlattr *tb[NDA_MAX+1];\n+\tstruct ndo_fdb_parms parms;\n \tstruct net_device *dev;\n \tu8 *addr;\n \tu16 vid;\n@@ -4852,6 +4852,14 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\n \tif (err)\n \t\treturn err;\n \n+\tparms = (struct ndo_fdb_parms) {\n+\t\t.dev = dev,\n+\t\t.addr = addr,\n+\t\t.vid = vid,\n+\t\t.flags = nlh-\u003enlmsg_flags,\n+\t\t.portid = NETLINK_CB(skb).portid,\n+\t};\n+\n \terr = -EOPNOTSUPP;\n \n \t/* Support fdb on master device the net/bridge default case */\n@@ -4861,8 +4869,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\n \t\tconst struct net_device_ops *ops = br_dev-\u003enetdev_ops;\n \t\tbool notified = false;\n \n-\t\terr = ops-\u003endo_fdb_add(ndm, tb, dev, addr, vid,\n-\t\t\t\t       nlh-\u003enlmsg_flags, \u0026notified, extack);\n+\t\terr = ops-\u003endo_fdb_add(ndm, tb, \u0026parms, \u0026notified, extack);\n \t\tif (err)\n \t\t\tgoto out;\n \t\telse\n@@ -4874,17 +4881,14 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\n \t\tbool notified = false;\n \n \t\tif (dev-\u003enetdev_ops-\u003endo_fdb_add)\n-\t\t\terr = dev-\u003enetdev_ops-\u003endo_fdb_add(ndm, tb, dev, addr,\n-\t\t\t\t\t\t\t   vid,\n-\t\t\t\t\t\t\t   nlh-\u003enlmsg_flags,\n+\t\t\terr = dev-\u003enetdev_ops-\u003endo_fdb_add(ndm, tb, \u0026parms,\n \t\t\t\t\t\t\t   \u0026notified, extack);\n \t\telse\n-\t\t\terr = ndo_dflt_fdb_add(ndm, tb, dev, addr, vid,\n-\t\t\t\t\t       nlh-\u003enlmsg_flags);\n+\t\t\terr = ndo_dflt_fdb_add(ndm, tb, \u0026parms);\n \n \t\tif (!err \u0026\u0026 !notified) {\n \t\t\trtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH,\n-\t\t\t\t\tndm-\u003endm_state);\n+\t\t\t\t\tndm-\u003endm_state, parms.portid);\n \t\t\tndm-\u003endm_flags \u0026= ~NTF_SELF;\n \t\t}\n \t}\n@@ -4897,8 +4901,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\n  */\n int ndo_dflt_fdb_del(struct ndmsg *ndm,\n \t\t     struct nlattr *tb[],\n-\t\t     struct net_device *dev,\n-\t\t     const unsigned char *addr, u16 vid)\n+\t\t     const struct ndo_fdb_parms *parms)\n {\n \tint err = -EINVAL;\n \n@@ -4906,14 +4909,15 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm,\n \t * implement its own handler for this.\n \t */\n \tif (!(ndm-\u003endm_state \u0026 NUD_PERMANENT)) {\n-\t\tnetdev_info(dev, \"default FDB implementation only supports local addresses\\n\");\n+\t\tnetdev_info(parms-\u003edev, \"default FDB implementation only supports local addresses\\n\");\n \t\treturn err;\n \t}\n \n-\tif (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))\n-\t\terr = dev_uc_del(dev, addr);\n-\telse if (is_multicast_ether_addr(addr))\n-\t\terr = dev_mc_del(dev, addr);\n+\tif (is_unicast_ether_addr(parms-\u003eaddr) ||\n+\t    is_link_local_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_uc_del(parms-\u003edev, parms-\u003eaddr);\n+\telse if (is_multicast_ether_addr(parms-\u003eaddr))\n+\t\terr = dev_mc_del(parms-\u003edev, parms-\u003eaddr);\n \n \treturn err;\n }\n@@ -4924,9 +4928,11 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n {\n \tbool del_bulk = !!(nlh-\u003enlmsg_flags \u0026 NLM_F_BULK);\n \tstruct net *net = sock_net(skb-\u003esk);\n+\tu32 portid = NETLINK_CB(skb).portid;\n \tconst struct net_device_ops *ops;\n \tstruct ndmsg *ndm;\n \tstruct nlattr *tb[NDA_MAX+1];\n+\tstruct ndo_fdb_parms parms;\n \tstruct net_device *dev;\n \t__u8 *addr = NULL;\n \tint err;\n@@ -4966,6 +4972,13 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n \t\terr = fdb_vid_parse(tb[NDA_VLAN], \u0026vid, extack);\n \t\tif (err)\n \t\t\treturn err;\n+\n+\t\tparms = (struct ndo_fdb_parms) {\n+\t\t\t.dev = dev,\n+\t\t\t.addr = addr,\n+\t\t\t.vid = vid,\n+\t\t\t.portid = portid,\n+\t\t};\n \t}\n \n \tif (dev-\u003etype != ARPHRD_ETHER) {\n@@ -4984,11 +4997,12 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n \t\tops = br_dev-\u003enetdev_ops;\n \t\tif (!del_bulk) {\n \t\t\tif (ops-\u003endo_fdb_del)\n-\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, dev, addr, vid,\n+\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\n \t\t\t\t\t\t       \u0026notified, extack);\n \t\t} else {\n \t\t\tif (ops-\u003endo_fdb_del_bulk)\n-\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, extack);\n+\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, portid,\n+\t\t\t\t\t\t\t    extack);\n \t\t}\n \n \t\tif (err)\n@@ -5004,21 +5018,22 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n \t\tops = dev-\u003enetdev_ops;\n \t\tif (!del_bulk) {\n \t\t\tif (ops-\u003endo_fdb_del)\n-\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, dev, addr, vid,\n+\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\n \t\t\t\t\t\t       \u0026notified, extack);\n \t\t\telse\n-\t\t\t\terr = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid);\n+\t\t\t\terr = ndo_dflt_fdb_del(ndm, tb, \u0026parms);\n \t\t} else {\n \t\t\t/* in case err was cleared by NTF_MASTER call */\n \t\t\terr = -EOPNOTSUPP;\n \t\t\tif (ops-\u003endo_fdb_del_bulk)\n-\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, extack);\n+\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, portid,\n+\t\t\t\t\t\t\t    extack);\n \t\t}\n \n \t\tif (!err) {\n \t\t\tif (!del_bulk \u0026\u0026 !notified)\n \t\t\t\trtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH,\n-\t\t\t\t\t\tndm-\u003endm_state);\n+\t\t\t\t\t\tndm-\u003endm_state, portid);\n \t\t\tndm-\u003endm_flags \u0026= ~NTF_SELF;\n \t\t}\n \t}\n@@ -5327,6 +5342,7 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,\n \tconst struct net_device_ops *ops = NULL;\n \tstruct net *net = sock_net(in_skb-\u003esk);\n \tstruct nlattr *tb[NDA_MAX + 1];\n+\tstruct ndo_fdb_parms parms;\n \tstruct sk_buff *skb;\n \tint brport_idx = 0;\n \tu8 ndm_flags = 0;\n@@ -5404,9 +5420,15 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,\n \n \tif (br_dev)\n \t\tdev = br_dev;\n-\terr = ops-\u003endo_fdb_get(skb, tb, dev, addr, vid,\n-\t\t\t       NETLINK_CB(in_skb).portid,\n-\t\t\t       nlh-\u003enlmsg_seq, extack);\n+\n+\tparms = (struct ndo_fdb_parms) {\n+\t\t.dev = dev,\n+\t\t.addr = addr,\n+\t\t.vid = vid,\n+\t\t.portid = NETLINK_CB(in_skb).portid,\n+\t};\n+\n+\terr = ops-\u003endo_fdb_get(skb, tb, \u0026parms, nlh-\u003enlmsg_seq, extack);\n \tif (err)\n \t\tgoto out;\n \ndiff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py\nindex fb5acb8acded11..0e9bcd0f259916 100644\n--- a/tools/net/ynl/pyynl/lib/ynl.py\n+++ b/tools/net/ynl/pyynl/lib/ynl.py\n@@ -61,6 +61,8 @@ class Netlink:\n     NLM_F_CREATE = 0x400\n     NLM_F_APPEND = 0x800\n \n+    NLM_F_BULK = 0x200\n+\n     NLM_F_CAPPED = 0x100\n     NLM_F_ACK_TLVS = 0x200\n \ndiff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile\nindex fb0a64662053fc..fafe30367243da 100644\n--- a/tools/testing/selftests/net/Makefile\n+++ b/tools/testing/selftests/net/Makefile\n@@ -35,6 +35,7 @@ TEST_PROGS := \\\n \tfcnal-other.sh \\\n \tfdb_flush.sh \\\n \tfdb_notify.sh \\\n+\tfdb_notify_portid.py \\\n \tfib-onlink-tests.sh \\\n \tfib_nexthop_multiprefix.sh \\\n \tfib_nexthop_nongw.sh \\\ndiff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config\nindex dab62cdfa27bad..18dfb45fb914e5 100644\n--- a/tools/testing/selftests/net/config\n+++ b/tools/testing/selftests/net/config\n@@ -126,6 +126,7 @@ CONFIG_NFT_COMPAT=m\n CONFIG_NFT_NAT=m\n CONFIG_NUMA=y\n CONFIG_OPENVSWITCH=m\n+CONFIG_PACKET=y\n CONFIG_PAGE_POOL_STATS=y\n CONFIG_PSAMPLE=m\n CONFIG_RPS=y\ndiff --git a/tools/testing/selftests/net/fdb_notify_portid.py b/tools/testing/selftests/net/fdb_notify_portid.py\nnew file mode 100755\nindex 00000000000000..b7b398aa8040a5\n--- /dev/null\n+++ b/tools/testing/selftests/net/fdb_notify_portid.py\n@@ -0,0 +1,297 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: GPL-2.0\n+\n+\"\"\"\n+Check that FDB notifications carry the netlink port ID of the requester in\n+nlmsg_pid. A listener socket subscribed to the neighbour group receives the\n+notifications, while separate requester sockets make the changes. The port ID\n+the listener sees is expected to match that of the requester socket.\n+\"\"\"\n+\n+import socket\n+import struct\n+from collections import namedtuple\n+\n+from lib.py import ksft_run, ksft_exit, ksft_eq, ksft_ne, ksft_true\n+from lib.py import ksft_busy_wait\n+from lib.py import ip, tool\n+from lib.py import NetNS, NetNSEnter\n+from lib.py import Netlink, RtnlNeighFamily\n+\n+RTM_NEWNEIGH = 28\n+RTM_DELNEIGH = 29\n+\n+NTF_SELF = 0x02\n+NTF_MASTER = 0x04\n+\n+NUD_NOARP = 0x40\n+NUD_PERMANENT = 0x80\n+\n+ETH_P_EXP1 = 0x88b5  # Local Experimental EtherType 1\n+\n+Ntf = namedtuple(\"Ntf\", \"type portid addr\")\n+\n+\n+class Env:\n+    \"\"\"The listener socket, the two requester sockets A and B, and the\n+    netlink port IDs of the latter. All sockets live in the given netns.\"\"\"\n+\n+    @staticmethod\n+    def _socket(ns):\n+        with NetNSEnter(ns):\n+            rtnl = RtnlNeighFamily()\n+        return rtnl\n+\n+    def __init__(self, ns):\n+        self.ns = str(ns)\n+\n+        self.listener = self._socket(ns)\n+        self.listener.include_raw = True\n+        self.listener.ntf_subscribe(\"rtnlgrp-neigh\")\n+\n+        self.a = self._socket(ns)\n+        self.a.sock.bind((0, 0))\n+\n+        self.b = self._socket(ns)\n+        self.b.sock.bind((0, 0))\n+\n+        self.portids = {self.a: self.a.sock.getsockname()[0],\n+                        self.b: self.b.sock.getsockname()[0]}\n+\n+        ksft_ne(self.portids[self.a], self.portids[self.b])\n+        ksft_ne(self.portids[self.a], 0)\n+\n+    def ifindex(self, name):\n+        \"\"\"Look up the ifindex of a device in the test netns.\"\"\"\n+        with NetNSEnter(self.ns):\n+            return socket.if_nametoindex(name)\n+\n+    def ntfs(self):\n+        \"\"\"Return the bridge-family notifications received by the listener.\"\"\"\n+        self.listener.check_ntf()\n+        ntfs = []\n+        while self.listener.async_msg_queue.qsize() \u003e 0:\n+            msg = self.listener.async_msg_queue.get()\n+            if msg['msg']['ndm-family'] == socket.AF_BRIDGE:\n+                ntfs.append(Ntf(msg['raw'].nl_type, msg['raw'].nl_portid,\n+                                msg['msg']['lladdr']))\n+        return ntfs\n+\n+    def check_ntfs(self, nl_type, addr, requester, count=1):\n+        \"\"\"Expect count notifications for addr, all from the requester.\"\"\"\n+        portids = [n.portid for n in self.ntfs()\n+                   if n.type == nl_type and n.addr == addr]\n+        ksft_eq(portids, [self.portids[requester]] * count,\n+                f\"nlmsg_pid of {addr} notifications\")\n+\n+\n+def fdb_req(ifindex, ndm_flags, attrs):\n+    \"\"\"Build an AF_BRIDGE neighbour request with the given attributes.\"\"\"\n+    return {'ndm-family': socket.AF_BRIDGE, 'ndm-ifindex': ifindex,\n+            'ndm-flags': ndm_flags, **attrs}\n+\n+\n+def test_msg(env, sock, message, message_type,\n+             ifindex, addr, ndm_flags, flags, count, attrs):\n+    \"\"\"Send one request through SOCK, and expect COUNT notifications of\n+    MESSAGE_TYPE about ADDR carrying the port ID of SOCK.\"\"\"\n+    # pylint: disable=too-many-arguments,too-many-positional-arguments\n+    req = fdb_req(ifindex, ndm_flags, attrs | {\"lladdr\": addr})\n+    sock.do(message, req, flags)\n+    env.check_ntfs(message_type, addr, sock, count)\n+\n+\n+def add_replace_del(env, ifname, addr, ndm_flags, *, add, rep, dlt, count=1):\n+    \"\"\"Add an entry through socket A, replace it through B, delete through A.\n+    ADD, REP and DLT are the attributes of the respective requests. If REP is\n+    None, the replace step is skipped.\"\"\"\n+    # pylint: disable=too-many-arguments\n+    ifindex = env.ifindex(ifname)\n+\n+    test_msg(env, env.a, 'newneigh', RTM_NEWNEIGH, ifindex, addr, ndm_flags,\n+             flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_EXCL],\n+             count=count, attrs=add)\n+\n+    if rep is not None:\n+        test_msg(env, env.b, 'newneigh', RTM_NEWNEIGH, ifindex, addr, ndm_flags,\n+                 flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_REPLACE],\n+                 count=count, attrs=rep)\n+\n+    test_msg(env, env.a, 'delneigh', RTM_DELNEIGH, ifindex, addr, ndm_flags,\n+             flags=[],\n+             count=count, attrs=dlt)\n+\n+\n+def flush(env, ifname, addrs, add, dlt):\n+    \"\"\"Flush all permanent entries through socket A, and check that all the\n+    notifications carry the port ID.\"\"\"\n+\n+    ifindex = env.ifindex(ifname)\n+\n+    for addr in addrs:\n+        attrs = add | {\"ndm-state\": NUD_PERMANENT,\n+                       \"lladdr\": addr}\n+        env.a.do('newneigh', fdb_req(ifindex, NTF_SELF, attrs),\n+                 flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_EXCL])\n+\n+    env.ntfs()\n+\n+    attrs = dlt | {'ndm-state': NUD_PERMANENT,\n+                   'ndm-state-mask': NUD_PERMANENT}\n+    env.a.do('delneigh', fdb_req(ifindex, NTF_SELF, attrs),\n+             flags=[Netlink.NLM_F_BULK])\n+\n+    ntfs = [n for n in env.ntfs() if n.type == RTM_DELNEIGH]\n+\n+    ksft_true({n.addr for n in ntfs} \u003e= set(addrs),\n+              \"Flush did not notify about all the entries\")\n+    ksft_eq({n.portid for n in ntfs}, {env.portids[env.a]},\n+            \"nlmsg_pid of flush notifications\")\n+\n+\n+def test_bridge() -\u003e None:\n+    \"\"\"Bridge port and bridge device entries: add, replace, delete.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+\n+        ip(\"link add br0 up type bridge vlan_default_pvid 0\", ns=ns)\n+        ip(\"link add d0 up type dummy\", ns=ns)\n+        ip(\"link set dev d0 master br0\", ns=ns)\n+\n+        add_replace_del(env, \"d0\", \"00:11:22:33:44:01\", NTF_MASTER,\n+                        add={\"ndm-state\": NUD_PERMANENT},\n+                        rep={\"ndm-state\": NUD_NOARP},\n+                        dlt={})\n+\n+        add_replace_del(env, \"br0\", \"00:11:22:33:44:02\", NTF_SELF,\n+                        add={\"ndm-state\": NUD_PERMANENT},\n+                        rep=None,\n+                        dlt={})\n+\n+\n+def test_bridge_vlan() -\u003e None:\n+    \"\"\"Without a VID given, an entry is added and deleted in every VLAN.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+\n+        ip(\"link add br0 up type bridge vlan_filtering 1 vlan_default_pvid 0\",\n+           ns=ns)\n+        ip(\"link add d0 up type dummy\", ns=ns)\n+        ip(\"link set dev d0 master br0\", ns=ns)\n+\n+        tool(\"bridge\", \"vlan add dev d0 vid 10\", ns=ns)\n+        tool(\"bridge\", \"vlan add dev d0 vid 20\", ns=ns)\n+\n+        # Three notifications: for VID 10 and 20, and for the entry\n+        # without VLAN.\n+        add_replace_del(env, \"d0\", \"00:11:22:33:44:03\", NTF_MASTER, count=3,\n+                        add={\"ndm-state\": NUD_PERMANENT},\n+                        rep=None,\n+                        dlt={})\n+\n+\n+def test_bridge_flush() -\u003e None:\n+    \"\"\"Bulk delete of bridge entries.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+        ip(\"link add br0 up type bridge vlan_default_pvid 0\", ns=ns)\n+        ip(\"link add d0 up type dummy\", ns=ns)\n+        ip(\"link set dev d0 master br0\", ns=ns)\n+\n+        flush(env, \"br0\", [\"00:11:22:33:44:10\",\n+                           \"00:11:22:33:44:11\",\n+                           \"00:11:22:33:44:12\"],\n+              add={},\n+              dlt={})\n+\n+\n+def test_bridge_learned() -\u003e None:\n+    \"\"\"Entries that are not a result of a request carry port ID of zero.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+        ip(\"link add br0 up type bridge\", ns=ns)\n+        ip(\"link add v0 up type veth peer name v1\", ns=ns)\n+        ip(\"link set dev v0 master br0\", ns=ns)\n+        ip(\"link set dev v1 up\", ns=ns)\n+\n+        addr = \"00:11:22:33:44:31\"\n+        frame = (b\"\\xff\" * 6 + bytes.fromhex(addr.replace(\":\", \"\")) +\n+                 struct.pack(\"!H\", ETH_P_EXP1) + b\"\\0\" * 46)\n+        with NetNSEnter(env.ns):\n+            tx = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)\n+            tx.bind((\"v1\", 0))\n+\n+        portids = []\n+\n+        def learned():\n+            nonlocal portids\n+            tx.send(frame)\n+            portids = [n.portid for n in env.ntfs()\n+                       if n.type == RTM_NEWNEIGH and n.addr == addr]\n+            return portids != []\n+\n+        # Keep sending until the entry is learned: a frame that\n+        # arrives while the bridge port is not yet up is dropped\n+        # without triggering learning. Once the entry exists, repeated\n+        # frames only refresh it and do not generate notifications.\n+        ksft_busy_wait(learned, deadline=2)\n+\n+        ksft_eq(portids, [0], \"nlmsg_pid of learned entry\")\n+\n+\n+def test_vxlan() -\u003e None:\n+    \"\"\"VXLAN entries: add, replace the remote, delete.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+        ip(\"link add vx0 up type vxlan id 2000 dstport 4789\", ns=ns)\n+\n+        add_replace_del(env, \"vx0\", \"00:11:22:33:44:41\", NTF_SELF,\n+                        add={\"dst\": \"192.0.2.1\", \"ndm-state\": NUD_PERMANENT},\n+                        rep={\"dst\": \"192.0.2.2\", \"ndm-state\": NUD_PERMANENT},\n+                        dlt={\"dst\": \"192.0.2.2\"})\n+\n+\n+def test_vxlan_flush() -\u003e None:\n+    \"\"\"Bulk delete of VXLAN entries.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+        ip(\"link add vx0 up type vxlan id 2000 dstport 4789\", ns=ns)\n+\n+        flush(env, \"vx0\", [\"00:11:22:33:44:50\",\n+                           \"00:11:22:33:44:51\",\n+                           \"00:11:22:33:44:52\"],\n+              add={\"dst\": \"192.0.2.1\"},\n+              dlt={\"dst\": \"192.0.2.1\"})\n+\n+\n+def test_macvlan() -\u003e None:\n+    \"\"\"The notifications for macvlan, which does not notify by itself, are\n+    sent by the generic code in rtnetlink.\"\"\"\n+    with NetNS() as ns:\n+        env = Env(ns)\n+        ip(\"link add dd up type dummy\", ns=ns)\n+        ip(\"link add mv0 up link dd type macvlan mode passthru\", ns=ns)\n+\n+        # macvlan does not support replace.\n+        add_replace_del(env, \"mv0\", \"00:11:22:33:44:61\", NTF_SELF,\n+                        add={\"ndm-state\": NUD_PERMANENT},\n+                        rep=None,\n+                        dlt={})\n+\n+\n+def main() -\u003e None:\n+    \"\"\"Run all the tests.\"\"\"\n+    ksft_run([\n+        test_bridge,\n+        test_bridge_vlan,\n+        test_bridge_flush,\n+        test_bridge_learned,\n+        test_vxlan,\n+        test_vxlan_flush,\n+        test_macvlan,\n+    ])\n+    ksft_exit()\n+\n+\n+if __name__ == \"__main__\":\n+    main()\ndiff --git a/tools/testing/selftests/net/lib/py/__init__.py b/tools/testing/selftests/net/lib/py/__init__.py\nindex b1696f432c7cf4..3f7696d06e6f43 100644\n--- a/tools/testing/selftests/net/lib/py/__init__.py\n+++ b/tools/testing/selftests/net/lib/py/__init__.py\n@@ -17,7 +17,8 @@ from .utils import CmdExitFailure, fd_read_timeout, cmd, bkg, defer, \\\n     ctl_file_write, wait_file, tool, tc\n from .bpf import bpf_map_set, bpf_map_dump, bpf_prog_map_ids\n from .ynl import NlError, NlctrlFamily, YnlFamily, \\\n-    EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily, RtnlRouteFamily\n+    EthtoolFamily, NetdevFamily, RtnlFamily, RtnlNeighFamily, \\\n+    RtnlAddrFamily, RtnlRouteFamily\n from .ynl import NetshaperFamily, DevlinkFamily, GtpFamily, PSPFamily, Netlink\n \n __all__ = [\"KSRC\",\n@@ -36,4 +37,5 @@ __all__ = [\"KSRC\",\n            \"NetshaperFamily\", \"DevlinkFamily\", \"GtpFamily\", \"PSPFamily\",\n            \"NlError\",\n            \"YnlFamily\", \"EthtoolFamily\", \"NetdevFamily\", \"RtnlFamily\",\n-           \"NlctrlFamily\", \"RtnlAddrFamily\", \"RtnlRouteFamily\", \"Netlink\"]\n+           \"RtnlNeighFamily\", \"NlctrlFamily\", \"RtnlAddrFamily\",\n+           \"RtnlRouteFamily\", \"Netlink\"]\ndiff --git a/tools/testing/selftests/net/lib/py/ynl.py b/tools/testing/selftests/net/lib/py/ynl.py\nindex 69a6e9d9b390b0..ac13bf1ff23d3a 100644\n--- a/tools/testing/selftests/net/lib/py/ynl.py\n+++ b/tools/testing/selftests/net/lib/py/ynl.py\n@@ -29,7 +29,8 @@ except ModuleNotFoundError as e:\n \n __all__ = [\n     \"NlError\", \"NlPolicy\", \"Netlink\", \"YnlFamily\", \"SPEC_PATH\",\n-    \"EthtoolFamily\", \"RtnlFamily\", \"RtnlAddrFamily\", \"RtnlRouteFamily\",\n+    \"EthtoolFamily\", \"RtnlFamily\", \"RtnlNeighFamily\", \"RtnlAddrFamily\",\n+    \"RtnlRouteFamily\",\n     \"NetdevFamily\", \"NetshaperFamily\", \"NlctrlFamily\", \"DevlinkFamily\",\n     \"GtpFamily\", \"PSPFamily\",\n ]\n@@ -49,6 +50,13 @@ class RtnlFamily(YnlFamily):\n         super().__init__((SPEC_PATH / Path('rt-link.yaml')).as_posix(),\n                          schema='', recv_size=recv_size)\n \n+class RtnlNeighFamily(YnlFamily):\n+    \"\"\"Netlink interface for neighbour messages.\"\"\"\n+    # pylint: disable=too-few-public-methods\n+    def __init__(self, recv_size=0):\n+        super().__init__((SPEC_PATH / Path('rt-neigh.yaml')).as_posix(),\n+                         schema='', recv_size=recv_size)\n+\n class RtnlAddrFamily(YnlFamily):\n     def __init__(self, recv_size=0):\n         super().__init__((SPEC_PATH / Path('rt-addr.yaml')).as_posix(),\n"
}

2/1 2026/11/28 16:39 agent patch-evaluator
0m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "NET",
    "INET",
    "BRIDGE",
    "VLAN_8021Q",
    "BRIDGE_VLAN_FILTERING",
    "VXLAN",
    "MACVLAN"
  ],
  "FocusSymbols": [
    "rtnl_fdb_add",
    "rtnl_fdb_del",
    "rtnl_fdb_get",
    "ndo_dflt_fdb_add",
    "ndo_dflt_fdb_del",
    "br_fdb_add",
    "br_fdb_delete",
    "br_fdb_delete_bulk",
    "br_fdb_get",
    "br_fdb_flush",
    "br_fdb_external_learn_add",
    "vxlan_fdb_add",
    "vxlan_fdb_delete",
    "vxlan_fdb_delete_bulk",
    "vxlan_fdb_get",
    "vxlan_fdb_update",
    "__vxlan_fdb_delete",
    "macvlan_fdb_add",
    "macvlan_fdb_del"
  ],
  "Reasoning": "The patch series modifies executable code in core networking (net/core/rtnetlink.c) and virtual netdev subsystems (net/bridge/, drivers/net/vxlan/, drivers/net/macvlan.c) by refactoring ndo_fdb_{add,del,get,del_bulk} and ndo_dflt_fdb_{add,del} to pass struct ndo_fdb_parms and propagating netlink portid into FDB notifications. These paths are directly reachable via PF_BRIDGE RTM_NEWNEIGH/RTM_DELNEIGH/RTM_GETNEIGH netlink requests on virtual devices (bridge, vxlan, macvlan, dummy, veth) in QEMU/GCE environments.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit fcf7445aef94f88776486a38b7fb429aeb61c1ed
Author: syz-cluster <triage@syzkaller.com>
Date:   Sat Nov 28 16:39:08 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/netlink/specs/rt-neigh.yaml b/Documentation/netlink/specs/rt-neigh.yaml
index 7929e667cc7a64..4dd4e3d997f099 100644
--- a/Documentation/netlink/specs/rt-neigh.yaml
+++ b/Documentation/netlink/specs/rt-neigh.yaml
@@ -380,7 +380,11 @@ operations:
           value: 29
           attributes:
             - dst
+            - lladdr
+            - vlan
             - ifindex
+            - ndm-state-mask
+            - ndm-flags-mask
     -
       name: delneigh-ntf
       doc: Notify a neighbour deletion
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index abbc71e815ae34..c8337bef5dbf79 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -13022,28 +13022,24 @@ static int i40e_get_phys_port_id(struct net_device *netdev,
  * i40e_ndo_fdb_add - add an entry to the hardware database
  * @ndm: the input from the stack
  * @tb: pointer to array of nladdr (unused)
- * @dev: the net device pointer
- * @addr: the MAC address entry being added
- * @vid: VLAN ID
- * @flags: instructions from stack about fdb operation
+ * @parms: common FDB parameters
  * @notified: whether notification was emitted
  * @extack: netlink extended ack, unused currently
  */
 static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr, u16 vid,
-			    u16 flags, bool *notified,
+			    const struct ndo_fdb_parms *parms, bool *notified,
 			    struct netlink_ext_ack *extack)
 {
-	struct i40e_netdev_priv *np = netdev_priv(dev);
+	struct i40e_netdev_priv *np = netdev_priv(parms->dev);
 	struct i40e_pf *pf = np->vsi->back;
 	int err = 0;
 
 	if (!test_bit(I40E_FLAG_SRIOV_ENA, pf->flags))
 		return -EOPNOTSUPP;
 
-	if (vid) {
-		pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n", dev->name);
+	if (parms->vid) {
+		pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n",
+			parms->dev->name);
 		return -EINVAL;
 	}
 
@@ -13051,19 +13047,20 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 	 * ndm_state is given only allow permanent addresses
 	 */
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "FDB only supports static addresses\n");
+		netdev_info(parms->dev, "FDB only supports static addresses\n");
 		return -EINVAL;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 	else
 		err = -EINVAL;
 
 	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+	if (err == -EEXIST && !(parms->flags & NLM_F_EXCL))
 		err = 0;
 
 	return err;
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index c8f06c3d0fdf20..396299d5d7bd5b 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6108,39 +6108,37 @@ ice_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 maxrate)
  * ice_fdb_add - add an entry to the hardware database
  * @ndm: the input from the stack
  * @tb: pointer to array of nladdr (unused)
- * @dev: the net device pointer
- * @addr: the MAC address entry being added
- * @vid: VLAN ID
- * @flags: instructions from stack about fdb operation
+ * @parms: common FDB parameters
  * @notified: whether notification was emitted
  * @extack: netlink extended ack
  */
 static int
 ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],
-	    struct net_device *dev, const unsigned char *addr, u16 vid,
-	    u16 flags, bool *notified,
+	    const struct ndo_fdb_parms *parms, bool *notified,
 	    struct netlink_ext_ack __always_unused *extack)
 {
 	int err;
 
-	if (vid) {
-		netdev_err(dev, "VLANs aren't supported yet for dev_uc|mc_add()\n");
+	if (parms->vid) {
+		netdev_err(parms->dev,
+			   "VLANs aren't supported yet for dev_uc|mc_add()\n");
 		return -EINVAL;
 	}
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_err(dev, "FDB only supports static addresses\n");
+		netdev_err(parms->dev, "FDB only supports static addresses\n");
 		return -EINVAL;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 	else
 		err = -EINVAL;
 
 	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+	if (err == -EEXIST && !(parms->flags & NLM_F_EXCL))
 		err = 0;
 
 	return err;
@@ -6150,29 +6148,26 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],
  * ice_fdb_del - delete an entry from the hardware database
  * @ndm: the input from the stack
  * @tb: pointer to array of nladdr (unused)
- * @dev: the net device pointer
- * @addr: the MAC address entry being added
- * @vid: VLAN ID
+ * @parms: common FDB parameters (device, address, VLAN ID)
  * @notified: whether notification was emitted
  * @extack: netlink extended ack
  */
 static int
 ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[],
-	    struct net_device *dev, const unsigned char *addr,
-	    __always_unused u16 vid, bool *notified,
+	    const struct ndo_fdb_parms *parms, bool *notified,
 	    struct netlink_ext_ack *extack)
 {
 	int err;
 
 	if (ndm->ndm_state & NUD_PERMANENT) {
-		netdev_err(dev, "FDB only supports static addresses\n");
+		netdev_err(parms->dev, "FDB only supports static addresses\n");
 		return -EINVAL;
 	}
 
-	if (is_unicast_ether_addr(addr))
-		err = dev_uc_del(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_del(dev, addr);
+	if (is_unicast_ether_addr(parms->addr))
+		err = dev_uc_del(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_del(parms->dev, parms->addr);
 	else
 		err = -EINVAL;
 
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index c75d78badf71f8..b2efa0a1fa071c 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2517,21 +2517,21 @@ static int igb_set_features(struct net_device *netdev,
 }
 
 static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 vid,
-			   u16 flags, bool *notified,
+			   const struct ndo_fdb_parms *parms, bool *notified,
 			   struct netlink_ext_ack *extack)
 {
 	/* guarantee we can provide a unique filter for the unicast address */
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
-		struct igb_adapter *adapter = netdev_priv(dev);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr)) {
+		struct igb_adapter *adapter = netdev_priv(parms->dev);
 		int vfn = adapter->vfs_allocated_count;
 
-		if (netdev_uc_count(dev) >= igb_available_rars(adapter, vfn))
+		if (netdev_uc_count(parms->dev) >=
+		    igb_available_rars(adapter, vfn))
 			return -ENOMEM;
 	}
 
-	return ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, flags);
+	return ndo_dflt_fdb_add(ndm, tb, parms);
 }
 
 #define IGB_MAX_MAC_HDR_LEN	127
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 6458cb2e511e7d..e444ebfe77fa5a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -10603,21 +10603,21 @@ static int ixgbe_set_features(struct net_device *netdev,
 }
 
 static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			     struct net_device *dev,
-			     const unsigned char *addr, u16 vid,
-			     u16 flags, bool *notified,
+			     const struct ndo_fdb_parms *parms, bool *notified,
 			     struct netlink_ext_ack *extack)
 {
 	/* guarantee we can provide a unique filter for the unicast address */
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
-		struct ixgbe_adapter *adapter = ixgbe_from_netdev(dev);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr)) {
+		struct ixgbe_adapter *adapter = ixgbe_from_netdev(parms->dev);
 		u16 pool = VMDQ_P(0);
 
-		if (netdev_uc_count(dev) >= ixgbe_available_rars(adapter, pool))
+		if (netdev_uc_count(parms->dev) >=
+		    ixgbe_available_rars(adapter, pool))
 			return -ENOMEM;
 	}
 
-	return ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, flags);
+	return ndo_dflt_fdb_add(ndm, tb, parms);
 }
 
 /**
diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c
index 4d45e136f08f5e..65f9dee62dc5b2 100644
--- a/drivers/net/ethernet/mscc/ocelot_net.c
+++ b/drivers/net/ethernet/mscc/ocelot_net.c
@@ -765,30 +765,29 @@ static void ocelot_get_stats64(struct net_device *dev,
 }
 
 static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			       struct net_device *dev,
-			       const unsigned char *addr,
-			       u16 vid, u16 flags, bool *notified,
-			       struct netlink_ext_ack *extack)
+			       const struct ndo_fdb_parms *parms,
+			       bool *notified, struct netlink_ext_ack *extack)
 {
-	struct ocelot_port_private *priv = netdev_priv(dev);
+	struct ocelot_port_private *priv = netdev_priv(parms->dev);
 	struct ocelot_port *ocelot_port = &priv->port;
 	struct ocelot *ocelot = ocelot_port->ocelot;
 	int port = priv->port.index;
 
-	return ocelot_fdb_add(ocelot, port, addr, vid, ocelot_port->bridge);
+	return ocelot_fdb_add(ocelot, port, parms->addr, parms->vid,
+			      ocelot_port->bridge);
 }
 
 static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			       struct net_device *dev,
-			       const unsigned char *addr, u16 vid,
+			       const struct ndo_fdb_parms *parms,
 			       bool *notified, struct netlink_ext_ack *extack)
 {
-	struct ocelot_port_private *priv = netdev_priv(dev);
+	struct ocelot_port_private *priv = netdev_priv(parms->dev);
 	struct ocelot_port *ocelot_port = &priv->port;
 	struct ocelot *ocelot = ocelot_port->ocelot;
 	int port = priv->port.index;
 
-	return ocelot_fdb_del(ocelot, port, addr, vid, ocelot_port->bridge);
+	return ocelot_fdb_del(ocelot, port, parms->addr, parms->vid,
+			      ocelot_port->bridge);
 }
 
 static int ocelot_port_fdb_do_dump(const unsigned char *addr, u16 vid,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 23ae76ca81dbe0..6c48cdaf25c0f3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -366,24 +366,23 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
 }
 
 static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			struct net_device *netdev,
-			const unsigned char *addr, u16 vid, bool *notified,
+			const struct ndo_fdb_parms *parms, bool *notified,
 			struct netlink_ext_ack *extack)
 {
-	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+	struct qlcnic_adapter *adapter = netdev_priv(parms->dev);
 	int err = -EOPNOTSUPP;
 
 	if (!adapter->fdb_mac_learn)
-		return ndo_dflt_fdb_del(ndm, tb, netdev, addr, vid);
+		return ndo_dflt_fdb_del(ndm, tb, parms);
 
 	if ((adapter->flags & QLCNIC_ESWITCH_ENABLED) ||
 	    qlcnic_sriov_check(adapter)) {
-		if (is_unicast_ether_addr(addr)) {
-			err = dev_uc_del(netdev, addr);
+		if (is_unicast_ether_addr(parms->addr)) {
+			err = dev_uc_del(parms->dev, parms->addr);
 			if (!err)
-				err = qlcnic_nic_del_mac(adapter, addr);
-		} else if (is_multicast_ether_addr(addr)) {
-			err = dev_mc_del(netdev, addr);
+				err = qlcnic_nic_del_mac(adapter, parms->addr);
+		} else if (is_multicast_ether_addr(parms->addr)) {
+			err = dev_mc_del(parms->dev, parms->addr);
 		} else {
 			err =  -EINVAL;
 		}
@@ -392,15 +391,14 @@ static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
 }
 
 static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			struct net_device *netdev,
-			const unsigned char *addr, u16 vid, u16 flags,
-			bool *notified, struct netlink_ext_ack *extack)
+			const struct ndo_fdb_parms *parms, bool *notified,
+			struct netlink_ext_ack *extack)
 {
-	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+	struct qlcnic_adapter *adapter = netdev_priv(parms->dev);
 	int err = 0;
 
 	if (!adapter->fdb_mac_learn)
-		return ndo_dflt_fdb_add(ndm, tb, netdev, addr, vid, flags);
+		return ndo_dflt_fdb_add(ndm, tb, parms);
 
 	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED) &&
 	    !qlcnic_sriov_check(adapter)) {
@@ -408,16 +406,16 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		return -EOPNOTSUPP;
 	}
 
-	if (ether_addr_equal(addr, adapter->mac_addr))
+	if (ether_addr_equal(parms->addr, adapter->mac_addr))
 		return err;
 
-	if (is_unicast_ether_addr(addr)) {
-		if (netdev_uc_count(netdev) < adapter->ahw->max_uc_count)
-			err = dev_uc_add_excl(netdev, addr);
+	if (is_unicast_ether_addr(parms->addr)) {
+		if (netdev_uc_count(parms->dev) < adapter->ahw->max_uc_count)
+			err = dev_uc_add_excl(parms->dev, parms->addr);
 		else
 			err = -ENOMEM;
-	} else if (is_multicast_ether_addr(addr)) {
-		err = dev_mc_add_excl(netdev, addr);
+	} else if (is_multicast_ether_addr(parms->addr)) {
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 	} else {
 		err = -EINVAL;
 	}
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index c7afa736c472bc..06079c69777242 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1054,49 +1054,46 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
 }
 
 static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 vid,
-			   u16 flags, bool *notified,
+			   const struct ndo_fdb_parms *parms, bool *notified,
 			   struct netlink_ext_ack *extack)
 {
-	struct macvlan_dev *vlan = netdev_priv(dev);
+	struct macvlan_dev *vlan = netdev_priv(parms->dev);
 	int err = -EINVAL;
 
 	/* Support unicast filter only on passthru devices.
 	 * Multicast filter should be allowed on all devices.
 	 */
-	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(addr))
+	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(parms->addr))
 		return -EOPNOTSUPP;
 
-	if (flags & NLM_F_REPLACE)
+	if (parms->flags & NLM_F_REPLACE)
 		return -EOPNOTSUPP;
 
-	if (is_unicast_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 
 	return err;
 }
 
 static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 vid, bool *notified,
+			   const struct ndo_fdb_parms *parms, bool *notified,
 			   struct netlink_ext_ack *extack)
 {
-	struct macvlan_dev *vlan = netdev_priv(dev);
+	struct macvlan_dev *vlan = netdev_priv(parms->dev);
 	int err = -EINVAL;
 
 	/* Support unicast filter only on passthru devices.
 	 * Multicast filter should be allowed on all devices.
 	 */
-	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(addr))
+	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(parms->addr))
 		return -EOPNOTSUPP;
 
-	if (is_unicast_ether_addr(addr))
-		err = dev_uc_del(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_del(dev, addr);
+	if (is_unicast_ether_addr(parms->addr))
+		err = dev_uc_del(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_del(parms->dev, parms->addr);
 
 	return err;
 }
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index d11028b374721c..c300e0bd9b577c 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -265,7 +265,7 @@ static inline size_t vxlan_nlmsg_size(void)
 }
 
 static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
-			       struct vxlan_rdst *rd, int type)
+			       struct vxlan_rdst *rd, int type, u32 portid)
 {
 	struct net *net = dev_net(vxlan->dev);
 	struct sk_buff *skb;
@@ -275,7 +275,7 @@ static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
 	if (skb == NULL)
 		goto errout;
 
-	err = vxlan_fdb_info(skb, vxlan, fdb, 0, 0, type, 0, rd);
+	err = vxlan_fdb_info(skb, vxlan, fdb, portid, 0, type, 0, rd);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in vxlan_nlmsg_size() */
 		WARN_ON(err == -EMSGSIZE);
@@ -329,8 +329,8 @@ static int vxlan_fdb_switchdev_call_notifiers(struct vxlan_dev *vxlan,
 }
 
 static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
-			    struct vxlan_rdst *rd, int type, bool swdev_notify,
-			    struct netlink_ext_ack *extack)
+			    struct vxlan_rdst *rd, int type, u32 portid,
+			    bool swdev_notify, struct netlink_ext_ack *extack)
 {
 	int err;
 
@@ -349,7 +349,7 @@ static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
 		}
 	}
 
-	__vxlan_fdb_notify(vxlan, fdb, rd, type);
+	__vxlan_fdb_notify(vxlan, fdb, rd, type, portid);
 	return 0;
 }
 
@@ -364,7 +364,7 @@ static void vxlan_ip_miss(struct net_device *dev, union vxlan_addr *ipa)
 		.remote_vni = cpu_to_be32(VXLAN_N_VID),
 	};
 
-	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, true, NULL);
+	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, 0, true, NULL);
 }
 
 static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN])
@@ -376,7 +376,7 @@ static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN])
 
 	memcpy(f.key.eth_addr, eth_addr, ETH_ALEN);
 
-	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, true, NULL);
+	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, 0, true, NULL);
 }
 
 /* Look up Ethernet address in forwarding table */
@@ -945,7 +945,7 @@ static void vxlan_fdb_free(struct rcu_head *head)
 }
 
 static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
-			      bool do_notify, bool swdev_notify)
+			      bool do_notify, u32 portid, bool swdev_notify)
 {
 	struct vxlan_rdst *rd;
 
@@ -955,11 +955,11 @@ static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
 	if (do_notify) {
 		if (rcu_access_pointer(f->nh))
 			vxlan_fdb_notify(vxlan, f, NULL, RTM_DELNEIGH,
-					 swdev_notify, NULL);
+					 portid, swdev_notify, NULL);
 		else
 			list_for_each_entry(rd, &f->remotes, list)
 				vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH,
-						 swdev_notify, NULL);
+						 portid, swdev_notify, NULL);
 	}
 
 	hlist_del_init_rcu(&f->fdb_node);
@@ -983,7 +983,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
 				     __be16 port, __be32 vni,
 				     __u32 ifindex, __u16 ndm_flags,
 				     struct vxlan_fdb *f, u32 nhid,
-				     bool swdev_notify,
+				     u32 portid, bool swdev_notify,
 				     struct netlink_ext_ack *extack)
 {
 	__u16 fdb_flags = (ndm_flags & ~NTF_USE);
@@ -1057,7 +1057,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
 
 		WRITE_ONCE(f->updated, jiffies);
 		err = vxlan_fdb_notify(vxlan, f, rd, RTM_NEWNEIGH,
-				       swdev_notify, extack);
+				       portid, swdev_notify, extack);
 		if (err)
 			goto err_notify;
 	}
@@ -1081,7 +1081,7 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,
 				   __u16 state, __u16 flags,
 				   __be16 port, __be32 src_vni, __be32 vni,
 				   __u32 ifindex, __u16 ndm_flags, u32 nhid,
-				   bool swdev_notify,
+				   u32 portid, bool swdev_notify,
 				   struct netlink_ext_ack *extack)
 {
 	__u16 fdb_flags = (ndm_flags & ~NTF_USE);
@@ -1100,14 +1100,14 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,
 		return rc;
 
 	rc = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_NEWNEIGH,
-			      swdev_notify, extack);
+			      portid, swdev_notify, extack);
 	if (rc)
 		goto err_notify;
 
 	return 0;
 
 err_notify:
-	vxlan_fdb_destroy(vxlan, f, false, false);
+	vxlan_fdb_destroy(vxlan, f, false, 0, false);
 	return rc;
 }
 
@@ -1117,7 +1117,7 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan,
 		     __u16 state, __u16 flags,
 		     __be16 port, __be32 src_vni, __be32 vni,
 		     __u32 ifindex, __u16 ndm_flags, u32 nhid,
-		     bool swdev_notify,
+		     u32 portid, bool swdev_notify,
 		     struct netlink_ext_ack *extack)
 {
 	struct vxlan_fdb *f;
@@ -1132,23 +1132,26 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan,
 
 		return vxlan_fdb_update_existing(vxlan, ip, state, flags, port,
 						 vni, ifindex, ndm_flags, f,
-						 nhid, swdev_notify, extack);
+						 nhid, portid, swdev_notify,
+						 extack);
 	} else {
 		if (!(flags & NLM_F_CREATE))
 			return -ENOENT;
 
 		return vxlan_fdb_update_create(vxlan, mac, ip, state, flags,
 					       port, src_vni, vni, ifindex,
-					       ndm_flags, nhid, swdev_notify,
-					       extack);
+					       ndm_flags, nhid, portid,
+					       swdev_notify, extack);
 	}
 }
 
 static void vxlan_fdb_dst_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
-				  struct vxlan_rdst *rd, bool swdev_notify)
+				  struct vxlan_rdst *rd, u32 portid,
+				  bool swdev_notify)
 {
 	list_del_rcu(&rd->list);
-	vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, swdev_notify, NULL);
+	vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, portid, swdev_notify,
+			 NULL);
 	call_rcu(&rd->rcu, vxlan_dst_free);
 }
 
@@ -1241,12 +1244,11 @@ static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,
 
 /* Add static entry (via netlink) */
 static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			 struct net_device *dev,
-			 const unsigned char *addr, u16 vid, u16 flags,
-			 bool *notified, struct netlink_ext_ack *extack)
+			 const struct ndo_fdb_parms *parms, bool *notified,
+			 struct netlink_ext_ack *extack)
 {
 	const struct vxlan_config *cfg;
-	struct vxlan_dev *vxlan = netdev_priv(dev);
+	struct vxlan_dev *vxlan = netdev_priv(parms->dev);
 	/* struct net *net = dev_net(vxlan->dev); */
 	union vxlan_addr ip;
 	__be16 port;
@@ -1273,10 +1275,11 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		return -EAFNOSUPPORT;
 
 	spin_lock_bh(&vxlan->hash_lock);
-	err = vxlan_fdb_update(vxlan, addr, &ip, ndm->ndm_state, flags,
+	err = vxlan_fdb_update(vxlan, parms->addr, &ip, ndm->ndm_state,
+			       parms->flags,
 			       port, src_vni, vni, ifindex,
 			       ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER,
-			       nhid, true, extack);
+			       nhid, parms->portid, true, extack);
 	spin_unlock_bh(&vxlan->hash_lock);
 
 	if (!err)
@@ -1288,7 +1291,7 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 		       const unsigned char *addr, union vxlan_addr ip,
 		       __be16 port, __be32 src_vni, __be32 vni,
-		       u32 ifindex, bool swdev_notify)
+		       u32 ifindex, u32 portid, bool swdev_notify)
 {
 	struct vxlan_rdst *rd = NULL;
 	struct vxlan_fdb *f;
@@ -1308,11 +1311,11 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 	 * otherwise destroy the fdb entry
 	 */
 	if (rd && !list_is_singular(&f->remotes)) {
-		vxlan_fdb_dst_destroy(vxlan, f, rd, swdev_notify);
+		vxlan_fdb_dst_destroy(vxlan, f, rd, portid, swdev_notify);
 		goto out;
 	}
 
-	vxlan_fdb_destroy(vxlan, f, true, swdev_notify);
+	vxlan_fdb_destroy(vxlan, f, true, portid, swdev_notify);
 
 out:
 	return 0;
@@ -1320,11 +1323,10 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 
 /* Delete entry (via netlink) */
 static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr, u16 vid, bool *notified,
+			    const struct ndo_fdb_parms *parms, bool *notified,
 			    struct netlink_ext_ack *extack)
 {
-	struct vxlan_dev *vxlan = netdev_priv(dev);
+	struct vxlan_dev *vxlan = netdev_priv(parms->dev);
 	union vxlan_addr ip;
 	__be32 src_vni, vni;
 	u32 ifindex, nhid;
@@ -1337,8 +1339,8 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
 		return err;
 
 	spin_lock_bh(&vxlan->hash_lock);
-	err = __vxlan_fdb_delete(vxlan, addr, ip, port, src_vni, vni, ifindex,
-				 true);
+	err = __vxlan_fdb_delete(vxlan, parms->addr, ip, port, src_vni, vni,
+				 ifindex, parms->portid, true);
 	spin_unlock_bh(&vxlan->hash_lock);
 
 	if (!err)
@@ -1400,12 +1402,10 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 
 static int vxlan_fdb_get(struct sk_buff *skb,
 			 struct nlattr *tb[],
-			 struct net_device *dev,
-			 const unsigned char *addr,
-			 u16 vid, u32 portid, u32 seq,
+			 const struct ndo_fdb_parms *parms, u32 seq,
 			 struct netlink_ext_ack *extack)
 {
-	struct vxlan_dev *vxlan = netdev_priv(dev);
+	struct vxlan_dev *vxlan = netdev_priv(parms->dev);
 	const struct vxlan_config *cfg;
 	struct vxlan_fdb *f;
 	__be32 vni;
@@ -1420,14 +1420,14 @@ static int vxlan_fdb_get(struct sk_buff *skb,
 
 	rcu_read_lock();
 
-	f = vxlan_find_mac_rcu(vxlan, cfg, addr, vni);
+	f = vxlan_find_mac_rcu(vxlan, cfg, parms->addr, vni);
 	if (!f) {
 		NL_SET_ERR_MSG(extack, "Fdb entry not found");
 		err = -ENOENT;
 		goto errout;
 	}
 
-	err = vxlan_fdb_info(skb, vxlan, f, portid, seq,
+	err = vxlan_fdb_info(skb, vxlan, f, parms->portid, seq,
 			     RTM_NEWNEIGH, 0, first_remote_rcu(f));
 errout:
 	rcu_read_unlock();
@@ -1483,7 +1483,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
 				    src_mac, &rdst->remote_ip.sa, &src_ip->sa);
 
 		rdst->remote_ip = *src_ip;
-		vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, true, NULL);
+		vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, 0, true, NULL);
 	} else {
 		/* learned new entry */
 		spin_lock(&vxlan->hash_lock);
@@ -1496,7 +1496,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
 					 cfg->dst_port,
 					 vni,
 					 cfg->vni,
-					 ifindex, NTF_SELF, 0, true, NULL);
+					 ifindex, NTF_SELF, 0, 0, true, NULL);
 		spin_unlock(&vxlan->hash_lock);
 	}
 
@@ -2946,7 +2946,7 @@ static void vxlan_cleanup(struct timer_list *t)
 				netdev_dbg(vxlan->dev, "garbage collect %pM\n",
 					   f->key.eth_addr);
 				f->state = NUD_STALE;
-				vxlan_fdb_destroy(vxlan, f, true, true);
+				vxlan_fdb_destroy(vxlan, f, true, 0, true);
 			}
 			spin_unlock(&vxlan->hash_lock);
 		} else if (time_before(timeout, next_timer)) {
@@ -3141,7 +3141,7 @@ vxlan_fdb_flush_remote_matches(const struct vxlan_fdb_flush_desc *desc,
 static void
 vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan,
 			      const struct vxlan_fdb_flush_desc *desc,
-			      bool *p_destroy_fdb)
+			      u32 portid, bool *p_destroy_fdb)
 {
 	struct vxlan_rdst *rd, *tmp;
 
@@ -3154,13 +3154,13 @@ vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan,
 			return;
 		}
 
-		vxlan_fdb_dst_destroy(vxlan, f, rd, true);
+		vxlan_fdb_dst_destroy(vxlan, f, rd, portid, true);
 	}
 }
 
 /* Purge the forwarding table */
 static void vxlan_flush(struct vxlan_dev *vxlan,
-			const struct vxlan_fdb_flush_desc *desc)
+			const struct vxlan_fdb_flush_desc *desc, u32 portid)
 {
 	bool match_remotes = vxlan_fdb_flush_should_match_remotes(desc);
 	struct vxlan_fdb *f;
@@ -3177,14 +3177,14 @@ static void vxlan_flush(struct vxlan_dev *vxlan,
 		if (match_remotes) {
 			bool destroy_fdb = false;
 
-			vxlan_fdb_flush_match_remotes(f, vxlan, desc,
+			vxlan_fdb_flush_match_remotes(f, vxlan, desc, portid,
 						      &destroy_fdb);
 
 			if (!destroy_fdb)
 				goto unlock;
 		}
 
-		vxlan_fdb_destroy(vxlan, f, true, true);
+		vxlan_fdb_destroy(vxlan, f, true, portid, true);
 unlock:
 		spin_unlock_bh(&vxlan->hash_lock);
 	}
@@ -3208,7 +3208,7 @@ static const struct nla_policy vxlan_del_bulk_policy[NDA_MAX + 1] = {
 					   NTF_ROUTER)
 
 static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
-				 struct netlink_ext_ack *extack)
+				 u32 portid, struct netlink_ext_ack *extack)
 {
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 	struct vxlan_fdb_flush_desc desc = {};
@@ -3266,7 +3266,7 @@ static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
 		desc.dst_ip = ip;
 	}
 
-	vxlan_flush(vxlan, &desc);
+	vxlan_flush(vxlan, &desc, portid);
 
 	return 0;
 }
@@ -3286,7 +3286,7 @@ static int vxlan_stop(struct net_device *dev)
 
 	timer_delete_sync(&vxlan->age_timer);
 
-	vxlan_flush(vxlan, &desc);
+	vxlan_flush(vxlan, &desc, 0);
 	vxlan_sock_release(vxlan);
 
 	return 0;
@@ -4146,7 +4146,7 @@ static int vxlan_dev_create(struct net *net, struct net_device *dev,
 				       cfg->vni,
 				       cfg->vni,
 				       cfg->remote_ifindex,
-				       NTF_SELF, 0, true, extack);
+				       NTF_SELF, 0, 0, true, extack);
 		spin_unlock_bh(&vxlan->hash_lock);
 		if (err)
 			goto unlink;
@@ -4609,7 +4609,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
 					       cfg->dst_port,
 					       conf.vni, conf.vni,
 					       conf.remote_ifindex,
-					       NTF_SELF, 0, true, extack);
+					       NTF_SELF, 0, 0, true, extack);
 			if (err) {
 				spin_unlock_bh(&vxlan->hash_lock);
 				if (lowerdev_changed)
@@ -4626,7 +4626,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
 					   cfg->vni,
 					   cfg->vni,
 					   cfg->remote_ifindex,
-					   true);
+					   0, true);
 		spin_unlock_bh(&vxlan->hash_lock);
 
 		/* If vni filtering device, also update default fdb entries of
@@ -4690,7 +4690,7 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 	struct vxlan_fdb_flush_desc desc = {};
 
-	vxlan_flush(vxlan, &desc);
+	vxlan_flush(vxlan, &desc, 0);
 
 	list_del(&vxlan->next);
 	unregister_netdevice_queue(dev, head);
@@ -4964,7 +4964,7 @@ vxlan_fdb_external_learn_add(struct net_device *dev,
 			       fdb_info->remote_vni,
 			       fdb_info->remote_ifindex,
 			       NTF_USE | NTF_SELF | NTF_EXT_LEARNED,
-			       0, false, extack);
+			       0, 0, false, extack);
 	spin_unlock_bh(&vxlan->hash_lock);
 
 	return err;
@@ -4990,7 +4990,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev,
 					 fdb_info->vni,
 					 fdb_info->remote_vni,
 					 fdb_info->remote_ifindex,
-					 false);
+					 0, false);
 
 	spin_unlock_bh(&vxlan->hash_lock);
 
@@ -5048,7 +5048,7 @@ static void vxlan_fdb_nh_flush(struct nexthop *nh)
 		WARN_ON(!vxlan);
 		spin_lock_bh(&vxlan->hash_lock);
 		if (!hlist_unhashed(&fdb->fdb_node))
-			vxlan_fdb_destroy(vxlan, fdb, false, false);
+			vxlan_fdb_destroy(vxlan, fdb, false, 0, false);
 		spin_unlock_bh(&vxlan->hash_lock);
 	}
 	rcu_read_unlock();
diff --git a/drivers/net/vxlan/vxlan_private.h b/drivers/net/vxlan/vxlan_private.h
index f0ee85f83732a2..632e1880c0b912 100644
--- a/drivers/net/vxlan/vxlan_private.h
+++ b/drivers/net/vxlan/vxlan_private.h
@@ -196,13 +196,14 @@ int vxlan_fdb_create(struct vxlan_dev *vxlan,
 int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 		       const unsigned char *addr, union vxlan_addr ip,
 		       __be16 port, __be32 src_vni, __be32 vni,
-		       u32 ifindex, bool swdev_notify);
+		       u32 ifindex, u32 portid, bool swdev_notify);
 int vxlan_fdb_update(struct vxlan_dev *vxlan,
 		     const u8 *mac, union vxlan_addr *ip,
 		     __u16 state, __u16 flags,
 		     __be16 port, __be32 src_vni, __be32 vni,
 		     __u32 ifindex, __u16 ndm_flags, u32 nhid,
-		     bool swdev_notify, struct netlink_ext_ack *extack);
+		     u32 portid, bool swdev_notify,
+		     struct netlink_ext_ack *extack);
 void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
 		    const struct vxlan_config *cfg,
 		    __be32 default_vni, struct vxlan_rdst *rdst, bool did_rsc);
diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c
index c5cc6cd085450a..927b63db3b5bf9 100644
--- a/drivers/net/vxlan/vxlan_vnifilter.c
+++ b/drivers/net/vxlan/vxlan_vnifilter.c
@@ -550,7 +550,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni,
 				       vni,
 				       vni,
 				       new_ifindex,
-				       NTF_SELF, 0, true, extack);
+				       NTF_SELF, 0, 0, true, extack);
 		if (err && extack) {
 			spin_unlock_bh(&vxlan->hash_lock);
 			return err;
@@ -563,7 +563,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni,
 				   cfg->dst_port,
 				   vni, vni,
 				   old_ifindex,
-				   true);
+				   0, true);
 	}
 	spin_unlock_bh(&vxlan->hash_lock);
 
@@ -727,7 +727,7 @@ static void vxlan_vni_delete_group(struct vxlan_dev *vxlan,
 				   cfg->dst_port,
 				   vninode->vni, vninode->vni,
 				   cfg->remote_ifindex,
-				   true);
+				   0, true);
 		spin_unlock_bh(&vxlan->hash_lock);
 	}
 
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 694b6d29f6807a..b2846b586a7f0d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1087,6 +1087,22 @@ struct netdev_net_notifier {
 	struct notifier_block *nb;
 };
 
+/**
+ * struct ndo_fdb_parms - parameters for ndo_fdb_{add,del,get}
+ * @dev: device the FDB entry is added to, deleted from or looked up on
+ * @addr: MAC address of the FDB entry
+ * @vid: VLAN ID of the FDB entry, 0 if none
+ * @flags: netlink message flags (NLM_F_*) of the request
+ * @portid: netlink port ID of the requester
+ */
+struct ndo_fdb_parms {
+	struct net_device	*dev;
+	const unsigned char	*addr;
+	u16			vid;
+	u16			flags;
+	u32			portid;
+};
+
 /*
  * This structure defines the management hooks for network devices.
  * The following hooks can be defined; unless noted otherwise, they are
@@ -1330,21 +1346,19 @@ struct netdev_net_notifier {
  *	Must return >0 or -errno if it changed dev->features itself.
  *
  * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[],
- *		      struct net_device *dev,
- *		      const unsigned char *addr, u16 vid, u16 flags,
+ *		      const struct ndo_fdb_parms *parms,
  *		      bool *notified, struct netlink_ext_ack *extack);
- *	Adds an FDB entry to dev for addr.
+ *	Adds an FDB entry to parms->dev for parms->addr.
  *	Callee shall set *notified to true if it sent any appropriate
  *	notification(s). Otherwise core will send a generic one.
  * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[],
- *		      struct net_device *dev,
- *		      const unsigned char *addr, u16 vid
+ *		      const struct ndo_fdb_parms *parms,
  *		      bool *notified, struct netlink_ext_ack *extack);
- *	Deletes the FDB entry from dev corresponding to addr.
+ *	Deletes the FDB entry from parms->dev corresponding to parms->addr.
  *	Callee shall set *notified to true if it sent any appropriate
  *	notification(s). Otherwise core will send a generic one.
  * int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh, struct net_device *dev,
- *			   struct netlink_ext_ack *extack);
+ *			   u32 portid, struct netlink_ext_ack *extack);
  * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
  *		       struct net_device *dev, struct net_device *filter_dev,
  *		       int *idx)
@@ -1614,21 +1628,17 @@ struct net_device_ops {
 
 	int			(*ndo_fdb_add)(struct ndmsg *ndm,
 					       struct nlattr *tb[],
-					       struct net_device *dev,
-					       const unsigned char *addr,
-					       u16 vid,
-					       u16 flags,
+					       const struct ndo_fdb_parms *parms,
 					       bool *notified,
 					       struct netlink_ext_ack *extack);
 	int			(*ndo_fdb_del)(struct ndmsg *ndm,
 					       struct nlattr *tb[],
-					       struct net_device *dev,
-					       const unsigned char *addr,
-					       u16 vid,
+					       const struct ndo_fdb_parms *parms,
 					       bool *notified,
 					       struct netlink_ext_ack *extack);
 	int			(*ndo_fdb_del_bulk)(struct nlmsghdr *nlh,
 						    struct net_device *dev,
+						    u32 portid,
 						    struct netlink_ext_ack *extack);
 	int			(*ndo_fdb_dump)(struct sk_buff *skb,
 						struct netlink_callback *cb,
@@ -1637,9 +1647,8 @@ struct net_device_ops {
 						int *idx);
 	int			(*ndo_fdb_get)(struct sk_buff *skb,
 					       struct nlattr *tb[],
-					       struct net_device *dev,
-					       const unsigned char *addr,
-					       u16 vid, u32 portid, u32 seq,
+					       const struct ndo_fdb_parms *parms,
+					       u32 seq,
 					       struct netlink_ext_ack *extack);
 	int			(*ndo_mdb_add)(struct net_device *dev,
 					       struct nlattr *tb[],
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index a54ec40d095c04..e963b43bce7678 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -211,15 +211,10 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
 			     int *idx);
 extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
 			    struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr,
-			    u16 vid,
-			    u16 flags);
+			    const struct ndo_fdb_parms *parms);
 extern int ndo_dflt_fdb_del(struct ndmsg *ndm,
 			    struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr,
-			    u16 vid);
+			    const struct ndo_fdb_parms *parms);
 
 extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				   struct net_device *dev, u16 mode,
diff --git a/net/bridge/br.c b/net/bridge/br.c
index d9a39ff98868d1..76feb286acab05 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -177,7 +177,7 @@ static int br_switchdev_event(struct notifier_block *unused,
 		fdb_info = ptr;
 		err = br_fdb_external_learn_add(br, p, fdb_info->addr,
 						fdb_info->vid,
-						fdb_info->locked, false);
+						fdb_info->locked, 0, false);
 		if (err) {
 			err = notifier_from_errno(err);
 			break;
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b601245ad92399..6b1c067974ff68 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -176,7 +176,7 @@ static inline size_t fdb_nlmsg_size(void)
 
 static void fdb_notify(struct net_bridge *br,
 		       const struct net_bridge_fdb_entry *fdb, int type,
-		       bool swdev_notify)
+		       u32 portid, bool swdev_notify)
 {
 	struct net *net = dev_net(br->dev);
 	struct sk_buff *skb;
@@ -189,7 +189,7 @@ static void fdb_notify(struct net_bridge *br,
 	if (skb == NULL)
 		goto errout;
 
-	err = fdb_fill_info(skb, br, fdb, 0, 0, type, 0);
+	err = fdb_fill_info(skb, br, fdb, portid, 0, type, 0);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in fdb_nlmsg_size() */
 		WARN_ON(err == -EMSGSIZE);
@@ -313,7 +313,7 @@ static void fdb_del_hw_addr(struct net_bridge *br, const unsigned char *addr)
 }
 
 static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,
-		       bool swdev_notify)
+		       u32 portid, bool swdev_notify)
 {
 	trace_fdb_delete(br, f, br_fdb_dst_port(f));
 
@@ -325,7 +325,7 @@ static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,
 			       br_fdb_rht_params);
 	if (test_and_clear_bit(BR_FDB_DYNAMIC_LEARNED, &f->flags))
 		atomic_dec(&br->fdb_n_learned);
-	fdb_notify(br, f, RTM_DELNEIGH, swdev_notify);
+	fdb_notify(br, f, RTM_DELNEIGH, portid, swdev_notify);
 	kfree_rcu(f, rcu);
 }
 
@@ -366,7 +366,7 @@ static void fdb_delete_local(struct net_bridge *br,
 		return;
 	}
 
-	fdb_delete(br, f, true);
+	fdb_delete(br, f, 0, true);
 }
 
 void br_fdb_find_delete_local(struct net_bridge *br,
@@ -445,7 +445,7 @@ static int fdb_add_local(struct net_bridge *br, struct net_bridge_port *source,
 			return 0;
 		br_warn(br, "adding interface %s with same address as a received packet (addr:%pM, vlan:%u)\n",
 			source ? source->dev->name : br->dev->name, addr, vid);
-		fdb_delete(br, fdb, true);
+		fdb_delete(br, fdb, 0, true);
 	}
 
 	fdb = fdb_create(br, br_port_to_dst(source), addr, vid,
@@ -454,7 +454,7 @@ static int fdb_add_local(struct net_bridge *br, struct net_bridge_port *source,
 		return -ENOMEM;
 
 	fdb_add_hw_addr(br, addr);
-	fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+	fdb_notify(br, fdb, RTM_NEWNEIGH, 0, true);
 	return 0;
 }
 
@@ -569,7 +569,8 @@ void br_fdb_cleanup(struct work_struct *work)
 							 this_timer - now);
 				else if (!test_and_set_bit(BR_FDB_NOTIFY_INACTIVE,
 							   &f->flags))
-					fdb_notify(br, f, RTM_NEWNEIGH, false);
+					fdb_notify(br, f, RTM_NEWNEIGH, 0,
+						   false);
 			}
 			continue;
 		}
@@ -579,7 +580,7 @@ void br_fdb_cleanup(struct work_struct *work)
 		} else {
 			spin_lock_bh(&br->hash_lock);
 			if (!hlist_unhashed(&f->fdb_node))
-				fdb_delete(br, f, true);
+				fdb_delete(br, f, 0, true);
 			spin_unlock_bh(&br->hash_lock);
 		}
 	}
@@ -711,7 +712,7 @@ static bool __fdb_flush_matches(const struct net_bridge *br,
 
 /* Flush forwarding database entries matching the description */
 void br_fdb_flush(struct net_bridge *br,
-		  const struct net_bridge_fdb_flush_desc *desc)
+		  const struct net_bridge_fdb_flush_desc *desc, u32 portid)
 {
 	struct net_bridge_fdb_entry *f;
 
@@ -722,7 +723,7 @@ void br_fdb_flush(struct net_bridge *br,
 
 		spin_lock_bh(&br->hash_lock);
 		if (!hlist_unhashed(&f->fdb_node))
-			fdb_delete(br, f, true);
+			fdb_delete(br, f, portid, true);
 		spin_unlock_bh(&br->hash_lock);
 	}
 	rcu_read_unlock();
@@ -796,7 +797,7 @@ static const struct nla_policy br_fdb_del_bulk_policy[NDA_MAX + 1] = {
 };
 
 int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
-		       struct netlink_ext_ack *extack)
+		       u32 portid, struct netlink_ext_ack *extack)
 {
 	struct net_bridge_fdb_flush_desc desc = {};
 	struct ndmsg *ndm = nlmsg_data(nlh);
@@ -863,7 +864,7 @@ int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
 	br_debug(br, "flushing port ifindex: %d vlan id: %u flags: 0x%lx flags mask: 0x%lx\n",
 		 desc.port_ifindex, desc.vlan_id, desc.flags, desc.flags_mask);
 
-	br_fdb_flush(br, &desc);
+	br_fdb_flush(br, &desc, portid);
 
 	return 0;
 }
@@ -918,7 +919,7 @@ void br_fdb_cleanup_by_dst(struct net_bridge *br,
 		if (test_bit(BR_FDB_LOCAL, &f->flags))
 			fdb_delete_local(br, p, f);
 		else
-			fdb_delete(br, f, true);
+			fdb_delete(br, f, 0, true);
 	}
 	spin_unlock_bh(&br->hash_lock);
 }
@@ -1000,7 +1001,7 @@ static void __fdb_update(struct net_bridge *br,
 			 struct net_bridge_fdb_entry *fdb,
 			 struct net_bridge_port *source,
 			 struct net_bridge_dst dst,
-			 unsigned long flags)
+			 unsigned long flags, u32 portid)
 {
 	struct net_bridge_port *old_port;
 	struct net_bridge_dst old_dst;
@@ -1057,13 +1058,15 @@ static void __fdb_update(struct net_bridge *br,
 	if (unlikely(fdb_modified)) {
 		trace_br_fdb_update(br, source, fdb->key.addr.addr,
 				    fdb->key.vlan_id, flags);
-		fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+		fdb_notify(br, fdb, RTM_NEWNEIGH, portid, true);
 	}
 }
 
-void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
-		   struct net_bridge_vlan *vlan, const unsigned char *addr,
-		   unsigned long flags)
+static void __br_fdb_update(struct net_bridge *br,
+			    struct net_bridge_port *source,
+			    struct net_bridge_vlan *vlan,
+			    const unsigned char *addr, unsigned long flags,
+			    u32 portid)
 {
 	struct net_bridge_dst dst = vlan ? br_vlan_to_dst(vlan) :
 					   br_port_to_dst(source);
@@ -1076,18 +1079,25 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 
 	fdb = fdb_find_rcu(&br->fdb_hash_tbl, addr, vid);
 	if (likely(fdb)) {
-		__fdb_update(br, fdb, source, dst, flags);
+		__fdb_update(br, fdb, source, dst, flags, portid);
 	} else {
 		spin_lock(&br->hash_lock);
 		fdb = fdb_create(br, dst, addr, vid, flags);
 		if (fdb) {
 			trace_br_fdb_update(br, source, addr, vid, flags);
-			fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+			fdb_notify(br, fdb, RTM_NEWNEIGH, portid, true);
 		}
 		spin_unlock(&br->hash_lock);
 	}
 }
 
+void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
+		   struct net_bridge_vlan *vlan, const unsigned char *addr,
+		   unsigned long flags)
+{
+	__br_fdb_update(br, source, vlan, addr, flags, 0);
+}
+
 /* Dump information about entries, in response to GETNEIGH */
 int br_fdb_dump(struct sk_buff *skb,
 		struct netlink_callback *cb,
@@ -1146,25 +1156,22 @@ int br_fdb_dump(struct sk_buff *skb,
 
 int br_fdb_get(struct sk_buff *skb,
 	       struct nlattr *tb[],
-	       struct net_device *dev,
-	       const unsigned char *addr,
-	       u16 vid, u32 portid, u32 seq,
+	       const struct ndo_fdb_parms *parms, u32 seq,
 	       struct netlink_ext_ack *extack)
 {
-	struct net_bridge *br = netdev_priv(dev);
+	struct net_bridge *br = netdev_priv(parms->dev);
 	struct net_bridge_fdb_entry *f;
 	int err = 0;
 
 	rcu_read_lock();
-	f = br_fdb_find_rcu(br, addr, vid);
+	f = br_fdb_find_rcu(br, parms->addr, parms->vid);
 	if (!f) {
 		NL_SET_ERR_MSG(extack, "Fdb entry not found");
 		err = -ENOENT;
 		goto errout;
 	}
 
-	err = fdb_fill_info(skb, br, f, portid, seq,
-			    RTM_NEWNEIGH, 0);
+	err = fdb_fill_info(skb, br, f, parms->portid, seq, RTM_NEWNEIGH, 0);
 errout:
 	rcu_read_unlock();
 	return err;
@@ -1212,7 +1219,7 @@ static bool fdb_update_dst(struct net_bridge_fdb_entry *fdb,
 
 /* Update (create or replace) forwarding database entry */
 static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
-			 const u8 *addr, struct ndmsg *ndm, u16 flags, u16 vid,
+			 struct ndmsg *ndm, const struct ndo_fdb_parms *parms,
 			 struct nlattr *nfea_tb[])
 {
 	struct net_bridge_port *source = br_dst_port(dst);
@@ -1245,12 +1252,12 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 			return -EINVAL;
 	}
 
-	fdb = br_fdb_find(br, addr, vid);
+	fdb = br_fdb_find(br, parms->addr, parms->vid);
 	if (fdb == NULL) {
-		if (!(flags & NLM_F_CREATE))
+		if (!(parms->flags & NLM_F_CREATE))
 			return -ENOENT;
 
-		fdb = fdb_create(br, dst, addr, vid,
+		fdb = fdb_create(br, dst, parms->addr, parms->vid,
 				 BIT(BR_FDB_ADDED_BY_USER));
 		if (!fdb)
 			return -ENOMEM;
@@ -1259,7 +1266,7 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 	} else {
 		struct net_bridge_dst old_dst;
 
-		if (flags & NLM_F_EXCL)
+		if (parms->flags & NLM_F_EXCL)
 			return -EEXIST;
 
 		old_dst = br_fdb_dst_read(fdb);
@@ -1274,15 +1281,15 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 		if (state & NUD_PERMANENT) {
 			set_bit(BR_FDB_LOCAL, &fdb->flags);
 			if (!test_and_set_bit(BR_FDB_STATIC, &fdb->flags))
-				fdb_add_hw_addr(br, addr);
+				fdb_add_hw_addr(br, parms->addr);
 		} else if (state & NUD_NOARP) {
 			clear_bit(BR_FDB_LOCAL, &fdb->flags);
 			if (!test_and_set_bit(BR_FDB_STATIC, &fdb->flags))
-				fdb_add_hw_addr(br, addr);
+				fdb_add_hw_addr(br, parms->addr);
 		} else {
 			clear_bit(BR_FDB_LOCAL, &fdb->flags);
 			if (test_and_clear_bit(BR_FDB_STATIC, &fdb->flags))
-				fdb_del_hw_addr(br, addr);
+				fdb_del_hw_addr(br, parms->addr);
 		}
 
 		modified = true;
@@ -1303,19 +1310,18 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 	if (modified) {
 		if (refresh)
 			WRITE_ONCE(fdb->updated, jiffies);
-		fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+		fdb_notify(br, fdb, RTM_NEWNEIGH, parms->portid, true);
 	}
 
 	return 0;
 }
 
 static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,
-			struct net_bridge_port *p, const unsigned char *addr,
-			u16 nlh_flags, struct net_bridge_vlan *vlan,
-			struct nlattr *nfea_tb[],
+			struct net_bridge_port *p,
+			const struct ndo_fdb_parms *parms,
+			struct net_bridge_vlan *vlan, struct nlattr *nfea_tb[],
 			bool *notified, struct netlink_ext_ack *extack)
 {
-	u16 vid = vlan ? vlan->vid : 0;
 	struct net_bridge_dst dst;
 	int err = 0;
 
@@ -1330,7 +1336,8 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,
 
 		local_bh_disable();
 		rcu_read_lock();
-		br_fdb_update(br, p, vlan, addr, BIT(BR_FDB_ADDED_BY_USER));
+		__br_fdb_update(br, p, vlan, parms->addr,
+				BIT(BR_FDB_ADDED_BY_USER), parms->portid);
 		rcu_read_unlock();
 		local_bh_enable();
 	} else if (ndm->ndm_flags & NTF_EXT_LEARNED) {
@@ -1339,12 +1346,12 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,
 					   "FDB entry towards bridge must be permanent");
 			return -EINVAL;
 		}
-		err = br_fdb_external_learn_add(br, p, addr, vid, false, true);
+		err = br_fdb_external_learn_add(br, p, parms->addr, parms->vid,
+						false, parms->portid, true);
 	} else {
 		dst = p && vlan ? br_vlan_to_dst(vlan) : br_port_to_dst(p);
 		spin_lock_bh(&br->hash_lock);
-		err = fdb_add_entry(br, dst, addr, ndm, nlh_flags, vid,
-				    nfea_tb);
+		err = fdb_add_entry(br, dst, ndm, parms, nfea_tb);
 		spin_unlock_bh(&br->hash_lock);
 	}
 
@@ -1360,9 +1367,8 @@ static const struct nla_policy br_nda_fdb_pol[NFEA_MAX + 1] = {
 
 /* Add new permanent fdb entry with RTM_NEWNEIGH */
 int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-	       struct net_device *dev,
-	       const unsigned char *addr, u16 vid, u16 nlh_flags,
-	       bool *notified, struct netlink_ext_ack *extack)
+	       const struct ndo_fdb_parms *parms, bool *notified,
+	       struct netlink_ext_ack *extack)
 {
 	struct nlattr *nfea_tb[NFEA_MAX + 1], *attr;
 	struct net_bridge_vlan_group *vg;
@@ -1372,26 +1378,27 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 	u32 ext_flags = 0;
 	int err = 0;
 
-	trace_br_fdb_add(ndm, dev, addr, vid, nlh_flags);
+	trace_br_fdb_add(ndm, parms->dev, parms->addr, parms->vid,
+			 parms->flags);
 
 	if (!(ndm->ndm_state & (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE))) {
 		pr_info("bridge: RTM_NEWNEIGH with invalid state %#x\n", ndm->ndm_state);
 		return -EINVAL;
 	}
 
-	if (is_zero_ether_addr(addr)) {
+	if (is_zero_ether_addr(parms->addr)) {
 		pr_info("bridge: RTM_NEWNEIGH with invalid ether address\n");
 		return -EINVAL;
 	}
 
-	if (netif_is_bridge_master(dev)) {
-		br = netdev_priv(dev);
+	if (netif_is_bridge_master(parms->dev)) {
+		br = netdev_priv(parms->dev);
 		vg = br_vlan_group(br);
 	} else {
-		p = br_port_get_rtnl(dev);
+		p = br_port_get_rtnl(parms->dev);
 		if (!p) {
 			pr_info("bridge: RTM_NEWNEIGH %s not a bridge port\n",
-				dev->name);
+				parms->dev->name);
 			return -EINVAL;
 		}
 		br = p->br;
@@ -1416,19 +1423,20 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		memset(nfea_tb, 0, sizeof(struct nlattr *) * (NFEA_MAX + 1));
 	}
 
-	if (vid) {
-		v = br_vlan_find(vg, vid);
+	if (parms->vid) {
+		v = br_vlan_find(vg, parms->vid);
 		if (!v || !br_vlan_should_use(v)) {
-			pr_info("bridge: RTM_NEWNEIGH with unconfigured vlan %d on %s\n", vid, dev->name);
+			pr_info("bridge: RTM_NEWNEIGH with unconfigured vlan %d on %s\n",
+				parms->vid, parms->dev->name);
 			return -EINVAL;
 		}
 
 		/* VID was specified, so use it. */
-		err = __br_fdb_add(ndm, br, p, addr, nlh_flags, v, nfea_tb,
-				   notified, extack);
+		err = __br_fdb_add(ndm, br, p, parms, v, nfea_tb, notified,
+				   extack);
 	} else {
-		err = __br_fdb_add(ndm, br, p, addr, nlh_flags, NULL, nfea_tb,
-				   notified, extack);
+		err = __br_fdb_add(ndm, br, p, parms, NULL, nfea_tb, notified,
+				   extack);
 		if (err || !vg || !vg->num_vlans)
 			goto out;
 
@@ -1437,10 +1445,13 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		 * vlan on this port.
 		 */
 		list_for_each_entry(v, &vg->vlan_list, vlist) {
+			struct ndo_fdb_parms vparms = *parms;
+
 			if (!br_vlan_should_use(v))
 				continue;
-			err = __br_fdb_add(ndm, br, p, addr, nlh_flags, v,
-					   nfea_tb, notified, extack);
+			vparms.vid = v->vid;
+			err = __br_fdb_add(ndm, br, p, &vparms, v, nfea_tb,
+					   notified, extack);
 			if (err)
 				goto out;
 		}
@@ -1452,7 +1463,8 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 
 static int fdb_delete_by_addr_and_port(struct net_bridge *br,
 				       const struct net_bridge_port *p,
-				       const u8 *addr, u16 vlan, bool *notified)
+				       const u8 *addr, u16 vlan, u32 portid,
+				       bool *notified)
 {
 	struct net_bridge_fdb_entry *fdb;
 
@@ -1460,7 +1472,7 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br,
 	if (!fdb || br_fdb_dst_port(fdb) != p)
 		return -ENOENT;
 
-	fdb_delete(br, fdb, true);
+	fdb_delete(br, fdb, portid, true);
 	*notified = true;
 
 	return 0;
@@ -1468,12 +1480,13 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br,
 
 static int __br_fdb_delete(struct net_bridge *br,
 			   const struct net_bridge_port *p,
-			   const unsigned char *addr, u16 vid, bool *notified)
+			   const unsigned char *addr, u16 vid, u32 portid,
+			   bool *notified)
 {
 	int err;
 
 	spin_lock_bh(&br->hash_lock);
-	err = fdb_delete_by_addr_and_port(br, p, addr, vid, notified);
+	err = fdb_delete_by_addr_and_port(br, p, addr, vid, portid, notified);
 	spin_unlock_bh(&br->hash_lock);
 
 	return err;
@@ -1481,8 +1494,7 @@ static int __br_fdb_delete(struct net_bridge *br,
 
 /* Remove neighbor entry with RTM_DELNEIGH */
 int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
-		  struct net_device *dev,
-		  const unsigned char *addr, u16 vid, bool *notified,
+		  const struct ndo_fdb_parms *parms, bool *notified,
 		  struct netlink_ext_ack *extack)
 {
 	struct net_bridge_vlan_group *vg;
@@ -1490,34 +1502,37 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
 	struct net_bridge *br;
 	int err;
 
-	if (netif_is_bridge_master(dev)) {
-		br = netdev_priv(dev);
+	if (netif_is_bridge_master(parms->dev)) {
+		br = netdev_priv(parms->dev);
 		vg = br_vlan_group(br);
 	} else {
-		p = br_port_get_rtnl(dev);
+		p = br_port_get_rtnl(parms->dev);
 		if (!p) {
 			pr_info("bridge: RTM_DELNEIGH %s not a bridge port\n",
-				dev->name);
+				parms->dev->name);
 			return -EINVAL;
 		}
 		vg = nbp_vlan_group(p);
 		br = p->br;
 	}
 
-	if (vid) {
-		err = __br_fdb_delete(br, p, addr, vid, notified);
+	if (parms->vid) {
+		err = __br_fdb_delete(br, p, parms->addr, parms->vid,
+				      parms->portid, notified);
 	} else {
 		struct net_bridge_vlan *v;
 
 		err = -ENOENT;
-		err &= __br_fdb_delete(br, p, addr, 0, notified);
+		err &= __br_fdb_delete(br, p, parms->addr, 0, parms->portid,
+				       notified);
 		if (!vg || !vg->num_vlans)
 			return err;
 
 		list_for_each_entry(v, &vg->vlan_list, vlist) {
 			if (!br_vlan_should_use(v))
 				continue;
-			err &= __br_fdb_delete(br, p, addr, v->vid, notified);
+			err &= __br_fdb_delete(br, p, parms->addr, v->vid,
+					       parms->portid, notified);
 		}
 	}
 
@@ -1598,7 +1613,7 @@ static struct net_bridge_dst br_fdb_resolve_dst(const struct net_bridge_port *p,
 
 int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid, bool locked,
-			      bool swdev_notify)
+			      u32 portid, bool swdev_notify)
 {
 	struct net_bridge_dst dst = br_fdb_resolve_dst(p, vid);
 	struct net_bridge_fdb_entry *fdb;
@@ -1630,7 +1645,7 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			err = -ENOMEM;
 			goto err_unlock;
 		}
-		fdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);
+		fdb_notify(br, fdb, RTM_NEWNEIGH, portid, swdev_notify);
 	} else {
 		struct net_bridge_dst old_dst;
 
@@ -1669,7 +1684,7 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			atomic_dec(&br->fdb_n_learned);
 
 		if (modified)
-			fdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);
+			fdb_notify(br, fdb, RTM_NEWNEIGH, portid, swdev_notify);
 	}
 
 err_unlock:
@@ -1689,7 +1704,7 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
 
 	fdb = br_fdb_find(br, addr, vid);
 	if (fdb && test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &fdb->flags))
-		fdb_delete(br, fdb, swdev_notify);
+		fdb_delete(br, fdb, 0, swdev_notify);
 	else
 		err = -ENOENT;
 
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 79c4a54990e26b..0a1dd507bbff85 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1001,7 +1001,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[],
 			.port_ifindex = p->dev->ifindex,
 		};
 
-		br_fdb_flush(p->br, &desc);
+		br_fdb_flush(p->br, &desc, 0);
 	}
 
 	changed_mask = old_flags ^ flags;
@@ -1431,7 +1431,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
 			.flags_mask = BIT(BR_FDB_STATIC)
 		};
 
-		br_fdb_flush(br, &desc);
+		br_fdb_flush(br, &desc, 0);
 	}
 
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 014d0b8db8c732..83f2b77289476c 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -992,7 +992,7 @@ void br_fdb_fini(void);
 int br_fdb_hash_init(struct net_bridge *br);
 void br_fdb_hash_fini(struct net_bridge *br);
 void br_fdb_flush(struct net_bridge *br,
-		  const struct net_bridge_fdb_flush_desc *desc);
+		  const struct net_bridge_fdb_flush_desc *desc, u32 portid);
 void br_fdb_find_delete_local(struct net_bridge *br,
 			      const struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid);
@@ -1015,23 +1015,23 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 		   unsigned long flags);
 
 int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
-		  struct net_device *dev, const unsigned char *addr, u16 vid,
-		  bool *notified, struct netlink_ext_ack *extack);
+		  const struct ndo_fdb_parms *parms, bool *notified,
+		  struct netlink_ext_ack *extack);
 int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
-		       struct netlink_ext_ack *extack);
-int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev,
-	       const unsigned char *addr, u16 vid, u16 nlh_flags,
-	       bool *notified, struct netlink_ext_ack *extack);
+		       u32 portid, struct netlink_ext_ack *extack);
+int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[],
+	       const struct ndo_fdb_parms *parms, bool *notified,
+	       struct netlink_ext_ack *extack);
 int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 		struct net_device *dev, struct net_device *fdev, int *idx);
-int br_fdb_get(struct sk_buff *skb, struct nlattr *tb[], struct net_device *dev,
-	       const unsigned char *addr, u16 vid, u32 portid, u32 seq,
+int br_fdb_get(struct sk_buff *skb, struct nlattr *tb[],
+	       const struct ndo_fdb_parms *parms, u32 seq,
 	       struct netlink_ext_ack *extack);
 int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p);
 void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p);
 int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid,
-			      bool locked, bool swdev_notify);
+			      bool locked, u32 portid, bool swdev_notify);
 int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid,
 			      bool swdev_notify);
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index d2993f187f5738..3a05764e607a16 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -349,7 +349,7 @@ static int set_flush(struct net_bridge *br, unsigned long val,
 		.flags_mask = BIT(BR_FDB_STATIC)
 	};
 
-	br_fdb_flush(br, &desc);
+	br_fdb_flush(br, &desc, 0);
 	return 0;
 }
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e141340172ce39..51713666f0e350 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -4721,7 +4721,7 @@ static inline size_t rtnl_fdb_nlmsg_size(const struct net_device *dev)
 }
 
 static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,
-			    u16 ndm_state)
+			    u16 ndm_state, u32 portid)
 {
 	struct net *net = dev_net(dev);
 	struct sk_buff *skb;
@@ -4732,7 +4732,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,
 		goto errout;
 
 	err = nlmsg_populate_fdb_fill(skb, dev, addr, vid,
-				      0, 0, type, NTF_SELF, 0, ndm_state);
+				      portid, 0, type, NTF_SELF, 0, ndm_state);
 	if (err < 0) {
 		kfree_skb(skb);
 		goto errout;
@@ -4749,9 +4749,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,
  */
 int ndo_dflt_fdb_add(struct ndmsg *ndm,
 		     struct nlattr *tb[],
-		     struct net_device *dev,
-		     const unsigned char *addr, u16 vid,
-		     u16 flags)
+		     const struct ndo_fdb_parms *parms)
 {
 	int err = -EINVAL;
 
@@ -4759,27 +4757,28 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "default FDB implementation only supports local addresses\n");
+		netdev_info(parms->dev, "default FDB implementation only supports local addresses\n");
 		return err;
 	}
 
 	if (tb[NDA_FLAGS_EXT]) {
-		netdev_info(dev, "invalid flags given to default FDB implementation\n");
+		netdev_info(parms->dev, "invalid flags given to default FDB implementation\n");
 		return err;
 	}
 
-	if (vid) {
-		netdev_info(dev, "vlans aren't supported yet for dev_uc|mc_add()\n");
+	if (parms->vid) {
+		netdev_info(parms->dev, "vlans aren't supported yet for dev_uc|mc_add()\n");
 		return err;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 
 	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+	if (err == -EEXIST && !(parms->flags & NLM_F_EXCL))
 		err = 0;
 
 	return err;
@@ -4814,6 +4813,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct net *net = sock_net(skb->sk);
 	struct ndmsg *ndm;
 	struct nlattr *tb[NDA_MAX+1];
+	struct ndo_fdb_parms parms;
 	struct net_device *dev;
 	u8 *addr;
 	u16 vid;
@@ -4852,6 +4852,14 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 	if (err)
 		return err;
 
+	parms = (struct ndo_fdb_parms) {
+		.dev = dev,
+		.addr = addr,
+		.vid = vid,
+		.flags = nlh->nlmsg_flags,
+		.portid = NETLINK_CB(skb).portid,
+	};
+
 	err = -EOPNOTSUPP;
 
 	/* Support fdb on master device the net/bridge default case */
@@ -4861,8 +4869,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 		const struct net_device_ops *ops = br_dev->netdev_ops;
 		bool notified = false;
 
-		err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid,
-				       nlh->nlmsg_flags, &notified, extack);
+		err = ops->ndo_fdb_add(ndm, tb, &parms, &notified, extack);
 		if (err)
 			goto out;
 		else
@@ -4874,17 +4881,14 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 		bool notified = false;
 
 		if (dev->netdev_ops->ndo_fdb_add)
-			err = dev->netdev_ops->ndo_fdb_add(ndm, tb, dev, addr,
-							   vid,
-							   nlh->nlmsg_flags,
+			err = dev->netdev_ops->ndo_fdb_add(ndm, tb, &parms,
 							   &notified, extack);
 		else
-			err = ndo_dflt_fdb_add(ndm, tb, dev, addr, vid,
-					       nlh->nlmsg_flags);
+			err = ndo_dflt_fdb_add(ndm, tb, &parms);
 
 		if (!err && !notified) {
 			rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH,
-					ndm->ndm_state);
+					ndm->ndm_state, parms.portid);
 			ndm->ndm_flags &= ~NTF_SELF;
 		}
 	}
@@ -4897,8 +4901,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
  */
 int ndo_dflt_fdb_del(struct ndmsg *ndm,
 		     struct nlattr *tb[],
-		     struct net_device *dev,
-		     const unsigned char *addr, u16 vid)
+		     const struct ndo_fdb_parms *parms)
 {
 	int err = -EINVAL;
 
@@ -4906,14 +4909,15 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (!(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "default FDB implementation only supports local addresses\n");
+		netdev_info(parms->dev, "default FDB implementation only supports local addresses\n");
 		return err;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_del(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_del(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_del(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_del(parms->dev, parms->addr);
 
 	return err;
 }
@@ -4924,9 +4928,11 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 {
 	bool del_bulk = !!(nlh->nlmsg_flags & NLM_F_BULK);
 	struct net *net = sock_net(skb->sk);
+	u32 portid = NETLINK_CB(skb).portid;
 	const struct net_device_ops *ops;
 	struct ndmsg *ndm;
 	struct nlattr *tb[NDA_MAX+1];
+	struct ndo_fdb_parms parms;
 	struct net_device *dev;
 	__u8 *addr = NULL;
 	int err;
@@ -4966,6 +4972,13 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		err = fdb_vid_parse(tb[NDA_VLAN], &vid, extack);
 		if (err)
 			return err;
+
+		parms = (struct ndo_fdb_parms) {
+			.dev = dev,
+			.addr = addr,
+			.vid = vid,
+			.portid = portid,
+		};
 	}
 
 	if (dev->type != ARPHRD_ETHER) {
@@ -4984,11 +4997,12 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		ops = br_dev->netdev_ops;
 		if (!del_bulk) {
 			if (ops->ndo_fdb_del)
-				err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid,
+				err = ops->ndo_fdb_del(ndm, tb, &parms,
 						       &notified, extack);
 		} else {
 			if (ops->ndo_fdb_del_bulk)
-				err = ops->ndo_fdb_del_bulk(nlh, dev, extack);
+				err = ops->ndo_fdb_del_bulk(nlh, dev, portid,
+							    extack);
 		}
 
 		if (err)
@@ -5004,21 +5018,22 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		ops = dev->netdev_ops;
 		if (!del_bulk) {
 			if (ops->ndo_fdb_del)
-				err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid,
+				err = ops->ndo_fdb_del(ndm, tb, &parms,
 						       &notified, extack);
 			else
-				err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid);
+				err = ndo_dflt_fdb_del(ndm, tb, &parms);
 		} else {
 			/* in case err was cleared by NTF_MASTER call */
 			err = -EOPNOTSUPP;
 			if (ops->ndo_fdb_del_bulk)
-				err = ops->ndo_fdb_del_bulk(nlh, dev, extack);
+				err = ops->ndo_fdb_del_bulk(nlh, dev, portid,
+							    extack);
 		}
 
 		if (!err) {
 			if (!del_bulk && !notified)
 				rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH,
-						ndm->ndm_state);
+						ndm->ndm_state, portid);
 			ndm->ndm_flags &= ~NTF_SELF;
 		}
 	}
@@ -5327,6 +5342,7 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
 	const struct net_device_ops *ops = NULL;
 	struct net *net = sock_net(in_skb->sk);
 	struct nlattr *tb[NDA_MAX + 1];
+	struct ndo_fdb_parms parms;
 	struct sk_buff *skb;
 	int brport_idx = 0;
 	u8 ndm_flags = 0;
@@ -5404,9 +5420,15 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
 
 	if (br_dev)
 		dev = br_dev;
-	err = ops->ndo_fdb_get(skb, tb, dev, addr, vid,
-			       NETLINK_CB(in_skb).portid,
-			       nlh->nlmsg_seq, extack);
+
+	parms = (struct ndo_fdb_parms) {
+		.dev = dev,
+		.addr = addr,
+		.vid = vid,
+		.portid = NETLINK_CB(in_skb).portid,
+	};
+
+	err = ops->ndo_fdb_get(skb, tb, &parms, nlh->nlmsg_seq, extack);
 	if (err)
 		goto out;
 
diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
index fb5acb8acded11..0e9bcd0f259916 100644
--- a/tools/net/ynl/pyynl/lib/ynl.py
+++ b/tools/net/ynl/pyynl/lib/ynl.py
@@ -61,6 +61,8 @@ class Netlink:
     NLM_F_CREATE = 0x400
     NLM_F_APPEND = 0x800
 
+    NLM_F_BULK = 0x200
+
     NLM_F_CAPPED = 0x100
     NLM_F_ACK_TLVS = 0x200
 
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index fb0a64662053fc..fafe30367243da 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -35,6 +35,7 @@ TEST_PROGS := \
 	fcnal-other.sh \
 	fdb_flush.sh \
 	fdb_notify.sh \
+	fdb_notify_portid.py \
 	fib-onlink-tests.sh \
 	fib_nexthop_multiprefix.sh \
 	fib_nexthop_nongw.sh \
diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config
index dab62cdfa27bad..18dfb45fb914e5 100644
--- a/tools/testing/selftests/net/config
+++ b/tools/testing/selftests/net/config
@@ -126,6 +126,7 @@ CONFIG_NFT_COMPAT=m
 CONFIG_NFT_NAT=m
 CONFIG_NUMA=y
 CONFIG_OPENVSWITCH=m
+CONFIG_PACKET=y
 CONFIG_PAGE_POOL_STATS=y
 CONFIG_PSAMPLE=m
 CONFIG_RPS=y
diff --git a/tools/testing/selftests/net/fdb_notify_portid.py b/tools/testing/selftests/net/fdb_notify_portid.py
new file mode 100755
index 00000000000000..b7b398aa8040a5
--- /dev/null
+++ b/tools/testing/selftests/net/fdb_notify_portid.py
@@ -0,0 +1,297 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+Check that FDB notifications carry the netlink port ID of the requester in
+nlmsg_pid. A listener socket subscribed to the neighbour group receives the
+notifications, while separate requester sockets make the changes. The port ID
+the listener sees is expected to match that of the requester socket.
+"""
+
+import socket
+import struct
+from collections import namedtuple
+
+from lib.py import ksft_run, ksft_exit, ksft_eq, ksft_ne, ksft_true
+from lib.py import ksft_busy_wait
+from lib.py import ip, tool
+from lib.py import NetNS, NetNSEnter
+from lib.py import Netlink, RtnlNeighFamily
+
+RTM_NEWNEIGH = 28
+RTM_DELNEIGH = 29
+
+NTF_SELF = 0x02
+NTF_MASTER = 0x04
+
+NUD_NOARP = 0x40
+NUD_PERMANENT = 0x80
+
+ETH_P_EXP1 = 0x88b5  # Local Experimental EtherType 1
+
+Ntf = namedtuple("Ntf", "type portid addr")
+
+
+class Env:
+    """The listener socket, the two requester sockets A and B, and the
+    netlink port IDs of the latter. All sockets live in the given netns."""
+
+    @staticmethod
+    def _socket(ns):
+        with NetNSEnter(ns):
+            rtnl = RtnlNeighFamily()
+        return rtnl
+
+    def __init__(self, ns):
+        self.ns = str(ns)
+
+        self.listener = self._socket(ns)
+        self.listener.include_raw = True
+        self.listener.ntf_subscribe("rtnlgrp-neigh")
+
+        self.a = self._socket(ns)
+        self.a.sock.bind((0, 0))
+
+        self.b = self._socket(ns)
+        self.b.sock.bind((0, 0))
+
+        self.portids = {self.a: self.a.sock.getsockname()[0],
+                        self.b: self.b.sock.getsockname()[0]}
+
+        ksft_ne(self.portids[self.a], self.portids[self.b])
+        ksft_ne(self.portids[self.a], 0)
+
+    def ifindex(self, name):
+        """Look up the ifindex of a device in the test netns."""
+        with NetNSEnter(self.ns):
+            return socket.if_nametoindex(name)
+
+    def ntfs(self):
+        """Return the bridge-family notifications received by the listener."""
+        self.listener.check_ntf()
+        ntfs = []
+        while self.listener.async_msg_queue.qsize() > 0:
+            msg = self.listener.async_msg_queue.get()
+            if msg['msg']['ndm-family'] == socket.AF_BRIDGE:
+                ntfs.append(Ntf(msg['raw'].nl_type, msg['raw'].nl_portid,
+                                msg['msg']['lladdr']))
+        return ntfs
+
+    def check_ntfs(self, nl_type, addr, requester, count=1):
+        """Expect count notifications for addr, all from the requester."""
+        portids = [n.portid for n in self.ntfs()
+                   if n.type == nl_type and n.addr == addr]
+        ksft_eq(portids, [self.portids[requester]] * count,
+                f"nlmsg_pid of {addr} notifications")
+
+
+def fdb_req(ifindex, ndm_flags, attrs):
+    """Build an AF_BRIDGE neighbour request with the given attributes."""
+    return {'ndm-family': socket.AF_BRIDGE, 'ndm-ifindex': ifindex,
+            'ndm-flags': ndm_flags, **attrs}
+
+
+def test_msg(env, sock, message, message_type,
+             ifindex, addr, ndm_flags, flags, count, attrs):
+    """Send one request through SOCK, and expect COUNT notifications of
+    MESSAGE_TYPE about ADDR carrying the port ID of SOCK."""
+    # pylint: disable=too-many-arguments,too-many-positional-arguments
+    req = fdb_req(ifindex, ndm_flags, attrs | {"lladdr": addr})
+    sock.do(message, req, flags)
+    env.check_ntfs(message_type, addr, sock, count)
+
+
+def add_replace_del(env, ifname, addr, ndm_flags, *, add, rep, dlt, count=1):
+    """Add an entry through socket A, replace it through B, delete through A.
+    ADD, REP and DLT are the attributes of the respective requests. If REP is
+    None, the replace step is skipped."""
+    # pylint: disable=too-many-arguments
+    ifindex = env.ifindex(ifname)
+
+    test_msg(env, env.a, 'newneigh', RTM_NEWNEIGH, ifindex, addr, ndm_flags,
+             flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_EXCL],
+             count=count, attrs=add)
+
+    if rep is not None:
+        test_msg(env, env.b, 'newneigh', RTM_NEWNEIGH, ifindex, addr, ndm_flags,
+                 flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_REPLACE],
+                 count=count, attrs=rep)
+
+    test_msg(env, env.a, 'delneigh', RTM_DELNEIGH, ifindex, addr, ndm_flags,
+             flags=[],
+             count=count, attrs=dlt)
+
+
+def flush(env, ifname, addrs, add, dlt):
+    """Flush all permanent entries through socket A, and check that all the
+    notifications carry the port ID."""
+
+    ifindex = env.ifindex(ifname)
+
+    for addr in addrs:
+        attrs = add | {"ndm-state": NUD_PERMANENT,
+                       "lladdr": addr}
+        env.a.do('newneigh', fdb_req(ifindex, NTF_SELF, attrs),
+                 flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_EXCL])
+
+    env.ntfs()
+
+    attrs = dlt | {'ndm-state': NUD_PERMANENT,
+                   'ndm-state-mask': NUD_PERMANENT}
+    env.a.do('delneigh', fdb_req(ifindex, NTF_SELF, attrs),
+             flags=[Netlink.NLM_F_BULK])
+
+    ntfs = [n for n in env.ntfs() if n.type == RTM_DELNEIGH]
+
+    ksft_true({n.addr for n in ntfs} >= set(addrs),
+              "Flush did not notify about all the entries")
+    ksft_eq({n.portid for n in ntfs}, {env.portids[env.a]},
+            "nlmsg_pid of flush notifications")
+
+
+def test_bridge() -> None:
+    """Bridge port and bridge device entries: add, replace, delete."""
+    with NetNS() as ns:
+        env = Env(ns)
+
+        ip("link add br0 up type bridge vlan_default_pvid 0", ns=ns)
+        ip("link add d0 up type dummy", ns=ns)
+        ip("link set dev d0 master br0", ns=ns)
+
+        add_replace_del(env, "d0", "00:11:22:33:44:01", NTF_MASTER,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep={"ndm-state": NUD_NOARP},
+                        dlt={})
+
+        add_replace_del(env, "br0", "00:11:22:33:44:02", NTF_SELF,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep=None,
+                        dlt={})
+
+
+def test_bridge_vlan() -> None:
+    """Without a VID given, an entry is added and deleted in every VLAN."""
+    with NetNS() as ns:
+        env = Env(ns)
+
+        ip("link add br0 up type bridge vlan_filtering 1 vlan_default_pvid 0",
+           ns=ns)
+        ip("link add d0 up type dummy", ns=ns)
+        ip("link set dev d0 master br0", ns=ns)
+
+        tool("bridge", "vlan add dev d0 vid 10", ns=ns)
+        tool("bridge", "vlan add dev d0 vid 20", ns=ns)
+
+        # Three notifications: for VID 10 and 20, and for the entry
+        # without VLAN.
+        add_replace_del(env, "d0", "00:11:22:33:44:03", NTF_MASTER, count=3,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep=None,
+                        dlt={})
+
+
+def test_bridge_flush() -> None:
+    """Bulk delete of bridge entries."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add br0 up type bridge vlan_default_pvid 0", ns=ns)
+        ip("link add d0 up type dummy", ns=ns)
+        ip("link set dev d0 master br0", ns=ns)
+
+        flush(env, "br0", ["00:11:22:33:44:10",
+                           "00:11:22:33:44:11",
+                           "00:11:22:33:44:12"],
+              add={},
+              dlt={})
+
+
+def test_bridge_learned() -> None:
+    """Entries that are not a result of a request carry port ID of zero."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add br0 up type bridge", ns=ns)
+        ip("link add v0 up type veth peer name v1", ns=ns)
+        ip("link set dev v0 master br0", ns=ns)
+        ip("link set dev v1 up", ns=ns)
+
+        addr = "00:11:22:33:44:31"
+        frame = (b"\xff" * 6 + bytes.fromhex(addr.replace(":", "")) +
+                 struct.pack("!H", ETH_P_EXP1) + b"\0" * 46)
+        with NetNSEnter(env.ns):
+            tx = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)
+            tx.bind(("v1", 0))
+
+        portids = []
+
+        def learned():
+            nonlocal portids
+            tx.send(frame)
+            portids = [n.portid for n in env.ntfs()
+                       if n.type == RTM_NEWNEIGH and n.addr == addr]
+            return portids != []
+
+        # Keep sending until the entry is learned: a frame that
+        # arrives while the bridge port is not yet up is dropped
+        # without triggering learning. Once the entry exists, repeated
+        # frames only refresh it and do not generate notifications.
+        ksft_busy_wait(learned, deadline=2)
+
+        ksft_eq(portids, [0], "nlmsg_pid of learned entry")
+
+
+def test_vxlan() -> None:
+    """VXLAN entries: add, replace the remote, delete."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add vx0 up type vxlan id 2000 dstport 4789", ns=ns)
+
+        add_replace_del(env, "vx0", "00:11:22:33:44:41", NTF_SELF,
+                        add={"dst": "192.0.2.1", "ndm-state": NUD_PERMANENT},
+                        rep={"dst": "192.0.2.2", "ndm-state": NUD_PERMANENT},
+                        dlt={"dst": "192.0.2.2"})
+
+
+def test_vxlan_flush() -> None:
+    """Bulk delete of VXLAN entries."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add vx0 up type vxlan id 2000 dstport 4789", ns=ns)
+
+        flush(env, "vx0", ["00:11:22:33:44:50",
+                           "00:11:22:33:44:51",
+                           "00:11:22:33:44:52"],
+              add={"dst": "192.0.2.1"},
+              dlt={"dst": "192.0.2.1"})
+
+
+def test_macvlan() -> None:
+    """The notifications for macvlan, which does not notify by itself, are
+    sent by the generic code in rtnetlink."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add dd up type dummy", ns=ns)
+        ip("link add mv0 up link dd type macvlan mode passthru", ns=ns)
+
+        # macvlan does not support replace.
+        add_replace_del(env, "mv0", "00:11:22:33:44:61", NTF_SELF,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep=None,
+                        dlt={})
+
+
+def main() -> None:
+    """Run all the tests."""
+    ksft_run([
+        test_bridge,
+        test_bridge_vlan,
+        test_bridge_flush,
+        test_bridge_learned,
+        test_vxlan,
+        test_vxlan_flush,
+        test_macvlan,
+    ])
+    ksft_exit()
+
+
+if __name__ == "__main__":
+    main()
diff --git a/tools/testing/selftests/net/lib/py/__init__.py b/tools/testing/selftests/net/lib/py/__init__.py
index b1696f432c7cf4..3f7696d06e6f43 100644
--- a/tools/testing/selftests/net/lib/py/__init__.py
+++ b/tools/testing/selftests/net/lib/py/__init__.py
@@ -17,7 +17,8 @@ from .utils import CmdExitFailure, fd_read_timeout, cmd, bkg, defer, \
     ctl_file_write, wait_file, tool, tc
 from .bpf import bpf_map_set, bpf_map_dump, bpf_prog_map_ids
 from .ynl import NlError, NlctrlFamily, YnlFamily, \
-    EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily, RtnlRouteFamily
+    EthtoolFamily, NetdevFamily, RtnlFamily, RtnlNeighFamily, \
+    RtnlAddrFamily, RtnlRouteFamily
 from .ynl import NetshaperFamily, DevlinkFamily, GtpFamily, PSPFamily, Netlink
 
 __all__ = ["KSRC",
@@ -36,4 +37,5 @@ __all__ = ["KSRC",
            "NetshaperFamily", "DevlinkFamily", "GtpFamily", "PSPFamily",
            "NlError",
            "YnlFamily", "EthtoolFamily", "NetdevFamily", "RtnlFamily",
-           "NlctrlFamily", "RtnlAddrFamily", "RtnlRouteFamily", "Netlink"]
+           "RtnlNeighFamily", "NlctrlFamily", "RtnlAddrFamily",
+           "RtnlRouteFamily", "Netlink"]
diff --git a/tools/testing/selftests/net/lib/py/ynl.py b/tools/testing/selftests/net/lib/py/ynl.py
index 69a6e9d9b390b0..ac13bf1ff23d3a 100644
--- a/tools/testing/selftests/net/lib/py/ynl.py
+++ b/tools/testing/selftests/net/lib/py/ynl.py
@@ -29,7 +29,8 @@ except ModuleNotFoundError as e:
 
 __all__ = [
     "NlError", "NlPolicy", "Netlink", "YnlFamily", "SPEC_PATH",
-    "EthtoolFamily", "RtnlFamily", "RtnlAddrFamily", "RtnlRouteFamily",
+    "EthtoolFamily", "RtnlFamily", "RtnlNeighFamily", "RtnlAddrFamily",
+    "RtnlRouteFamily",
     "NetdevFamily", "NetshaperFamily", "NlctrlFamily", "DevlinkFamily",
     "GtpFamily", "PSPFamily",
 ]
@@ -49,6 +50,13 @@ class RtnlFamily(YnlFamily):
         super().__init__((SPEC_PATH / Path('rt-link.yaml')).as_posix(),
                          schema='', recv_size=recv_size)
 
+class RtnlNeighFamily(YnlFamily):
+    """Netlink interface for neighbour messages."""
+    # pylint: disable=too-few-public-methods
+    def __init__(self, recv_size=0):
+        super().__init__((SPEC_PATH / Path('rt-neigh.yaml')).as_posix(),
+                         schema='', recv_size=recv_size)
+
 class RtnlAddrFamily(YnlFamily):
     def __init__(self, recv_size=0):
         super().__init__((SPEC_PATH / Path('rt-addr.yaml')).as_posix(),

3/2 2026/11/28 16:39 llm patch-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 37197
							output: 146
							thoughts: 373
						

Thoughts:
**Analyzing the FDB Patch**

Okay, let's dive into this patch. My immediate thought is to carefully analyze the refactoring of those `ndo_fdb_*` functions: `ndo_fdb_add`, `ndo_fdb_del`, `ndo_fdb_get`, `ndo_fdb_del_bulk`, `ndo_dflt_fdb_add`, and `ndo_dflt_fdb_del`. The key change seems to be introducing and propagating the `struct ndo_fdb_parms *parms` structure, which contains device, address, VLAN ID, flags, and most importantly, `portid`. This `portid` propagation to the FDB netlink notifications (`rtnl_fdb_notify`, `br_fdb_notify` / `fdb_notify`, `vxlan_fdb_notify`) is the critical detail here. That's the core of the change.

Now, let's map out where this refactoring impacts the code base. I need to check the Kconfigs for any modified reachable code. Obviously, `net/core/rtnetlink.c` is involved because it's a core networking component, and is always enabled with `NET`. The bridge code, `net/bridge/`, depends on `CONFIG_BRIDGE`, so that is relevant. Similarly, `drivers/net/vxlan/` relies on `CONFIG_VXLAN`. Then we have `drivers/net/macvlan.c`, which uses `CONFIG_MACVLAN`. I should also keep an eye on the hardware drivers (`i40e`, `ice`, `igb`, `ixgbe`, `ocelot`, `qlcnic`) to verify the signature change in the `ndo_fdb_*` methods in the code. I'll need to check the Kconfigs and see the exact dependencies.

My next step is to examine the specific code files: `net/core/rtnetlink.c`, `net/bridge/br_fdb.c`, `drivers/net/vxlan/vxlan_core.c`, and `drivers/net/macvlan.c`. I need to verify the Kconfig dependencies, ensure I'm getting the right symbol names, and understand any behavioral changes. I also need to make sure I check the Kconfig files in `net/bridge/Kconfig`, `drivers/net/Kconfig`, and `drivers/net/vxlan/` (if there are any) to catch any potential gotchas with the configurations and make sure that there isn't any hidden code. I am particularly interested in how the `portid` is being utilized and if there are any subtle side effects that could result.



4/2 2026/11/28 16:39 tool read-file
0m Args:
{
  "File": "net/bridge/Kconfig",
  "FirstLine": 1,
  "LineCount": 100
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# 802.1d Ethernet Bridging\n   4:\t#\n   5:\t\n   6:\tconfig BRIDGE\n   7:\t\ttristate \"802.1d Ethernet Bridging\"\n   8:\t\tselect LLC\n   9:\t\tselect STP\n  10:\t\thelp\n  11:\t\t  If you say Y here, then your Linux box will be able to act as an\n  12:\t\t  Ethernet bridge, which means that the different Ethernet segments it\n  13:\t\t  is connected to will appear as one Ethernet to the participants.\n  14:\t\t  Several such bridges can work together to create even larger\n  15:\t\t  networks of Ethernets using the IEEE 802.1 spanning tree algorithm.\n  16:\t\t  As this is a standard, Linux bridges will cooperate properly with\n  17:\t\t  other third party bridge products.\n  18:\t\n  19:\t\t  In order to use the Ethernet bridge, you'll need the bridge\n  20:\t\t  configuration tools; see \u003cfile:Documentation/networking/bridge.rst\u003e\n  21:\t\t  for location. Please read the Bridge mini-HOWTO for more\n  22:\t\t  information.\n  23:\t\n  24:\t\t  If you enable iptables support along with the bridge support then you\n  25:\t\t  turn your bridge into a bridging IP firewall.\n  26:\t\t  iptables will then see the IP packets being bridged, so you need to\n  27:\t\t  take this into account when setting up your firewall rules.\n  28:\t\t  Enabling arptables support when bridging will let arptables see\n  29:\t\t  bridged ARP traffic in the arptables FORWARD chain.\n  30:\t\n  31:\t\t  To compile this code as a module, choose M here: the module\n  32:\t\t  will be called bridge.\n  33:\t\n  34:\t\t  If unsure, say N.\n  35:\t\n  36:\tconfig BRIDGE_IGMP_SNOOPING\n  37:\t\tbool \"IGMP/MLD snooping\"\n  38:\t\tdepends on BRIDGE\n  39:\t\tdepends on INET\n  40:\t\tdefault y\n  41:\t\thelp\n  42:\t\t  If you say Y here, then the Ethernet bridge will be able selectively\n  43:\t\t  forward multicast traffic based on IGMP/MLD traffic received from\n  44:\t\t  each port.\n  45:\t\n  46:\t\t  Say N to exclude this support and reduce the binary size.\n  47:\t\n  48:\t\t  If unsure, say Y.\n  49:\t\n  50:\tconfig BRIDGE_VLAN_FILTERING\n  51:\t\tbool \"VLAN filtering\"\n  52:\t\tdepends on BRIDGE\n  53:\t\tdepends on VLAN_8021Q\n  54:\t\tdefault n\n  55:\t\thelp\n  56:\t\t  If you say Y here, then the Ethernet bridge will be able selectively\n  57:\t\t  receive and forward traffic based on VLAN information in the packet\n  58:\t\t  any VLAN information configured on the bridge port or bridge device.\n  59:\t\n  60:\t\t  Say N to exclude this support and reduce the binary size.\n  61:\t\n  62:\t\t  If unsure, say Y.\n  63:\t\n  64:\tconfig BRIDGE_MRP\n  65:\t\tbool \"MRP protocol\"\n  66:\t\tdepends on BRIDGE\n  67:\t\tdefault n\n  68:\t\thelp\n  69:\t\t  If you say Y here, then the Ethernet bridge will be able to run MRP\n  70:\t\t  protocol to detect loops\n  71:\t\n  72:\t\t  Say N to exclude this support and reduce the binary size.\n  73:\t\n  74:\t\t  If unsure, say N.\n  75:\t\n  76:\tconfig BRIDGE_CFM\n  77:\t\tbool \"CFM protocol\"\n  78:\t\tdepends on BRIDGE\n  79:\t\thelp\n  80:\t\t  If you say Y here, then the Ethernet bridge will be able to run CFM\n  81:\t\t  protocol according to 802.1Q section 12.14\n  82:\t\n  83:\t\t  Say N to exclude this support and reduce the binary size.\n  84:\t\n  85:\t\t  If unsure, say N.\n"
}

5/2 2026/11/28 16:39 tool grepper
0m Args:
{
  "Expression": "config (VXLAN|MACVLAN)\\b",
  "PathPrefixes": [
    "drivers/net/Kconfig",
    "drivers/net/vxlan/Kconfig"
  ]
}

Results:
{
  "Output": "drivers/net/Kconfig=163=source \"drivers/net/team/Kconfig\"\ndrivers/net/Kconfig-164-\ndrivers/net/Kconfig:165:config MACVLAN\ndrivers/net/Kconfig-166-\ttristate \"MAC-VLAN support\"\n--\ndrivers/net/Kconfig=216=config IPVTAP\n--\ndrivers/net/Kconfig-229-\ndrivers/net/Kconfig:230:config VXLAN\ndrivers/net/Kconfig-231-\ttristate \"Virtual eXtensible Local Area Network (VXLAN)\"\n"
}

6/2 2026/11/28 16:39 tool grepper
0m Args:
{
  "Expression": "ndo_fdb_add|ndo_fdb_del|ndo_fdb_get|ndo_fdb_del_bulk",
  "PathPrefixes": [
    "net/",
    "drivers/net/"
  ]
}

Results:
{
  "Output": "drivers/net/dsa/netc/netc_main.c=712=static int netc_port_del_fdb_entry(struct netc_port *np,\n--\ndrivers/net/dsa/netc/netc_main.c-732-\t\t * For NTF_SELF path: dsa_user_netdev_ops does not implement\ndrivers/net/dsa/netc/netc_main.c:733:\t\t * ndo_fdb_del(), so rtnl_fdb_del() falls back to\ndrivers/net/dsa/netc/netc_main.c-734-\t\t * ndo_dflt_fdb_del(), which only supports NUD_PERMANENT static\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c=13005=static int i40e_get_phys_port_id(struct net_device *netdev,\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13021-/**\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13022: * i40e_ndo_fdb_add - add an entry to the hardware database\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13023- * @ndm: the input from the stack\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13028- */\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13029:static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13030-\t\t\t    const struct ndo_fdb_parms *parms, bool *notified,\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c=13633=static const struct net_device_ops i40e_netdev_ops = {\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13659-\t.ndo_get_phys_port_id\t= i40e_get_phys_port_id,\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13660:\t.ndo_fdb_add\t\t= i40e_ndo_fdb_add,\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13661-\t.ndo_features_check\t= i40e_features_check,\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=9795=static const struct net_device_ops ice_netdev_ops = {\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-9821-\t.ndo_bridge_setlink = ice_bridge_setlink,\ndrivers/net/ethernet/intel/ice/ice_main.c:9822:\t.ndo_fdb_add = ice_fdb_add,\ndrivers/net/ethernet/intel/ice/ice_main.c:9823:\t.ndo_fdb_del = ice_fdb_del,\ndrivers/net/ethernet/intel/ice/ice_main.c-9824-#ifdef CONFIG_RFS_ACCEL\n--\ndrivers/net/ethernet/intel/igb/igb_main.c=2482=static int igb_set_features(struct net_device *netdev,\n--\ndrivers/net/ethernet/intel/igb/igb_main.c-2518-\ndrivers/net/ethernet/intel/igb/igb_main.c:2519:static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/intel/igb/igb_main.c-2520-\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\n--\ndrivers/net/ethernet/intel/igb/igb_main.c=3036=static const struct net_device_ops igb_netdev_ops = {\n--\ndrivers/net/ethernet/intel/igb/igb_main.c-3056-\t.ndo_set_features\t= igb_set_features,\ndrivers/net/ethernet/intel/igb/igb_main.c:3057:\t.ndo_fdb_add\t\t= igb_ndo_fdb_add,\ndrivers/net/ethernet/intel/igb/igb_main.c-3058-\t.ndo_features_check\t= igb_features_check,\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c=10534=static int ixgbe_set_features(struct net_device *netdev,\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-10604-\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:10605:static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-10606-\t\t\t     const struct ndo_fdb_parms *parms, bool *notified,\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c=11070=static const struct net_device_ops ixgbe_netdev_ops = {\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-11105-\t.ndo_fix_features = ixgbe_fix_features,\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:11106:\t.ndo_fdb_add\t\t= ixgbe_ndo_fdb_add,\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-11107-\t.ndo_bridge_setlink\t= ixgbe_ndo_bridge_setlink,\n--\ndrivers/net/ethernet/mscc/ocelot_net.c=947=static const struct net_device_ops ocelot_port_netdev_ops = {\n--\ndrivers/net/ethernet/mscc/ocelot_net.c-954-\t.ndo_get_stats64\t\t= ocelot_get_stats64,\ndrivers/net/ethernet/mscc/ocelot_net.c:955:\t.ndo_fdb_add\t\t\t= ocelot_port_fdb_add,\ndrivers/net/ethernet/mscc/ocelot_net.c:956:\t.ndo_fdb_del\t\t\t= ocelot_port_fdb_del,\ndrivers/net/ethernet/mscc/ocelot_net.c-957-\t.ndo_fdb_dump\t\t\t= ocelot_port_fdb_dump,\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c=500=static const struct net_device_ops qlcnic_netdev_ops = {\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c-513-\t.ndo_vlan_rx_kill_vid\t= qlcnic_vlan_rx_del,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:514:\t.ndo_fdb_add\t\t= qlcnic_fdb_add,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:515:\t.ndo_fdb_del\t\t= qlcnic_fdb_del,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c-516-\t.ndo_fdb_dump\t\t= qlcnic_fdb_dump,\n--\ndrivers/net/macvlan.c=1201=static const struct net_device_ops macvlan_netdev_ops = {\n--\ndrivers/net/macvlan.c-1215-\t.ndo_vlan_rx_kill_vid\t= macvlan_vlan_rx_kill_vid,\ndrivers/net/macvlan.c:1216:\t.ndo_fdb_add\t\t= macvlan_fdb_add,\ndrivers/net/macvlan.c:1217:\t.ndo_fdb_del\t\t= macvlan_fdb_del,\ndrivers/net/macvlan.c-1218-\t.ndo_fdb_dump\t\t= ndo_dflt_fdb_dump,\n--\ndrivers/net/vxlan/vxlan_core.c=3376=static const struct net_device_ops vxlan_netdev_ether_ops = {\n--\ndrivers/net/vxlan/vxlan_core.c-3385-\t.ndo_set_mac_address\t= eth_mac_addr,\ndrivers/net/vxlan/vxlan_core.c:3386:\t.ndo_fdb_add\t\t= vxlan_fdb_add,\ndrivers/net/vxlan/vxlan_core.c:3387:\t.ndo_fdb_del\t\t= vxlan_fdb_delete,\ndrivers/net/vxlan/vxlan_core.c:3388:\t.ndo_fdb_del_bulk\t= vxlan_fdb_delete_bulk,\ndrivers/net/vxlan/vxlan_core.c-3389-\t.ndo_fdb_dump\t\t= vxlan_fdb_dump,\ndrivers/net/vxlan/vxlan_core.c:3390:\t.ndo_fdb_get\t\t= vxlan_fdb_get,\ndrivers/net/vxlan/vxlan_core.c-3391-\t.ndo_mdb_add\t\t= vxlan_mdb_add,\n--\nnet/bridge/br_device.c=440=static const struct net_device_ops br_netdev_ops = {\n--\nnet/bridge/br_device.c-459-\t.ndo_fix_features        = br_fix_features,\nnet/bridge/br_device.c:460:\t.ndo_fdb_add\t\t = br_fdb_add,\nnet/bridge/br_device.c:461:\t.ndo_fdb_del\t\t = br_fdb_delete,\nnet/bridge/br_device.c:462:\t.ndo_fdb_del_bulk\t = br_fdb_delete_bulk,\nnet/bridge/br_device.c-463-\t.ndo_fdb_dump\t\t = br_fdb_dump,\nnet/bridge/br_device.c:464:\t.ndo_fdb_get\t\t = br_fdb_get,\nnet/bridge/br_device.c-465-\t.ndo_mdb_add\t\t = br_mdb_add,\n--\nnet/core/rtnetlink.c=4810=static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\n--\nnet/core/rtnetlink.c-4871-\nnet/core/rtnetlink.c:4872:\t\terr = ops-\u003endo_fdb_add(ndm, tb, \u0026parms, \u0026notified, extack);\nnet/core/rtnetlink.c-4873-\t\tif (err)\n--\nnet/core/rtnetlink.c-4882-\nnet/core/rtnetlink.c:4883:\t\tif (dev-\u003enetdev_ops-\u003endo_fdb_add)\nnet/core/rtnetlink.c:4884:\t\t\terr = dev-\u003enetdev_ops-\u003endo_fdb_add(ndm, tb, \u0026parms,\nnet/core/rtnetlink.c-4885-\t\t\t\t\t\t\t   \u0026notified, extack);\n--\nnet/core/rtnetlink.c=4926=static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n--\nnet/core/rtnetlink.c-4998-\t\tif (!del_bulk) {\nnet/core/rtnetlink.c:4999:\t\t\tif (ops-\u003endo_fdb_del)\nnet/core/rtnetlink.c:5000:\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\nnet/core/rtnetlink.c-5001-\t\t\t\t\t\t       \u0026notified, extack);\nnet/core/rtnetlink.c-5002-\t\t} else {\nnet/core/rtnetlink.c:5003:\t\t\tif (ops-\u003endo_fdb_del_bulk)\nnet/core/rtnetlink.c:5004:\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, portid,\nnet/core/rtnetlink.c-5005-\t\t\t\t\t\t\t    extack);\n--\nnet/core/rtnetlink.c-5019-\t\tif (!del_bulk) {\nnet/core/rtnetlink.c:5020:\t\t\tif (ops-\u003endo_fdb_del)\nnet/core/rtnetlink.c:5021:\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\nnet/core/rtnetlink.c-5022-\t\t\t\t\t\t       \u0026notified, extack);\n--\nnet/core/rtnetlink.c-5027-\t\t\terr = -EOPNOTSUPP;\nnet/core/rtnetlink.c:5028:\t\t\tif (ops-\u003endo_fdb_del_bulk)\nnet/core/rtnetlink.c:5029:\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, portid,\nnet/core/rtnetlink.c-5030-\t\t\t\t\t\t\t    extack);\n--\nnet/core/rtnetlink.c=5338=static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,\n--\nnet/core/rtnetlink.c-5411-\nnet/core/rtnetlink.c:5412:\tif (!ops || !ops-\u003endo_fdb_get) {\nnet/core/rtnetlink.c-5413-\t\tNL_SET_ERR_MSG(extack, \"Fdb get operation not supported by device\");\n--\nnet/core/rtnetlink.c-5430-\nnet/core/rtnetlink.c:5431:\terr = ops-\u003endo_fdb_get(skb, tb, \u0026parms, nlh-\u003enlmsg_seq, extack);\nnet/core/rtnetlink.c-5432-\tif (err)\n"
}

7/2 2026/11/28 16:39 llm patch-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 42672
							output: 81
							thoughts: 95
						

Thoughts:
Okay, here's my summary, tailored as requested:

**Digging into MACVLAN/VXLAN and FDB Handling**

Alright, let's get down to brass tacks. I need to refresh my memory on the kernel configuration specifics for `MACVLAN` and `VXLAN`. My initial hunch is that something might have shifted in their dependency setup, perhaps introduced an unexpected interaction or requirement. I'm going to jump into `drivers/net/Kconfig`, specifically focusing on lines 165 through 245. That should be the core region where those features are defined, and where the conditional dependencies should be clearly laid out. I'm looking for anything that stands out, any subtle changes in how those options are enabled or disabled, or perhaps any new dependencies that might be relevant.

Next, I need to investigate the FDB (Forwarding Database) handling. I'm going to examine `net/core/rtnetlink.c`, zeroing in on the `rtnl_fdb_add`, `rtnl_fdb_del`, and `rtnl_fdb_get` functions. The goal here is to check for potential regression points. Specifically, I'm watching for any changes in the way parameters are handled, looking for any uninitialized `parms` usage. That area has historically been a source of subtle issues, and I need to be certain nothing problematic has crept in. It's a classic area for a race condition, or a missed init, that could cause packet corruption or even a kernel panic. I'll meticulously review the control flow to ensure proper initialization and safety.



8/2 2026/11/28 16:39 tool read-file
0m Args:
{
  "File": "drivers/net/Kconfig",
  "FirstLine": 165,
  "LineCount": 90
}

Results:
{
  "Contents": " 165:\tconfig MACVLAN\n 166:\t\ttristate \"MAC-VLAN support\"\n 167:\t\thelp\n 168:\t\t  This allows one to create virtual interfaces that map packets to\n 169:\t\t  or from specific MAC addresses to a particular interface.\n 170:\t\n 171:\t\t  Macvlan devices can be added using the \"ip\" command from the\n 172:\t\t  iproute2 package starting with the iproute2-2.6.23 release:\n 173:\t\n 174:\t\t  \"ip link add link \u003creal dev\u003e [ address MAC ] [ NAME ] type macvlan\"\n 175:\t\n 176:\t\t  To compile this driver as a module, choose M here: the module\n 177:\t\t  will be called macvlan.\n 178:\t\n 179:\tconfig MACVTAP\n 180:\t\ttristate \"MAC-VLAN based tap driver\"\n 181:\t\tdepends on MACVLAN\n 182:\t\tdepends on INET\n 183:\t\tselect TAP\n 184:\t\thelp\n 185:\t\t  This adds a specialized tap character device driver that is based\n 186:\t\t  on the MAC-VLAN network interface, called macvtap. A macvtap device\n 187:\t\t  can be added in the same way as a macvlan device, using 'type\n 188:\t\t  macvtap', and then be accessed through the tap user space interface.\n 189:\t\n 190:\t\t  To compile this driver as a module, choose M here: the module\n 191:\t\t  will be called macvtap.\n 192:\t\n 193:\tconfig IPVLAN_L3S\n 194:\t\tdepends on NETFILTER\n 195:\t\tdepends on IPVLAN\n 196:\t\tdef_bool y\n 197:\t\tselect NET_L3_MASTER_DEV\n 198:\t\n 199:\tconfig IPVLAN\n 200:\t\ttristate \"IP-VLAN support\"\n 201:\t\tdepends on INET\n 202:\t\thelp\n 203:\t\t  This allows one to create virtual devices off of a main interface\n 204:\t\t  and packets will be delivered based on the dest L3 (IPv6/IPv4 addr)\n 205:\t\t  on packets. All interfaces (including the main interface) share L2\n 206:\t\t  making it transparent to the connected L2 switch.\n 207:\t\n 208:\t\t  Ipvlan devices can be added using the \"ip\" command from the\n 209:\t\t  iproute2 package starting with the iproute2-3.19 release:\n 210:\t\n 211:\t\t  \"ip link add link \u003cmain-dev\u003e [ NAME ] type ipvlan\"\n 212:\t\n 213:\t\t  To compile this driver as a module, choose M here: the module\n 214:\t\t  will be called ipvlan.\n 215:\t\n 216:\tconfig IPVTAP\n 217:\t\ttristate \"IP-VLAN based tap driver\"\n 218:\t\tdepends on IPVLAN\n 219:\t\tdepends on INET\n 220:\t\tselect TAP\n 221:\t\thelp\n 222:\t\t  This adds a specialized tap character device driver that is based\n 223:\t\t  on the IP-VLAN network interface, called ipvtap. An ipvtap device\n 224:\t\t  can be added in the same way as a ipvlan device, using 'type\n 225:\t\t  ipvtap', and then be accessed through the tap user space interface.\n 226:\t\n 227:\t\t  To compile this driver as a module, choose M here: the module\n 228:\t\t  will be called ipvtap.\n 229:\t\n 230:\tconfig VXLAN\n 231:\t\ttristate \"Virtual eXtensible Local Area Network (VXLAN)\"\n 232:\t\tdepends on INET\n 233:\t\tselect NET_UDP_TUNNEL\n 234:\t\tselect GRO_CELLS\n 235:\t\thelp\n 236:\t\t  This allows one to create vxlan virtual interfaces that provide\n 237:\t\t  Layer 2 Networks over Layer 3 Networks. VXLAN is often used\n 238:\t\t  to tunnel virtual network infrastructure in virtualized environments.\n 239:\t\t  For more information see:\n 240:\t\t    http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-02\n 241:\t\n 242:\t\t  To compile this driver as a module, choose M here: the module\n 243:\t\t  will be called vxlan.\n 244:\t\n 245:\tconfig GENEVE\n 246:\t\ttristate \"Generic Network Virtualization Encapsulation\"\n 247:\t\tdepends on INET\n 248:\t\tselect NET_UDP_TUNNEL\n 249:\t\tselect GRO_CELLS\n 250:\t\thelp\n 251:\t\t  This allows one to create geneve virtual interfaces that provide\n 252:\t\t  Layer 2 Networks over Layer 3 Networks. GENEVE is often used\n 253:\t\t  to tunnel virtual network infrastructure in virtualized environments.\n 254:\t\t  For more information see:\n"
}

9/2 2026/11/28 16:39 tool read-file
0m Args:
{
  "File": "net/core/rtnetlink.c",
  "FirstLine": 4925,
  "LineCount": 100
}

Results:
{
  "Contents": "4925:\t\n4926:\tstatic int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n4927:\t\t\t\tstruct netlink_ext_ack *extack)\n4928:\t{\n4929:\t\tbool del_bulk = !!(nlh-\u003enlmsg_flags \u0026 NLM_F_BULK);\n4930:\t\tstruct net *net = sock_net(skb-\u003esk);\n4931:\t\tu32 portid = NETLINK_CB(skb).portid;\n4932:\t\tconst struct net_device_ops *ops;\n4933:\t\tstruct ndmsg *ndm;\n4934:\t\tstruct nlattr *tb[NDA_MAX+1];\n4935:\t\tstruct ndo_fdb_parms parms;\n4936:\t\tstruct net_device *dev;\n4937:\t\t__u8 *addr = NULL;\n4938:\t\tint err;\n4939:\t\tu16 vid;\n4940:\t\n4941:\t\tif (!del_bulk) {\n4942:\t\t\terr = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX,\n4943:\t\t\t\t\t\t     NULL, extack);\n4944:\t\t} else {\n4945:\t\t\t/* For bulk delete, the drivers will parse the message with\n4946:\t\t\t * policy.\n4947:\t\t\t */\n4948:\t\t\terr = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, extack);\n4949:\t\t}\n4950:\t\tif (err \u003c 0)\n4951:\t\t\treturn err;\n4952:\t\n4953:\t\tndm = nlmsg_data(nlh);\n4954:\t\tif (ndm-\u003endm_ifindex == 0) {\n4955:\t\t\tNL_SET_ERR_MSG(extack, \"invalid ifindex\");\n4956:\t\t\treturn -EINVAL;\n4957:\t\t}\n4958:\t\n4959:\t\tdev = __dev_get_by_index(net, ndm-\u003endm_ifindex);\n4960:\t\tif (dev == NULL) {\n4961:\t\t\tNL_SET_ERR_MSG(extack, \"unknown ifindex\");\n4962:\t\t\treturn -ENODEV;\n4963:\t\t}\n4964:\t\n4965:\t\tif (!del_bulk) {\n4966:\t\t\tif (!tb[NDA_LLADDR] || nla_len(tb[NDA_LLADDR]) != ETH_ALEN) {\n4967:\t\t\t\tNL_SET_ERR_MSG(extack, \"invalid address\");\n4968:\t\t\t\treturn -EINVAL;\n4969:\t\t\t}\n4970:\t\t\taddr = nla_data(tb[NDA_LLADDR]);\n4971:\t\n4972:\t\t\terr = fdb_vid_parse(tb[NDA_VLAN], \u0026vid, extack);\n4973:\t\t\tif (err)\n4974:\t\t\t\treturn err;\n4975:\t\n4976:\t\t\tparms = (struct ndo_fdb_parms) {\n4977:\t\t\t\t.dev = dev,\n4978:\t\t\t\t.addr = addr,\n4979:\t\t\t\t.vid = vid,\n4980:\t\t\t\t.portid = portid,\n4981:\t\t\t};\n4982:\t\t}\n4983:\t\n4984:\t\tif (dev-\u003etype != ARPHRD_ETHER) {\n4985:\t\t\tNL_SET_ERR_MSG(extack, \"FDB delete only supported for Ethernet devices\");\n4986:\t\t\treturn -EINVAL;\n4987:\t\t}\n4988:\t\n4989:\t\terr = -EOPNOTSUPP;\n4990:\t\n4991:\t\t/* Support fdb on master device the net/bridge default case */\n4992:\t\tif ((!ndm-\u003endm_flags || ndm-\u003endm_flags \u0026 NTF_MASTER) \u0026\u0026\n4993:\t\t    netif_is_bridge_port(dev)) {\n4994:\t\t\tstruct net_device *br_dev = netdev_master_upper_dev_get(dev);\n4995:\t\t\tbool notified = false;\n4996:\t\n4997:\t\t\tops = br_dev-\u003enetdev_ops;\n4998:\t\t\tif (!del_bulk) {\n4999:\t\t\t\tif (ops-\u003endo_fdb_del)\n5000:\t\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\n5001:\t\t\t\t\t\t\t       \u0026notified, extack);\n5002:\t\t\t} else {\n5003:\t\t\t\tif (ops-\u003endo_fdb_del_bulk)\n5004:\t\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, portid,\n5005:\t\t\t\t\t\t\t\t    extack);\n5006:\t\t\t}\n5007:\t\n5008:\t\t\tif (err)\n5009:\t\t\t\tgoto out;\n5010:\t\t\telse\n5011:\t\t\t\tndm-\u003endm_flags \u0026= ~NTF_MASTER;\n5012:\t\t}\n5013:\t\n5014:\t\t/* Embedded bridge, macvlan, and any other device support */\n5015:\t\tif (ndm-\u003endm_flags \u0026 NTF_SELF) {\n5016:\t\t\tbool notified = false;\n5017:\t\n5018:\t\t\tops = dev-\u003enetdev_ops;\n5019:\t\t\tif (!del_bulk) {\n5020:\t\t\t\tif (ops-\u003endo_fdb_del)\n5021:\t\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\n5022:\t\t\t\t\t\t\t       \u0026notified, extack);\n5023:\t\t\t\telse\n5024:\t\t\t\t\terr = ndo_dflt_fdb_del(ndm, tb, \u0026parms);\n"
}

10/2 2026/11/28 16:39 llm patch-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 45763
							output: 46
							thoughts: 947
						

Thoughts:
**Analyzing FDB Functionality in the Kernel**

Okay, let's dive into this FDB situation. First, I need to check `rtnl_fdb_add`, `rtnl_fdb_get`, and `rtnl_fdb_del` within `net/core/rtnetlink.c`, as that's where the netlink interfaces for FDB management typically reside. I'll also do a quick sweep of the tree, specifically looking for any `ndo_fdb_*` implementations scattered around, particularly in driver areas like Mellanox, DSA, and bonding. A grep from earlier showed occurrences, but it's always good to be thorough.

Wait, hold on. Before I get too far, I need to focus on the bridge code. I need to examine `net/bridge/br_fdb.c`, specifically around `br_fdb_add`, `br_fdb_delete`, `br_fdb_delete_bulk` and the VXLAN counterparts: `vxlan_fdb_add`, `vxlan_fdb_delete`, `vxlan_fdb_delete_bulk` and `vxlan_fdb_get`. This is important because I need to identify which functions are *not* static, and hence, potentially visible to syzkaller's kcov/symbol analysis. Recall that static functions are fine unless inlined, but the `ndo_fdb_*` callbacks stored in `struct net_device_ops` *can't* be inlined. Their addresses are taken!

Right, let's make a clear list of the specific functions modified across the relevant subsystems: `net/core/rtnetlink.c`, `net/bridge/`, `drivers/net/vxlan/`, and `drivers/net/macvlan.c`. Okay, here's what I have:

1.  **`net/core/rtnetlink.c`**:
    *   `rtnl_fdb_add`
    *   `rtnl_fdb_del`
    *   `rtnl_fdb_get`
    *   `ndo_dflt_fdb_add`
    *   `ndo_dflt_fdb_del`
    *   `rtnl_fdb_notify` (a static helper function)
2.  **`net/bridge/br_fdb.c`**:
    *   `br_fdb_add`
    *   `br_fdb_delete`
    *   `br_fdb_delete_bulk`
    *   `br_fdb_get`
    *   `br_fdb_flush`
    *   `br_fdb_external_learn_add`
    *   `br_fdb_external_learn_del`
    *   `br_fdb_update` / `__br_fdb_update`
    *   `fdb_notify`, `fdb_add_entry`, `__br_fdb_add`, `fdb_delete`, etc.
3.  **`drivers/net/vxlan/vxlan_core.c`**:
    *   `vxlan_fdb_add`
    *   `vxlan_fdb_delete`
    *   `vxlan_fdb_delete_bulk`
    *   `vxlan_fdb_get`
    *   `vxlan_fdb_update`
    *   `__vxlan_fdb_delete`
    *   `vxlan_fdb_notify`
    *   `vxlan_flush`
4.  **`drivers/net/macvlan.c`**:
    *   `macvlan_fdb_add`
    *   `macvlan_fdb_del`

Now, the crucial question: are `rtnl_fdb_add`, `rtnl_fdb_del`, and `rtnl_fdb_get` just called from random places, or are they *special*? Aha, they are the direct netlink handlers for `RTM_NEWNEIGH`, `RTM_DELNEIGH`, `RTM_GETNEIGH` operations for `PF_BRIDGE`. That implies they are not called by unrelated tests!

Wait, this is good. These functions are non-ubiquitous! They're *only* invoked for `AF_BRIDGE` neighbor netlink operations, so they're not general netlink handlers or part of general socket/netdev lifecycle! That narrows things down significantly. Just to be absolutely sure, I'll quickly double-check how these functions are registered in `net/


11/2 2026/11/28 16:39 tool grepper
0m Args:
{
  "Expression": "rtnl_fdb_(add|del|get)",
  "PathPrefixes": [
    "net/core/rtnetlink.c"
  ]
}

Results:
{
  "Output": "net/core/rtnetlink.c=4788=static int fdb_vid_parse(struct nlattr *vlan_attr, u16 *p_vid,\n--\nnet/core/rtnetlink.c-4809-\nnet/core/rtnetlink.c:4810:static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,\nnet/core/rtnetlink.c-4811-\t\t\tstruct netlink_ext_ack *extack)\n--\nnet/core/rtnetlink.c=4924=EXPORT_SYMBOL(ndo_dflt_fdb_del);\nnet/core/rtnetlink.c-4925-\nnet/core/rtnetlink.c:4926:static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\nnet/core/rtnetlink.c-4927-\t\t\tstruct netlink_ext_ack *extack)\n--\nnet/core/rtnetlink.c=5275=static int valid_fdb_get_strict(const struct nlmsghdr *nlh,\n--\nnet/core/rtnetlink.c-5337-\nnet/core/rtnetlink.c:5338:static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,\nnet/core/rtnetlink.c-5339-\t\t\tstruct netlink_ext_ack *extack)\n--\nnet/core/rtnetlink.c=7293=static const struct rtnl_msg_handler rtnetlink_rtnl_msg_handlers[] __initconst = {\n--\nnet/core/rtnetlink.c-7320-\t .doit = rtnl_bridge_setlink},\nnet/core/rtnetlink.c:7321:\t{.protocol = PF_BRIDGE, .msgtype = RTM_NEWNEIGH, .doit = rtnl_fdb_add},\nnet/core/rtnetlink.c:7322:\t{.protocol = PF_BRIDGE, .msgtype = RTM_DELNEIGH, .doit = rtnl_fdb_del,\nnet/core/rtnetlink.c-7323-\t .flags = RTNL_FLAG_BULK_DEL_SUPPORTED},\nnet/core/rtnetlink.c:7324:\t{.protocol = PF_BRIDGE, .msgtype = RTM_GETNEIGH, .doit = rtnl_fdb_get,\nnet/core/rtnetlink.c-7325-\t .dumpit = rtnl_fdb_dump},\n"
}

12/2 2026/11/28 16:39 llm patch-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 47413
							output: 42
							thoughts: 318
						

Thoughts:
**Kconfig Dependencies Review**

Alright, let's get down to brass tacks and double-check these Kconfig dependencies for `BRIDGE`, `VXLAN`, `MACVLAN`, and `BRIDGE_VLAN_FILTERING`. It's good practice to make sure everything's lined up. I'm noting that `br_fdb.c` handles VLANs in `br_fdb_add` and `br_fdb_delete`, specifically using the `vparms.vid` which is something to keep in mind.

First stop, `net/bridge/Kconfig`. We've got:

*   `BRIDGE` (which selects `LLC` and `STP` – no surprises there).
*   `BRIDGE_VLAN_FILTERING` which, as expected, depends on `BRIDGE` and `VLAN_8021Q`.

Next, the `drivers/net/Kconfig` file. We find:

*   `VXLAN`, which depends on `INET` and selects `NET_UDP_TUNNEL` and `GRO_CELLS`.
*   And finally, `MACVLAN`.

Now, we need to think about `NET`, `INET`, and `VLAN_8021Q`. Are they explicitly in the `EnableConfigs`? We should ensure they're there, especially since they're critical for these bridge and tunneling features. Adding `BRIDGE`, `BRIDGE_VLAN_FILTERING`, `VLAN_8021Q`, `VXLAN`, and `MACVLAN` feels right. Even if `INET` is usually a given, it's good to make sure it's present; and `VLAN_8021Q` doesn't hurt, either. Let's make sure that `BRIDGE_VLAN_FILTERING` and `VXLAN` can be enabled. One last check, I'll go through `net/8021q/Kconfig` to see if `VLAN_8021Q` has any unexpected dependencies. This is just due diligence, but better safe than sorry.



13/2 2026/11/28 16:39 tool read-file
0m Args:
{
  "File": "net/8021q/Kconfig",
  "FirstLine": 1,
  "LineCount": 30
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# Configuration for 802.1Q VLAN support\n   4:\t#\n   5:\t\n   6:\tconfig VLAN_8021Q\n   7:\t\ttristate \"802.1Q/802.1ad VLAN Support\"\n   8:\t\thelp\n   9:\t\t  Select this and you will be able to create 802.1Q VLAN interfaces\n  10:\t\t  on your Ethernet interfaces. 802.1Q VLAN supports almost\n  11:\t\t  everything a regular Ethernet interface does, including\n  12:\t\t  firewalling, bridging, and of course IP traffic. You will need\n  13:\t\t  the 'ip' utility in order to effectively use VLANs.\n  14:\t\t  See the VLAN web page for more information:\n  15:\t\t  \u003chttp://www.candelatech.com/~greear/vlan.html\u003e\n  16:\t\n  17:\t\t  To compile this code as a module, choose M here: the module\n  18:\t\t  will be called 8021q.\n  19:\t\n  20:\t\t  If unsure, say N.\n  21:\t\n  22:\tconfig VLAN_8021Q_GVRP\n  23:\t\tbool \"GVRP (GARP VLAN Registration Protocol) support\"\n  24:\t\tdepends on VLAN_8021Q\n  25:\t\tselect GARP\n  26:\t\thelp\n  27:\t\t  Select this to enable GVRP end-system support. GVRP is used for\n  28:\t\t  automatic propagation of registered VLANs to switches.\n  29:\t\n  30:\t\t  If unsure, say N.\n"
}

14/2 2026/11/28 16:39 llm patch-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 48227
							output: 413
							thoughts: 428
						

Thoughts:
**My Analysis of the FDB Patch Series**

Okay, I've got a clear picture of what's being modified here. This patch series is focused, and everything seems well-defined. The core of the changes revolves around how the Forwarding Database (FDB) is managed within the Linux kernel's networking stack. It's touching several key areas: `net/core/rtnetlink.c`, the Ethernet bridge (`net/bridge/`), VXLAN (`drivers/net/vxlan/`), and macvlan (`drivers/net/macvlan.c`). The introduction of `struct ndo_fdb_parms` and propagation of `portid` are central to this.

The changes directly impact how FDB entries are added, deleted, retrieved, and flushed, as well as how external learning and notifications work. We're talking about direct interaction with userspace via netlink messages (`PF_BRIDGE`, `RTM_NEWNEIGH`, `RTM_DELNEIGH`, `RTM_GETNEIGH`) on virtual interfaces like bridges, VXLANs, macvlans, and even dummy and veth devices. This is significant because it directly affects how network administrators interact with these virtual interfaces.

The patch's `FocusSymbols` are spot-on; they've identified the critical FDB netlink entry points and driver callbacks that are being modified. They're avoiding more general lifecycle functions, which is good for maintainability and avoiding unintended side effects.

Finally, the `EnableConfigs` list confirms the relevant kernel configurations that are affected. `BRIDGE`, `BRIDGE_VLAN_FILTERING`, `VLAN_8021Q`, `VXLAN`, `MACVLAN`, `INET`, and `NET` – makes perfect sense given the scope of the changes.

In short, it's a focused set of changes that should impact key networking features. My initial assessment is that these look like a series of clean and targeted updates.



15/2 2026/11/28 16:40 tool set-results
0m Args:
{
  "EnableConfigs": [
    "NET",
    "INET",
    "BRIDGE",
    "VLAN_8021Q",
    "BRIDGE_VLAN_FILTERING",
    "VXLAN",
    "MACVLAN"
  ],
  "FocusSymbols": [
    "rtnl_fdb_add",
    "rtnl_fdb_del",
    "rtnl_fdb_get",
    "ndo_dflt_fdb_add",
    "ndo_dflt_fdb_del",
    "br_fdb_add",
    "br_fdb_delete",
    "br_fdb_delete_bulk",
    "br_fdb_get",
    "br_fdb_flush",
    "br_fdb_external_learn_add",
    "vxlan_fdb_add",
    "vxlan_fdb_delete",
    "vxlan_fdb_delete_bulk",
    "vxlan_fdb_get",
    "vxlan_fdb_update",
    "__vxlan_fdb_delete",
    "macvlan_fdb_add",
    "macvlan_fdb_del"
  ],
  "Reasoning": "The patch series modifies executable code in core networking (net/core/rtnetlink.c) and virtual netdev subsystems (net/bridge/, drivers/net/vxlan/, drivers/net/macvlan.c) by refactoring ndo_fdb_{add,del,get,del_bulk} and ndo_dflt_fdb_{add,del} to pass struct ndo_fdb_parms and propagating netlink portid into FDB notifications. These paths are directly reachable via PF_BRIDGE RTM_NEWNEIGH/RTM_DELNEIGH/RTM_GETNEIGH netlink requests on virtual devices (bridge, vxlan, macvlan, dummy, veth) in QEMU/GCE environments.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "NET",
    "INET",
    "BRIDGE",
    "VLAN_8021Q",
    "BRIDGE_VLAN_FILTERING",
    "VXLAN",
    "MACVLAN"
  ],
  "FocusSymbols": [
    "rtnl_fdb_add",
    "rtnl_fdb_del",
    "rtnl_fdb_get",
    "ndo_dflt_fdb_add",
    "ndo_dflt_fdb_del",
    "br_fdb_add",
    "br_fdb_delete",
    "br_fdb_delete_bulk",
    "br_fdb_get",
    "br_fdb_flush",
    "br_fdb_external_learn_add",
    "vxlan_fdb_add",
    "vxlan_fdb_delete",
    "vxlan_fdb_delete_bulk",
    "vxlan_fdb_get",
    "vxlan_fdb_update",
    "__vxlan_fdb_delete",
    "macvlan_fdb_add",
    "macvlan_fdb_del"
  ],
  "Reasoning": "The patch series modifies executable code in core networking (net/core/rtnetlink.c) and virtual netdev subsystems (net/bridge/, drivers/net/vxlan/, drivers/net/macvlan.c) by refactoring ndo_fdb_{add,del,get,del_bulk} and ndo_dflt_fdb_{add,del} to pass struct ndo_fdb_parms and propagating netlink portid into FDB notifications. These paths are directly reachable via PF_BRIDGE RTM_NEWNEIGH/RTM_DELNEIGH/RTM_GETNEIGH netlink requests on virtual devices (bridge, vxlan, macvlan, dummy, veth) in QEMU/GCE environments.",
  "WorthFuzzing": true
}

16/1 2026/11/28 16:40 action If
1m Args:
{
  "WorthFuzzing": true
}

Results:
null

17/2 2026/11/28 16:40 agent kmsan-evaluator
1m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch series refactors the FDB net_device_ops callbacks (ndo_fdb_add, ndo_fdb_del, ndo_fdb_get, ndo_dflt_fdb_add, ndo_dflt_fdb_del) to pass parameters via a new internal struct ndo_fdb_parms, and propagates the requester's netlink u32 portid (from NETLINK_CB(skb).portid, or 0 for internal/async notifications) through bridge, vxlan, and rtnetlink FDB notification paths so nlmsg_pid is populated instead of 0.\n\nThere are no uninitialized memory risks introduced by these changes:\n1. struct ndo_fdb_parms is strictly an internal kernel stack struct and is never copied directly to user space. Whenever \u0026parms is passed to callbacks (in rtnl_fdb_add, rtnl_fdb_del when !del_bulk, and rtnl_fdb_get), it is initialized with a C compound literal (struct ndo_fdb_parms) { ... } which explicitly initializes all read fields and zero-initializes any omitted fields (e.g., .flags in del/get). In rtnl_fdb_del, the del_bulk == true path never touches parms.\n2. In net/bridge/br_fdb.c, vparms is initialized by copying *parms before overriding vparms.vid.\n3. The u32 portid passed to fdb_fill_info(), vxlan_fdb_info(), and nlmsg_populate_fdb_fill() is always initialized (either NETLINK_CB(skb).portid or 0) and simply replaces a hardcoded 0 argument in nlmsg_put() for nlmsg_pid.\n4. No new netlink attributes or kernel-to-user structures with uninitialized fields or padding are added, and no bounds or length calculations are changed. Any potential issues in these paths (such as pointer/lifetime bugs in netdevice ops or bridge/vxlan FDB handling) would be caught by standard KASAN/LOCKDEP/UBSAN fuzzing rather than requiring KMSAN.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit fcf7445aef94f88776486a38b7fb429aeb61c1ed
Author: syz-cluster <triage@syzkaller.com>
Date:   Sat Nov 28 16:39:08 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/netlink/specs/rt-neigh.yaml b/Documentation/netlink/specs/rt-neigh.yaml
index 7929e667cc7a64..4dd4e3d997f099 100644
--- a/Documentation/netlink/specs/rt-neigh.yaml
+++ b/Documentation/netlink/specs/rt-neigh.yaml
@@ -380,7 +380,11 @@ operations:
           value: 29
           attributes:
             - dst
+            - lladdr
+            - vlan
             - ifindex
+            - ndm-state-mask
+            - ndm-flags-mask
     -
       name: delneigh-ntf
       doc: Notify a neighbour deletion
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index abbc71e815ae34..c8337bef5dbf79 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -13022,28 +13022,24 @@ static int i40e_get_phys_port_id(struct net_device *netdev,
  * i40e_ndo_fdb_add - add an entry to the hardware database
  * @ndm: the input from the stack
  * @tb: pointer to array of nladdr (unused)
- * @dev: the net device pointer
- * @addr: the MAC address entry being added
- * @vid: VLAN ID
- * @flags: instructions from stack about fdb operation
+ * @parms: common FDB parameters
  * @notified: whether notification was emitted
  * @extack: netlink extended ack, unused currently
  */
 static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr, u16 vid,
-			    u16 flags, bool *notified,
+			    const struct ndo_fdb_parms *parms, bool *notified,
 			    struct netlink_ext_ack *extack)
 {
-	struct i40e_netdev_priv *np = netdev_priv(dev);
+	struct i40e_netdev_priv *np = netdev_priv(parms->dev);
 	struct i40e_pf *pf = np->vsi->back;
 	int err = 0;
 
 	if (!test_bit(I40E_FLAG_SRIOV_ENA, pf->flags))
 		return -EOPNOTSUPP;
 
-	if (vid) {
-		pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n", dev->name);
+	if (parms->vid) {
+		pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n",
+			parms->dev->name);
 		return -EINVAL;
 	}
 
@@ -13051,19 +13047,20 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 	 * ndm_state is given only allow permanent addresses
 	 */
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "FDB only supports static addresses\n");
+		netdev_info(parms->dev, "FDB only supports static addresses\n");
 		return -EINVAL;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 	else
 		err = -EINVAL;
 
 	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+	if (err == -EEXIST && !(parms->flags & NLM_F_EXCL))
 		err = 0;
 
 	return err;
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index c8f06c3d0fdf20..396299d5d7bd5b 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6108,39 +6108,37 @@ ice_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 maxrate)
  * ice_fdb_add - add an entry to the hardware database
  * @ndm: the input from the stack
  * @tb: pointer to array of nladdr (unused)
- * @dev: the net device pointer
- * @addr: the MAC address entry being added
- * @vid: VLAN ID
- * @flags: instructions from stack about fdb operation
+ * @parms: common FDB parameters
  * @notified: whether notification was emitted
  * @extack: netlink extended ack
  */
 static int
 ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],
-	    struct net_device *dev, const unsigned char *addr, u16 vid,
-	    u16 flags, bool *notified,
+	    const struct ndo_fdb_parms *parms, bool *notified,
 	    struct netlink_ext_ack __always_unused *extack)
 {
 	int err;
 
-	if (vid) {
-		netdev_err(dev, "VLANs aren't supported yet for dev_uc|mc_add()\n");
+	if (parms->vid) {
+		netdev_err(parms->dev,
+			   "VLANs aren't supported yet for dev_uc|mc_add()\n");
 		return -EINVAL;
 	}
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_err(dev, "FDB only supports static addresses\n");
+		netdev_err(parms->dev, "FDB only supports static addresses\n");
 		return -EINVAL;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 	else
 		err = -EINVAL;
 
 	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+	if (err == -EEXIST && !(parms->flags & NLM_F_EXCL))
 		err = 0;
 
 	return err;
@@ -6150,29 +6148,26 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],
  * ice_fdb_del - delete an entry from the hardware database
  * @ndm: the input from the stack
  * @tb: pointer to array of nladdr (unused)
- * @dev: the net device pointer
- * @addr: the MAC address entry being added
- * @vid: VLAN ID
+ * @parms: common FDB parameters (device, address, VLAN ID)
  * @notified: whether notification was emitted
  * @extack: netlink extended ack
  */
 static int
 ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[],
-	    struct net_device *dev, const unsigned char *addr,
-	    __always_unused u16 vid, bool *notified,
+	    const struct ndo_fdb_parms *parms, bool *notified,
 	    struct netlink_ext_ack *extack)
 {
 	int err;
 
 	if (ndm->ndm_state & NUD_PERMANENT) {
-		netdev_err(dev, "FDB only supports static addresses\n");
+		netdev_err(parms->dev, "FDB only supports static addresses\n");
 		return -EINVAL;
 	}
 
-	if (is_unicast_ether_addr(addr))
-		err = dev_uc_del(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_del(dev, addr);
+	if (is_unicast_ether_addr(parms->addr))
+		err = dev_uc_del(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_del(parms->dev, parms->addr);
 	else
 		err = -EINVAL;
 
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index c75d78badf71f8..b2efa0a1fa071c 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2517,21 +2517,21 @@ static int igb_set_features(struct net_device *netdev,
 }
 
 static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 vid,
-			   u16 flags, bool *notified,
+			   const struct ndo_fdb_parms *parms, bool *notified,
 			   struct netlink_ext_ack *extack)
 {
 	/* guarantee we can provide a unique filter for the unicast address */
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
-		struct igb_adapter *adapter = netdev_priv(dev);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr)) {
+		struct igb_adapter *adapter = netdev_priv(parms->dev);
 		int vfn = adapter->vfs_allocated_count;
 
-		if (netdev_uc_count(dev) >= igb_available_rars(adapter, vfn))
+		if (netdev_uc_count(parms->dev) >=
+		    igb_available_rars(adapter, vfn))
 			return -ENOMEM;
 	}
 
-	return ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, flags);
+	return ndo_dflt_fdb_add(ndm, tb, parms);
 }
 
 #define IGB_MAX_MAC_HDR_LEN	127
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 6458cb2e511e7d..e444ebfe77fa5a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -10603,21 +10603,21 @@ static int ixgbe_set_features(struct net_device *netdev,
 }
 
 static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			     struct net_device *dev,
-			     const unsigned char *addr, u16 vid,
-			     u16 flags, bool *notified,
+			     const struct ndo_fdb_parms *parms, bool *notified,
 			     struct netlink_ext_ack *extack)
 {
 	/* guarantee we can provide a unique filter for the unicast address */
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
-		struct ixgbe_adapter *adapter = ixgbe_from_netdev(dev);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr)) {
+		struct ixgbe_adapter *adapter = ixgbe_from_netdev(parms->dev);
 		u16 pool = VMDQ_P(0);
 
-		if (netdev_uc_count(dev) >= ixgbe_available_rars(adapter, pool))
+		if (netdev_uc_count(parms->dev) >=
+		    ixgbe_available_rars(adapter, pool))
 			return -ENOMEM;
 	}
 
-	return ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, flags);
+	return ndo_dflt_fdb_add(ndm, tb, parms);
 }
 
 /**
diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c
index 4d45e136f08f5e..65f9dee62dc5b2 100644
--- a/drivers/net/ethernet/mscc/ocelot_net.c
+++ b/drivers/net/ethernet/mscc/ocelot_net.c
@@ -765,30 +765,29 @@ static void ocelot_get_stats64(struct net_device *dev,
 }
 
 static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			       struct net_device *dev,
-			       const unsigned char *addr,
-			       u16 vid, u16 flags, bool *notified,
-			       struct netlink_ext_ack *extack)
+			       const struct ndo_fdb_parms *parms,
+			       bool *notified, struct netlink_ext_ack *extack)
 {
-	struct ocelot_port_private *priv = netdev_priv(dev);
+	struct ocelot_port_private *priv = netdev_priv(parms->dev);
 	struct ocelot_port *ocelot_port = &priv->port;
 	struct ocelot *ocelot = ocelot_port->ocelot;
 	int port = priv->port.index;
 
-	return ocelot_fdb_add(ocelot, port, addr, vid, ocelot_port->bridge);
+	return ocelot_fdb_add(ocelot, port, parms->addr, parms->vid,
+			      ocelot_port->bridge);
 }
 
 static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			       struct net_device *dev,
-			       const unsigned char *addr, u16 vid,
+			       const struct ndo_fdb_parms *parms,
 			       bool *notified, struct netlink_ext_ack *extack)
 {
-	struct ocelot_port_private *priv = netdev_priv(dev);
+	struct ocelot_port_private *priv = netdev_priv(parms->dev);
 	struct ocelot_port *ocelot_port = &priv->port;
 	struct ocelot *ocelot = ocelot_port->ocelot;
 	int port = priv->port.index;
 
-	return ocelot_fdb_del(ocelot, port, addr, vid, ocelot_port->bridge);
+	return ocelot_fdb_del(ocelot, port, parms->addr, parms->vid,
+			      ocelot_port->bridge);
 }
 
 static int ocelot_port_fdb_do_dump(const unsigned char *addr, u16 vid,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 23ae76ca81dbe0..6c48cdaf25c0f3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -366,24 +366,23 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
 }
 
 static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			struct net_device *netdev,
-			const unsigned char *addr, u16 vid, bool *notified,
+			const struct ndo_fdb_parms *parms, bool *notified,
 			struct netlink_ext_ack *extack)
 {
-	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+	struct qlcnic_adapter *adapter = netdev_priv(parms->dev);
 	int err = -EOPNOTSUPP;
 
 	if (!adapter->fdb_mac_learn)
-		return ndo_dflt_fdb_del(ndm, tb, netdev, addr, vid);
+		return ndo_dflt_fdb_del(ndm, tb, parms);
 
 	if ((adapter->flags & QLCNIC_ESWITCH_ENABLED) ||
 	    qlcnic_sriov_check(adapter)) {
-		if (is_unicast_ether_addr(addr)) {
-			err = dev_uc_del(netdev, addr);
+		if (is_unicast_ether_addr(parms->addr)) {
+			err = dev_uc_del(parms->dev, parms->addr);
 			if (!err)
-				err = qlcnic_nic_del_mac(adapter, addr);
-		} else if (is_multicast_ether_addr(addr)) {
-			err = dev_mc_del(netdev, addr);
+				err = qlcnic_nic_del_mac(adapter, parms->addr);
+		} else if (is_multicast_ether_addr(parms->addr)) {
+			err = dev_mc_del(parms->dev, parms->addr);
 		} else {
 			err =  -EINVAL;
 		}
@@ -392,15 +391,14 @@ static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
 }
 
 static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			struct net_device *netdev,
-			const unsigned char *addr, u16 vid, u16 flags,
-			bool *notified, struct netlink_ext_ack *extack)
+			const struct ndo_fdb_parms *parms, bool *notified,
+			struct netlink_ext_ack *extack)
 {
-	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+	struct qlcnic_adapter *adapter = netdev_priv(parms->dev);
 	int err = 0;
 
 	if (!adapter->fdb_mac_learn)
-		return ndo_dflt_fdb_add(ndm, tb, netdev, addr, vid, flags);
+		return ndo_dflt_fdb_add(ndm, tb, parms);
 
 	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED) &&
 	    !qlcnic_sriov_check(adapter)) {
@@ -408,16 +406,16 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		return -EOPNOTSUPP;
 	}
 
-	if (ether_addr_equal(addr, adapter->mac_addr))
+	if (ether_addr_equal(parms->addr, adapter->mac_addr))
 		return err;
 
-	if (is_unicast_ether_addr(addr)) {
-		if (netdev_uc_count(netdev) < adapter->ahw->max_uc_count)
-			err = dev_uc_add_excl(netdev, addr);
+	if (is_unicast_ether_addr(parms->addr)) {
+		if (netdev_uc_count(parms->dev) < adapter->ahw->max_uc_count)
+			err = dev_uc_add_excl(parms->dev, parms->addr);
 		else
 			err = -ENOMEM;
-	} else if (is_multicast_ether_addr(addr)) {
-		err = dev_mc_add_excl(netdev, addr);
+	} else if (is_multicast_ether_addr(parms->addr)) {
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 	} else {
 		err = -EINVAL;
 	}
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index c7afa736c472bc..06079c69777242 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1054,49 +1054,46 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
 }
 
 static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 vid,
-			   u16 flags, bool *notified,
+			   const struct ndo_fdb_parms *parms, bool *notified,
 			   struct netlink_ext_ack *extack)
 {
-	struct macvlan_dev *vlan = netdev_priv(dev);
+	struct macvlan_dev *vlan = netdev_priv(parms->dev);
 	int err = -EINVAL;
 
 	/* Support unicast filter only on passthru devices.
 	 * Multicast filter should be allowed on all devices.
 	 */
-	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(addr))
+	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(parms->addr))
 		return -EOPNOTSUPP;
 
-	if (flags & NLM_F_REPLACE)
+	if (parms->flags & NLM_F_REPLACE)
 		return -EOPNOTSUPP;
 
-	if (is_unicast_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 
 	return err;
 }
 
 static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 vid, bool *notified,
+			   const struct ndo_fdb_parms *parms, bool *notified,
 			   struct netlink_ext_ack *extack)
 {
-	struct macvlan_dev *vlan = netdev_priv(dev);
+	struct macvlan_dev *vlan = netdev_priv(parms->dev);
 	int err = -EINVAL;
 
 	/* Support unicast filter only on passthru devices.
 	 * Multicast filter should be allowed on all devices.
 	 */
-	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(addr))
+	if (!macvlan_passthru(vlan->port) && is_unicast_ether_addr(parms->addr))
 		return -EOPNOTSUPP;
 
-	if (is_unicast_ether_addr(addr))
-		err = dev_uc_del(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_del(dev, addr);
+	if (is_unicast_ether_addr(parms->addr))
+		err = dev_uc_del(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_del(parms->dev, parms->addr);
 
 	return err;
 }
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index d11028b374721c..c300e0bd9b577c 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -265,7 +265,7 @@ static inline size_t vxlan_nlmsg_size(void)
 }
 
 static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
-			       struct vxlan_rdst *rd, int type)
+			       struct vxlan_rdst *rd, int type, u32 portid)
 {
 	struct net *net = dev_net(vxlan->dev);
 	struct sk_buff *skb;
@@ -275,7 +275,7 @@ static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
 	if (skb == NULL)
 		goto errout;
 
-	err = vxlan_fdb_info(skb, vxlan, fdb, 0, 0, type, 0, rd);
+	err = vxlan_fdb_info(skb, vxlan, fdb, portid, 0, type, 0, rd);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in vxlan_nlmsg_size() */
 		WARN_ON(err == -EMSGSIZE);
@@ -329,8 +329,8 @@ static int vxlan_fdb_switchdev_call_notifiers(struct vxlan_dev *vxlan,
 }
 
 static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
-			    struct vxlan_rdst *rd, int type, bool swdev_notify,
-			    struct netlink_ext_ack *extack)
+			    struct vxlan_rdst *rd, int type, u32 portid,
+			    bool swdev_notify, struct netlink_ext_ack *extack)
 {
 	int err;
 
@@ -349,7 +349,7 @@ static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
 		}
 	}
 
-	__vxlan_fdb_notify(vxlan, fdb, rd, type);
+	__vxlan_fdb_notify(vxlan, fdb, rd, type, portid);
 	return 0;
 }
 
@@ -364,7 +364,7 @@ static void vxlan_ip_miss(struct net_device *dev, union vxlan_addr *ipa)
 		.remote_vni = cpu_to_be32(VXLAN_N_VID),
 	};
 
-	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, true, NULL);
+	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, 0, true, NULL);
 }
 
 static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN])
@@ -376,7 +376,7 @@ static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN])
 
 	memcpy(f.key.eth_addr, eth_addr, ETH_ALEN);
 
-	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, true, NULL);
+	vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, 0, true, NULL);
 }
 
 /* Look up Ethernet address in forwarding table */
@@ -945,7 +945,7 @@ static void vxlan_fdb_free(struct rcu_head *head)
 }
 
 static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
-			      bool do_notify, bool swdev_notify)
+			      bool do_notify, u32 portid, bool swdev_notify)
 {
 	struct vxlan_rdst *rd;
 
@@ -955,11 +955,11 @@ static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
 	if (do_notify) {
 		if (rcu_access_pointer(f->nh))
 			vxlan_fdb_notify(vxlan, f, NULL, RTM_DELNEIGH,
-					 swdev_notify, NULL);
+					 portid, swdev_notify, NULL);
 		else
 			list_for_each_entry(rd, &f->remotes, list)
 				vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH,
-						 swdev_notify, NULL);
+						 portid, swdev_notify, NULL);
 	}
 
 	hlist_del_init_rcu(&f->fdb_node);
@@ -983,7 +983,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
 				     __be16 port, __be32 vni,
 				     __u32 ifindex, __u16 ndm_flags,
 				     struct vxlan_fdb *f, u32 nhid,
-				     bool swdev_notify,
+				     u32 portid, bool swdev_notify,
 				     struct netlink_ext_ack *extack)
 {
 	__u16 fdb_flags = (ndm_flags & ~NTF_USE);
@@ -1057,7 +1057,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
 
 		WRITE_ONCE(f->updated, jiffies);
 		err = vxlan_fdb_notify(vxlan, f, rd, RTM_NEWNEIGH,
-				       swdev_notify, extack);
+				       portid, swdev_notify, extack);
 		if (err)
 			goto err_notify;
 	}
@@ -1081,7 +1081,7 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,
 				   __u16 state, __u16 flags,
 				   __be16 port, __be32 src_vni, __be32 vni,
 				   __u32 ifindex, __u16 ndm_flags, u32 nhid,
-				   bool swdev_notify,
+				   u32 portid, bool swdev_notify,
 				   struct netlink_ext_ack *extack)
 {
 	__u16 fdb_flags = (ndm_flags & ~NTF_USE);
@@ -1100,14 +1100,14 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,
 		return rc;
 
 	rc = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_NEWNEIGH,
-			      swdev_notify, extack);
+			      portid, swdev_notify, extack);
 	if (rc)
 		goto err_notify;
 
 	return 0;
 
 err_notify:
-	vxlan_fdb_destroy(vxlan, f, false, false);
+	vxlan_fdb_destroy(vxlan, f, false, 0, false);
 	return rc;
 }
 
@@ -1117,7 +1117,7 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan,
 		     __u16 state, __u16 flags,
 		     __be16 port, __be32 src_vni, __be32 vni,
 		     __u32 ifindex, __u16 ndm_flags, u32 nhid,
-		     bool swdev_notify,
+		     u32 portid, bool swdev_notify,
 		     struct netlink_ext_ack *extack)
 {
 	struct vxlan_fdb *f;
@@ -1132,23 +1132,26 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan,
 
 		return vxlan_fdb_update_existing(vxlan, ip, state, flags, port,
 						 vni, ifindex, ndm_flags, f,
-						 nhid, swdev_notify, extack);
+						 nhid, portid, swdev_notify,
+						 extack);
 	} else {
 		if (!(flags & NLM_F_CREATE))
 			return -ENOENT;
 
 		return vxlan_fdb_update_create(vxlan, mac, ip, state, flags,
 					       port, src_vni, vni, ifindex,
-					       ndm_flags, nhid, swdev_notify,
-					       extack);
+					       ndm_flags, nhid, portid,
+					       swdev_notify, extack);
 	}
 }
 
 static void vxlan_fdb_dst_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
-				  struct vxlan_rdst *rd, bool swdev_notify)
+				  struct vxlan_rdst *rd, u32 portid,
+				  bool swdev_notify)
 {
 	list_del_rcu(&rd->list);
-	vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, swdev_notify, NULL);
+	vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, portid, swdev_notify,
+			 NULL);
 	call_rcu(&rd->rcu, vxlan_dst_free);
 }
 
@@ -1241,12 +1244,11 @@ static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,
 
 /* Add static entry (via netlink) */
 static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			 struct net_device *dev,
-			 const unsigned char *addr, u16 vid, u16 flags,
-			 bool *notified, struct netlink_ext_ack *extack)
+			 const struct ndo_fdb_parms *parms, bool *notified,
+			 struct netlink_ext_ack *extack)
 {
 	const struct vxlan_config *cfg;
-	struct vxlan_dev *vxlan = netdev_priv(dev);
+	struct vxlan_dev *vxlan = netdev_priv(parms->dev);
 	/* struct net *net = dev_net(vxlan->dev); */
 	union vxlan_addr ip;
 	__be16 port;
@@ -1273,10 +1275,11 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		return -EAFNOSUPPORT;
 
 	spin_lock_bh(&vxlan->hash_lock);
-	err = vxlan_fdb_update(vxlan, addr, &ip, ndm->ndm_state, flags,
+	err = vxlan_fdb_update(vxlan, parms->addr, &ip, ndm->ndm_state,
+			       parms->flags,
 			       port, src_vni, vni, ifindex,
 			       ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER,
-			       nhid, true, extack);
+			       nhid, parms->portid, true, extack);
 	spin_unlock_bh(&vxlan->hash_lock);
 
 	if (!err)
@@ -1288,7 +1291,7 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 		       const unsigned char *addr, union vxlan_addr ip,
 		       __be16 port, __be32 src_vni, __be32 vni,
-		       u32 ifindex, bool swdev_notify)
+		       u32 ifindex, u32 portid, bool swdev_notify)
 {
 	struct vxlan_rdst *rd = NULL;
 	struct vxlan_fdb *f;
@@ -1308,11 +1311,11 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 	 * otherwise destroy the fdb entry
 	 */
 	if (rd && !list_is_singular(&f->remotes)) {
-		vxlan_fdb_dst_destroy(vxlan, f, rd, swdev_notify);
+		vxlan_fdb_dst_destroy(vxlan, f, rd, portid, swdev_notify);
 		goto out;
 	}
 
-	vxlan_fdb_destroy(vxlan, f, true, swdev_notify);
+	vxlan_fdb_destroy(vxlan, f, true, portid, swdev_notify);
 
 out:
 	return 0;
@@ -1320,11 +1323,10 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 
 /* Delete entry (via netlink) */
 static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr, u16 vid, bool *notified,
+			    const struct ndo_fdb_parms *parms, bool *notified,
 			    struct netlink_ext_ack *extack)
 {
-	struct vxlan_dev *vxlan = netdev_priv(dev);
+	struct vxlan_dev *vxlan = netdev_priv(parms->dev);
 	union vxlan_addr ip;
 	__be32 src_vni, vni;
 	u32 ifindex, nhid;
@@ -1337,8 +1339,8 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
 		return err;
 
 	spin_lock_bh(&vxlan->hash_lock);
-	err = __vxlan_fdb_delete(vxlan, addr, ip, port, src_vni, vni, ifindex,
-				 true);
+	err = __vxlan_fdb_delete(vxlan, parms->addr, ip, port, src_vni, vni,
+				 ifindex, parms->portid, true);
 	spin_unlock_bh(&vxlan->hash_lock);
 
 	if (!err)
@@ -1400,12 +1402,10 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 
 static int vxlan_fdb_get(struct sk_buff *skb,
 			 struct nlattr *tb[],
-			 struct net_device *dev,
-			 const unsigned char *addr,
-			 u16 vid, u32 portid, u32 seq,
+			 const struct ndo_fdb_parms *parms, u32 seq,
 			 struct netlink_ext_ack *extack)
 {
-	struct vxlan_dev *vxlan = netdev_priv(dev);
+	struct vxlan_dev *vxlan = netdev_priv(parms->dev);
 	const struct vxlan_config *cfg;
 	struct vxlan_fdb *f;
 	__be32 vni;
@@ -1420,14 +1420,14 @@ static int vxlan_fdb_get(struct sk_buff *skb,
 
 	rcu_read_lock();
 
-	f = vxlan_find_mac_rcu(vxlan, cfg, addr, vni);
+	f = vxlan_find_mac_rcu(vxlan, cfg, parms->addr, vni);
 	if (!f) {
 		NL_SET_ERR_MSG(extack, "Fdb entry not found");
 		err = -ENOENT;
 		goto errout;
 	}
 
-	err = vxlan_fdb_info(skb, vxlan, f, portid, seq,
+	err = vxlan_fdb_info(skb, vxlan, f, parms->portid, seq,
 			     RTM_NEWNEIGH, 0, first_remote_rcu(f));
 errout:
 	rcu_read_unlock();
@@ -1483,7 +1483,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
 				    src_mac, &rdst->remote_ip.sa, &src_ip->sa);
 
 		rdst->remote_ip = *src_ip;
-		vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, true, NULL);
+		vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, 0, true, NULL);
 	} else {
 		/* learned new entry */
 		spin_lock(&vxlan->hash_lock);
@@ -1496,7 +1496,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
 					 cfg->dst_port,
 					 vni,
 					 cfg->vni,
-					 ifindex, NTF_SELF, 0, true, NULL);
+					 ifindex, NTF_SELF, 0, 0, true, NULL);
 		spin_unlock(&vxlan->hash_lock);
 	}
 
@@ -2946,7 +2946,7 @@ static void vxlan_cleanup(struct timer_list *t)
 				netdev_dbg(vxlan->dev, "garbage collect %pM\n",
 					   f->key.eth_addr);
 				f->state = NUD_STALE;
-				vxlan_fdb_destroy(vxlan, f, true, true);
+				vxlan_fdb_destroy(vxlan, f, true, 0, true);
 			}
 			spin_unlock(&vxlan->hash_lock);
 		} else if (time_before(timeout, next_timer)) {
@@ -3141,7 +3141,7 @@ vxlan_fdb_flush_remote_matches(const struct vxlan_fdb_flush_desc *desc,
 static void
 vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan,
 			      const struct vxlan_fdb_flush_desc *desc,
-			      bool *p_destroy_fdb)
+			      u32 portid, bool *p_destroy_fdb)
 {
 	struct vxlan_rdst *rd, *tmp;
 
@@ -3154,13 +3154,13 @@ vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan,
 			return;
 		}
 
-		vxlan_fdb_dst_destroy(vxlan, f, rd, true);
+		vxlan_fdb_dst_destroy(vxlan, f, rd, portid, true);
 	}
 }
 
 /* Purge the forwarding table */
 static void vxlan_flush(struct vxlan_dev *vxlan,
-			const struct vxlan_fdb_flush_desc *desc)
+			const struct vxlan_fdb_flush_desc *desc, u32 portid)
 {
 	bool match_remotes = vxlan_fdb_flush_should_match_remotes(desc);
 	struct vxlan_fdb *f;
@@ -3177,14 +3177,14 @@ static void vxlan_flush(struct vxlan_dev *vxlan,
 		if (match_remotes) {
 			bool destroy_fdb = false;
 
-			vxlan_fdb_flush_match_remotes(f, vxlan, desc,
+			vxlan_fdb_flush_match_remotes(f, vxlan, desc, portid,
 						      &destroy_fdb);
 
 			if (!destroy_fdb)
 				goto unlock;
 		}
 
-		vxlan_fdb_destroy(vxlan, f, true, true);
+		vxlan_fdb_destroy(vxlan, f, true, portid, true);
 unlock:
 		spin_unlock_bh(&vxlan->hash_lock);
 	}
@@ -3208,7 +3208,7 @@ static const struct nla_policy vxlan_del_bulk_policy[NDA_MAX + 1] = {
 					   NTF_ROUTER)
 
 static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
-				 struct netlink_ext_ack *extack)
+				 u32 portid, struct netlink_ext_ack *extack)
 {
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 	struct vxlan_fdb_flush_desc desc = {};
@@ -3266,7 +3266,7 @@ static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
 		desc.dst_ip = ip;
 	}
 
-	vxlan_flush(vxlan, &desc);
+	vxlan_flush(vxlan, &desc, portid);
 
 	return 0;
 }
@@ -3286,7 +3286,7 @@ static int vxlan_stop(struct net_device *dev)
 
 	timer_delete_sync(&vxlan->age_timer);
 
-	vxlan_flush(vxlan, &desc);
+	vxlan_flush(vxlan, &desc, 0);
 	vxlan_sock_release(vxlan);
 
 	return 0;
@@ -4146,7 +4146,7 @@ static int vxlan_dev_create(struct net *net, struct net_device *dev,
 				       cfg->vni,
 				       cfg->vni,
 				       cfg->remote_ifindex,
-				       NTF_SELF, 0, true, extack);
+				       NTF_SELF, 0, 0, true, extack);
 		spin_unlock_bh(&vxlan->hash_lock);
 		if (err)
 			goto unlink;
@@ -4609,7 +4609,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
 					       cfg->dst_port,
 					       conf.vni, conf.vni,
 					       conf.remote_ifindex,
-					       NTF_SELF, 0, true, extack);
+					       NTF_SELF, 0, 0, true, extack);
 			if (err) {
 				spin_unlock_bh(&vxlan->hash_lock);
 				if (lowerdev_changed)
@@ -4626,7 +4626,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
 					   cfg->vni,
 					   cfg->vni,
 					   cfg->remote_ifindex,
-					   true);
+					   0, true);
 		spin_unlock_bh(&vxlan->hash_lock);
 
 		/* If vni filtering device, also update default fdb entries of
@@ -4690,7 +4690,7 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 	struct vxlan_fdb_flush_desc desc = {};
 
-	vxlan_flush(vxlan, &desc);
+	vxlan_flush(vxlan, &desc, 0);
 
 	list_del(&vxlan->next);
 	unregister_netdevice_queue(dev, head);
@@ -4964,7 +4964,7 @@ vxlan_fdb_external_learn_add(struct net_device *dev,
 			       fdb_info->remote_vni,
 			       fdb_info->remote_ifindex,
 			       NTF_USE | NTF_SELF | NTF_EXT_LEARNED,
-			       0, false, extack);
+			       0, 0, false, extack);
 	spin_unlock_bh(&vxlan->hash_lock);
 
 	return err;
@@ -4990,7 +4990,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev,
 					 fdb_info->vni,
 					 fdb_info->remote_vni,
 					 fdb_info->remote_ifindex,
-					 false);
+					 0, false);
 
 	spin_unlock_bh(&vxlan->hash_lock);
 
@@ -5048,7 +5048,7 @@ static void vxlan_fdb_nh_flush(struct nexthop *nh)
 		WARN_ON(!vxlan);
 		spin_lock_bh(&vxlan->hash_lock);
 		if (!hlist_unhashed(&fdb->fdb_node))
-			vxlan_fdb_destroy(vxlan, fdb, false, false);
+			vxlan_fdb_destroy(vxlan, fdb, false, 0, false);
 		spin_unlock_bh(&vxlan->hash_lock);
 	}
 	rcu_read_unlock();
diff --git a/drivers/net/vxlan/vxlan_private.h b/drivers/net/vxlan/vxlan_private.h
index f0ee85f83732a2..632e1880c0b912 100644
--- a/drivers/net/vxlan/vxlan_private.h
+++ b/drivers/net/vxlan/vxlan_private.h
@@ -196,13 +196,14 @@ int vxlan_fdb_create(struct vxlan_dev *vxlan,
 int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
 		       const unsigned char *addr, union vxlan_addr ip,
 		       __be16 port, __be32 src_vni, __be32 vni,
-		       u32 ifindex, bool swdev_notify);
+		       u32 ifindex, u32 portid, bool swdev_notify);
 int vxlan_fdb_update(struct vxlan_dev *vxlan,
 		     const u8 *mac, union vxlan_addr *ip,
 		     __u16 state, __u16 flags,
 		     __be16 port, __be32 src_vni, __be32 vni,
 		     __u32 ifindex, __u16 ndm_flags, u32 nhid,
-		     bool swdev_notify, struct netlink_ext_ack *extack);
+		     u32 portid, bool swdev_notify,
+		     struct netlink_ext_ack *extack);
 void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
 		    const struct vxlan_config *cfg,
 		    __be32 default_vni, struct vxlan_rdst *rdst, bool did_rsc);
diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c
index c5cc6cd085450a..927b63db3b5bf9 100644
--- a/drivers/net/vxlan/vxlan_vnifilter.c
+++ b/drivers/net/vxlan/vxlan_vnifilter.c
@@ -550,7 +550,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni,
 				       vni,
 				       vni,
 				       new_ifindex,
-				       NTF_SELF, 0, true, extack);
+				       NTF_SELF, 0, 0, true, extack);
 		if (err && extack) {
 			spin_unlock_bh(&vxlan->hash_lock);
 			return err;
@@ -563,7 +563,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni,
 				   cfg->dst_port,
 				   vni, vni,
 				   old_ifindex,
-				   true);
+				   0, true);
 	}
 	spin_unlock_bh(&vxlan->hash_lock);
 
@@ -727,7 +727,7 @@ static void vxlan_vni_delete_group(struct vxlan_dev *vxlan,
 				   cfg->dst_port,
 				   vninode->vni, vninode->vni,
 				   cfg->remote_ifindex,
-				   true);
+				   0, true);
 		spin_unlock_bh(&vxlan->hash_lock);
 	}
 
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 694b6d29f6807a..b2846b586a7f0d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1087,6 +1087,22 @@ struct netdev_net_notifier {
 	struct notifier_block *nb;
 };
 
+/**
+ * struct ndo_fdb_parms - parameters for ndo_fdb_{add,del,get}
+ * @dev: device the FDB entry is added to, deleted from or looked up on
+ * @addr: MAC address of the FDB entry
+ * @vid: VLAN ID of the FDB entry, 0 if none
+ * @flags: netlink message flags (NLM_F_*) of the request
+ * @portid: netlink port ID of the requester
+ */
+struct ndo_fdb_parms {
+	struct net_device	*dev;
+	const unsigned char	*addr;
+	u16			vid;
+	u16			flags;
+	u32			portid;
+};
+
 /*
  * This structure defines the management hooks for network devices.
  * The following hooks can be defined; unless noted otherwise, they are
@@ -1330,21 +1346,19 @@ struct netdev_net_notifier {
  *	Must return >0 or -errno if it changed dev->features itself.
  *
  * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[],
- *		      struct net_device *dev,
- *		      const unsigned char *addr, u16 vid, u16 flags,
+ *		      const struct ndo_fdb_parms *parms,
  *		      bool *notified, struct netlink_ext_ack *extack);
- *	Adds an FDB entry to dev for addr.
+ *	Adds an FDB entry to parms->dev for parms->addr.
  *	Callee shall set *notified to true if it sent any appropriate
  *	notification(s). Otherwise core will send a generic one.
  * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[],
- *		      struct net_device *dev,
- *		      const unsigned char *addr, u16 vid
+ *		      const struct ndo_fdb_parms *parms,
  *		      bool *notified, struct netlink_ext_ack *extack);
- *	Deletes the FDB entry from dev corresponding to addr.
+ *	Deletes the FDB entry from parms->dev corresponding to parms->addr.
  *	Callee shall set *notified to true if it sent any appropriate
  *	notification(s). Otherwise core will send a generic one.
  * int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh, struct net_device *dev,
- *			   struct netlink_ext_ack *extack);
+ *			   u32 portid, struct netlink_ext_ack *extack);
  * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
  *		       struct net_device *dev, struct net_device *filter_dev,
  *		       int *idx)
@@ -1614,21 +1628,17 @@ struct net_device_ops {
 
 	int			(*ndo_fdb_add)(struct ndmsg *ndm,
 					       struct nlattr *tb[],
-					       struct net_device *dev,
-					       const unsigned char *addr,
-					       u16 vid,
-					       u16 flags,
+					       const struct ndo_fdb_parms *parms,
 					       bool *notified,
 					       struct netlink_ext_ack *extack);
 	int			(*ndo_fdb_del)(struct ndmsg *ndm,
 					       struct nlattr *tb[],
-					       struct net_device *dev,
-					       const unsigned char *addr,
-					       u16 vid,
+					       const struct ndo_fdb_parms *parms,
 					       bool *notified,
 					       struct netlink_ext_ack *extack);
 	int			(*ndo_fdb_del_bulk)(struct nlmsghdr *nlh,
 						    struct net_device *dev,
+						    u32 portid,
 						    struct netlink_ext_ack *extack);
 	int			(*ndo_fdb_dump)(struct sk_buff *skb,
 						struct netlink_callback *cb,
@@ -1637,9 +1647,8 @@ struct net_device_ops {
 						int *idx);
 	int			(*ndo_fdb_get)(struct sk_buff *skb,
 					       struct nlattr *tb[],
-					       struct net_device *dev,
-					       const unsigned char *addr,
-					       u16 vid, u32 portid, u32 seq,
+					       const struct ndo_fdb_parms *parms,
+					       u32 seq,
 					       struct netlink_ext_ack *extack);
 	int			(*ndo_mdb_add)(struct net_device *dev,
 					       struct nlattr *tb[],
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index a54ec40d095c04..e963b43bce7678 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -211,15 +211,10 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
 			     int *idx);
 extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
 			    struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr,
-			    u16 vid,
-			    u16 flags);
+			    const struct ndo_fdb_parms *parms);
 extern int ndo_dflt_fdb_del(struct ndmsg *ndm,
 			    struct nlattr *tb[],
-			    struct net_device *dev,
-			    const unsigned char *addr,
-			    u16 vid);
+			    const struct ndo_fdb_parms *parms);
 
 extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				   struct net_device *dev, u16 mode,
diff --git a/net/bridge/br.c b/net/bridge/br.c
index d9a39ff98868d1..76feb286acab05 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -177,7 +177,7 @@ static int br_switchdev_event(struct notifier_block *unused,
 		fdb_info = ptr;
 		err = br_fdb_external_learn_add(br, p, fdb_info->addr,
 						fdb_info->vid,
-						fdb_info->locked, false);
+						fdb_info->locked, 0, false);
 		if (err) {
 			err = notifier_from_errno(err);
 			break;
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b601245ad92399..6b1c067974ff68 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -176,7 +176,7 @@ static inline size_t fdb_nlmsg_size(void)
 
 static void fdb_notify(struct net_bridge *br,
 		       const struct net_bridge_fdb_entry *fdb, int type,
-		       bool swdev_notify)
+		       u32 portid, bool swdev_notify)
 {
 	struct net *net = dev_net(br->dev);
 	struct sk_buff *skb;
@@ -189,7 +189,7 @@ static void fdb_notify(struct net_bridge *br,
 	if (skb == NULL)
 		goto errout;
 
-	err = fdb_fill_info(skb, br, fdb, 0, 0, type, 0);
+	err = fdb_fill_info(skb, br, fdb, portid, 0, type, 0);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in fdb_nlmsg_size() */
 		WARN_ON(err == -EMSGSIZE);
@@ -313,7 +313,7 @@ static void fdb_del_hw_addr(struct net_bridge *br, const unsigned char *addr)
 }
 
 static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,
-		       bool swdev_notify)
+		       u32 portid, bool swdev_notify)
 {
 	trace_fdb_delete(br, f, br_fdb_dst_port(f));
 
@@ -325,7 +325,7 @@ static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,
 			       br_fdb_rht_params);
 	if (test_and_clear_bit(BR_FDB_DYNAMIC_LEARNED, &f->flags))
 		atomic_dec(&br->fdb_n_learned);
-	fdb_notify(br, f, RTM_DELNEIGH, swdev_notify);
+	fdb_notify(br, f, RTM_DELNEIGH, portid, swdev_notify);
 	kfree_rcu(f, rcu);
 }
 
@@ -366,7 +366,7 @@ static void fdb_delete_local(struct net_bridge *br,
 		return;
 	}
 
-	fdb_delete(br, f, true);
+	fdb_delete(br, f, 0, true);
 }
 
 void br_fdb_find_delete_local(struct net_bridge *br,
@@ -445,7 +445,7 @@ static int fdb_add_local(struct net_bridge *br, struct net_bridge_port *source,
 			return 0;
 		br_warn(br, "adding interface %s with same address as a received packet (addr:%pM, vlan:%u)\n",
 			source ? source->dev->name : br->dev->name, addr, vid);
-		fdb_delete(br, fdb, true);
+		fdb_delete(br, fdb, 0, true);
 	}
 
 	fdb = fdb_create(br, br_port_to_dst(source), addr, vid,
@@ -454,7 +454,7 @@ static int fdb_add_local(struct net_bridge *br, struct net_bridge_port *source,
 		return -ENOMEM;
 
 	fdb_add_hw_addr(br, addr);
-	fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+	fdb_notify(br, fdb, RTM_NEWNEIGH, 0, true);
 	return 0;
 }
 
@@ -569,7 +569,8 @@ void br_fdb_cleanup(struct work_struct *work)
 							 this_timer - now);
 				else if (!test_and_set_bit(BR_FDB_NOTIFY_INACTIVE,
 							   &f->flags))
-					fdb_notify(br, f, RTM_NEWNEIGH, false);
+					fdb_notify(br, f, RTM_NEWNEIGH, 0,
+						   false);
 			}
 			continue;
 		}
@@ -579,7 +580,7 @@ void br_fdb_cleanup(struct work_struct *work)
 		} else {
 			spin_lock_bh(&br->hash_lock);
 			if (!hlist_unhashed(&f->fdb_node))
-				fdb_delete(br, f, true);
+				fdb_delete(br, f, 0, true);
 			spin_unlock_bh(&br->hash_lock);
 		}
 	}
@@ -711,7 +712,7 @@ static bool __fdb_flush_matches(const struct net_bridge *br,
 
 /* Flush forwarding database entries matching the description */
 void br_fdb_flush(struct net_bridge *br,
-		  const struct net_bridge_fdb_flush_desc *desc)
+		  const struct net_bridge_fdb_flush_desc *desc, u32 portid)
 {
 	struct net_bridge_fdb_entry *f;
 
@@ -722,7 +723,7 @@ void br_fdb_flush(struct net_bridge *br,
 
 		spin_lock_bh(&br->hash_lock);
 		if (!hlist_unhashed(&f->fdb_node))
-			fdb_delete(br, f, true);
+			fdb_delete(br, f, portid, true);
 		spin_unlock_bh(&br->hash_lock);
 	}
 	rcu_read_unlock();
@@ -796,7 +797,7 @@ static const struct nla_policy br_fdb_del_bulk_policy[NDA_MAX + 1] = {
 };
 
 int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
-		       struct netlink_ext_ack *extack)
+		       u32 portid, struct netlink_ext_ack *extack)
 {
 	struct net_bridge_fdb_flush_desc desc = {};
 	struct ndmsg *ndm = nlmsg_data(nlh);
@@ -863,7 +864,7 @@ int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
 	br_debug(br, "flushing port ifindex: %d vlan id: %u flags: 0x%lx flags mask: 0x%lx\n",
 		 desc.port_ifindex, desc.vlan_id, desc.flags, desc.flags_mask);
 
-	br_fdb_flush(br, &desc);
+	br_fdb_flush(br, &desc, portid);
 
 	return 0;
 }
@@ -918,7 +919,7 @@ void br_fdb_cleanup_by_dst(struct net_bridge *br,
 		if (test_bit(BR_FDB_LOCAL, &f->flags))
 			fdb_delete_local(br, p, f);
 		else
-			fdb_delete(br, f, true);
+			fdb_delete(br, f, 0, true);
 	}
 	spin_unlock_bh(&br->hash_lock);
 }
@@ -1000,7 +1001,7 @@ static void __fdb_update(struct net_bridge *br,
 			 struct net_bridge_fdb_entry *fdb,
 			 struct net_bridge_port *source,
 			 struct net_bridge_dst dst,
-			 unsigned long flags)
+			 unsigned long flags, u32 portid)
 {
 	struct net_bridge_port *old_port;
 	struct net_bridge_dst old_dst;
@@ -1057,13 +1058,15 @@ static void __fdb_update(struct net_bridge *br,
 	if (unlikely(fdb_modified)) {
 		trace_br_fdb_update(br, source, fdb->key.addr.addr,
 				    fdb->key.vlan_id, flags);
-		fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+		fdb_notify(br, fdb, RTM_NEWNEIGH, portid, true);
 	}
 }
 
-void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
-		   struct net_bridge_vlan *vlan, const unsigned char *addr,
-		   unsigned long flags)
+static void __br_fdb_update(struct net_bridge *br,
+			    struct net_bridge_port *source,
+			    struct net_bridge_vlan *vlan,
+			    const unsigned char *addr, unsigned long flags,
+			    u32 portid)
 {
 	struct net_bridge_dst dst = vlan ? br_vlan_to_dst(vlan) :
 					   br_port_to_dst(source);
@@ -1076,18 +1079,25 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 
 	fdb = fdb_find_rcu(&br->fdb_hash_tbl, addr, vid);
 	if (likely(fdb)) {
-		__fdb_update(br, fdb, source, dst, flags);
+		__fdb_update(br, fdb, source, dst, flags, portid);
 	} else {
 		spin_lock(&br->hash_lock);
 		fdb = fdb_create(br, dst, addr, vid, flags);
 		if (fdb) {
 			trace_br_fdb_update(br, source, addr, vid, flags);
-			fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+			fdb_notify(br, fdb, RTM_NEWNEIGH, portid, true);
 		}
 		spin_unlock(&br->hash_lock);
 	}
 }
 
+void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
+		   struct net_bridge_vlan *vlan, const unsigned char *addr,
+		   unsigned long flags)
+{
+	__br_fdb_update(br, source, vlan, addr, flags, 0);
+}
+
 /* Dump information about entries, in response to GETNEIGH */
 int br_fdb_dump(struct sk_buff *skb,
 		struct netlink_callback *cb,
@@ -1146,25 +1156,22 @@ int br_fdb_dump(struct sk_buff *skb,
 
 int br_fdb_get(struct sk_buff *skb,
 	       struct nlattr *tb[],
-	       struct net_device *dev,
-	       const unsigned char *addr,
-	       u16 vid, u32 portid, u32 seq,
+	       const struct ndo_fdb_parms *parms, u32 seq,
 	       struct netlink_ext_ack *extack)
 {
-	struct net_bridge *br = netdev_priv(dev);
+	struct net_bridge *br = netdev_priv(parms->dev);
 	struct net_bridge_fdb_entry *f;
 	int err = 0;
 
 	rcu_read_lock();
-	f = br_fdb_find_rcu(br, addr, vid);
+	f = br_fdb_find_rcu(br, parms->addr, parms->vid);
 	if (!f) {
 		NL_SET_ERR_MSG(extack, "Fdb entry not found");
 		err = -ENOENT;
 		goto errout;
 	}
 
-	err = fdb_fill_info(skb, br, f, portid, seq,
-			    RTM_NEWNEIGH, 0);
+	err = fdb_fill_info(skb, br, f, parms->portid, seq, RTM_NEWNEIGH, 0);
 errout:
 	rcu_read_unlock();
 	return err;
@@ -1212,7 +1219,7 @@ static bool fdb_update_dst(struct net_bridge_fdb_entry *fdb,
 
 /* Update (create or replace) forwarding database entry */
 static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
-			 const u8 *addr, struct ndmsg *ndm, u16 flags, u16 vid,
+			 struct ndmsg *ndm, const struct ndo_fdb_parms *parms,
 			 struct nlattr *nfea_tb[])
 {
 	struct net_bridge_port *source = br_dst_port(dst);
@@ -1245,12 +1252,12 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 			return -EINVAL;
 	}
 
-	fdb = br_fdb_find(br, addr, vid);
+	fdb = br_fdb_find(br, parms->addr, parms->vid);
 	if (fdb == NULL) {
-		if (!(flags & NLM_F_CREATE))
+		if (!(parms->flags & NLM_F_CREATE))
 			return -ENOENT;
 
-		fdb = fdb_create(br, dst, addr, vid,
+		fdb = fdb_create(br, dst, parms->addr, parms->vid,
 				 BIT(BR_FDB_ADDED_BY_USER));
 		if (!fdb)
 			return -ENOMEM;
@@ -1259,7 +1266,7 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 	} else {
 		struct net_bridge_dst old_dst;
 
-		if (flags & NLM_F_EXCL)
+		if (parms->flags & NLM_F_EXCL)
 			return -EEXIST;
 
 		old_dst = br_fdb_dst_read(fdb);
@@ -1274,15 +1281,15 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 		if (state & NUD_PERMANENT) {
 			set_bit(BR_FDB_LOCAL, &fdb->flags);
 			if (!test_and_set_bit(BR_FDB_STATIC, &fdb->flags))
-				fdb_add_hw_addr(br, addr);
+				fdb_add_hw_addr(br, parms->addr);
 		} else if (state & NUD_NOARP) {
 			clear_bit(BR_FDB_LOCAL, &fdb->flags);
 			if (!test_and_set_bit(BR_FDB_STATIC, &fdb->flags))
-				fdb_add_hw_addr(br, addr);
+				fdb_add_hw_addr(br, parms->addr);
 		} else {
 			clear_bit(BR_FDB_LOCAL, &fdb->flags);
 			if (test_and_clear_bit(BR_FDB_STATIC, &fdb->flags))
-				fdb_del_hw_addr(br, addr);
+				fdb_del_hw_addr(br, parms->addr);
 		}
 
 		modified = true;
@@ -1303,19 +1310,18 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_dst dst,
 	if (modified) {
 		if (refresh)
 			WRITE_ONCE(fdb->updated, jiffies);
-		fdb_notify(br, fdb, RTM_NEWNEIGH, true);
+		fdb_notify(br, fdb, RTM_NEWNEIGH, parms->portid, true);
 	}
 
 	return 0;
 }
 
 static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,
-			struct net_bridge_port *p, const unsigned char *addr,
-			u16 nlh_flags, struct net_bridge_vlan *vlan,
-			struct nlattr *nfea_tb[],
+			struct net_bridge_port *p,
+			const struct ndo_fdb_parms *parms,
+			struct net_bridge_vlan *vlan, struct nlattr *nfea_tb[],
 			bool *notified, struct netlink_ext_ack *extack)
 {
-	u16 vid = vlan ? vlan->vid : 0;
 	struct net_bridge_dst dst;
 	int err = 0;
 
@@ -1330,7 +1336,8 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,
 
 		local_bh_disable();
 		rcu_read_lock();
-		br_fdb_update(br, p, vlan, addr, BIT(BR_FDB_ADDED_BY_USER));
+		__br_fdb_update(br, p, vlan, parms->addr,
+				BIT(BR_FDB_ADDED_BY_USER), parms->portid);
 		rcu_read_unlock();
 		local_bh_enable();
 	} else if (ndm->ndm_flags & NTF_EXT_LEARNED) {
@@ -1339,12 +1346,12 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br,
 					   "FDB entry towards bridge must be permanent");
 			return -EINVAL;
 		}
-		err = br_fdb_external_learn_add(br, p, addr, vid, false, true);
+		err = br_fdb_external_learn_add(br, p, parms->addr, parms->vid,
+						false, parms->portid, true);
 	} else {
 		dst = p && vlan ? br_vlan_to_dst(vlan) : br_port_to_dst(p);
 		spin_lock_bh(&br->hash_lock);
-		err = fdb_add_entry(br, dst, addr, ndm, nlh_flags, vid,
-				    nfea_tb);
+		err = fdb_add_entry(br, dst, ndm, parms, nfea_tb);
 		spin_unlock_bh(&br->hash_lock);
 	}
 
@@ -1360,9 +1367,8 @@ static const struct nla_policy br_nda_fdb_pol[NFEA_MAX + 1] = {
 
 /* Add new permanent fdb entry with RTM_NEWNEIGH */
 int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-	       struct net_device *dev,
-	       const unsigned char *addr, u16 vid, u16 nlh_flags,
-	       bool *notified, struct netlink_ext_ack *extack)
+	       const struct ndo_fdb_parms *parms, bool *notified,
+	       struct netlink_ext_ack *extack)
 {
 	struct nlattr *nfea_tb[NFEA_MAX + 1], *attr;
 	struct net_bridge_vlan_group *vg;
@@ -1372,26 +1378,27 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 	u32 ext_flags = 0;
 	int err = 0;
 
-	trace_br_fdb_add(ndm, dev, addr, vid, nlh_flags);
+	trace_br_fdb_add(ndm, parms->dev, parms->addr, parms->vid,
+			 parms->flags);
 
 	if (!(ndm->ndm_state & (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE))) {
 		pr_info("bridge: RTM_NEWNEIGH with invalid state %#x\n", ndm->ndm_state);
 		return -EINVAL;
 	}
 
-	if (is_zero_ether_addr(addr)) {
+	if (is_zero_ether_addr(parms->addr)) {
 		pr_info("bridge: RTM_NEWNEIGH with invalid ether address\n");
 		return -EINVAL;
 	}
 
-	if (netif_is_bridge_master(dev)) {
-		br = netdev_priv(dev);
+	if (netif_is_bridge_master(parms->dev)) {
+		br = netdev_priv(parms->dev);
 		vg = br_vlan_group(br);
 	} else {
-		p = br_port_get_rtnl(dev);
+		p = br_port_get_rtnl(parms->dev);
 		if (!p) {
 			pr_info("bridge: RTM_NEWNEIGH %s not a bridge port\n",
-				dev->name);
+				parms->dev->name);
 			return -EINVAL;
 		}
 		br = p->br;
@@ -1416,19 +1423,20 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		memset(nfea_tb, 0, sizeof(struct nlattr *) * (NFEA_MAX + 1));
 	}
 
-	if (vid) {
-		v = br_vlan_find(vg, vid);
+	if (parms->vid) {
+		v = br_vlan_find(vg, parms->vid);
 		if (!v || !br_vlan_should_use(v)) {
-			pr_info("bridge: RTM_NEWNEIGH with unconfigured vlan %d on %s\n", vid, dev->name);
+			pr_info("bridge: RTM_NEWNEIGH with unconfigured vlan %d on %s\n",
+				parms->vid, parms->dev->name);
 			return -EINVAL;
 		}
 
 		/* VID was specified, so use it. */
-		err = __br_fdb_add(ndm, br, p, addr, nlh_flags, v, nfea_tb,
-				   notified, extack);
+		err = __br_fdb_add(ndm, br, p, parms, v, nfea_tb, notified,
+				   extack);
 	} else {
-		err = __br_fdb_add(ndm, br, p, addr, nlh_flags, NULL, nfea_tb,
-				   notified, extack);
+		err = __br_fdb_add(ndm, br, p, parms, NULL, nfea_tb, notified,
+				   extack);
 		if (err || !vg || !vg->num_vlans)
 			goto out;
 
@@ -1437,10 +1445,13 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 		 * vlan on this port.
 		 */
 		list_for_each_entry(v, &vg->vlan_list, vlist) {
+			struct ndo_fdb_parms vparms = *parms;
+
 			if (!br_vlan_should_use(v))
 				continue;
-			err = __br_fdb_add(ndm, br, p, addr, nlh_flags, v,
-					   nfea_tb, notified, extack);
+			vparms.vid = v->vid;
+			err = __br_fdb_add(ndm, br, p, &vparms, v, nfea_tb,
+					   notified, extack);
 			if (err)
 				goto out;
 		}
@@ -1452,7 +1463,8 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 
 static int fdb_delete_by_addr_and_port(struct net_bridge *br,
 				       const struct net_bridge_port *p,
-				       const u8 *addr, u16 vlan, bool *notified)
+				       const u8 *addr, u16 vlan, u32 portid,
+				       bool *notified)
 {
 	struct net_bridge_fdb_entry *fdb;
 
@@ -1460,7 +1472,7 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br,
 	if (!fdb || br_fdb_dst_port(fdb) != p)
 		return -ENOENT;
 
-	fdb_delete(br, fdb, true);
+	fdb_delete(br, fdb, portid, true);
 	*notified = true;
 
 	return 0;
@@ -1468,12 +1480,13 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br,
 
 static int __br_fdb_delete(struct net_bridge *br,
 			   const struct net_bridge_port *p,
-			   const unsigned char *addr, u16 vid, bool *notified)
+			   const unsigned char *addr, u16 vid, u32 portid,
+			   bool *notified)
 {
 	int err;
 
 	spin_lock_bh(&br->hash_lock);
-	err = fdb_delete_by_addr_and_port(br, p, addr, vid, notified);
+	err = fdb_delete_by_addr_and_port(br, p, addr, vid, portid, notified);
 	spin_unlock_bh(&br->hash_lock);
 
 	return err;
@@ -1481,8 +1494,7 @@ static int __br_fdb_delete(struct net_bridge *br,
 
 /* Remove neighbor entry with RTM_DELNEIGH */
 int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
-		  struct net_device *dev,
-		  const unsigned char *addr, u16 vid, bool *notified,
+		  const struct ndo_fdb_parms *parms, bool *notified,
 		  struct netlink_ext_ack *extack)
 {
 	struct net_bridge_vlan_group *vg;
@@ -1490,34 +1502,37 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
 	struct net_bridge *br;
 	int err;
 
-	if (netif_is_bridge_master(dev)) {
-		br = netdev_priv(dev);
+	if (netif_is_bridge_master(parms->dev)) {
+		br = netdev_priv(parms->dev);
 		vg = br_vlan_group(br);
 	} else {
-		p = br_port_get_rtnl(dev);
+		p = br_port_get_rtnl(parms->dev);
 		if (!p) {
 			pr_info("bridge: RTM_DELNEIGH %s not a bridge port\n",
-				dev->name);
+				parms->dev->name);
 			return -EINVAL;
 		}
 		vg = nbp_vlan_group(p);
 		br = p->br;
 	}
 
-	if (vid) {
-		err = __br_fdb_delete(br, p, addr, vid, notified);
+	if (parms->vid) {
+		err = __br_fdb_delete(br, p, parms->addr, parms->vid,
+				      parms->portid, notified);
 	} else {
 		struct net_bridge_vlan *v;
 
 		err = -ENOENT;
-		err &= __br_fdb_delete(br, p, addr, 0, notified);
+		err &= __br_fdb_delete(br, p, parms->addr, 0, parms->portid,
+				       notified);
 		if (!vg || !vg->num_vlans)
 			return err;
 
 		list_for_each_entry(v, &vg->vlan_list, vlist) {
 			if (!br_vlan_should_use(v))
 				continue;
-			err &= __br_fdb_delete(br, p, addr, v->vid, notified);
+			err &= __br_fdb_delete(br, p, parms->addr, v->vid,
+					       parms->portid, notified);
 		}
 	}
 
@@ -1598,7 +1613,7 @@ static struct net_bridge_dst br_fdb_resolve_dst(const struct net_bridge_port *p,
 
 int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid, bool locked,
-			      bool swdev_notify)
+			      u32 portid, bool swdev_notify)
 {
 	struct net_bridge_dst dst = br_fdb_resolve_dst(p, vid);
 	struct net_bridge_fdb_entry *fdb;
@@ -1630,7 +1645,7 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			err = -ENOMEM;
 			goto err_unlock;
 		}
-		fdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);
+		fdb_notify(br, fdb, RTM_NEWNEIGH, portid, swdev_notify);
 	} else {
 		struct net_bridge_dst old_dst;
 
@@ -1669,7 +1684,7 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			atomic_dec(&br->fdb_n_learned);
 
 		if (modified)
-			fdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);
+			fdb_notify(br, fdb, RTM_NEWNEIGH, portid, swdev_notify);
 	}
 
 err_unlock:
@@ -1689,7 +1704,7 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
 
 	fdb = br_fdb_find(br, addr, vid);
 	if (fdb && test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &fdb->flags))
-		fdb_delete(br, fdb, swdev_notify);
+		fdb_delete(br, fdb, 0, swdev_notify);
 	else
 		err = -ENOENT;
 
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 79c4a54990e26b..0a1dd507bbff85 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1001,7 +1001,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[],
 			.port_ifindex = p->dev->ifindex,
 		};
 
-		br_fdb_flush(p->br, &desc);
+		br_fdb_flush(p->br, &desc, 0);
 	}
 
 	changed_mask = old_flags ^ flags;
@@ -1431,7 +1431,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
 			.flags_mask = BIT(BR_FDB_STATIC)
 		};
 
-		br_fdb_flush(br, &desc);
+		br_fdb_flush(br, &desc, 0);
 	}
 
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 014d0b8db8c732..83f2b77289476c 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -992,7 +992,7 @@ void br_fdb_fini(void);
 int br_fdb_hash_init(struct net_bridge *br);
 void br_fdb_hash_fini(struct net_bridge *br);
 void br_fdb_flush(struct net_bridge *br,
-		  const struct net_bridge_fdb_flush_desc *desc);
+		  const struct net_bridge_fdb_flush_desc *desc, u32 portid);
 void br_fdb_find_delete_local(struct net_bridge *br,
 			      const struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid);
@@ -1015,23 +1015,23 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 		   unsigned long flags);
 
 int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
-		  struct net_device *dev, const unsigned char *addr, u16 vid,
-		  bool *notified, struct netlink_ext_ack *extack);
+		  const struct ndo_fdb_parms *parms, bool *notified,
+		  struct netlink_ext_ack *extack);
 int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev,
-		       struct netlink_ext_ack *extack);
-int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev,
-	       const unsigned char *addr, u16 vid, u16 nlh_flags,
-	       bool *notified, struct netlink_ext_ack *extack);
+		       u32 portid, struct netlink_ext_ack *extack);
+int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[],
+	       const struct ndo_fdb_parms *parms, bool *notified,
+	       struct netlink_ext_ack *extack);
 int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 		struct net_device *dev, struct net_device *fdev, int *idx);
-int br_fdb_get(struct sk_buff *skb, struct nlattr *tb[], struct net_device *dev,
-	       const unsigned char *addr, u16 vid, u32 portid, u32 seq,
+int br_fdb_get(struct sk_buff *skb, struct nlattr *tb[],
+	       const struct ndo_fdb_parms *parms, u32 seq,
 	       struct netlink_ext_ack *extack);
 int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p);
 void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p);
 int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid,
-			      bool locked, bool swdev_notify);
+			      bool locked, u32 portid, bool swdev_notify);
 int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
 			      const unsigned char *addr, u16 vid,
 			      bool swdev_notify);
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index d2993f187f5738..3a05764e607a16 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -349,7 +349,7 @@ static int set_flush(struct net_bridge *br, unsigned long val,
 		.flags_mask = BIT(BR_FDB_STATIC)
 	};
 
-	br_fdb_flush(br, &desc);
+	br_fdb_flush(br, &desc, 0);
 	return 0;
 }
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e141340172ce39..51713666f0e350 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -4721,7 +4721,7 @@ static inline size_t rtnl_fdb_nlmsg_size(const struct net_device *dev)
 }
 
 static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,
-			    u16 ndm_state)
+			    u16 ndm_state, u32 portid)
 {
 	struct net *net = dev_net(dev);
 	struct sk_buff *skb;
@@ -4732,7 +4732,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,
 		goto errout;
 
 	err = nlmsg_populate_fdb_fill(skb, dev, addr, vid,
-				      0, 0, type, NTF_SELF, 0, ndm_state);
+				      portid, 0, type, NTF_SELF, 0, ndm_state);
 	if (err < 0) {
 		kfree_skb(skb);
 		goto errout;
@@ -4749,9 +4749,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,
  */
 int ndo_dflt_fdb_add(struct ndmsg *ndm,
 		     struct nlattr *tb[],
-		     struct net_device *dev,
-		     const unsigned char *addr, u16 vid,
-		     u16 flags)
+		     const struct ndo_fdb_parms *parms)
 {
 	int err = -EINVAL;
 
@@ -4759,27 +4757,28 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "default FDB implementation only supports local addresses\n");
+		netdev_info(parms->dev, "default FDB implementation only supports local addresses\n");
 		return err;
 	}
 
 	if (tb[NDA_FLAGS_EXT]) {
-		netdev_info(dev, "invalid flags given to default FDB implementation\n");
+		netdev_info(parms->dev, "invalid flags given to default FDB implementation\n");
 		return err;
 	}
 
-	if (vid) {
-		netdev_info(dev, "vlans aren't supported yet for dev_uc|mc_add()\n");
+	if (parms->vid) {
+		netdev_info(parms->dev, "vlans aren't supported yet for dev_uc|mc_add()\n");
 		return err;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_add_excl(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_add_excl(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_add_excl(parms->dev, parms->addr);
 
 	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+	if (err == -EEXIST && !(parms->flags & NLM_F_EXCL))
 		err = 0;
 
 	return err;
@@ -4814,6 +4813,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct net *net = sock_net(skb->sk);
 	struct ndmsg *ndm;
 	struct nlattr *tb[NDA_MAX+1];
+	struct ndo_fdb_parms parms;
 	struct net_device *dev;
 	u8 *addr;
 	u16 vid;
@@ -4852,6 +4852,14 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 	if (err)
 		return err;
 
+	parms = (struct ndo_fdb_parms) {
+		.dev = dev,
+		.addr = addr,
+		.vid = vid,
+		.flags = nlh->nlmsg_flags,
+		.portid = NETLINK_CB(skb).portid,
+	};
+
 	err = -EOPNOTSUPP;
 
 	/* Support fdb on master device the net/bridge default case */
@@ -4861,8 +4869,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 		const struct net_device_ops *ops = br_dev->netdev_ops;
 		bool notified = false;
 
-		err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid,
-				       nlh->nlmsg_flags, &notified, extack);
+		err = ops->ndo_fdb_add(ndm, tb, &parms, &notified, extack);
 		if (err)
 			goto out;
 		else
@@ -4874,17 +4881,14 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 		bool notified = false;
 
 		if (dev->netdev_ops->ndo_fdb_add)
-			err = dev->netdev_ops->ndo_fdb_add(ndm, tb, dev, addr,
-							   vid,
-							   nlh->nlmsg_flags,
+			err = dev->netdev_ops->ndo_fdb_add(ndm, tb, &parms,
 							   &notified, extack);
 		else
-			err = ndo_dflt_fdb_add(ndm, tb, dev, addr, vid,
-					       nlh->nlmsg_flags);
+			err = ndo_dflt_fdb_add(ndm, tb, &parms);
 
 		if (!err && !notified) {
 			rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH,
-					ndm->ndm_state);
+					ndm->ndm_state, parms.portid);
 			ndm->ndm_flags &= ~NTF_SELF;
 		}
 	}
@@ -4897,8 +4901,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
  */
 int ndo_dflt_fdb_del(struct ndmsg *ndm,
 		     struct nlattr *tb[],
-		     struct net_device *dev,
-		     const unsigned char *addr, u16 vid)
+		     const struct ndo_fdb_parms *parms)
 {
 	int err = -EINVAL;
 
@@ -4906,14 +4909,15 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (!(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "default FDB implementation only supports local addresses\n");
+		netdev_info(parms->dev, "default FDB implementation only supports local addresses\n");
 		return err;
 	}
 
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_del(dev, addr);
-	else if (is_multicast_ether_addr(addr))
-		err = dev_mc_del(dev, addr);
+	if (is_unicast_ether_addr(parms->addr) ||
+	    is_link_local_ether_addr(parms->addr))
+		err = dev_uc_del(parms->dev, parms->addr);
+	else if (is_multicast_ether_addr(parms->addr))
+		err = dev_mc_del(parms->dev, parms->addr);
 
 	return err;
 }
@@ -4924,9 +4928,11 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 {
 	bool del_bulk = !!(nlh->nlmsg_flags & NLM_F_BULK);
 	struct net *net = sock_net(skb->sk);
+	u32 portid = NETLINK_CB(skb).portid;
 	const struct net_device_ops *ops;
 	struct ndmsg *ndm;
 	struct nlattr *tb[NDA_MAX+1];
+	struct ndo_fdb_parms parms;
 	struct net_device *dev;
 	__u8 *addr = NULL;
 	int err;
@@ -4966,6 +4972,13 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		err = fdb_vid_parse(tb[NDA_VLAN], &vid, extack);
 		if (err)
 			return err;
+
+		parms = (struct ndo_fdb_parms) {
+			.dev = dev,
+			.addr = addr,
+			.vid = vid,
+			.portid = portid,
+		};
 	}
 
 	if (dev->type != ARPHRD_ETHER) {
@@ -4984,11 +4997,12 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		ops = br_dev->netdev_ops;
 		if (!del_bulk) {
 			if (ops->ndo_fdb_del)
-				err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid,
+				err = ops->ndo_fdb_del(ndm, tb, &parms,
 						       &notified, extack);
 		} else {
 			if (ops->ndo_fdb_del_bulk)
-				err = ops->ndo_fdb_del_bulk(nlh, dev, extack);
+				err = ops->ndo_fdb_del_bulk(nlh, dev, portid,
+							    extack);
 		}
 
 		if (err)
@@ -5004,21 +5018,22 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		ops = dev->netdev_ops;
 		if (!del_bulk) {
 			if (ops->ndo_fdb_del)
-				err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid,
+				err = ops->ndo_fdb_del(ndm, tb, &parms,
 						       &notified, extack);
 			else
-				err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid);
+				err = ndo_dflt_fdb_del(ndm, tb, &parms);
 		} else {
 			/* in case err was cleared by NTF_MASTER call */
 			err = -EOPNOTSUPP;
 			if (ops->ndo_fdb_del_bulk)
-				err = ops->ndo_fdb_del_bulk(nlh, dev, extack);
+				err = ops->ndo_fdb_del_bulk(nlh, dev, portid,
+							    extack);
 		}
 
 		if (!err) {
 			if (!del_bulk && !notified)
 				rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH,
-						ndm->ndm_state);
+						ndm->ndm_state, portid);
 			ndm->ndm_flags &= ~NTF_SELF;
 		}
 	}
@@ -5327,6 +5342,7 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
 	const struct net_device_ops *ops = NULL;
 	struct net *net = sock_net(in_skb->sk);
 	struct nlattr *tb[NDA_MAX + 1];
+	struct ndo_fdb_parms parms;
 	struct sk_buff *skb;
 	int brport_idx = 0;
 	u8 ndm_flags = 0;
@@ -5404,9 +5420,15 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
 
 	if (br_dev)
 		dev = br_dev;
-	err = ops->ndo_fdb_get(skb, tb, dev, addr, vid,
-			       NETLINK_CB(in_skb).portid,
-			       nlh->nlmsg_seq, extack);
+
+	parms = (struct ndo_fdb_parms) {
+		.dev = dev,
+		.addr = addr,
+		.vid = vid,
+		.portid = NETLINK_CB(in_skb).portid,
+	};
+
+	err = ops->ndo_fdb_get(skb, tb, &parms, nlh->nlmsg_seq, extack);
 	if (err)
 		goto out;
 
diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
index fb5acb8acded11..0e9bcd0f259916 100644
--- a/tools/net/ynl/pyynl/lib/ynl.py
+++ b/tools/net/ynl/pyynl/lib/ynl.py
@@ -61,6 +61,8 @@ class Netlink:
     NLM_F_CREATE = 0x400
     NLM_F_APPEND = 0x800
 
+    NLM_F_BULK = 0x200
+
     NLM_F_CAPPED = 0x100
     NLM_F_ACK_TLVS = 0x200
 
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index fb0a64662053fc..fafe30367243da 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -35,6 +35,7 @@ TEST_PROGS := \
 	fcnal-other.sh \
 	fdb_flush.sh \
 	fdb_notify.sh \
+	fdb_notify_portid.py \
 	fib-onlink-tests.sh \
 	fib_nexthop_multiprefix.sh \
 	fib_nexthop_nongw.sh \
diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config
index dab62cdfa27bad..18dfb45fb914e5 100644
--- a/tools/testing/selftests/net/config
+++ b/tools/testing/selftests/net/config
@@ -126,6 +126,7 @@ CONFIG_NFT_COMPAT=m
 CONFIG_NFT_NAT=m
 CONFIG_NUMA=y
 CONFIG_OPENVSWITCH=m
+CONFIG_PACKET=y
 CONFIG_PAGE_POOL_STATS=y
 CONFIG_PSAMPLE=m
 CONFIG_RPS=y
diff --git a/tools/testing/selftests/net/fdb_notify_portid.py b/tools/testing/selftests/net/fdb_notify_portid.py
new file mode 100755
index 00000000000000..b7b398aa8040a5
--- /dev/null
+++ b/tools/testing/selftests/net/fdb_notify_portid.py
@@ -0,0 +1,297 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+Check that FDB notifications carry the netlink port ID of the requester in
+nlmsg_pid. A listener socket subscribed to the neighbour group receives the
+notifications, while separate requester sockets make the changes. The port ID
+the listener sees is expected to match that of the requester socket.
+"""
+
+import socket
+import struct
+from collections import namedtuple
+
+from lib.py import ksft_run, ksft_exit, ksft_eq, ksft_ne, ksft_true
+from lib.py import ksft_busy_wait
+from lib.py import ip, tool
+from lib.py import NetNS, NetNSEnter
+from lib.py import Netlink, RtnlNeighFamily
+
+RTM_NEWNEIGH = 28
+RTM_DELNEIGH = 29
+
+NTF_SELF = 0x02
+NTF_MASTER = 0x04
+
+NUD_NOARP = 0x40
+NUD_PERMANENT = 0x80
+
+ETH_P_EXP1 = 0x88b5  # Local Experimental EtherType 1
+
+Ntf = namedtuple("Ntf", "type portid addr")
+
+
+class Env:
+    """The listener socket, the two requester sockets A and B, and the
+    netlink port IDs of the latter. All sockets live in the given netns."""
+
+    @staticmethod
+    def _socket(ns):
+        with NetNSEnter(ns):
+            rtnl = RtnlNeighFamily()
+        return rtnl
+
+    def __init__(self, ns):
+        self.ns = str(ns)
+
+        self.listener = self._socket(ns)
+        self.listener.include_raw = True
+        self.listener.ntf_subscribe("rtnlgrp-neigh")
+
+        self.a = self._socket(ns)
+        self.a.sock.bind((0, 0))
+
+        self.b = self._socket(ns)
+        self.b.sock.bind((0, 0))
+
+        self.portids = {self.a: self.a.sock.getsockname()[0],
+                        self.b: self.b.sock.getsockname()[0]}
+
+        ksft_ne(self.portids[self.a], self.portids[self.b])
+        ksft_ne(self.portids[self.a], 0)
+
+    def ifindex(self, name):
+        """Look up the ifindex of a device in the test netns."""
+        with NetNSEnter(self.ns):
+            return socket.if_nametoindex(name)
+
+    def ntfs(self):
+        """Return the bridge-family notifications received by the listener."""
+        self.listener.check_ntf()
+        ntfs = []
+        while self.listener.async_msg_queue.qsize() > 0:
+            msg = self.listener.async_msg_queue.get()
+            if msg['msg']['ndm-family'] == socket.AF_BRIDGE:
+                ntfs.append(Ntf(msg['raw'].nl_type, msg['raw'].nl_portid,
+                                msg['msg']['lladdr']))
+        return ntfs
+
+    def check_ntfs(self, nl_type, addr, requester, count=1):
+        """Expect count notifications for addr, all from the requester."""
+        portids = [n.portid for n in self.ntfs()
+                   if n.type == nl_type and n.addr == addr]
+        ksft_eq(portids, [self.portids[requester]] * count,
+                f"nlmsg_pid of {addr} notifications")
+
+
+def fdb_req(ifindex, ndm_flags, attrs):
+    """Build an AF_BRIDGE neighbour request with the given attributes."""
+    return {'ndm-family': socket.AF_BRIDGE, 'ndm-ifindex': ifindex,
+            'ndm-flags': ndm_flags, **attrs}
+
+
+def test_msg(env, sock, message, message_type,
+             ifindex, addr, ndm_flags, flags, count, attrs):
+    """Send one request through SOCK, and expect COUNT notifications of
+    MESSAGE_TYPE about ADDR carrying the port ID of SOCK."""
+    # pylint: disable=too-many-arguments,too-many-positional-arguments
+    req = fdb_req(ifindex, ndm_flags, attrs | {"lladdr": addr})
+    sock.do(message, req, flags)
+    env.check_ntfs(message_type, addr, sock, count)
+
+
+def add_replace_del(env, ifname, addr, ndm_flags, *, add, rep, dlt, count=1):
+    """Add an entry through socket A, replace it through B, delete through A.
+    ADD, REP and DLT are the attributes of the respective requests. If REP is
+    None, the replace step is skipped."""
+    # pylint: disable=too-many-arguments
+    ifindex = env.ifindex(ifname)
+
+    test_msg(env, env.a, 'newneigh', RTM_NEWNEIGH, ifindex, addr, ndm_flags,
+             flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_EXCL],
+             count=count, attrs=add)
+
+    if rep is not None:
+        test_msg(env, env.b, 'newneigh', RTM_NEWNEIGH, ifindex, addr, ndm_flags,
+                 flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_REPLACE],
+                 count=count, attrs=rep)
+
+    test_msg(env, env.a, 'delneigh', RTM_DELNEIGH, ifindex, addr, ndm_flags,
+             flags=[],
+             count=count, attrs=dlt)
+
+
+def flush(env, ifname, addrs, add, dlt):
+    """Flush all permanent entries through socket A, and check that all the
+    notifications carry the port ID."""
+
+    ifindex = env.ifindex(ifname)
+
+    for addr in addrs:
+        attrs = add | {"ndm-state": NUD_PERMANENT,
+                       "lladdr": addr}
+        env.a.do('newneigh', fdb_req(ifindex, NTF_SELF, attrs),
+                 flags=[Netlink.NLM_F_CREATE | Netlink.NLM_F_EXCL])
+
+    env.ntfs()
+
+    attrs = dlt | {'ndm-state': NUD_PERMANENT,
+                   'ndm-state-mask': NUD_PERMANENT}
+    env.a.do('delneigh', fdb_req(ifindex, NTF_SELF, attrs),
+             flags=[Netlink.NLM_F_BULK])
+
+    ntfs = [n for n in env.ntfs() if n.type == RTM_DELNEIGH]
+
+    ksft_true({n.addr for n in ntfs} >= set(addrs),
+              "Flush did not notify about all the entries")
+    ksft_eq({n.portid for n in ntfs}, {env.portids[env.a]},
+            "nlmsg_pid of flush notifications")
+
+
+def test_bridge() -> None:
+    """Bridge port and bridge device entries: add, replace, delete."""
+    with NetNS() as ns:
+        env = Env(ns)
+
+        ip("link add br0 up type bridge vlan_default_pvid 0", ns=ns)
+        ip("link add d0 up type dummy", ns=ns)
+        ip("link set dev d0 master br0", ns=ns)
+
+        add_replace_del(env, "d0", "00:11:22:33:44:01", NTF_MASTER,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep={"ndm-state": NUD_NOARP},
+                        dlt={})
+
+        add_replace_del(env, "br0", "00:11:22:33:44:02", NTF_SELF,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep=None,
+                        dlt={})
+
+
+def test_bridge_vlan() -> None:
+    """Without a VID given, an entry is added and deleted in every VLAN."""
+    with NetNS() as ns:
+        env = Env(ns)
+
+        ip("link add br0 up type bridge vlan_filtering 1 vlan_default_pvid 0",
+           ns=ns)
+        ip("link add d0 up type dummy", ns=ns)
+        ip("link set dev d0 master br0", ns=ns)
+
+        tool("bridge", "vlan add dev d0 vid 10", ns=ns)
+        tool("bridge", "vlan add dev d0 vid 20", ns=ns)
+
+        # Three notifications: for VID 10 and 20, and for the entry
+        # without VLAN.
+        add_replace_del(env, "d0", "00:11:22:33:44:03", NTF_MASTER, count=3,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep=None,
+                        dlt={})
+
+
+def test_bridge_flush() -> None:
+    """Bulk delete of bridge entries."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add br0 up type bridge vlan_default_pvid 0", ns=ns)
+        ip("link add d0 up type dummy", ns=ns)
+        ip("link set dev d0 master br0", ns=ns)
+
+        flush(env, "br0", ["00:11:22:33:44:10",
+                           "00:11:22:33:44:11",
+                           "00:11:22:33:44:12"],
+              add={},
+              dlt={})
+
+
+def test_bridge_learned() -> None:
+    """Entries that are not a result of a request carry port ID of zero."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add br0 up type bridge", ns=ns)
+        ip("link add v0 up type veth peer name v1", ns=ns)
+        ip("link set dev v0 master br0", ns=ns)
+        ip("link set dev v1 up", ns=ns)
+
+        addr = "00:11:22:33:44:31"
+        frame = (b"\xff" * 6 + bytes.fromhex(addr.replace(":", "")) +
+                 struct.pack("!H", ETH_P_EXP1) + b"\0" * 46)
+        with NetNSEnter(env.ns):
+            tx = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)
+            tx.bind(("v1", 0))
+
+        portids = []
+
+        def learned():
+            nonlocal portids
+            tx.send(frame)
+            portids = [n.portid for n in env.ntfs()
+                       if n.type == RTM_NEWNEIGH and n.addr == addr]
+            return portids != []
+
+        # Keep sending until the entry is learned: a frame that
+        # arrives while the bridge port is not yet up is dropped
+        # without triggering learning. Once the entry exists, repeated
+        # frames only refresh it and do not generate notifications.
+        ksft_busy_wait(learned, deadline=2)
+
+        ksft_eq(portids, [0], "nlmsg_pid of learned entry")
+
+
+def test_vxlan() -> None:
+    """VXLAN entries: add, replace the remote, delete."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add vx0 up type vxlan id 2000 dstport 4789", ns=ns)
+
+        add_replace_del(env, "vx0", "00:11:22:33:44:41", NTF_SELF,
+                        add={"dst": "192.0.2.1", "ndm-state": NUD_PERMANENT},
+                        rep={"dst": "192.0.2.2", "ndm-state": NUD_PERMANENT},
+                        dlt={"dst": "192.0.2.2"})
+
+
+def test_vxlan_flush() -> None:
+    """Bulk delete of VXLAN entries."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add vx0 up type vxlan id 2000 dstport 4789", ns=ns)
+
+        flush(env, "vx0", ["00:11:22:33:44:50",
+                           "00:11:22:33:44:51",
+                           "00:11:22:33:44:52"],
+              add={"dst": "192.0.2.1"},
+              dlt={"dst": "192.0.2.1"})
+
+
+def test_macvlan() -> None:
+    """The notifications for macvlan, which does not notify by itself, are
+    sent by the generic code in rtnetlink."""
+    with NetNS() as ns:
+        env = Env(ns)
+        ip("link add dd up type dummy", ns=ns)
+        ip("link add mv0 up link dd type macvlan mode passthru", ns=ns)
+
+        # macvlan does not support replace.
+        add_replace_del(env, "mv0", "00:11:22:33:44:61", NTF_SELF,
+                        add={"ndm-state": NUD_PERMANENT},
+                        rep=None,
+                        dlt={})
+
+
+def main() -> None:
+    """Run all the tests."""
+    ksft_run([
+        test_bridge,
+        test_bridge_vlan,
+        test_bridge_flush,
+        test_bridge_learned,
+        test_vxlan,
+        test_vxlan_flush,
+        test_macvlan,
+    ])
+    ksft_exit()
+
+
+if __name__ == "__main__":
+    main()
diff --git a/tools/testing/selftests/net/lib/py/__init__.py b/tools/testing/selftests/net/lib/py/__init__.py
index b1696f432c7cf4..3f7696d06e6f43 100644
--- a/tools/testing/selftests/net/lib/py/__init__.py
+++ b/tools/testing/selftests/net/lib/py/__init__.py
@@ -17,7 +17,8 @@ from .utils import CmdExitFailure, fd_read_timeout, cmd, bkg, defer, \
     ctl_file_write, wait_file, tool, tc
 from .bpf import bpf_map_set, bpf_map_dump, bpf_prog_map_ids
 from .ynl import NlError, NlctrlFamily, YnlFamily, \
-    EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily, RtnlRouteFamily
+    EthtoolFamily, NetdevFamily, RtnlFamily, RtnlNeighFamily, \
+    RtnlAddrFamily, RtnlRouteFamily
 from .ynl import NetshaperFamily, DevlinkFamily, GtpFamily, PSPFamily, Netlink
 
 __all__ = ["KSRC",
@@ -36,4 +37,5 @@ __all__ = ["KSRC",
            "NetshaperFamily", "DevlinkFamily", "GtpFamily", "PSPFamily",
            "NlError",
            "YnlFamily", "EthtoolFamily", "NetdevFamily", "RtnlFamily",
-           "NlctrlFamily", "RtnlAddrFamily", "RtnlRouteFamily", "Netlink"]
+           "RtnlNeighFamily", "NlctrlFamily", "RtnlAddrFamily",
+           "RtnlRouteFamily", "Netlink"]
diff --git a/tools/testing/selftests/net/lib/py/ynl.py b/tools/testing/selftests/net/lib/py/ynl.py
index 69a6e9d9b390b0..ac13bf1ff23d3a 100644
--- a/tools/testing/selftests/net/lib/py/ynl.py
+++ b/tools/testing/selftests/net/lib/py/ynl.py
@@ -29,7 +29,8 @@ except ModuleNotFoundError as e:
 
 __all__ = [
     "NlError", "NlPolicy", "Netlink", "YnlFamily", "SPEC_PATH",
-    "EthtoolFamily", "RtnlFamily", "RtnlAddrFamily", "RtnlRouteFamily",
+    "EthtoolFamily", "RtnlFamily", "RtnlNeighFamily", "RtnlAddrFamily",
+    "RtnlRouteFamily",
     "NetdevFamily", "NetshaperFamily", "NlctrlFamily", "DevlinkFamily",
     "GtpFamily", "PSPFamily",
 ]
@@ -49,6 +50,13 @@ class RtnlFamily(YnlFamily):
         super().__init__((SPEC_PATH / Path('rt-link.yaml')).as_posix(),
                          schema='', recv_size=recv_size)
 
+class RtnlNeighFamily(YnlFamily):
+    """Netlink interface for neighbour messages."""
+    # pylint: disable=too-few-public-methods
+    def __init__(self, recv_size=0):
+        super().__init__((SPEC_PATH / Path('rt-neigh.yaml')).as_posix(),
+                         schema='', recv_size=recv_size)
+
 class RtnlAddrFamily(YnlFamily):
     def __init__(self, recv_size=0):
         super().__init__((SPEC_PATH / Path('rt-addr.yaml')).as_posix(),

18/3 2026/11/28 16:40 llm kmsan-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 36443
							output: 65
							thoughts: 422
						

Thoughts:
**Analyzing the FDB Patch**

Okay, let's dive into this patch. My initial thought is to carefully dissect the changes. It seems they're introducing `struct ndo_fdb_parms` – a sensible consolidation of parameters for `ndo_fdb_add`, `ndo_fdb_del`, `ndo_fdb_get`, and the default FDB functions. The inclusion of `portid` propagation to carry the netlink `portid` of the requester is also interesting and potentially useful for debugging and tracing.

But wait a minute! My immediate concern is always memory safety. I need to make sure there are *no* uninitialized memory access vulnerabilities introduced here. Let's start by scrutinizing how `struct ndo_fdb_parms` is initialized and used.

I see in `net/core/rtnetlink.c`, specifically within `rtnl_fdb_add`, that they're using a compound literal: `parms = (struct ndo_fdb_parms) { ... }`. Okay, that's good. In C, compound literals zero-initialize any omitted fields. In this case, all fields are specified: `dev`, `addr`, `vid`, `flags`, and `portid`, so there's no inherent issue with uninitialized members. While the C standard doesn't guarantee zeroing of padding bytes in compound literals, the code only reads the individual fields and never copies the `parms` struct as a whole to userspace, so we should be safe.

However, I need to be thorough. I'm going to pay special attention to `rtnl_fdb_del` and `rtnl_fdb_get` to ensure that `parms` is *always* initialized before being used in those functions. I'll read the relevant sections of `net/core/rtnetlink.c`, around lines 4920-5040 for `rtnl_fdb_del` and 5320-5440 for `rtnl_fdb_get`.

Just to be absolutely sure I'm not missing anything, I'll run a quick `read-file` command on `net/core/rtnetlink.c`, and check all other callers of `ndo_fdb_*`. Gotta check everywhere that this is used, just to be sure.



19/3 2026/11/28 16:40 tool read-file
0m Args:
{
  "File": "net/core/rtnetlink.c",
  "FirstLine": 4920,
  "LineCount": 120
}

Results:
{
  "Contents": "4920:\t\t\terr = dev_mc_del(parms-\u003edev, parms-\u003eaddr);\n4921:\t\n4922:\t\treturn err;\n4923:\t}\n4924:\tEXPORT_SYMBOL(ndo_dflt_fdb_del);\n4925:\t\n4926:\tstatic int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,\n4927:\t\t\t\tstruct netlink_ext_ack *extack)\n4928:\t{\n4929:\t\tbool del_bulk = !!(nlh-\u003enlmsg_flags \u0026 NLM_F_BULK);\n4930:\t\tstruct net *net = sock_net(skb-\u003esk);\n4931:\t\tu32 portid = NETLINK_CB(skb).portid;\n4932:\t\tconst struct net_device_ops *ops;\n4933:\t\tstruct ndmsg *ndm;\n4934:\t\tstruct nlattr *tb[NDA_MAX+1];\n4935:\t\tstruct ndo_fdb_parms parms;\n4936:\t\tstruct net_device *dev;\n4937:\t\t__u8 *addr = NULL;\n4938:\t\tint err;\n4939:\t\tu16 vid;\n4940:\t\n4941:\t\tif (!del_bulk) {\n4942:\t\t\terr = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX,\n4943:\t\t\t\t\t\t     NULL, extack);\n4944:\t\t} else {\n4945:\t\t\t/* For bulk delete, the drivers will parse the message with\n4946:\t\t\t * policy.\n4947:\t\t\t */\n4948:\t\t\terr = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, extack);\n4949:\t\t}\n4950:\t\tif (err \u003c 0)\n4951:\t\t\treturn err;\n4952:\t\n4953:\t\tndm = nlmsg_data(nlh);\n4954:\t\tif (ndm-\u003endm_ifindex == 0) {\n4955:\t\t\tNL_SET_ERR_MSG(extack, \"invalid ifindex\");\n4956:\t\t\treturn -EINVAL;\n4957:\t\t}\n4958:\t\n4959:\t\tdev = __dev_get_by_index(net, ndm-\u003endm_ifindex);\n4960:\t\tif (dev == NULL) {\n4961:\t\t\tNL_SET_ERR_MSG(extack, \"unknown ifindex\");\n4962:\t\t\treturn -ENODEV;\n4963:\t\t}\n4964:\t\n4965:\t\tif (!del_bulk) {\n4966:\t\t\tif (!tb[NDA_LLADDR] || nla_len(tb[NDA_LLADDR]) != ETH_ALEN) {\n4967:\t\t\t\tNL_SET_ERR_MSG(extack, \"invalid address\");\n4968:\t\t\t\treturn -EINVAL;\n4969:\t\t\t}\n4970:\t\t\taddr = nla_data(tb[NDA_LLADDR]);\n4971:\t\n4972:\t\t\terr = fdb_vid_parse(tb[NDA_VLAN], \u0026vid, extack);\n4973:\t\t\tif (err)\n4974:\t\t\t\treturn err;\n4975:\t\n4976:\t\t\tparms = (struct ndo_fdb_parms) {\n4977:\t\t\t\t.dev = dev,\n4978:\t\t\t\t.addr = addr,\n4979:\t\t\t\t.vid = vid,\n4980:\t\t\t\t.portid = portid,\n4981:\t\t\t};\n4982:\t\t}\n4983:\t\n4984:\t\tif (dev-\u003etype != ARPHRD_ETHER) {\n4985:\t\t\tNL_SET_ERR_MSG(extack, \"FDB delete only supported for Ethernet devices\");\n4986:\t\t\treturn -EINVAL;\n4987:\t\t}\n4988:\t\n4989:\t\terr = -EOPNOTSUPP;\n4990:\t\n4991:\t\t/* Support fdb on master device the net/bridge default case */\n4992:\t\tif ((!ndm-\u003endm_flags || ndm-\u003endm_flags \u0026 NTF_MASTER) \u0026\u0026\n4993:\t\t    netif_is_bridge_port(dev)) {\n4994:\t\t\tstruct net_device *br_dev = netdev_master_upper_dev_get(dev);\n4995:\t\t\tbool notified = false;\n4996:\t\n4997:\t\t\tops = br_dev-\u003enetdev_ops;\n4998:\t\t\tif (!del_bulk) {\n4999:\t\t\t\tif (ops-\u003endo_fdb_del)\n5000:\t\t\t\t\terr = ops-\u003endo_fdb_del(ndm, tb, \u0026parms,\n5001:\t\t\t\t\t\t\t       \u0026notified, extack);\n5002:\t\t\t} else {\n5003:\t\t\t\tif (ops-\u003endo_fdb_del_bulk)\n5004:\t\t\t\t\terr = ops-\u003endo_fdb_del_bulk(nlh, dev, portid,\n5005:\t\t\t\t\t\t\t\t    extack);\n5006:\t\t\t}\n5007:\t\n5008:\t\t\tif (err)\n5009:\t\t\t\tgoto out;\n5010:\t\t\telse\n5011:\t\t\t\tndm-\u003endm_flags \u0026= ~NTF_MASTER;\n5012:\t\t}\n5013:\t\n5014:\t\t/* Embedded bridge, macvlan, and any other device support */\n5015:\t\tif (ndm-\u003endm_flags \u0026 NTF_SELF) {\n5016:\t\t\tbool notified = false;\n5017:\t\n5018:\t\t\tops = dev-\u003enetdev_ops;\n5019:\t\t\tif (!del_bulk) {\n"
}

20/3 2026/11/28 16:40 tool grepper
0m Args:
{
  "Expression": "ndo_fdb_"
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 427 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (20 files in total):\nDocumentation/networking/dsa/dsa.rst:1\nDocumentation/networking/switchdev.rst:7\ndrivers/net/dsa/netc/netc_main.c:1\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c:2\ndrivers/net/ethernet/intel/i40e/i40e_main.c:4\ndrivers/net/ethernet/intel/ice/ice_main.c:4\ndrivers/net/ethernet/intel/igb/igb_main.c:3\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3\ndrivers/net/ethernet/mscc/ocelot_net.c:6\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:5\ndrivers/net/macvlan.c:5\ndrivers/net/vxlan/vxlan_core.c:9\ninclude/linux/netdevice.h:16\ninclude/linux/rtnetlink.h:4\nnet/bridge/br_device.c:5\nnet/bridge/br_fdb.c:7\nnet/bridge/br_private.h:3\nnet/core/rtnetlink.c:28\nnet/dsa/user.c:2\ntools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh:1\n\nDocumentation/networking/dsa/dsa.rst=971=Bridge VLAN filtering\n--\nDocumentation/networking/dsa/dsa.rst-1005-\nDocumentation/networking/dsa/dsa.rst:1006:- ``port_fdb_dump``: bridge bypass function invoked by ``ndo_fdb_dump`` on the\nDocumentation/networking/dsa/dsa.rst-1007-  physical DSA port interfaces. Since DSA does not attempt to keep in sync its\n--\nDocumentation/networking/switchdev.rst=182=Static FDB Entries\n--\nDocumentation/networking/switchdev.rst-184-\nDocumentation/networking/switchdev.rst:185:A driver which implements the ``ndo_fdb_add``, ``ndo_fdb_del`` and\nDocumentation/networking/switchdev.rst:186:``ndo_fdb_dump`` operations is able to support the command below, which adds a\nDocumentation/networking/switchdev.rst-187-static bridge FDB entry::\n--\nDocumentation/networking/switchdev.rst=194=The \"self\" keyword (optional because it is implicit) has the role of\nDocumentation/networking/switchdev.rst:195:instructing the kernel to fulfill the operation through the ``ndo_fdb_add``\nDocumentation/networking/switchdev.rst-196-implementation of the ``DEV`` device itself. If ``DEV`` is a bridge port, this\n--\nDocumentation/networking/switchdev.rst=204=The above command instructs the kernel to search for a master interface of\nDocumentation/networking/switchdev.rst:205:``DEV`` and fulfill the operation through the ``ndo_fdb_add`` method of that.\nDocumentation/networking/switchdev.rst-206-This time, the bridge generates a ``SWITCHDEV_FDB_ADD_TO_DEVICE`` notification\n--\nDocumentation/networking/switchdev.rst=211=Note: for new switchdev drivers that offload the Linux bridge, implementing the\nDocumentation/networking/switchdev.rst:212:``ndo_fdb_add`` and ``ndo_fdb_del`` bridge bypass methods is strongly\nDocumentation/networking/switchdev.rst-213-discouraged: all static FDB entries should be added on a bridge port using the\nDocumentation/networking/switchdev.rst:214:\"master\" flag. The ``ndo_fdb_dump`` is an exception and can be implemented to\nDocumentation/networking/switchdev.rst-215-visualize the hardware tables, if the device does not have an interrupt for\n--\nDocumentation/networking/switchdev.rst=217=addresses. In that case, the hardware FDB might end up having entries that the\nDocumentation/networking/switchdev.rst:218:software FDB does not, and implementing ``ndo_fdb_dump`` is the only way to see\nDocumentation/networking/switchdev.rst-219-them.\n--\ndrivers/net/dsa/netc/netc_main.c=712=static int netc_port_del_fdb_entry(struct netc_port *np,\n--\ndrivers/net/dsa/netc/netc_main.c-732-\t\t * For NTF_SELF path: dsa_user_netdev_ops does not implement\ndrivers/net/dsa/netc/netc_main.c:733:\t\t * ndo_fdb_del(), so rtnl_fdb_del() falls back to\ndrivers/net/dsa/netc/netc_main.c-734-\t\t * ndo_dflt_fdb_del(), which only supports NUD_PERMANENT static\n--\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c=954=static int dpaa2_switch_fdb_dump_nl(struct fdb_dump_entry *entry,\n--\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c-956-{\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c:957:\tstruct ndo_fdb_dump_context *ctx = (void *)dump-\u003ecb-\u003ectx;\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c-958-\tint is_dynamic = entry-\u003etype \u0026 DPSW_FDB_ENTRY_DINAMIC;\n--\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c=1590=static const struct net_device_ops dpaa2_switch_port_ops = {\n--\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c-1598-\t.ndo_get_offload_stats\t= dpaa2_switch_port_get_offload_stats,\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c:1599:\t.ndo_fdb_dump\t\t= dpaa2_switch_port_fdb_dump,\ndrivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c-1600-\t.ndo_vlan_rx_add_vid\t= dpaa2_switch_port_vlan_add,\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c=13005=static int i40e_get_phys_port_id(struct net_device *netdev,\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13021-/**\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13022: * i40e_ndo_fdb_add - add an entry to the hardware database\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13023- * @ndm: the input from the stack\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13028- */\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13029:static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13030:\t\t\t    const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13031-\t\t\t    struct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c=13633=static const struct net_device_ops i40e_netdev_ops = {\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13659-\t.ndo_get_phys_port_id\t= i40e_get_phys_port_id,\ndrivers/net/ethernet/intel/i40e/i40e_main.c:13660:\t.ndo_fdb_add\t\t= i40e_ndo_fdb_add,\ndrivers/net/ethernet/intel/i40e/i40e_main.c-13661-\t.ndo_features_check\t= i40e_features_check,\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=6116=ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],\ndrivers/net/ethernet/intel/ice/ice_main.c:6117:\t    const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/intel/ice/ice_main.c-6118-\t    struct netlink_ext_ack __always_unused *extack)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=6156=ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[],\ndrivers/net/ethernet/intel/ice/ice_main.c:6157:\t    const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/intel/ice/ice_main.c-6158-\t    struct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=9795=static const struct net_device_ops ice_netdev_ops = {\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-9821-\t.ndo_bridge_setlink = ice_bridge_setlink,\ndrivers/net/ethernet/intel/ice/ice_main.c:9822:\t.ndo_fdb_add = ice_fdb_add,\ndrivers/net/ethernet/intel/ice/ice_main.c:9823:\t.ndo_fdb_del = ice_fdb_del,\ndrivers/net/ethernet/intel/ice/ice_main.c-9824-#ifdef CONFIG_RFS_ACCEL\n--\ndrivers/net/ethernet/intel/igb/igb_main.c=2482=static int igb_set_features(struct net_device *netdev,\n--\ndrivers/net/ethernet/intel/igb/igb_main.c-2518-\ndrivers/net/ethernet/intel/igb/igb_main.c:2519:static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/intel/igb/igb_main.c:2520:\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/intel/igb/igb_main.c-2521-\t\t\t   struct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/intel/igb/igb_main.c=3036=static const struct net_device_ops igb_netdev_ops = {\n--\ndrivers/net/ethernet/intel/igb/igb_main.c-3056-\t.ndo_set_features\t= igb_set_features,\ndrivers/net/ethernet/intel/igb/igb_main.c:3057:\t.ndo_fdb_add\t\t= igb_ndo_fdb_add,\ndrivers/net/ethernet/intel/igb/igb_main.c-3058-\t.ndo_features_check\t= igb_features_check,\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c=10534=static int ixgbe_set_features(struct net_device *netdev,\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-10604-\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:10605:static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:10606:\t\t\t     const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-10607-\t\t\t     struct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c=11070=static const struct net_device_ops ixgbe_netdev_ops = {\n--\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-11105-\t.ndo_fix_features = ixgbe_fix_features,\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:11106:\t.ndo_fdb_add\t\t= ixgbe_ndo_fdb_add,\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c-11107-\t.ndo_bridge_setlink\t= ixgbe_ndo_bridge_setlink,\n--\ndrivers/net/ethernet/mscc/ocelot_net.c=767=static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/mscc/ocelot_net.c:768:\t\t\t       const struct ndo_fdb_parms *parms,\ndrivers/net/ethernet/mscc/ocelot_net.c-769-\t\t\t       bool *notified, struct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/mscc/ocelot_net.c=780=static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/mscc/ocelot_net.c:781:\t\t\t       const struct ndo_fdb_parms *parms,\ndrivers/net/ethernet/mscc/ocelot_net.c-782-\t\t\t       bool *notified, struct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/mscc/ocelot_net.c=793=static int ocelot_port_fdb_do_dump(const unsigned char *addr, u16 vid,\n--\ndrivers/net/ethernet/mscc/ocelot_net.c-796-\tstruct ocelot_dump_ctx *dump = data;\ndrivers/net/ethernet/mscc/ocelot_net.c:797:\tstruct ndo_fdb_dump_context *ctx = (void *)dump-\u003ecb-\u003ectx;\ndrivers/net/ethernet/mscc/ocelot_net.c-798-\tu32 portid = NETLINK_CB(dump-\u003ecb-\u003eskb).portid;\n--\ndrivers/net/ethernet/mscc/ocelot_net.c=947=static const struct net_device_ops ocelot_port_netdev_ops = {\n--\ndrivers/net/ethernet/mscc/ocelot_net.c-954-\t.ndo_get_stats64\t\t= ocelot_get_stats64,\ndrivers/net/ethernet/mscc/ocelot_net.c:955:\t.ndo_fdb_add\t\t\t= ocelot_port_fdb_add,\ndrivers/net/ethernet/mscc/ocelot_net.c:956:\t.ndo_fdb_del\t\t\t= ocelot_port_fdb_del,\ndrivers/net/ethernet/mscc/ocelot_net.c:957:\t.ndo_fdb_dump\t\t\t= ocelot_port_fdb_dump,\ndrivers/net/ethernet/mscc/ocelot_net.c-958-\t.ndo_vlan_rx_add_vid\t\t= ocelot_vlan_rx_add_vid,\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c=368=static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:369:\t\t\tconst struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c-370-\t\t\tstruct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c=393=static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:394:\t\t\tconst struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c-395-\t\t\tstruct netlink_ext_ack *extack)\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c=500=static const struct net_device_ops qlcnic_netdev_ops = {\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c-513-\t.ndo_vlan_rx_kill_vid\t= qlcnic_vlan_rx_del,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:514:\t.ndo_fdb_add\t\t= qlcnic_fdb_add,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:515:\t.ndo_fdb_del\t\t= qlcnic_fdb_del,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:516:\t.ndo_fdb_dump\t\t= qlcnic_fdb_dump,\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c-517-\t.ndo_get_phys_port_id\t= qlcnic_get_phys_port_id,\n--\ndrivers/net/macvlan.c=1056=static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/macvlan.c:1057:\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/macvlan.c-1058-\t\t\t   struct netlink_ext_ack *extack)\n--\ndrivers/net/macvlan.c=1080=static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/macvlan.c:1081:\t\t\t   const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/macvlan.c-1082-\t\t\t   struct netlink_ext_ack *extack)\n--\ndrivers/net/macvlan.c=1201=static const struct net_device_ops macvlan_netdev_ops = {\n--\ndrivers/net/macvlan.c-1215-\t.ndo_vlan_rx_kill_vid\t= macvlan_vlan_rx_kill_vid,\ndrivers/net/macvlan.c:1216:\t.ndo_fdb_add\t\t= macvlan_fdb_add,\ndrivers/net/macvlan.c:1217:\t.ndo_fdb_del\t\t= macvlan_fdb_del,\ndrivers/net/macvlan.c:1218:\t.ndo_fdb_dump\t\t= ndo_dflt_fdb_dump,\ndrivers/net/macvlan.c-1219-#ifdef CONFIG_NET_POLL_CONTROLLER\n--\ndrivers/net/vxlan/vxlan_core.c=1246=static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/vxlan/vxlan_core.c:1247:\t\t\t const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/vxlan/vxlan_core.c-1248-\t\t\t struct netlink_ext_ack *extack)\n--\ndrivers/net/vxlan/vxlan_core.c=1325=static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],\ndrivers/net/vxlan/vxlan_core.c:1326:\t\t\t    const struct ndo_fdb_parms *parms, bool *notified,\ndrivers/net/vxlan/vxlan_core.c-1327-\t\t\t    struct netlink_ext_ack *extack)\n--\ndrivers/net/vxlan/vxlan_core.c=1353=static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,\n--\ndrivers/net/vxlan/vxlan_core.c-1356-{\ndrivers/net/vxlan/vxlan_core.c:1357:\tstruct ndo_fdb_dump_context *ctx = (void *)cb-\u003ectx;\ndrivers/net/vxlan/vxlan_core.c-1358-\tstruct vxlan_dev *vxlan = netdev_priv(dev);\n--\ndrivers/net/vxlan/vxlan_core.c=1403=static int vxlan_fdb_get(struct sk_buff *skb,\ndrivers/net/vxlan/vxlan_core.c-1404-\t\t\t struct nlattr *tb[],\ndrivers/net/vxlan/vxlan_core.c:1405:\t\t\t const struct ndo_fdb_parms *parms, u32 seq,\ndrivers/net/vxlan/vxlan_core.c-1406-\t\t\t struct netlink_ext_ack *extack)\n--\ndrivers/net/vxlan/vxlan_core.c=3376=static const struct net_device_ops vxlan_netdev_ether_ops = {\n--\ndrivers/net/vxlan/vxlan_core.c-3385-\t.ndo_set_mac_address\t= eth_mac_addr,\ndrivers/net/vxlan/vxlan_core.c:3386:\t.ndo_fdb_add\t\t= vxlan_fdb_add,\ndrivers/net/vxlan/vxlan_core.c:3387:\t.ndo_fdb_del\t\t= vxlan_fdb_delete,\ndrivers/net/vxlan/vxlan_core.c:3388:\t.ndo_fdb_del_bulk\t= vxlan_fdb_delete_bulk,\ndrivers/net/vxlan/vxlan_core.c:3389:\t.ndo_fdb_dump\t\t= vxlan_fdb_dump,\ndrivers/net/vxlan/vxlan_core.c:3390:\t.ndo_fdb_get\t\t= vxlan_fdb_get,\ndrivers/net/vxlan/vxlan_core.c-3391-\t.ndo_mdb_add\t\t= vxlan_mdb_add,\n--\ninclude/linux/netdevice.h=1085=struct netdev_net_notifier {\n--\ninclude/linux/netdevice.h-1090-/**\ninclude/linux/netdevice.h:1091: * struct ndo_fdb_parms - parameters for ndo_fdb_{add,del,get}\ninclude/linux/netdevice.h-1092- * @dev: device the FDB entry is added to, deleted from or looked up on\n--\ninclude/linux/netdevice.h-1097- */\ninclude/linux/netdevice.h:1098:struct ndo_fdb_parms {\ninclude/linux/netdevice.h-1099-\tstruct net_device\t*dev;\n--\n\n"
}

21/3 2026/11/28 16:40 llm kmsan-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 44464
							output: 61
							thoughts: 545
						

Thoughts:
**Analyzing FDB Parameter Initialization**

Okay, let's break down how the `ndo_fdb_parms` struct is initialized and used, focusing on potential issues, especially concerning the `flags` member. I'm starting by looking at `br_fdb.c` around line 1445, where `vparms` gets created for VLAN entries. I see that `parms` is fully initialized within `rtnl_fdb_add` using a compound literal, including the `flags` field, which seems right at first glance. However, I need to make sure this initialization is consistent across all FDB operations.

Now, I'm re-examining `rtnl_fdb_del` because deletion scenarios can often reveal unexpected behavior.  The key here is the `del_bulk` flag. If `del_bulk` is true, it seems that `parms` isn't initialized at all, and more importantly, it's not even used because all uses of `&parms` are within a conditional. When `del_bulk` is false, `parms` *is* initialized, but the initialization omits `.flags`, relying on zero initialization as a result of the compound literal.  Crucially, it looks like `ndo_fdb_del` and `ndo_dflt_fdb_del` don't actually *use* the `parms->flags` field in any case. That's a point to keep in mind, even though this omission feels a bit... risky, or at least a potential point of future confusion.

Similarly, in `rtnl_fdb_get`, `parms` *is* initialized, but `.flags` is again omitted, so it gets zero-initialized. I need to be 100% sure this isn't going to have a side effect, since uninitialized or incorrectly initialized flags are a classic source of problems.

Finally, to be really thorough, I'm going to investigate how the `portid` field is used, in case there are subtle interactions I'm missing. So, I need to check `fdb_fill_info`, `vxlan_fdb_info`, and `nlmsg_populate_fdb_fill` and grep for those functions to get a complete picture. This helps me verify that the compound literals are correct for each case.



22/3 2026/11/28 16:40 tool grepper
0m Args:
{
  "Expression": "fdb_fill_info|vxlan_fdb_info|nlmsg_populate_fdb_fill",
  "PathPrefixes": [
    "net/",
    "drivers/net/vxlan/"
  ]
}

Results:
{
  "Output": "drivers/net/vxlan/vxlan_core.c=144=static struct vxlan_dev *vxlan_find_vni(struct net *net, int ifindex,\n--\ndrivers/net/vxlan/vxlan_core.c-157-/* Fill in neighbour message in skbuff. */\ndrivers/net/vxlan/vxlan_core.c:158:static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,\ndrivers/net/vxlan/vxlan_core.c-159-\t\t\t  const struct vxlan_fdb *fdb,\n--\ndrivers/net/vxlan/vxlan_core.c=267=static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,\n--\ndrivers/net/vxlan/vxlan_core.c-277-\ndrivers/net/vxlan/vxlan_core.c:278:\terr = vxlan_fdb_info(skb, vxlan, fdb, portid, 0, type, 0, rd);\ndrivers/net/vxlan/vxlan_core.c-279-\tif (err \u003c 0) {\n--\ndrivers/net/vxlan/vxlan_core.c=292=static void vxlan_fdb_switchdev_notifier_info(const struct vxlan_dev *vxlan,\n--\ndrivers/net/vxlan/vxlan_core.c-295-\t\t\t    struct netlink_ext_ack *extack,\ndrivers/net/vxlan/vxlan_core.c:296:\t\t\t    struct switchdev_notifier_vxlan_fdb_info *fdb_info)\ndrivers/net/vxlan/vxlan_core.c-297-{\n--\ndrivers/net/vxlan/vxlan_core.c=310=static int vxlan_fdb_switchdev_call_notifiers(struct vxlan_dev *vxlan,\n--\ndrivers/net/vxlan/vxlan_core.c-315-{\ndrivers/net/vxlan/vxlan_core.c:316:\tstruct switchdev_notifier_vxlan_fdb_info info;\ndrivers/net/vxlan/vxlan_core.c-317-\tenum switchdev_notifier_type notifier_type;\n--\ndrivers/net/vxlan/vxlan_core.c=449=int vxlan_fdb_find_uc(struct net_device *dev, const u8 *mac, __be32 vni,\ndrivers/net/vxlan/vxlan_core.c:450:\t\t      struct switchdev_notifier_vxlan_fdb_info *fdb_info)\ndrivers/net/vxlan/vxlan_core.c-451-{\n--\ndrivers/net/vxlan/vxlan_core.c=482=static int vxlan_fdb_notify_one(struct notifier_block *nb,\n--\ndrivers/net/vxlan/vxlan_core.c-487-{\ndrivers/net/vxlan/vxlan_core.c:488:\tstruct switchdev_notifier_vxlan_fdb_info fdb_info;\ndrivers/net/vxlan/vxlan_core.c-489-\tint rc;\n--\ndrivers/net/vxlan/vxlan_core.c=1353=static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,\n--\ndrivers/net/vxlan/vxlan_core.c-1368-\t\t\t\tgoto skip_nh;\ndrivers/net/vxlan/vxlan_core.c:1369:\t\t\terr = vxlan_fdb_info(skb, vxlan, f,\ndrivers/net/vxlan/vxlan_core.c-1370-\t\t\t\t\t     NETLINK_CB(cb-\u003eskb).portid,\n--\ndrivers/net/vxlan/vxlan_core.c-1385-\ndrivers/net/vxlan/vxlan_core.c:1386:\t\t\terr = vxlan_fdb_info(skb, vxlan, f,\ndrivers/net/vxlan/vxlan_core.c-1387-\t\t\t\t\t     NETLINK_CB(cb-\u003eskb).portid,\n--\ndrivers/net/vxlan/vxlan_core.c=1403=static int vxlan_fdb_get(struct sk_buff *skb,\n--\ndrivers/net/vxlan/vxlan_core.c-1429-\ndrivers/net/vxlan/vxlan_core.c:1430:\terr = vxlan_fdb_info(skb, vxlan, f, parms-\u003eportid, seq,\ndrivers/net/vxlan/vxlan_core.c-1431-\t\t\t     RTM_NEWNEIGH, 0, first_remote_rcu(f));\n--\ndrivers/net/vxlan/vxlan_core.c=4922=vxlan_fdb_offloaded_set(struct net_device *dev,\ndrivers/net/vxlan/vxlan_core.c:4923:\t\t\tstruct switchdev_notifier_vxlan_fdb_info *fdb_info)\ndrivers/net/vxlan/vxlan_core.c-4924-{\n--\ndrivers/net/vxlan/vxlan_core.c=4949=vxlan_fdb_external_learn_add(struct net_device *dev,\ndrivers/net/vxlan/vxlan_core.c:4950:\t\t\t     struct switchdev_notifier_vxlan_fdb_info *fdb_info)\ndrivers/net/vxlan/vxlan_core.c-4951-{\n--\ndrivers/net/vxlan/vxlan_core.c=4974=vxlan_fdb_external_learn_del(struct net_device *dev,\ndrivers/net/vxlan/vxlan_core.c:4975:\t\t\t     struct switchdev_notifier_vxlan_fdb_info *fdb_info)\ndrivers/net/vxlan/vxlan_core.c-4976-{\n--\ndrivers/net/vxlan/vxlan_core.c=5000=static int vxlan_switchdev_event(struct notifier_block *unused,\n--\ndrivers/net/vxlan/vxlan_core.c-5003-\tstruct net_device *dev = switchdev_notifier_info_to_dev(ptr);\ndrivers/net/vxlan/vxlan_core.c:5004:\tstruct switchdev_notifier_vxlan_fdb_info *fdb_info;\ndrivers/net/vxlan/vxlan_core.c-5005-\tint err = 0;\n--\nnet/bridge/br_fdb.c=76=static int fdb_to_nud(const struct net_bridge *br,\n--\nnet/bridge/br_fdb.c-88-\nnet/bridge/br_fdb.c:89:static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br,\nnet/bridge/br_fdb.c-90-\t\t\t const struct net_bridge_fdb_entry *fdb,\n--\nnet/bridge/br_fdb.c=177=static void fdb_notify(struct net_bridge *br,\n--\nnet/bridge/br_fdb.c-191-\nnet/bridge/br_fdb.c:192:\terr = fdb_fill_info(skb, br, fdb, portid, 0, type, 0);\nnet/bridge/br_fdb.c-193-\tif (err \u003c 0) {\n--\nnet/bridge/br_fdb.c=1102=int br_fdb_dump(struct sk_buff *skb,\n--\nnet/bridge/br_fdb.c-1141-\nnet/bridge/br_fdb.c:1142:\t\terr = fdb_fill_info(skb, br, f,\nnet/bridge/br_fdb.c-1143-\t\t\t\t    NETLINK_CB(cb-\u003eskb).portid,\n--\nnet/bridge/br_fdb.c=1157=int br_fdb_get(struct sk_buff *skb,\n--\nnet/bridge/br_fdb.c-1173-\nnet/bridge/br_fdb.c:1174:\terr = fdb_fill_info(skb, br, f, parms-\u003eportid, seq, RTM_NEWNEIGH, 0);\nnet/bridge/br_fdb.c-1175-errout:\n--\nnet/core/rtnetlink.c=4672=void rtmsg_ifinfo_newnet(int type, struct net_device *dev, unsigned int change,\n--\nnet/core/rtnetlink.c-4678-\nnet/core/rtnetlink.c:4679:static int nlmsg_populate_fdb_fill(struct sk_buff *skb,\nnet/core/rtnetlink.c-4680-\t\t\t\t   struct net_device *dev,\n--\nnet/core/rtnetlink.c=4723=static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,\n--\nnet/core/rtnetlink.c-4733-\nnet/core/rtnetlink.c:4734:\terr = nlmsg_populate_fdb_fill(skb, dev, addr, vid,\nnet/core/rtnetlink.c-4735-\t\t\t\t      portid, 0, type, NTF_SELF, 0, ndm_state);\n--\nnet/core/rtnetlink.c=5044=static int nlmsg_populate_fdb(struct sk_buff *skb,\n--\nnet/core/rtnetlink.c-5061-\nnet/core/rtnetlink.c:5062:\t\terr = nlmsg_populate_fdb_fill(skb, dev, ha-\u003eaddr, 0,\nnet/core/rtnetlink.c-5063-\t\t\t\t\t      portid, seq,\n"
}

23/3 2026/11/28 16:40 llm kmsan-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 47665
							output: 45
							thoughts: 31
						

Thoughts:
Here's my take on the thought process:

**Diving Deeper into the Route Retrieval Logic**

Okay, so we've looked at the obvious suspects, but I'm feeling a little uneasy. Let's not make assumptions; this is network code, and things can get hairy. Just to be absolutely thorough, I need to double-check `rtnl_fdb_get` within the `net/core/rtnetlink.c` file. It's a key function for retrieving forwarding database entries through netlink, and even if it seems unlikely, there's always a chance something's amiss there that we missed in our initial triage. Gotta cover all the bases to be sure. It's the most likely area for the problem to lie.



24/3 2026/11/28 16:41 tool read-file
0m Args:
{
  "File": "net/core/rtnetlink.c",
  "FirstLine": 5325,
  "LineCount": 110
}

Results:
{
  "Contents": "5325:\t\t\t\t\treturn err;\n5326:\t\t\t\tbreak;\n5327:\t\t\tcase NDA_VNI:\n5328:\t\t\t\tbreak;\n5329:\t\t\tdefault:\n5330:\t\t\t\tNL_SET_ERR_MSG(extack, \"Unsupported attribute in fdb get request\");\n5331:\t\t\t\treturn -EINVAL;\n5332:\t\t\t}\n5333:\t\t}\n5334:\t\n5335:\t\treturn 0;\n5336:\t}\n5337:\t\n5338:\tstatic int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,\n5339:\t\t\t\tstruct netlink_ext_ack *extack)\n5340:\t{\n5341:\t\tstruct net_device *dev = NULL, *br_dev = NULL;\n5342:\t\tconst struct net_device_ops *ops = NULL;\n5343:\t\tstruct net *net = sock_net(in_skb-\u003esk);\n5344:\t\tstruct nlattr *tb[NDA_MAX + 1];\n5345:\t\tstruct ndo_fdb_parms parms;\n5346:\t\tstruct sk_buff *skb;\n5347:\t\tint brport_idx = 0;\n5348:\t\tu8 ndm_flags = 0;\n5349:\t\tint br_idx = 0;\n5350:\t\tu8 *addr = NULL;\n5351:\t\tu16 vid = 0;\n5352:\t\tint err;\n5353:\t\n5354:\t\terr = valid_fdb_get_strict(nlh, tb, \u0026ndm_flags, \u0026br_idx,\n5355:\t\t\t\t\t   \u0026brport_idx, \u0026addr, \u0026vid, extack);\n5356:\t\tif (err \u003c 0)\n5357:\t\t\treturn err;\n5358:\t\n5359:\t\tif (!addr) {\n5360:\t\t\tNL_SET_ERR_MSG(extack, \"Missing lookup address for fdb get request\");\n5361:\t\t\treturn -EINVAL;\n5362:\t\t}\n5363:\t\n5364:\t\tif (brport_idx) {\n5365:\t\t\tdev = __dev_get_by_index(net, brport_idx);\n5366:\t\t\tif (!dev) {\n5367:\t\t\t\tNL_SET_ERR_MSG(extack, \"Unknown device ifindex\");\n5368:\t\t\t\treturn -ENODEV;\n5369:\t\t\t}\n5370:\t\t}\n5371:\t\n5372:\t\tif (br_idx) {\n5373:\t\t\tif (dev) {\n5374:\t\t\t\tNL_SET_ERR_MSG(extack, \"Master and device are mutually exclusive\");\n5375:\t\t\t\treturn -EINVAL;\n5376:\t\t\t}\n5377:\t\n5378:\t\t\tbr_dev = __dev_get_by_index(net, br_idx);\n5379:\t\t\tif (!br_dev) {\n5380:\t\t\t\tNL_SET_ERR_MSG(extack, \"Invalid master ifindex\");\n5381:\t\t\t\treturn -EINVAL;\n5382:\t\t\t}\n5383:\t\t\tops = br_dev-\u003enetdev_ops;\n5384:\t\t}\n5385:\t\n5386:\t\tif (dev) {\n5387:\t\t\tif (!ndm_flags || (ndm_flags \u0026 NTF_MASTER)) {\n5388:\t\t\t\tif (!netif_is_bridge_port(dev)) {\n5389:\t\t\t\t\tNL_SET_ERR_MSG(extack, \"Device is not a bridge port\");\n5390:\t\t\t\t\treturn -EINVAL;\n5391:\t\t\t\t}\n5392:\t\t\t\tbr_dev = netdev_master_upper_dev_get(dev);\n5393:\t\t\t\tif (!br_dev) {\n5394:\t\t\t\t\tNL_SET_ERR_MSG(extack, \"Master of device not found\");\n5395:\t\t\t\t\treturn -EINVAL;\n5396:\t\t\t\t}\n5397:\t\t\t\tops = br_dev-\u003enetdev_ops;\n5398:\t\t\t} else {\n5399:\t\t\t\tif (!(ndm_flags \u0026 NTF_SELF)) {\n5400:\t\t\t\t\tNL_SET_ERR_MSG(extack, \"Missing NTF_SELF\");\n5401:\t\t\t\t\treturn -EINVAL;\n5402:\t\t\t\t}\n5403:\t\t\t\tops = dev-\u003enetdev_ops;\n5404:\t\t\t}\n5405:\t\t}\n5406:\t\n5407:\t\tif (!br_dev \u0026\u0026 !dev) {\n5408:\t\t\tNL_SET_ERR_MSG(extack, \"No device specified\");\n5409:\t\t\treturn -ENODEV;\n5410:\t\t}\n5411:\t\n5412:\t\tif (!ops || !ops-\u003endo_fdb_get) {\n5413:\t\t\tNL_SET_ERR_MSG(extack, \"Fdb get operation not supported by device\");\n5414:\t\t\treturn -EOPNOTSUPP;\n5415:\t\t}\n5416:\t\n5417:\t\tskb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);\n5418:\t\tif (!skb)\n5419:\t\t\treturn -ENOBUFS;\n5420:\t\n5421:\t\tif (br_dev)\n5422:\t\t\tdev = br_dev;\n5423:\t\n5424:\t\tparms = (struct ndo_fdb_parms) {\n"
}

25/3 2026/11/28 16:41 llm kmsan-evaluator
0m Model:
gemini-4-hydrogen

Args:
null

Results:
null

Tokens:
							input: 49195
							output: 486
							thoughts: 371
						

Thoughts:
**KMSAN Assessment: Clean Code Path**

Okay, let's break this down from a kernel perspective. I've examined the code paths and I'm confident there are no issues requiring KMSAN's attention. Here's why:

First, the `struct ndo_fdb_parms` is strictly an internal, stack-based structure. That's good, no direct user-space exposure. Second, every time we pass a pointer to it, it is initialized using a compound literal, which covers us. If any fields are omitted during initialisation, these will be zero-initialized as per C standards, mitigating any potential issues.

I specifically looked at the `rtnl_fdb_del` code. While `parms` is not initialized when `del_bulk` is true, the `&parms` is only ever used within the `if (!del_bulk)` branches. No worries there. Also, within `br_fdb_add`, a copy operation is made, and the `vid` field is then updated after the copy. This ensures a defined state, which makes me feel comfortable. The `portid` is obtained from reliable sources and always populated properly.

Crucially, there's no introduction of new user-space output structures that might contain uninitialized fields or padding. We're also not seeing any conditional logic that relies on uninitialized variables, nor any alterations in buffer lengths or bounds checks that could expose uninitialized bytes.

Given all this, I'm comfortable saying that `NeedsKMSAN` should be `false`. Time to call `set-results` and move on to the next one!



26/3 2026/11/28 16:41 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch series refactors the FDB net_device_ops callbacks (ndo_fdb_add, ndo_fdb_del, ndo_fdb_get, ndo_dflt_fdb_add, ndo_dflt_fdb_del) to pass parameters via a new internal struct ndo_fdb_parms, and propagates the requester's netlink u32 portid (from NETLINK_CB(skb).portid, or 0 for internal/async notifications) through bridge, vxlan, and rtnetlink FDB notification paths so nlmsg_pid is populated instead of 0.\n\nThere are no uninitialized memory risks introduced by these changes:\n1. struct ndo_fdb_parms is strictly an internal kernel stack struct and is never copied directly to user space. Whenever \u0026parms is passed to callbacks (in rtnl_fdb_add, rtnl_fdb_del when !del_bulk, and rtnl_fdb_get), it is initialized with a C compound literal (struct ndo_fdb_parms) { ... } which explicitly initializes all read fields and zero-initializes any omitted fields (e.g., .flags in del/get). In rtnl_fdb_del, the del_bulk == true path never touches parms.\n2. In net/bridge/br_fdb.c, vparms is initialized by copying *parms before overriding vparms.vid.\n3. The u32 portid passed to fdb_fill_info(), vxlan_fdb_info(), and nlmsg_populate_fdb_fill() is always initialized (either NETLINK_CB(skb).portid or 0) and simply replaces a hardcoded 0 argument in nlmsg_put() for nlmsg_pid.\n4. No new netlink attributes or kernel-to-user structures with uninitialized fields or padding are added, and no bounds or length calculations are changed. Any potential issues in these paths (such as pointer/lifetime bugs in netdevice ops or bridge/vxlan FDB handling) would be caught by standard KASAN/LOCKDEP/UBSAN fuzzing rather than requiring KMSAN.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch series refactors the FDB net_device_ops callbacks (ndo_fdb_add, ndo_fdb_del, ndo_fdb_get, ndo_dflt_fdb_add, ndo_dflt_fdb_del) to pass parameters via a new internal struct ndo_fdb_parms, and propagates the requester's netlink u32 portid (from NETLINK_CB(skb).portid, or 0 for internal/async notifications) through bridge, vxlan, and rtnetlink FDB notification paths so nlmsg_pid is populated instead of 0.\n\nThere are no uninitialized memory risks introduced by these changes:\n1. struct ndo_fdb_parms is strictly an internal kernel stack struct and is never copied directly to user space. Whenever \u0026parms is passed to callbacks (in rtnl_fdb_add, rtnl_fdb_del when !del_bulk, and rtnl_fdb_get), it is initialized with a C compound literal (struct ndo_fdb_parms) { ... } which explicitly initializes all read fields and zero-initializes any omitted fields (e.g., .flags in del/get). In rtnl_fdb_del, the del_bulk == true path never touches parms.\n2. In net/bridge/br_fdb.c, vparms is initialized by copying *parms before overriding vparms.vid.\n3. The u32 portid passed to fdb_fill_info(), vxlan_fdb_info(), and nlmsg_populate_fdb_fill() is always initialized (either NETLINK_CB(skb).portid or 0) and simply replaces a hardcoded 0 argument in nlmsg_put() for nlmsg_pid.\n4. No new netlink attributes or kernel-to-user structures with uninitialized fields or padding are added, and no bounds or length calculations are changed. Any potential issues in these paths (such as pointer/lifetime bugs in netdevice ops or bridge/vxlan FDB handling) would be caught by standard KASAN/LOCKDEP/UBSAN fuzzing rather than requiring KMSAN.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)