]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
8 years agopim-anycast-rp: Add limited support for secondary addresses.
anuradhak [Fri, 18 Nov 2016 17:12:27 +0000 (09:12 -0800)]
pim-anycast-rp: Add limited support for secondary addresses.

Anycast requires that the lo interface be associated with multiple
addresses. One is the anycast IP address (which is the same on all RPs
participating in RP redundancy) and the second is the unique IP address
that will be used as the router id by routing protocols.

To accomodate that we maintain a list of secondary addresses per-pim iface
and allow any of them to be the RP address. This lets the I_am_RP macro
succeed on anycast RPs.

Note that the support is limited i.e. we don't actually advertise a
secondary list to the neighbors. This is assuming the anycast IP will never
be used as a router id i.e. will never be an RPF neighbor.

Sample output:
==============
dell-s6000-04# sh ip pim interface lo
Interface : lo
State     : up
Address   : 100.1.1.1 (primary)
            100.1.1.2
            100.1.1.3
            100.1.2.1
>>>>>>> SNIP >>>>>>>>>>>>>>>
dell-s6000-04# sh ip pim interface lo json
{
  "lo":{
    "name":"lo",
    "state":"up",
    "address":"100.1.1.1",
    "index":1,
    "lanDelayEnabled":true,
    "secondaryAddressList":[
      "100.1.1.2",
      "100.1.1.3",
      "100.1.2.1"
    ],
>>>>>>> SNIP >>>>>>>>>>>>>>>
dell-s6000-04#sh ip pim rp-info
RP address       group/prefix-list   OIF         I am RP
100.1.2.1        224.0.0.0/4         lo          yes
dell-s6000-04#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Set pim socket receive buffer to a larger value
Donald Sharp [Fri, 18 Nov 2016 00:57:10 +0000 (19:57 -0500)]
pimd: Set pim socket receive buffer to a larger value

There exists situations where we can receive data
faster than we can process it.  Make the buffer
large enough to catch these situations for
the pim sockets.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify mroute_read to be non-blocking
Donald Sharp [Thu, 17 Nov 2016 16:18:06 +0000 (11:18 -0500)]
pimd: Modify mroute_read to be non-blocking

Modify mroute_read to be non-blocking and
then to read in up to 3 packets at a time
to be handled.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify pim_sock_read to read 3 times before yielding
Donald Sharp [Thu, 17 Nov 2016 15:50:05 +0000 (10:50 -0500)]
pimd: Modify pim_sock_read to read 3 times before yielding

Modify pim_sock_read to read up to 3 packets before yielding
the cpu to something else.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Reduce duplicate debug messages in wrvifwhole
Donald Sharp [Thu, 17 Nov 2016 15:03:21 +0000 (10:03 -0500)]
pimd: Reduce duplicate debug messages in wrvifwhole

When we get a wrong vif whole callback, reduce
the duplicate debug messages being processed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Further refine debugs in pim_sock_read path
Donald Sharp [Thu, 17 Nov 2016 14:39:56 +0000 (09:39 -0500)]
pimd: Further refine debugs in pim_sock_read path

When we received a packet we were dumping packet information
with debugs on 2 times for each packet where we had overlapping
data being passed.

Since debugs are expensive, reduce the count to 1.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow storing of sg in string format
Donald Sharp [Thu, 17 Nov 2016 13:17:25 +0000 (08:17 -0500)]
pimd: Allow storing of sg in string format

Debugs are extremely expensive currently.  Let's
store 'struct prefix_sg sg' string format in
the ifchannel, upstream and msdp_sa structures.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Cleanup handling of pim_sock_read
Donald Sharp [Thu, 17 Nov 2016 03:59:32 +0000 (22:59 -0500)]
pimd: Cleanup handling of pim_sock_read

Cleanup some turned on debug code that is no longer
needed to be turned on in the pim_sock_read
code path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify wait time for response from Null Register
Donald Sharp [Thu, 17 Nov 2016 03:12:57 +0000 (22:12 -0500)]
pimd: Modify wait time for response from Null Register

Give ourselves a few more seconds to wait for a response
for a NULL Register.  This will benefit us under heavy
mroute churn on the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim-kat: changed kat handling to match rfc-4601 more closely.
anuradhak [Tue, 15 Nov 2016 23:39:11 +0000 (15:39 -0800)]
pim-kat: changed kat handling to match rfc-4601 more closely.

1. This is needed to layout the MSDP macros for determining what SAs are
originated by a MSDP speaker.
2. We no longer let the kat timer expire on an active flow. Activity
counters/lastuse is polled via a wheel for every SG entry. If new
activity is detected the keepalive timer is started and SPT bit set.
A SRC_STREAM reference is also created for the entry if one doesn't
already exist.
3. If KAT actually expires it means the flow is no longer active. At
this point we stop advertising the SA to MSDP peers. We also pull
the SRC_STREAM reference (deleting the entry if there are no other
references).

PS: Checking counters on KAT expiry will come in the next change.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Remove dead code from pim_register.c
Donald Sharp [Thu, 17 Nov 2016 00:44:23 +0000 (19:44 -0500)]
pimd: Remove dead code from pim_register.c

Remove the dead test code from pim_register.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add appropriate (S,G) debugs for register
Donald Sharp [Thu, 17 Nov 2016 00:20:33 +0000 (19:20 -0500)]
pimd: Add appropriate (S,G) debugs for register

When we send a register record the S,G if debugs are turned on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Increase kernel socket rcvbuf size.
Donald Sharp [Wed, 16 Nov 2016 19:38:14 +0000 (14:38 -0500)]
pimd: Increase kernel socket rcvbuf size.

We are receiving notifications from the linux
kernel that we are filling up the receive buffer
for upcalls into pimd.  Let's increase the size
to something a bit bigger.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add 'ip pim register-suppress-time <5-60000>'
Donald Sharp [Wed, 16 Nov 2016 23:11:49 +0000 (18:11 -0500)]
pimd: Add 'ip pim register-suppress-time <5-60000>'

Add the 'ip pim register-suppress-time ...' command.
Remove the 'no ip pim rp keep-al...' command as
that the register suppress set that value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Move pim_mroute.c global data to file local static
Donald Sharp [Wed, 16 Nov 2016 20:12:25 +0000 (15:12 -0500)]
pimd: Move pim_mroute.c global data to file local static

Move the qpim_mroute_socket_reader thread to pim_mroute.c
and make it static to the file.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Protect log messages with debug in pim_pim.c
Donald Sharp [Wed, 16 Nov 2016 02:27:28 +0000 (21:27 -0500)]
pimd: Protect log messages with debug in pim_pim.c

Protect the log messages in pim_pim.c with PIM_DEBUG_PIM_PACKETS

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: 'show ip pim rp-info json' should use JSON_C_TO_STRING_PRETTY
Daniel Walton [Tue, 15 Nov 2016 19:08:22 +0000 (19:08 +0000)]
pimd: 'show ip pim rp-info json' should use JSON_C_TO_STRING_PRETTY

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agopimd: Use NULL to signify NULL pointer
Donald Sharp [Tue, 15 Nov 2016 17:27:17 +0000 (12:27 -0500)]
pimd: Use NULL to signify NULL pointer

Use the NULL c symbol to signify that we are
intentionally setting the pointer to NULL
instead of 0.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow 'ip pim rp ...' config after bringup
Donald Sharp [Tue, 15 Nov 2016 17:22:34 +0000 (12:22 -0500)]
pimd: Allow 'ip pim rp ...' config after bringup

If you specified the 'ip pim rp ...' after the
system has been configured it was not accepting
the new rp.  This fixes that issue.

Ticket:CM-12623
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow 'no ip pim sm' to not turn off igmp
Donald Sharp [Tue, 15 Nov 2016 17:09:14 +0000 (12:09 -0500)]
pimd: Allow 'no ip pim sm' to not turn off igmp

When we receive a 'no ip pim sm' for an interface
that has both pim and igmp on it, only turn
off pim.

Ticket: CM-12985
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix crash in pim_rp_show_information
Donald Sharp [Tue, 15 Nov 2016 00:54:36 +0000 (19:54 -0500)]
pimd: Fix crash in pim_rp_show_information

When a 'show ip pim rp-info' is issued shortly
after a restart/start, pim will crash because
nexthop information has not been fully resolved
and the outgoing interface is NULL.

Ticket: CM-13567
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim-msdp: part-4: cli cleanup
anuradhak [Sat, 12 Nov 2016 13:39:44 +0000 (05:39 -0800)]
pim-msdp: part-4: cli cleanup

1. Add support for mesh-group based configuration that is easy to apply
via automation. The older per-peer configuartion is temporarily hidden
and will be cleaned up later.
Sample config -
ip msdp mesh-group cumulus source 100.1.1.4
ip msdp mesh-group cumulus member 100.1.1.5
ip msdp mesh-group cumulus member 100.1.1.6

2. Added support for detail peer and sa-cache displays. Along with
filter keys.

3. Add json output for all the msdp displays.

With this commit basic support for anycast-RP with MSDP (in numbered
network is complete). Unnumbered support will be added separately.

Ticket: CM-13306

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Backing up broken state.
Donald Sharp [Mon, 14 Nov 2016 13:45:44 +0000 (08:45 -0500)]
pimd: Backing up broken state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix clang SA warnings.
Donald Sharp [Sun, 13 Nov 2016 03:45:25 +0000 (22:45 -0500)]
lib: Fix clang SA warnings.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Cleanup zebra_static CLANG/SA issues.
Donald Sharp [Sun, 13 Nov 2016 03:12:13 +0000 (22:12 -0500)]
zebra: Cleanup zebra_static CLANG/SA issues.

When compiling using CLANG's SA, cleanup the
SA issues found.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Removing impossible code
Donald Sharp [Sat, 12 Nov 2016 02:21:49 +0000 (21:21 -0500)]
pimd: Removing impossible code

We've already allocated the mp data structure
and am using hash_alloc_intern for the hash_get
function.  This will return the passed
in data structure.  There is no possibility
of mp being NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Fix clang SA warnings
Donald Sharp [Sat, 12 Nov 2016 02:07:50 +0000 (21:07 -0500)]
zebra: Fix clang SA warnings

The mr value was not being initialized to anything
and as such could contain garbage.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Reduce pim oil scan timer to 50ms
Donald Sharp [Sat, 12 Nov 2016 01:00:15 +0000 (20:00 -0500)]
pimd: Reduce pim oil scan timer to 50ms

We need to react to route changes/Interface up/down events
faster in PIM.  Reduce the timer down to 50ms.

Ticket:CM-13549
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start handling of wrong interface for (*,G)
Donald Sharp [Sat, 12 Nov 2016 00:13:55 +0000 (19:13 -0500)]
pimd: Start handling of wrong interface for (*,G)

When we get a callback for a specific (S,G) and
we have no ifchannel for it, see if we have a
(*,G) channel and handle it appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix thread_execute_crash
Donald Sharp [Fri, 11 Nov 2016 18:57:49 +0000 (13:57 -0500)]
lib: Fix thread_execute_crash

With the change to have thread_get fill inthe ->hist
pointer, thread_execute was missed and it
needs to fill in the .hist pointer for the
dummy thread created.

I'm not really sure why we need to call a
thread_execute on a function.  When we
could, you know, just call the bloody
thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim-msdp: part-3: use SA cache for setting up SPTs
anuradhak [Tue, 8 Nov 2016 18:34:31 +0000 (10:34 -0800)]
pim-msdp: part-3: use SA cache for setting up SPTs

1. Added a new MSDP source reference flag for creating (S,G) entries
based on the SA-cache. The RFC recommends treating as SA like rxing
a (S, G) join (which is a bit different then treating like a traffic
stream).
2. SA-SPT is only setup if we are RP for the group and a corresponding
(*,G) exists with a non-empty OIL.
3. When an SA is moved we need to let the SPT live if it is active (this
change will come in a subsequent CL).

Testing done:
1. SA first; SPT setup whenever (*, G) comes around.
2. (*, G) first. As soon as SA is added SPT is setup.
3. (*, G) del with valid SA entries around.

Ticket: CM-13306

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add (-) PRUNE(S,G,rpt) from interface determination.
Donald Sharp [Fri, 11 Nov 2016 02:08:48 +0000 (21:08 -0500)]
pimd: Add (-) PRUNE(S,G,rpt) from interface determination.

When determining the inherited_olist(S,G) add
the determination that we have received a
prune(S,G,rpt) from a neighbor.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Perform safe walk of RIB entries in rib_process()
vivek [Fri, 11 Nov 2016 02:49:43 +0000 (18:49 -0800)]
zebra: Perform safe walk of RIB entries in rib_process()

There is a scenario where a RIB entry is unlinked and freed during RIB
processing. However, the walk of the entries is not being performed in
a safe manner. Fix the code to do this correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-13393
Reviewed By: Trivial
Testing Done: Basic manual test

8 years agopimd: Fix the test to see if a upstream is (S,G,rpt)
Donald Sharp [Fri, 11 Nov 2016 01:09:01 +0000 (20:09 -0500)]
pimd: Fix the test to see if a upstream is (S,G,rpt)

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix 'show thread cpu' to display active threads
Donald Sharp [Thu, 10 Nov 2016 19:25:39 +0000 (14:25 -0500)]
lib: Fix 'show thread cpu' to display active threads

Fix the display of 'show thread cpu' to keep track
of the number of active threads and to display that
information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Slight Optimization of thread handling.
Donald Sharp [Thu, 10 Nov 2016 18:58:40 +0000 (13:58 -0500)]
lib: Slight Optimization of thread handling.

This commit does these things:

1) Make thread_add_unuse own the setting of THREAD_UNUSED.
2) Move thread->hist finding to to thread_get.
   We are storing the thread->hist even when the thread
   is on the unused.  This means that we check to see
   if the funcname or func have changed and we get new
   history.  Else we've probably just retrieved the last
   unused which has the same func/funcanme.  This is
   a common practice to do THREAD_OFF/THREAD_ON in
   quick succession.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
8 years agopimd: Add code to handle pim prune(S,G) with sptbit
Donald Sharp [Thu, 10 Nov 2016 15:25:36 +0000 (10:25 -0500)]
pimd: Add code to handle pim prune(S,G) with sptbit

Add some more code to handle the prune(S,G) with the
sptbit set.  Turns this ifchannel into a (S,G,rpt).

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Write pim_upstream_empty_inherited_olist
Donald Sharp [Thu, 10 Nov 2016 14:41:28 +0000 (09:41 -0500)]
pimd: Write pim_upstream_empty_inherited_olist

A empty inherited_olist implies that we have
no outgoing interfaces.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix possible crash when leaving a channel
Donald Sharp [Thu, 10 Nov 2016 12:35:02 +0000 (07:35 -0500)]
pimd: Fix possible crash when leaving a channel

When leaving a channel, there exists a possibility
that we have not created the channel oil yet.
Ensure that we have channel oil before dereferencing

Ticket: CM-13522
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify downstream JP state to take into account all states
Donald Sharp [Wed, 9 Nov 2016 13:30:04 +0000 (08:30 -0500)]
pimd: Modify downstream JP state to take into account all states

When we make a decision about downstream state let's
take into account all states.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Remove unnecessary asserts
Donald Sharp [Tue, 8 Nov 2016 20:49:28 +0000 (15:49 -0500)]
pimd: Remove unnecessary asserts

When we handle the thread arguments,
there is no need to assert.  As that
if they are wrong, we are going down
shortly anyways.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add Handler for Receive (*,G) join for (S,G,rpt)
Donald Sharp [Tue, 8 Nov 2016 20:26:48 +0000 (15:26 -0500)]
pimd: Add Handler for Receive (*,G) join for (S,G,rpt)

According to Figure 5( Downstream per-interface (S,G,rpt)
state when we receive a (*,G) we need to move (S,G,rpt)
children of the (*,G) into different states.  This
implements that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Ensure 'struct prefix sg' is inited in right order
Donald Sharp [Wed, 9 Nov 2016 00:40:08 +0000 (19:40 -0500)]
pimd: Ensure 'struct prefix sg' is inited in right order

When we called pim_parse_addr_group, don't reinitialize
the 'struct prefix_sg' *after* we've parsed the group.

Ensure in other places that we do this work, we initialize
prior as well.

Ticket: CM-13510
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix 'show ip pim join json' output
Donald Sharp [Tue, 8 Nov 2016 17:53:28 +0000 (12:53 -0500)]
pimd: Fix 'show ip pim join json' output

When we have multiple incoming joins for
a single group on a interface, we need to
allow proper output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add ability to know if ifchannel is (S,G,rpt)
Donald Sharp [Tue, 8 Nov 2016 13:00:02 +0000 (08:00 -0500)]
pimd: Add ability to know if ifchannel is (S,G,rpt)

Add ability to track (S,G,rpt) ifchannel prunes.
Add ability to display this data in json.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: 'show ip pim join json' add by src not grp
Donald Sharp [Tue, 8 Nov 2016 12:55:51 +0000 (07:55 -0500)]
pimd: 'show ip pim join json' add by src not grp

If you add to the json by grp, if you have multiple
ifchannels for that group, on the the first one will
be displayed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Don't delete ifchannel if expiry timer is still running.
Donald Sharp [Tue, 8 Nov 2016 00:43:13 +0000 (19:43 -0500)]
pimd: Don't delete ifchannel if expiry timer is still running.

Don't delete the ifchannel if the expiry timer is still running.
We might need to add the prune pending timer as well?  Not sure

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: use 'struct prefix_sg' for recv_join and _prune
Donald Sharp [Mon, 7 Nov 2016 20:51:18 +0000 (15:51 -0500)]
pimd: use 'struct prefix_sg' for recv_join and _prune

When we read in the S,G from the join/prune message,
convert it into a 'struct prefix_sg' at an
earlier point in time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify pim_parse_addr_source to use 'struct prefix_sg'
Donald Sharp [Mon, 7 Nov 2016 20:45:40 +0000 (15:45 -0500)]
pimd: Modify pim_parse_addr_source to use 'struct prefix_sg'

Modify the pim_parse_addr_source function to take
a 'struct prefix_sg' and to fill in the src data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify pim_parse_addr_group to use 'struct prefix_sg'
Donald Sharp [Mon, 7 Nov 2016 20:40:08 +0000 (15:40 -0500)]
pimd: Modify pim_parse_addr_group to use 'struct prefix_sg'

Modify the pim_parse_addr_group to use 'struct prefix_sg sg'.
This is the first of 2 commits to clean up this parsing to
be a bit better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add ability for ifchannel *,G to know their S,G's
Donald Sharp [Mon, 7 Nov 2016 19:33:54 +0000 (14:33 -0500)]
pimd: Add ability for ifchannel *,G to know their S,G's

Add the ability for pim ifchannels *,G's to know their
corresponding S,G's.  This will facilitate handling
S,G,rpt state information better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Send prune(S,G,RPT) with (*,G) join
Donald Sharp [Mon, 7 Nov 2016 15:40:26 +0000 (10:40 -0500)]
pimd: Send prune(S,G,RPT) with (*,G) join

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim-msdp: part-2: SA cache support
anuradhak [Mon, 31 Oct 2016 19:29:17 +0000 (12:29 -0700)]
pim-msdp: part-2: SA cache support

This commit includes -
1. Maintaining SA cache with local and remote entries.
2. Local SA entries - there are two cases where we pick up these -
   - We are RP and got a source-register from the FHR.
   - We are RP and FHR and learnt a new directly connected source on a
     DR interface.
3. Local entries are pushed to peers immediately on addition and
   periodically. An immediate push is also done when peer session is
   established.
4. Remote SA entries - from other peers in the mesh group and passed
   peer-RPF checks.
5. Remote entries are aged out. No other way to del them
   currently. In the future we may add a knob to flush entries on
   peer-down.

Testing done -
Misc topologies with CL routers plus basic interop with another vendor (
we can process their SA updates and they ours).

Sample output -
root@rp:~# vtysh -c "show ip msdp sa"
Source                     Group               RP    Uptime
33.1.1.1               239.1.1.2            local  00:02:34
33.1.1.1               239.1.1.3            local  00:02:19
44.1.1.1               239.1.1.4        100.1.3.1  00:01:12
44.1.1.1               239.1.1.5        100.1.3.1  00:00:55
root@rp:~#

Ticket: CM-13306

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Store ifchannel information in a global list too.
Donald Sharp [Mon, 7 Nov 2016 17:34:44 +0000 (12:34 -0500)]
pimd: Store ifchannel information in a global list too.

This fix handles two issues:

1) Searching entire vrf_iflist to get per interface pim_ifchannel_list
2) Display of ifchannel information in pim not being ordered correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow further refinement of pim join order
Donald Sharp [Mon, 7 Nov 2016 15:01:50 +0000 (10:01 -0500)]
pimd: Allow further refinement of pim join order

When a 'show ip pim join' is issued and we have
(S,G,rpt) being sent back up to us.  We need
to order correctly for this situation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Protect some zlog_debug messages
Donald Sharp [Thu, 3 Nov 2016 22:55:35 +0000 (18:55 -0400)]
pimd: Protect some zlog_debug messages

Protect some zlog_debug messages with if(...) so we
don't see them all the time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Protect debug messages.
Donald Sharp [Thu, 3 Nov 2016 20:29:05 +0000 (16:29 -0400)]
pimd: Protect debug messages.

Protect some debug messages from being displayed always.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Turn off automatic debugging of Wheel code.
Donald Sharp [Thu, 3 Nov 2016 20:25:12 +0000 (16:25 -0400)]
lib: Turn off automatic debugging of Wheel code.

Turn off the automatic debugging of Timer wheel code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add some explanatory debugging for a error condition.
Donald Sharp [Thu, 3 Nov 2016 20:23:50 +0000 (16:23 -0400)]
pimd: Add some explanatory debugging for a error condition.

When we decide to ignore a incoming packet, allow detailed
debugging to give a pointer to where to go to understand the
issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix test for (S,G,rpt) prune inclusion.
Donald Sharp [Thu, 3 Nov 2016 19:44:24 +0000 (15:44 -0400)]
pimd: Fix test for (S,G,rpt) prune inclusion.

The (S,G,rpt) prune inclusion was incorrectly considering
if the RPF' was the same for (S,G) and (*,G).

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: No need to reset uptime if state is the same
Donald Sharp [Thu, 3 Nov 2016 17:51:18 +0000 (13:51 -0400)]
pimd: No need to reset uptime if state is the same

Do not reset the time the mroute has been in it's
current state if we get a transition to the same state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Abstract setting of the spt bit a bit more
Donald Sharp [Thu, 3 Nov 2016 14:56:39 +0000 (10:56 -0400)]
pimd: Abstract setting of the spt bit a bit more

Allow the spt bit to be set appropriately from multiple
places.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add ability to set SPTBIT on a S,G stream
Donald Sharp [Thu, 3 Nov 2016 14:02:59 +0000 (10:02 -0400)]
pimd: Add ability to set SPTBIT on a S,G stream

Implement 4.2.2 for setting the SPT bit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start addition of timer wheel
Donald Sharp [Wed, 2 Nov 2016 23:19:40 +0000 (19:19 -0400)]
pimd: Start addition of timer wheel

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Add Timer Wheel functionality
Donald Sharp [Wed, 2 Nov 2016 23:03:29 +0000 (19:03 -0400)]
lib: Add Timer Wheel functionality

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start coding of sending Prune (s,g,rpt) with *,g prune.
Donald Sharp [Wed, 2 Nov 2016 15:21:49 +0000 (11:21 -0400)]
pimd: Start coding of sending Prune (s,g,rpt) with *,g prune.

Add logic to show that we are making decisions about
the s,g,rpt prune send.  We are not actually sending
anything yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add some helper functions.
Donald Sharp [Wed, 2 Nov 2016 15:20:27 +0000 (11:20 -0400)]
pimd: Add some helper functions.

Currently these are stubs to help debug logic.
Will be filled in as we go.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add the ability to test if the RPF' is the same
Donald Sharp [Wed, 2 Nov 2016 14:53:28 +0000 (10:53 -0400)]
pimd: Add the ability to test if the RPF' is the same

Test the ability to see if two RPF' are the same
or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoPIM After LHR swp bounce toward rx host, igmp_source_forward_start
Daniel Walton [Wed, 2 Nov 2016 18:03:00 +0000 (18:03 +0000)]
PIM After LHR swp bounce toward rx host, igmp_source_forward_start
failure message repeats in log

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-13340

8 years agopimd: Add ability to listen to igmp messages on 224.0.0.2
Donald Sharp [Wed, 2 Nov 2016 13:35:31 +0000 (09:35 -0400)]
pimd: Add ability to listen to igmp messages on 224.0.0.2

Some igmpv2 messages are sent to 224.0.0.2.  We were
not listening for these messages and as such we
were ignoring some withdrawals.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix 'ip igmp join ..'
Donald Sharp [Tue, 1 Nov 2016 14:16:03 +0000 (10:16 -0400)]
pimd: Fix 'ip igmp join ..'

When a static igmp join is issued, before routing
has come up, the ability to recover was accidently
removed from the code.

Ticket: CM-13379
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: When nexthop lookup fails, back out gracefully
Donald Sharp [Tue, 1 Nov 2016 03:17:53 +0000 (23:17 -0400)]
pimd: When nexthop lookup fails, back out gracefully

When the nexthop lookup fails when establishing the
upstream state as part of a register receive, kill
the upstream state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow FHR/RP/LHR to be one and the same
Donald Sharp [Tue, 1 Nov 2016 00:49:18 +0000 (20:49 -0400)]
pimd: Allow FHR/RP/LHR to be one and the same

When we have a FHR/RP/LHR all on the same box, we were
experiencing a situation where we were not sending
a register stop nor where we setting the sptbit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
fd

8 years agopimd: Modify Debug to be better
Donald Sharp [Tue, 1 Nov 2016 00:01:16 +0000 (20:01 -0400)]
pimd: Modify Debug to be better

Make debugs of some pim processes easier
to interpret and understand.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Be more careful looking up mroute statistics
Donald Sharp [Mon, 31 Oct 2016 20:33:38 +0000 (16:33 -0400)]
pimd: Be more careful looking up mroute statistics

When we get a request to look up the mroute statistics
from the kernel, ensure that the interface returned
is a valid usable interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: pim upstream child list
Donald Sharp [Mon, 24 Oct 2016 02:47:25 +0000 (22:47 -0400)]
pimd: pim upstream child list

Add the ability to keep the list of S,G's associated with
a *,G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim-msdp: part-1 - initial protocol infra.
anuradhak [Tue, 25 Oct 2016 17:59:48 +0000 (10:59 -0700)]
pim-msdp: part-1 - initial protocol infra.

This commit includes the following changes -
1. Support for MSDP peer DB (hash and sorted list).
2. Support for the following timers - keepalive, connect-retry, hold.
3. TCP session management (lower-ip is active, higher-ip is passive).
4. MSDP KA packet rx/tx.
5. Limited temporary config (will be replaced with the more automation
friendly RP-set).

Testing done -
Peer bringup/deletion (including interop with another vendor)

Sample out -
root@dell-s6000-04:~# sudo vtysh -c "show ip msdp peer"
Peer                       Local        Mesh-group        State Uptime
100.1.1.1              100.1.2.1           default  established 00:07:27
100.1.3.1              100.1.2.1           default  established 00:31:50
root@dell-s6000-04:~#

Coming soon -
1. part-2: SA cache management.
2. part-3: SPT setup using source in SA cache.
3. part-4: CLI cleanup.

Ticket: CM-13306

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix gcc compile issue.
Donald Sharp [Mon, 31 Oct 2016 13:20:01 +0000 (09:20 -0400)]
pimd: Fix gcc compile issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Pass in upstream to pim_msg_join_prune_encode.
Donald Sharp [Mon, 31 Oct 2016 13:03:57 +0000 (09:03 -0400)]
pimd: Pass in upstream to pim_msg_join_prune_encode.

Pass in the upstream data structure to pim_msg_join_prune_encode
so it can decide to send (S,G,rpt) information if it wants to or
not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Remove unused/unmaintained test commands
Donald Sharp [Mon, 31 Oct 2016 12:54:35 +0000 (08:54 -0400)]
pimd: Remove unused/unmaintained test commands

The test commands are not being maintained and
are not out of date with the rest of the system.  There
are better ways to test code and in addition these
commands if entered by a user could seriously impact
their running system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Convert pim_joinprune_send to receive upstream
Donald Sharp [Mon, 31 Oct 2016 12:44:01 +0000 (08:44 -0400)]
pimd: Convert pim_joinprune_send to receive upstream

When sending a join/prune send in the upstream pointer.
this will allow us to implement some of the other state
machines necessary.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: When nexthop_lookup fails allow a retry.
Donald Sharp [Sun, 30 Oct 2016 23:34:26 +0000 (19:34 -0400)]
pimd: When nexthop_lookup fails allow a retry.

We are seeing situations where nexthop lookups are failing
unexpectedly.  Don't consider the lookup to have succeeded
in this case to allow the next lookup to work?

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Ignore (S,G) Prunes with no current state
Donald Sharp [Fri, 28 Oct 2016 19:25:56 +0000 (15:25 -0400)]
pimd: Ignore (S,G) Prunes with no current state

If we get a (S,G) Prune with no current ifchannel state, ignore
the neighbors request.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Find an interface that is both connected and setup for pim
Donald Sharp [Fri, 28 Oct 2016 17:43:13 +0000 (13:43 -0400)]
pimd: Find an interface that is both connected and setup for pim

When we are looking up the incoming interface for the ipmr
call back socket from the kernel, look to see if the src
is connected as well as has a valid pim_ifp to use.

This is to allow vrr configuration in a mlag env.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start (S,G,rpt) coding
Donald Sharp [Fri, 28 Oct 2016 17:23:17 +0000 (13:23 -0400)]
pimd: Start (S,G,rpt) coding

Start putting some infrastructure for (S,G,rpt) handling

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Clean up the interface deletion
Donald Sharp [Fri, 28 Oct 2016 00:35:22 +0000 (20:35 -0400)]
pimd: Clean up the interface deletion

When cleaning up the interface, actually clean up
data associated with that interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Make sure we have valid pointer when printing debugs
Donald Sharp [Thu, 27 Oct 2016 22:27:28 +0000 (18:27 -0400)]
pimd: Make sure we have valid pointer when printing debugs

When we print a debug in the pim_upstream_add, there
exists failure cases for pim_upstream_new where
we cannot create a upstream data structure.  Make
sure the debug handles it right.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix possible crash using 'struct pim_nexthop'
Donald Sharp [Thu, 27 Oct 2016 22:16:47 +0000 (18:16 -0400)]
pimd: Fix possible crash using 'struct pim_nexthop'

When passing in a nexthop data structure to nexthop_lookup
ensure that it is zero'ed out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Ensure 'struct nexthop' has been zeroed
Donald Sharp [Thu, 27 Oct 2016 22:13:19 +0000 (18:13 -0400)]
pimd: Ensure 'struct nexthop' has been zeroed

When calling nexthop_lookup, the code assumes
that the nexthop passed in has been 0'ed out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix crash when cannot find igmp
Donald Sharp [Thu, 27 Oct 2016 22:09:09 +0000 (18:09 -0400)]
pimd: Fix crash when cannot find igmp

When we look up a igmp data structure, if we
don't find it, safely do nothing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add basic nexthop lookup cached information.
Donald Sharp [Thu, 27 Oct 2016 15:54:55 +0000 (11:54 -0400)]
pimd: Add basic nexthop lookup cached information.

Cache the last time we looked up the nexthop for this particular
address.  Store time to usec accuracy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add the ability to get time in usec
Donald Sharp [Thu, 27 Oct 2016 16:26:00 +0000 (12:26 -0400)]
pimd: Add the ability to get time in usec

Add ability to return a int64_t time in usec.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix possible double free of upstream
Donald Sharp [Thu, 27 Oct 2016 12:05:57 +0000 (08:05 -0400)]
pimd: Fix possible double free of upstream

Fix possible double free of upstream and in
addition add some debug code to help find
where the problem is coming from.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix crash when igmp message comes in on non-configured interface
Donald Sharp [Thu, 27 Oct 2016 00:26:16 +0000 (20:26 -0400)]
pimd: Fix crash when igmp message comes in on non-configured interface

When we receive a igmp message through the kernel upcall, make
sure that we are configured to work on that interface via pim/igmp
before attempting to use that interface.

Ticket: CM-13338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix child ifchannel overwrite parent ifchannel
Donald Sharp [Mon, 24 Oct 2016 02:35:47 +0000 (22:35 -0400)]
pimd: Fix child ifchannel overwrite parent ifchannel

When we look for child channels, don't overwrite the
parents ifchannel.  Leave that one alone.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: always build json for show commands
Daniel Walton [Wed, 26 Oct 2016 14:03:29 +0000 (14:03 +0000)]
pimd: always build json for show commands

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This cleans up the following so that they always collect the data to
display in json structures and then either dumps the json output or
traverses it to produce the non-json output.

  show ip pim local-membership
  show ip pim interface

8 years agopimd: Fix pim_nexthop_lookup
Donald Sharp [Tue, 25 Oct 2016 14:40:04 +0000 (10:40 -0400)]
pimd: Fix pim_nexthop_lookup

There are situations where we may never look at a better
route for nexthop_lookup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix uninitialized value
Donald Sharp [Tue, 25 Oct 2016 12:16:09 +0000 (08:16 -0400)]
pimd: Fix uninitialized value

When handling a igmp request, fill in group address before
we attempt to output debug information on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add interface to ifchannel debugs
Donald Sharp [Mon, 17 Oct 2016 12:33:13 +0000 (08:33 -0400)]
pimd: Add interface to ifchannel debugs

When outputting data about ifchannels due to debug
include the interface this is happening on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add debug for packet stats
Donald Sharp [Fri, 14 Oct 2016 17:15:30 +0000 (13:15 -0400)]
pimd: Add debug for packet stats

Allow us to figure out what is going wrong in some
situations, so add some debugs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>