Commit Graph

78 Commits

Author SHA1 Message Date
Donald Sharp
f7a775a78e
Merge pull request #13020 from SaiGomathiN/2462808-3
pimd: PIM not sending register packets after changing from non DR to DR
2023-05-02 11:55:34 -04:00
Donald Sharp
e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Sai Gomathi N
1c883aef96 pimd: PIM not sending register packets after changing from non DR to DR
When the router is non dr for an interface, it installs mroute to drop
the packets from directly connected source. This was done to avoid packets
coming to cpu as nocache hit. Later when it gets change from non-DR to DR,
these entries are not cleared. So the packets are still dropped.
This causes register packets not getting generated.
So cleaning up the mroute entries and channel oil without
upstream reference which was created to drop.

Co-authored-by: Saravanan K <saravanank@vmware.com>
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2023-03-17 03:51:16 -07:00
Sarita Patra
3dbf370ac0 pimd,pim6d: Modify pim_neighbor_find() API
Modify pim_neighbor_find() API to find the neighbor
in neighbor secondary list.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-02-24 04:40:38 -08:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Mobashshera Rasool
79c0c50db9 pimd: Removal of unused function pim_neighbor_find_prefix
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-09-02 09:50:28 -07:00
sarita patra
bad81cbc7b pim6d: Handle rpf_addr in on_neighbor_jp_timer()
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
David Lamparter
cbbb1813a6
Merge pull request #11008 from patrasar/sec_addr_list_pimv6 2022-05-20 15:25:52 +02:00
David Lamparter
993e3d8e13 pimd: un-dependency-hell pim_instance.h
This is causing build issues on BSD by including (transitively)
`linux/mroute6.h` - try to address by disentangling the headers a bunch.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 15:10:57 +02:00
sarita patra
53749ba70b pimd: Print secondary address using %pFX
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-28 03:28:17 -07:00
sarita patra
d58395d1f3 pim6d: Adjust IPV6 secondary address list
Within one Address List Hello option, all the addresses MUST be of
the same address family.  It is not permitted to mix IPv4 and IPv6
addresses within the same message.  In addition, the address family
of the fields in the message SHOULD be the same as the IP source and
destination addresses of the packet header.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-28 03:27:42 -07:00
Donald Sharp
cc9f21da22 *: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23 19:56:04 -05:00
David Lamparter
034db86b72 pim6d: IPv6-adjust iface primary/DR addrs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
9bb93fa04e pim6d: IPv6-adjust neigh->source_addr
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
Mobashshera Rasool
79992e8a42 pimd: Add a flag to decide PIM has to send Hello
Problem Statement:
==================
pim maintains two counters hello tx and hello rx at interface level.
At present pim needs to send the hello message prior to other pim
message as per RFC. This logic is getting derived from the tx hello
counters. So when a new neighbor is added, tx counters are set to
zero and then based on this, it is further decided to send hello in
pim_hello_require function.

Fix:
====
Separating the hello statistics and the logic to decide when to send hello
based on a new flag. pim_ifstat_hello_sent will be used to note down
the hello stats while a new flag is added to decide whether to send hello
or not if it is the first packet to a neighbor.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-10-03 22:04:34 -07:00
github login name
69b2df12bb pimd: zlog_info changed to zlog_notice for neighbor up/down event
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-06 22:51:19 -07:00
Mark Stapp
f71e1ff6a9
Merge pull request #8545 from opensourcerouting/assert-our-own
*: make our own assert() actually work
2021-05-03 11:17:36 -04:00
Rafael Zalamena
1f3e6bf585 pimd: rework BFD integration
Rewrite the BFD integration code to use the new library.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:28:57 -03:00
David Lamparter
df5dfb77b5 pimd: zassert => assert
No point in having pimd use zassert() while everything else uses plain
assert().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-23 12:25:47 +02:00
Mark Stapp
5047884528 *: unify thread/event cancel macros
Replace all lib/thread cancel macros, use thread_cancel()
everywhere. Only the THREAD_OFF macro and thread_cancel() api are
supported. Also adjust thread_cancel_async() to NULL caller's pointer (if
present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 12:16:52 -04:00
Donald Sharp
88b5958e31
Merge pull request #6054 from sarav511/dr2ndr
pimd: When DR becomes non DR, Still sends register packets to RP
2020-06-01 07:58:32 -04:00
saravanank
46a9ea8bfa pimd: When DR becomes non DR, couldreg state events not handled.
RCA: Upstreams which are in register state other than noinfo, doesnt remove
register tunnel from oif after it becomes nonDR

Fix: scan upstreams with iif as the old dr and check if couldReg becomes false.
If couldreg becomes false from true, remove regiface and stop reg timer.
Do not disturb the entry. Later the entry shall be removed by kat expiry.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-19 18:27:37 -07:00
saravanank
b3a474d82e pimd: pimd crashes during neighbor clean up
RCA:
It has asserted because during neighbor delete on a interface,
pim_number_of_nonlandelay_neighbors count has become less less than 0.
This was due to not updating the count when hello option changed.

Fix:
During hello option update, check and increment or decrement when this option changes.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-18 21:41:04 -07: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
Donald Sharp
63265b5c1f *: Convert prefix_free to double pointer
Have the prefix_free code take a double pointer to free the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-02 16:13:44 -04:00
Satheesh Kumar K
5b4d431d23 pimd: PIM Core seen during NH processing
PIM Core was seen during EVPN PIM Testing beacuse of NULL
Interface pointer

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-07-23 22:03:06 -07:00
Donald Sharp
c9cd7fbc3f pimd: Limit lookup of neighbor since we know we have one
When a new pim neighbor comes up, we need to go through and
mark nexthops that we have received from zebra for reachability
tracking so we can refigure stuff.  If we pass in the new neighbor
we can limit the search to those nexthops out the interface that
the new neighbor has come up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-02 08:20:02 -04:00
Donald Sharp
5b45753eff pimd: Convert qpim_t_periodic into the struct pim_router structure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp
36417fcc20 pimd: Create a struct pim_router and move thread master into it
Create a `struct pim_router` and move the thread master into it.
Future commits will further move global varaibles into the pim_router
structure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:21:00 -05:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Quentin Young
450971aa99 *: LIB_[ERR|WARN] -> EC_LIB
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:34:28 +00:00
Quentin Young
af4c27286d *: rename zlog_fer -> flog_err
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
3613d89844 pimd: Convert over to use LIB_ERR_XXX for zlog_err
Convert, where appropriate, the zlog_err functions to zlog_ferr
for the LIB_ERR_XXX enums

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
662ba9e6f0 pimd: Cleanup bfd memory on shutdown
When shutting down pim, ensure that we cleanup bfd memory

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-02 22:56:55 -04:00
Donald Sharp
2b57b94834 pimd: Remove unnecessary alloc failures
Remove from pim unnecessary alloc failure testing
as that alloc failure will cause an assert.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-08 12:09:21 -04:00
Donald Sharp
da11e32521 pimd: Make the rpf scan per vrf.
We know the vrf that we are in when we need to initiate a
rescan of the rpf cache.  So pass it in and use that information.
This should help the rescan at scale with several vrf's cutting
out a lot of unnecessary work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 21:13:09 -04:00
Donald Sharp
78c16071f9 pimd: Just call the actual function
We do not really need a level of abstraction to call a particular function.
Just call it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 20:54:04 -04:00
Donald Sharp
affe9e9983 *: Convert list_delete(struct list *) to ** to allow nulling
Convert the list_delete(struct list *) function to use
struct list **.  This is to allow the list pointer to be nulled.

I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.

Let's make the api explicit in it setting the list pointer
to null.

Cynical Prediction:  This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:53:13 -04:00
Donald Sharp
9b29ea95fc pimd: Remove pimg from pim_upstream.c
Move the upstream_list, hash and wheel into 'struct pim_instance'
Remove all pimg to pim in pim_upstream

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
fec883d95a pimd: pim_rp.c -> convert pimg to pim
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
David Lamparter
68b2595ec9 Merge pull request #576 from chiragshah6/pim_dev
pimd: pim bfd support
2017-05-30 14:37:08 +02:00
Chirag Shah
ba4eb1bccf pimd: pim bfd support
All PIM Neighbors for a given pim interface is registered with
BFD.
Upon receiving BFD status down event, PIM Neighbor with BFD info is deleted.
Add pim bfd configuraiton (CLI) per interface, '[no] ip pim bfd'

Testing Done:
Configure BFD under PIM interface on all neighbor routers,
check bfd sessions up, remote end unconfigure BFD, results in BFD session down.
Previous state was UP to New state DOWN, results in PIM neighbor delete behind
that particular pim interface.
Pim-smoke Results:
Ran 94 tests in 7409.680s
FAILED (SKIP=8, failures=2)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-17 22:42:28 -07:00
Donald Sharp
4a07939b68 pimd: Thread changes allow pim to crash a boo
When we add a thread pointer to thread_add_XXX functions
when the specified function is called, thread.c is setting
the thread pointer to NULL.  This was causing pim to
liberally pull it's zassert grenade pin's.

Additionally clean up code to not set the NULL pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17 20:33:43 -04:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
Quentin Young
ffa2c8986d *: remove THREAD_ON macros, add nullity check
The way thread.c is written, a caller who wishes to be able to cancel a
thread or avoid scheduling it twice must keep a reference to the thread.
Typically this is done with a long lived pointer whose value is checked
for null in order to know if the thread is currently scheduled.  The
check-and-schedule idiom is so common that several wrapper macros in
thread.h existed solely to provide it.

This patch removes those macros and adds a new parameter to all
thread_add_* functions which is a pointer to the struct thread * to
store the result of a scheduling call. If the value passed is non-null,
the thread will only be scheduled if the value is null. This helps with
consistency.

A Coccinelle spatch has been used to transform code of the form:

  if (t == NULL)
    t = thread_add_* (...)

to the form

  thread_add_* (..., &t)

The THREAD_ON macros have also been transformed to the underlying
thread.c calls.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-09 20:44:19 +00:00
Donald Sharp
05ba625af7 Merge remote-tracking branch 'origin/stable/3.0' 2017-05-02 15:52:09 -04:00