Commit Graph

435 Commits

Author SHA1 Message Date
David Lamparter
62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
Donald Sharp
950b395e8e
Merge pull request #6011 from patrasar/pim-no-msdp-group-cmd
pimd: added no ip msdp mesh-group <word>
2020-04-14 08:35:09 -04:00
Sarita Patra
34d86eff8e pimd: added no ip msdp mesh-group <word>
Issue: no ip msdp mesh-group <word> source command
deleting the mesh group, which might be used by the member.

Solution: no ip msdp mesh-group <word> source command, deletes
the mesh-group source.
Add a new cli command "no ip msdp mesh-group <word>" to delete
the mesh group.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-13 02:40:51 -07:00
Quentin Young
a5f610e474 pimd: fix BSM JSON keys
We use camelCase keys in FRR.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-05 23:54:12 -04:00
Quentin Young
4ad05982dc
Merge pull request #6080 from sarav511/buf_inc
pimd: increase buffer size for prefix str while printing bsrp-info
2020-03-24 12:29:47 -04:00
Russ White
bb1cceed4a
Merge pull request #6024 from patrasar/mroute_reshape
pimd: re-shaping show ip mroute outout
2020-03-24 10:16:43 -04:00
saravanank
93a5bc8022 pimd: increase buffer size for prefix str while printing bsrp-info
Problem: output is cut short when prefix string all octets are 3 digit.
RCA: Buffer was allocated only to hold ip addr str.

Fix: Added 3 bytes more to hold prefix length and a /.
Modified buffer in 'show ip pim bsrp-info' and 'show ip pim bsm database'

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-24 00:24:56 -07:00
Donald Sharp
a01f317b0f
Merge pull request #6008 from sarav511/max_vif
pimd: Do not allow to configure multicast on more than MAXVIF interfaces
2020-03-23 11:28:45 -04:00
Donatas Abraitis
2a7280e2e5
Merge pull request #5882 from patrasar/2386429
pimd: fix pim interface traffic & pim rp-info json command
2020-03-18 11:26:44 +02:00
Sarita Patra
5dff8b9dcf pimd: re-shaping show ip mroute outout
Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-17 21:44:20 -07:00
Russ White
09c04bc490
Merge pull request #5849 from donaldsharp/pim_register_prefix_list
Pim register prefix list
2020-03-17 14:57:10 -04:00
Donald Sharp
7967afda07
Merge pull request #5880 from patrasar/2371558
pimd: fix OIL not removed after IGMP prune
2020-03-17 13:40:53 -04:00
Donald Sharp
fc74cbe76c
Merge pull request #5940 from patrasar/214257
pimd: add flags in show ip mroute command
2020-03-17 06:38:41 -04:00
Sarita Patra
9443810eef pimd: fix OIL not removed after IGMP prune
Issue: Client1------LHR-----(int-1)RP(int-2)------client2
Client2 send IGMP join for group G.
Client1 send IGMP join for group G.
verify show ip mroute in RP, will have 2 OIL.
Client2 send IGMP leave.
Verify show ip mroute in RP, will still have 2.

Root cause: When RP receives IGMP join from client2, it creates
a (s,g) channel oil and add the interface int-2 into oil list and
set the flag PIM_OIF_FLAG_PROTO_IGMP to int-2
Client1 send IGMP join, LHR will send a (*,G) join to RP. RP will
add the interface int-1 into the oil list of (s,g) channel_oil and
will set the flag PIM_OIF_FLAG_PROTO_IGMP and PIM_OIF_FLAG_PROTO_PIM
to the int-1 and set PIM_OIF_FLAG_PROTO_PIM to int-2 as well. It is
happening because of the pim_upstream_inherited_olist_decide() and
forward_on() get all the oil and update the flag wrongly.
So now when client 2 sends IGMP prune, RP will not remove the int-2
from oil list since both PIM_OIF_FLAG_PROTO_PIM & PIM_OIF_FLAG_PROTO_IGMP
are set, it just unset the flag PIM_OIF_FLAG_PROTO_IGMP.

Fix: Introduced new flags in if_channel, PIM_IF_FLAG_MASK_PROTO_PIM
& PIM_IF_FLAG_MASK_PROTO_IGMP. If a if_channel is created because of
pim join or pim (s,g,rpt) prune received, then set the flag
PIM_IF_FLAG_MASK_PROTO_PIM. If a if_channel is created becuase of IGMP
join received, then set the flag PIM_IF_FLAG_MASK_PROTO_IGMP.
When an interface needs to be added into the oil list check if
PIM_IF_FLAG_MASK_PROTO_PIM or PIM_IF_FLAG_MASK_PROTO_IGMP is set, then
update oil flag accordingly.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-16 21:54:34 -07:00
Sarita Patra
a7a5472ef2 pimd: fix pim interface traffic & pim rp-info json command
Issue 1: "show ip pim interface traffic" not show prune TX/RX
Rootcause : not added the variable in the json
Fix : add prune TX/RX in show ip pim interface traffic json

Issue 2: "show ip pim rp-info" not shows the key iAmRp when it is false
Rootcause: Only display the key when the value is true.
Fix: add iAmRp as false in show ip pim rp-info json

Issue 3: "show ip pim rp-info" not showing outbound interface if it is empty
Rootcause: Only display when there is any OIL

Fix: When RP is not reachable then, the outbound interface is Unknown
The command "show ip pim rp-info json" not displaying the outbound
interafce if it is unknown

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-16 21:44:38 -07:00
Sarita Patra
6a42461973 pimd: add flags in show ip mroute command
S - Sparse Mode
C - indicates there is a member of the group directly connected to the router.
R -set on an (S, G) by the receipt of an (S, G) RP bit prune message.
F -This indicates that this router is a FHR and send register messages to RP to inform RP of this active source
P - OIL list is NULL. That means the router will send a prune.
T - At least one packet received via SPT.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-16 21:38:56 -07:00
saravanank
ccf696e85f pimd: Do not allow to configure multicast on more than MAXVIF interfaces
RCA: When configured more than 32(MAXVIS), the inerfaces that are configured
after 32nd interfaces have the value of MAXVIF.
This is used as index to access the free vif tracker of array size 32(MAXVIFS).
So the channel oil list pointer which is present as the next field in pim structure get corrupt, when updating free vif.
This gets accessed during rpf update resulting in crash.

Fix: Refrain from allocating mcast interface structure and throw config error when more than MAXVIFS are attempted to configure.
Max vif checks are exempted for vrf device and pimreg as vrf device will be the first interface and not expected to fail and pimreg has reserved vif.
vxlan tunnel termination device creation has this check and throw warning on max vif.
All other creation are through CLI.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-16 19:49:18 -07:00
saravanank
36afe48622 pimd: show ip pim bsr json output - removing vtysh caption
Root cause: The header display is put in common outside the vtysh/json if-else.
Fix: Brought inside vtysh condition.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-15 18:58:53 -07:00
Russ White
7f6c322d50
Merge pull request #5839 from donaldsharp/upstream_merge
Upstream merge of missed MLAG code
2020-03-09 15:34:18 -04:00
Donald Sharp
5cb1323595
Merge pull request #5942 from patrasar/2438087
pimd: Display mroute uptime per (s,g) entry
2020-03-09 08:47:10 -04:00
Sarita Patra
dfd12d0255 pimd: Display mroute uptime per (s,g) entry
Issue: show ip mroute displays the mroute uptime (time when
mroute installed into the kernel) per oif.
This is confusing.

Fix: Display mroute uptime per (s,g) mroute entry.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-09 00:30:34 -07:00
Donald Sharp
f4e74bd038 pimd: Add ip pim register-accept-list PLIST command
When pim receives a register packet, we will apply the
received source to the prefix list.  If accepted normal
processing continues.  If denied we will send a register
stop message to the source.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:27:01 -05:00
Donald Sharp
1c4e26bc06 pimd: Rename the PIM_SPT_PLIST_NAME to PIM_PLIST_NAME
The memory type PIM_SPT_PLIST_NAME is specific to
SPT but we are going to store more prefix-list names
in pim, make it generic to allow for less confusion
in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:24:21 -05:00
Donald Sharp
17823cdd2c pimd: Add accidently missed code during upstreaming process
There was some code missed during the upstreaming process
due to code squash.  Identify and put into a commit
to keep code consistent and correct.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:02:52 -05:00
Donald Sharp
5e81f5dd1a *: Finish off the __PRETTY_FUNCTION__ to __func__
FINISH IT

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 09:23:22 -05:00
Donatas Abraitis
15569c58f8 *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05 20:23:23 +02:00
Russ White
30ac36dbfc
Merge pull request #5897 from patrasar/2415676
pimd: fix crash seen while executing igmp related configuration
2020-03-03 09:35:43 -05:00
Sarita Patra
4f007a5a03 pimd: fix crash seen while executing igmp related configuration
Issue 1:
1. Enable pim on an interface.
2. Configure query-interval or query max response time,
which results in pimd crash.

Root cause:
1. When pim is enabled on an interface, it creates a igmp socket
with querier_timer and other_querier time as NULL.
2. When query-interval/max_response_time is configured, it call the
function igmp_sock_query_reschedule() to reshedule the query. This
function check either of querier_timer or other_querier timer should
be running. Since in this case both are NULL, it results in crash.

Issue 2:
1. Enable pim on an interface.
2. Execute no ip igmp query-interval or query max response time,
which results in pimd crash.

Root cause:
1. When pim is enabled on an interface, it creates a pim interface
with querier_timer and other_querier time as NULL.
2. When no ip igmp query-interval/max_response_time is executed, it will
check either of querier_timer or other_querier timer should be running.
Since in this case both are NULL, it results in crash.

Fix:
When pim is enabled on an interface, it creates a igmp socket with
mtrace_only as true. So add a check if mtrace_only is true, then don't
reshedule the query.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-03 03:35:43 -08:00
Donald Sharp
7f5818fbd6 *: change hash_backet to hash_bucket
It's been a year search and destroy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-28 13:59:13 -05:00
Jafar Al-Gharaibeh
4d67e75282 Revert "*: change hash_backet to hash_bucket"
This reverts commit 3895c42a2e.

LabN CI update needs to be coordinated before merging this

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-02-27 09:52:02 -06:00
Donald Sharp
3895c42a2e *: change hash_backet to hash_bucket
It's been a year search and destroy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-26 20:03:34 -05:00
Mark Stapp
6c1b7a8c49 pimd: fix SA reports
Fix a couple of SA warnings introduced recently; replace some
'strcpy' calls.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-20 11:32:32 -05:00
Anuradha Karuppiah
f80427e9e7 pimd: pim mlag show commands
1. show ip pim mlag summary
provides MLAG session information and stats
2. show ip pim mlag upstream
displays the upstream entries synced across the MLAG switches

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
448139e704 pimd: stop overloading SRC_IGMP upstream for vxlan local membership
A local membership is created on the vxlan termination device ipmr-lo. This
is done to -
1. Pull multicast vxlan tunnel traffic to the VTEP for termination by
triggering JoinDesired on the BUM multicast group.
2. Include the OIF in the mroute to signal to the dataplane component
that flow needs to be vxlan terminated.

Earlier we were overloading the PIM_UPSTREAM_FLAG_MASK_SRC_IGMP for
this local membership creation but that is creating confusion both in
the state machine and in the show outputs. To avoid that we use the
more apparent PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM. With this change -
1. We get LHR functionality for VXLAN_TERM mroutes
2. OIF is populated with PIM_OIF_FLAG_PROTO_PIM only

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
05ca004b80 pim: DF election for tunnel termination mroutes in an anycast-VTEP setup
1. Upstream entries associated with tunnel termination mroutes are
synced to the MLAG peer via the local MLAG daemon.
2. These entries are installed in the peer switch (via an upstream
ref flag).
3. DF (Designated Forwarder) election is run per-upstream entry by both
the MLAG switches -
a. The switch with the lowest RPF cost is the DF winner
b. If both switches have the same RPF cost the MLAG role is
used as a tie breaker with the MLAG primary becoming the DF
winner.
4. The DF winner terminates the multicast traffic by adding the tunnel
termination device to the OIL. The non-DF suppresses the termination
device from the OIL.

Note: Before the PIM-MLAG interface was available hidden config was
used to test the EVPN-PIM functionality with MLAG. I have removed the
code to persist that config to avoid confusion. The hidden commands are
still available.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Donatas Abraitis
975a328e2e *: Replace s_addr 0 => INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06 09:00:12 +02:00
Donald Sharp
dd3364cb1a pimd: Convert the upstream_list and hash to a rb tree
Convert the upstream_list and hash to a rb tree, Significant
time was being spent in the listnode_add_sort.  This reduces
this time greatly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-03 08:39:55 -05:00
Donald Sharp
7315ecdabe pimd: Convert the channel_oil_list|hash to a rb_tree
The channel_oil_list and hash are taking significant
cpu at scale when adding to the sorted list.  Replace
with a RB_TREE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-03 08:39:55 -05:00
Jafar Al-Gharaibeh
e57cc5f056 pimd: refactor ip mroute cmd
combine:
  ip mroute INTERFACE A.B.C.D
  ip mroute INTERFACE A.B.C.D A.B.C.D

into:
  ip mroute INTERFACE A.B.C.D [A.B.C.D]

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2019-12-20 17:04:03 -06:00
Donald Sharp
4e29b89aba
Merge pull request #5427 from liam-mcb/igmp-join-any
pimd: Add command to join any-source multicast.
2019-12-16 07:47:41 -05:00
Liam McBirnie
771ce8ad24 pimd: Add command to join any-source multicast.
Allow 'ip igmp join' to join group for any source if no source is
specified.
Disallow joining source "0.0.0.0" as it is used to define an
any-source multicast group.

Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>
2019-12-12 13:09:46 +01:00
Jafar Al-Gharaibeh
94c1ae82da
Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixes
PIM state machine fixes
2019-12-06 17:47:07 -06:00
Mark Stapp
07e123defc
Merge pull request #5328 from satheeshkarra/pim_mlag
pimd, lib, zebra : PIM MLAG Support
2019-11-22 08:51:47 -05:00
Anuradha Karuppiah
075a475e0c pimd: fixup whitespace errors reported by CI
No functional changes.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-20 13:32:08 -08:00
Donald Sharp
0f39cb4cb9 pimd: Create pimreg interface when we start any interface config
When you configure interface configuration without explicitly
configuring pim on that interface, we were not creating the pimreg
interface and as such we would crash in an attempted register
since the pimreg device is non-existent.

The crash is this:
==8823== Invalid read of size 8
==8823==    at 0x468614: pim_channel_add_oif (pim_oil.c:392)
==8823==    by 0x46D0F1: pim_register_join (pim_register.c:61)
==8823==    by 0x449AB3: pim_mroute_msg_nocache (pim_mroute.c:242)
==8823==    by 0x449AB3: pim_mroute_msg (pim_mroute.c:661)
==8823==    by 0x449AB3: mroute_read (pim_mroute.c:707)
==8823==    by 0x4FC0676: thread_call (thread.c:1549)
==8823==    by 0x4EF3A2F: frr_run (libfrr.c:1064)
==8823==    by 0x40DCB5: main (pim_main.c:162)
==8823==  Address 0xc8 is not stack'd, malloc'd or (recently) free'd

pim_register_join calls pim_channel_add_oif with:

	pim_channel_add_oif(up->channel_oil, pim->regiface,
			    PIM_OIF_FLAG_PROTO_PIM);

We just need to make srue pim->regiface exists once we start configuring
pim.

Fixes: #5358
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18 11:43:52 -05:00
Anuradha Karuppiah
8ff637c8c9 pimd: bring back "show ip pim upstream-join-desired"
It is now used to evaluate and display join-desired state for
each upstream entry -
root@spine-1:~# net show pim upstream-join-desired
Source          Group           EvalJD
*               239.1.1.111     yes
6.0.0.28        239.1.1.111     yes
6.0.0.29        239.1.1.111     no
6.0.0.30        239.1.1.111     yes

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah
5c9a72ef47 pimd: rename the upstream-join-desired command to "show ip pim channel"
This re-naming was needed because the JD state on an upstream is
not just based on channel info i.e. we can have JD=true even if there
is no downstream channel. The "show ip upstream-join-desired" command
will be changed to display that info i.e. upstream's JD state instead
of downstream channel params. The downstream channel params are now
available via "show ip pim channel"

PS: This change maybe reverted if upstream NAKs it. But there is a
pressing need for it to debug some not-so-reproduible problems.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah
60eb7e6b80 pimd: enforce PIM_ENFORCE_LOOPFREE_MFC at the time of MFC programming
This is needed for two reasons -
1. The inherited OIL needs to be setup independent of the RPF interface
to allow correct computation of the JoinDesired macro.
2. The RPF interface is computed at the time of MFC programming so
it is not possible to permanently evict the OIF at that time oif_add

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah
87b7cd5bc7 pimd: display the per-RPF neighbor join-prune agg list
root@leaf-12:~# vtysh -c "show ip pim jp-agg"
Interface        RPF Nbr         Source          Group           State
swp1             6.0.0.26        *               239.1.1.111         J
swp1             6.0.0.26        *               239.1.1.112         J
swp1             6.0.0.26        *               239.1.1.113         J
swp1             6.0.0.26        *               239.1.1.114         J
root@leaf-12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah
9929a2a9af pimd: display changes to indicate if a SG entry is still on the RPT
Sample output -
root@leaf-12:~# net show pim state
Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted
Active Source           Group            RPT  IIF               OIL
1      *                239.1.1.111      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.111      y    swp1
1      *                239.1.1.112      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.112      y    swp1
1      *                239.1.1.113      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.113      y    swp1
1      *                239.1.1.114      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.114      y    swp1
root@leaf-12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 12:00:29 -08:00