summaryrefslogtreecommitdiff
path: root/pimd/pim_oil.c
AgeCommit message (Collapse)Author
2023-09-19pimd: Use a better name for oil_parentDonald Sharp
Use oil_incoming_vif instead of oil_parent. I had to go look this up as that I failed to remember that the linux kernel calls this parent for some bizarre reason. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-14pimd: Display oil_parent as a string name of the interfaceDonald Sharp
When debugging and outputting the oil_parent() let's just convert it to a string that is useful for people trying to debug pim Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-02pimd: Fix old commit that got inDonald Sharp
An old fix that used THREAD_OFF was pushed in, should have used EVENT_OFF instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-17pimd: PIM not sending register packets after changing from non DR to DRSai Gomathi N
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-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-12-16pimd: Fix (S,G) debug issueSarita Patra
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-06-15pimd: Fix the setting of oif_flags in channel oilMobashshera Rasool
When pim_upstream_inherited_olist_decide calls the api pim_channel_add_oif, it can pass PIM_OIF_FLAG_PROTO_GM, PIM_OIF_FLAG_PROTO_PIM and/or PIM_OIF_FLAG_PROTO_STAR. Now a consider a case where PIM flag was already set but STAR flag was not set and this api tries to set both STAR + PIM and passes the same. The api pim_channel_add_oif returns since it sees that PIM is already set without setting the STAR flag. So basically this will lead to issues in scenarios where for the same OIF multiple flags(IGMP, PIM, STAR) needs to be set. Fixing it for all combinations. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-09pimd: Fixup oil_if_has and oil_if_set to be consistentDonald Sharp
the v4 and v6 versions were different. Make them the same. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-09pimd: Fix pim_channel_oil_empty testsDonald Sharp
The pim_channel_oil_empty() function was setting the pimreg if it ever existed for NULL comparison but of course the pimreg device is never pulled back out again when it was needed to be when the pimreg is not present. Commit: a5fa982256b23d53d5b833f75224fb7f96054b9b broke this. Fixes: #11368 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-23pim6d: Mroute changesplsaranya
Mroute and supporting changes Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-03-12pimd: add safety check to OIL add/delDavid Lamparter
These will corrupt memory if mroute_vif_index is -1 (e.g. interface not operating.) That shouldn't happen, but it does while doing development work, so trip an assert rather than corrupting memory. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16pim6d: IPv6-adjust mroute codeDavid Lamparter
This is just hitting the pim_mroute code with a hammer until it doesn't print warnings anymore. This is NOT quite tested or working yet, it just compiles. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: move, rename and deploy pim_addr_is_any()David Lamparter
Replaces comparison against INADDR_ANY, so we can do IPv6 too. (Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and type fixed to bool.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_dump()David Lamparter
... and replace with `%pSG` printfrr specifier. This actually used a static buffer in the formatting function, so subsequent formatting would overwrite earlier uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: `prefix_sg` => `pim_sgaddr`David Lamparter
Mostly just 2 sed calls: - `sed -e 's%struct prefix_sg%pim_sgaddr%g'` - `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'` Plus a bunch of fixing whatever that broke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: move `%pSG4` to `%pPSG4`David Lamparter
Since this is only used in very few places, moving it out of the way is reasonable. (`%pSG` will be pim_sgaddr) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-08pimd: Cleanup weird indentationDonald Sharp
The zlog_warn used to be bounded by a debug guard but the debug guard was removed but the code was never fixed up to remove the open and close paranthesis. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-19pimd: Fix rare crash situationDonald Sharp
When running pim on an interface and that interface has state and we move that interface into a different vrf there exists a call path where we have not created the pimreg device yet. Prevent a crash in this rare situation. Ticket: #2552763 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-23pimd: zassert => assertDavid Lamparter
No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-06-03pimd: Fix missing codeDonald Sharp
Found some more missing code that got dropped during the upstreaming process causing issues with things actually working. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06pimd: logs to help debug leaked channel OIF problemsAnuradha Karuppiah
Additional protocols were being set on the OIF proto-mask without logs. Added logs in that area. Also added start and end logs to ifchannel_delete to help identify state machine changes that play out as a part of this event handling. Ticket: CM-26732 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-03-06pimd: Add accidently missed code during upstreaming processDonald Sharp
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-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-03pimd: Convert the upstream_list and hash to a rb treeDonald Sharp
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-03pimd: Convert the channel_oil_list|hash to a rb_treeDonald Sharp
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>
2019-11-19pimd: exclude pimreg from the inherited OILAnuradha Karuppiah
Inherited OIL is used as a part of the JoinDesired macro. And in FRR we use the channel OIL as the inherited OIL (to reduce processing overhead everytime JD needs to be re-evaluated). On a FHR pimreg is a part of the channel-OIL but must not be used for JD computation. This commit blacklists pimreg from the inherited_oil i.e. present but ignored. Note: This fixup is being done to address topotest failures. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: enforce PIM_ENFORCE_LOOPFREE_MFC at the time of MFC programmingAnuradha Karuppiah
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-15pimd: re-eval JD on sources when a STAR_OIF is removedAnuradha Karuppiah
When a inherited OIL becomes empty join-desired can go to false. So we need to re-run join-desired evaluation on any inherited OIL changes. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: fixup pim_channel_oil_empty macroAnuradha Karuppiah
The macro was always returning non-empty because of comparing an array of u8_t with an array of u32_t. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: set mfcc_parent at the time of MFCC programmingAnuradha Karuppiah
mfcc_parent for an (S, G) entry was being updated on any upstream RPF change. With the change to use RPT for (S,G) in some cases we can no longer do that. Instead the upstream entry's RPF neigbor is managed separately form the channel_oil's mfcc_parent i.e. via NHT. And the mfcc_parent is evaluated at the time of mroute programming. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: decide between SPT based and RPT based forwardingAnuradha Karuppiah
An (S,G) mroute can be created as a result of rpt prune. However that entry needs to stay on the parent (*,G)'s tree (IIF) till a decision is made to switch the source to the SPT. The decision to stay on the RPT is made based on the SPTbit setting according to - RFC7761, Section 4.2 “Data Packet Forwarding Rules” However those rules are hard to achieve when hw acceleration i.e. control and data planes are separate. So instead of relying on data we make the decision of using SPT if we have decided to join the SPT - Use_RPT(S,G) { if (Joined(S,G) == TRUE // we have decided to join the SPT OR Directly_Connected(S) == TRUE // source is directly connected OR I_am_RP(G) == TRUE) // RP //use_spt return FALSE; //use_rpt return TRUE; } To make that change some re-org was needed - 1. pim static mroutes and dynamic (upstream mroutes) top level APIs have been separated. This is to limit the state machine to dynamic mroutes. 2. c_oil->oil.mfcc_parent is re-evaluated based on if we decided to use the SPT or stay on the RPT. 3. upstream mroute re-eval is done when any of the criteria involved in Use_RPT changes. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: re-eval c_oil mute flags on upstream attach/detachAnuradha Karuppiah
Theoretically there should be no case where the channel-oil hangs around after the upstream entry is removed. But currently there are cases where it does. This is a precautionary fixup till we are rid off all of those cases. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: MUTE flag to suppress traffic forwarding on non-DFAnuradha Karuppiah
If an mroute loses DF election (with the MLAG peer) it has to stop forwarding traffic on active-active devices such as ipmr-lo used for vxlan traffic termination. To acheive that this commit introduces a concept of OIF muting. That way we can let the PIM and IGMP state machines play out and silence OIFs after the fact. Relevant outputs: ================= 1. muted OIFs are displayed with the M flag in "pim state" - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> root@TORC12:~# net show pim state |grep "27.0.0.13"|grep 100 1 27.0.0.13 239.1.1.100 uplink-1 ipmr-lo( *M) root@TORC12:~# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2. And supressed altogether in the mroute output - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> root@TORC12:~# net show mroute |grep "27.0.0.13"|grep 100 27.0.0.13 239.1.1.100 none uplink-1 none 0 --:--:-- root@TORC12:~# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: update add_oif and del_oif debugs to print callerAnuradha Karuppiah
These logs were printing file name which has little value (is always pim_oil.c). Instead print the caller. add_oif/del_oif are being called directly from one too many. Instead OIF setup needs to be consolidated via the PIM state machine. These debugs are expected to help in understanding what needs to be cleaned up. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-07-18pimd: Add pim_channel_oil_change_iifDonald Sharp
Add a function that allows you to modify the channel oil's incoming interface and to appropriately install/remove it from the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-21Merge pull request #4518 from sarav511/dr_lhrDonald Sharp
pimd: fix DR at LHR scenario where non DR is connected to RP
2019-06-14pimd: Add debugs for channel_oil creation and deletionDonald Sharp
Add some debugs so we can see channel oil creation and deletion events. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-14pimd: Display ifp name in pim_channel_oil_dumpDonald Sharp
The vifi being displayed is just confusing. Display the actual interface name being used in the mroute. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-12pimd: fix DR at LHR scenario where non DR is connected to RPsaravanank
In Scenario where receiver is present in a subnet where 2 or more pim mrouters. When IGMP query received on a DR interface and RP is reachable through non DR. Currently we are blocking to create upstream where iif == oif. So pim join not generated towards RP. We have to allow the DR router in the network to create an upstream. Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14lib: hashing functions should take const argumentsQuentin Young
It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-20pimd: allow mroutes with IIF in the OILAnuradha Karuppiah
This is specifically needed to allow pim-evpn mroutes in the MLAG setup - (36.0.0.11, 239.1.1.100) Iif: peerlink.4094 Oifs: uplink-1, peerlink.4094 I could have gone the other way and disabled PIM_ENFORCE_LOOPFREE_MFC but that opens the door too wide. Relaxing the checks for mlag-specific mroutes seemed like the safer choice. This commit provides the infrastructure to relax checks on a per-mroute basis. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-03-18pimd: Addressing the review commentsSarita Patra
Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-24pimd: Don't install dummy channel oil entry into KernelSarita Patra
If the channel oil is dummy(channel_oil->is_valid != True), then don't install entry into the kernel. Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-24pimd: create dummy (*,G) upstream when RP not configured/reachableSarita Patra
In this commit, we are creating a dummy upstream & dummy channel_oil for (*, G) when RP is not configured or not reachable. Dummy upstream: <upstream_addr = INADDR_ANY, rpf = Unknown> Dummy channel oil: <iif = MAXVIFS> Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-07pimd: Don't refersh the oif_creation timer if S,G already presentSarita Patra
Issue: Shut the RP interface in the router RP. LHR will get to know RP becomes not-reachable, so it send a prune towards the RP. On receiving the prune, RP clear the (*, G) entry, but (S, G) should not get removed if present. Now no-shut the RP interface in the router RP. LHR will send a (*, G) join towards the RP. On receiving join FRR create the (*, G) entry. Along with this, it also add the interface(join received) in the OIL of (S, G) and also refresh the (S, G) timer. Fix: Dont refresh the timer for S, G or (*, G), if the flag for the channel OIL is PIM_OIF_FLAG_PROTO_ANY. Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-10-19*: Replace hash_cmp function return value to a boolDonald Sharp
The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-21*: fix gcc-8 format-overflow warningsDavid Lamparter
e.g. pimd/pim_oil.c: In function ‘pim_channel_oil_dump’: pimd/pim_oil.c:51:19: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=] Build on gcc-8.2.0 is warning-free after this patch. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-07-08pimd: Remove unnecessary alloc failuresDonald Sharp
Remove from pim unnecessary alloc failure testing as that alloc failure will cause an assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-18ospfd, pimd: redundant memset (cppcheck)paco
Signed-off-by: F. Aragon <paco@voltanet.io>