Skip to content

Commit

Permalink
Merge pull request #15068 from chiragshah6/zdev
Browse files Browse the repository at this point in the history
bgpd: lttng tp add ethtag to macip zebra send
  • Loading branch information
ton31337 authored Jan 2, 2024
2 parents e684b42 + 42949ed commit bfe52f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
zclient_create_header(
s, add ? ZEBRA_REMOTE_MACIP_ADD : ZEBRA_REMOTE_MACIP_DEL,
bgp->vrf_id);
stream_putl(s, vpn->vni);
stream_putl(s, vpn ? vpn->vni : 0);

if (mac) /* Mac Addr */
stream_put(s, &mac->octet, ETH_ALEN);
Expand Down Expand Up @@ -960,7 +960,7 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
snprintf(esi_buf, sizeof(esi_buf), "-");
zlog_debug(
"Tx %s MACIP, VNI %u MAC %pEA IP %pIA flags 0x%x seq %u remote VTEP %pI4 esi %s",
add ? "ADD" : "DEL", vpn->vni,
add ? "ADD" : "DEL", (vpn ? vpn->vni : 0),
(mac ? mac : &p->prefix.macip_addr.mac),
&p->prefix.macip_addr.ip, flags, seq, &remote_vtep_ip,
esi_buf);
Expand Down Expand Up @@ -1003,14 +1003,14 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
zclient_create_header(
s, add ? ZEBRA_REMOTE_VTEP_ADD : ZEBRA_REMOTE_VTEP_DEL,
bgp->vrf_id);
stream_putl(s, vpn->vni);
stream_putl(s, vpn ? vpn->vni : 0);
if (is_evpn_prefix_ipaddr_v4(p))
stream_put_in_addr(s, &p->prefix.imet_addr.ip.ipaddr_v4);
else if (is_evpn_prefix_ipaddr_v6(p)) {
flog_err(
EC_BGP_VTEP_INVALID,
"Bad remote IP when trying to %s remote VTEP for VNI %u",
add ? "ADD" : "DEL", vpn->vni);
add ? "ADD" : "DEL", (vpn ? vpn->vni : 0));
return -1;
}
stream_putl(s, flood_control);
Expand All @@ -1019,7 +1019,7 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,

if (bgp_debug_zebra(NULL))
zlog_debug("Tx %s Remote VTEP, VNI %u remote VTEP %pI4",
add ? "ADD" : "DEL", vpn->vni,
add ? "ADD" : "DEL", (vpn ? vpn->vni : 0),
&p->prefix.imet_addr.ip.ipaddr_v4);

frrtrace(3, frr_bgp, evpn_bum_vtep_zsend, add, vpn, p);
Expand Down
5 changes: 3 additions & 2 deletions bgpd/bgp_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ TRACEPOINT_EVENT(
struct in_addr, vtep, esi_t *, esi),
TP_FIELDS(
ctf_string(action, add ? "add" : "del")
ctf_integer(vni_t, vni, vpn->vni)
ctf_integer(vni_t, vni, (vpn ? vpn->vni : 0))
ctf_integer(uint32_t, eth_tag, &pfx->prefix.macip_addr.eth_tag)
ctf_array(unsigned char, mac, &pfx->prefix.macip_addr.mac,
sizeof(struct ethaddr))
ctf_array(unsigned char, ip, &pfx->prefix.macip_addr.ip,
Expand All @@ -326,7 +327,7 @@ TRACEPOINT_EVENT(
const struct prefix_evpn *, pfx),
TP_FIELDS(
ctf_string(action, add ? "add" : "del")
ctf_integer(vni_t, vni, vpn->vni)
ctf_integer(vni_t, vni, (vpn ? vpn->vni : 0))
ctf_integer_network_hex(unsigned int, vtep,
pfx->prefix.imet_addr.ip.ipaddr_v4.s_addr)
)
Expand Down

0 comments on commit bfe52f8

Please sign in to comment.