zebra: Remove unused parameter in MAC delete

When a MAC moves from local to remote, a replace is allowed, EVPN
no longer has to delete the local MAC before installing the remote
MAC.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Chirag Shah <chirag@cumulusnetworks.com>
This commit is contained in:
vivek 2018-08-28 17:02:40 -07:00 committed by Donald Sharp
parent dc790ba83d
commit d63c1b18b4
4 changed files with 21 additions and 36 deletions

View File

@ -118,8 +118,7 @@ extern int kernel_add_mac(struct interface *ifp, vlanid_t vid,
struct ethaddr *mac, struct in_addr vtep_ip,
uint8_t sticky);
extern int kernel_del_mac(struct interface *ifp, vlanid_t vid,
struct ethaddr *mac, struct in_addr vtep_ip,
int local);
struct ethaddr *mac, struct in_addr vtep_ip);
extern int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
struct ethaddr *mac, uint8_t flags);

View File

@ -2178,7 +2178,7 @@ int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
struct ethaddr *mac, struct in_addr vtep_ip,
int local, int cmd, uint8_t sticky)
int cmd, uint8_t sticky)
{
struct zebra_ns *zns;
struct {
@ -2223,12 +2223,10 @@ static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
addattr_l(&req.n, sizeof(req), NDA_LLADDR, mac, 6);
req.ndm.ndm_ifindex = ifp->ifindex;
if (!local) {
dst_alen = 4; // TODO: hardcoded
addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
dst_present = 1;
sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
}
dst_alen = 4; // TODO: hardcoded
addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
dst_present = 1;
sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
br_zif = (struct zebra_if *)br_if->info;
if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) && vid > 0) {
addattr16(&req.n, sizeof(req), NDA_VLAN, vid);
@ -2565,15 +2563,14 @@ static int netlink_neigh_update2(struct interface *ifp, struct ipaddr *ip,
int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
struct in_addr vtep_ip, uint8_t sticky)
{
return netlink_macfdb_update(ifp, vid, mac, vtep_ip, 0, RTM_NEWNEIGH,
return netlink_macfdb_update(ifp, vid, mac, vtep_ip, RTM_NEWNEIGH,
sticky);
}
int kernel_del_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
struct in_addr vtep_ip, int local)
struct in_addr vtep_ip)
{
return netlink_macfdb_update(ifp, vid, mac, vtep_ip, local,
RTM_DELNEIGH, 0);
return netlink_macfdb_update(ifp, vid, mac, vtep_ip, RTM_DELNEIGH, 0);
}
int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,

View File

@ -459,7 +459,7 @@ int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
}
int kernel_del_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
struct in_addr vtep_ip, int local)
struct in_addr vtep_ip)
{
return 0;
}

View File

@ -153,7 +153,7 @@ static int zvni_mac_send_del_to_client(vni_t vni, struct ethaddr *macaddr,
static zebra_vni_t *zvni_map_vlan(struct interface *ifp,
struct interface *br_if, vlanid_t vid);
static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac);
static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac, int local);
static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac);
static void zvni_install_mac_hash(struct hash_backet *backet, void *ctxt);
static unsigned int vni_hash_keymake(void *p);
@ -2309,7 +2309,7 @@ static void zvni_mac_del_hash_entry(struct hash_backet *backet, void *arg)
}
if (wctx->uninstall)
zvni_mac_uninstall(wctx->zvni, mac, 0);
zvni_mac_uninstall(wctx->zvni, mac);
zvni_mac_del(wctx->zvni, mac);
}
@ -2611,18 +2611,16 @@ static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac)
}
/*
* Uninstall remote MAC from the kernel. In the scenario where the MAC
* moves to remote, we have to uninstall any existing local entry first.
* Uninstall remote MAC from the kernel.
*/
static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac, int local)
static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac)
{
struct zebra_if *zif;
struct zebra_l2info_vxlan *vxl;
struct in_addr vtep_ip = {.s_addr = 0};
struct zebra_ns *zns;
struct interface *ifp;
if (!local && !(mac->flags & ZEBRA_MAC_REMOTE))
if (!(mac->flags & ZEBRA_MAC_REMOTE))
return 0;
if (!zvni->vxlan_if) {
@ -2636,19 +2634,10 @@ static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac, int local)
return -1;
vxl = &zif->l2info.vxl;
if (local) {
zns = zebra_ns_lookup(NS_DEFAULT);
ifp = if_lookup_by_index_per_ns(zns,
mac->fwd_info.local.ifindex);
if (!ifp) // unexpected
return -1;
} else {
ifp = zvni->vxlan_if;
vtep_ip = mac->fwd_info.r_vtep_ip;
}
ifp = zvni->vxlan_if;
vtep_ip = mac->fwd_info.r_vtep_ip;
return kernel_del_mac(ifp, vxl->access_vlan, &mac->macaddr, vtep_ip,
local);
return kernel_del_mac(ifp, vxl->access_vlan, &mac->macaddr, vtep_ip);
}
/*
@ -2677,7 +2666,7 @@ static void zvni_deref_ip2mac(zebra_vni_t *zvni, zebra_mac_t *mac,
return;
if (uninstall)
zvni_mac_uninstall(zvni, mac, 0);
zvni_mac_uninstall(zvni, mac);
zvni_mac_del(zvni, mac);
}
@ -3290,7 +3279,7 @@ static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac)
vxl = &zif->l2info.vxl;
return kernel_del_mac(zl3vni->vxlan_if, vxl->access_vlan,
&zrmac->macaddr, zrmac->fwd_info.r_vtep_ip, 0);
&zrmac->macaddr, zrmac->fwd_info.r_vtep_ip);
}
/* handle rmac add */
@ -4391,7 +4380,7 @@ static void process_remote_macip_del(vni_t vni,
zvni_process_neigh_on_remote_mac_del(zvni, mac);
if (list_isempty(mac->neigh_list)) {
zvni_mac_uninstall(zvni, mac, 0);
zvni_mac_uninstall(zvni, mac);
zvni_mac_del(zvni, mac);
} else
SET_FLAG(mac->flags, ZEBRA_MAC_AUTO);