summaryrefslogtreecommitdiff
path: root/pimd/pim_vxlan.c
AgeCommit message (Collapse)Author
2024-01-10pimd: Send up to 10 NULL registers on vxlan startupDonald Sharp
When doing pim vxlan multicast bum handling, setup the register to send up to 10 null registers on immediate startup. If the null register packet gets dropped this delays the formation of the S,G tree from the RP towards the FHR. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-13pimd: Free up link list on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-12pimd: Allow more immediate null registers to be sent in the vxlan codeDonald Sharp
When a pim vxlan S,G is created, the code attempts to send out a NULL register. This is used to build the S,G tree from the RP to the FHR. Upon initial startup it is not unusual for the pim vxlan state be fully ready to go but the RP is still not reachable. Let's add a bit of a pump prime that allows the vxlan code to re-attempt to send the null register for vxlan S,G's that the RP's outgoing interface changed from unknown to an actual interface. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
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-21*: Add a hash_clean_and_free() functionDonald Sharp
Add a hash_clean_and_free() function as well as convert the code to use it. This function also takes a double pointer to the hash to set it NULL. Also it cleanly does nothing if the pointer is NULL( as a bunch of code tested for ). Signed-off-by: Donald Sharp <sharpd@nvidia.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-07-06pim6d: Pass pim_addr for pim_nht callbacks.sarita patra
For pim callbacks, we pass pim_addr as value, not pointer. So making it consistent for pim_nht callbacks. Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06pim6d: Adjust rpf_addr in pim_vxlan_orig_mr_up_addsarita patra
In this PR, we are handling the pim_vxlan_orig_mr_up_add() after rpf_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-06-27pim6d: Changing igmp_enable to gm_enable.Abhishek N R
Modified variable name so that it can be reused in mld. Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-05Merge pull request #10959 from patrasar/pim_coverityDonald Sharp
pimd: Fixing pim coverity issues
2022-04-04pimd: fix pim_instance NULL deference in pim_vxlan_mlag_updatesarita patra
Fixing the below coverity issue. >>> CID 1515545: (NULL_RETURNS) >>> Dereferencing a pointer that might be "NULL" "pim" when calling "pim_vxlan_set_peerlink_rif". 902 pim_vxlan_set_peerlink_rif(pim, NULL); Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-04pimd: remove useless PIM_IF_* macrosDavid Lamparter
The only function these macros have is to make the code confusing. "PIM_IF_DO_PIM" sounds like it triggers some action, but it doesn't. Replace with "bool" fields in struct pim_interface. (Note: PIM_IF_*_IGMP_LISTEN_ALLROUTERS was always set, without any way to unset it. It is completely removed now and always enabled.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
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-14pim6d: IPv6-adjust pim_upstream addrDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: deploy pim_sgaddr_* helpersDavid Lamparter
Use _cmp/_hash/_match helpers for operations on pim_sgaddr to prepare IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_set()David Lamparter
... and replace with `%pSG` printfrr specifier. 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>
2021-12-04Merge pull request #10017 from AnuradhaKaruppiah/evpn-pim-registerRuss White
pimd: handle vxlan sg add/del for upstream entries that are in a reg-join state
2021-12-03pimd: Clean up switch statement to our standardsDonald Sharp
Fixup the switch statement to not have a default statement with a enum as the case. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-22Merge pull request #10076 from idryzhov/if-is-loopback-or-vrfDonald Sharp
*: unify if_is_loopback/if_is_loopback_or_vrf
2021-11-17pimd: clean up BSR NHT & fix parallel linksDavid Lamparter
The Bootstrap message RX path needs a RPF check for the BSR address, and this is implemented both incorrectly as well as quite ugly. Clean up and fix case when we have multiple interfaces to the same LAN and/or ECMP nexthops (both would cause message duplication, the former can even cause BSM forwarding loops.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16*: unify if_is_loopback/if_is_loopback_or_vrfIgor Ryzhov
We should always treat the VRF interface as a loopback. Currently, this is not the case, because in some old pre-VRF code we use if_is_loopback instead of if_is_loopback_or_vrf. To avoid any future problems, the proposal is to rename if_is_loopback_or_vrf to if_is_loopback and use it everywhere. if_is_loopback is renamed to if_is_loopback_exact in case it's ever needed, but currently it's not used anywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-09pimd: handle vxlan sg add/del for upstream entries that are in a reg-join stateAnuradha Karuppiah
pim-vxlan uses periodic null registers to bootstrap a new (VTEP, mcast-grp). These null registers were not being sent if the (S, G) was already present and in a register-join state. Ticket: #2848079 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-05-12pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp
VRF creation can happen from either cli or from knowledged about the vrf learned from zebra. In the case where we learn about the vrf from the cli, the vrf id is UNKNOWN. Upon actual creation of the vrf, lib/vrf.c touches up the vrf_id and calls pim_vrf_enable to turn it on properly. At this point in time we have a pim->vrf_id of UNKNOWN and the vrf->vrf_id of the right value. There is no point in duplicating this data. So just remove all pim->vrf_id and use the vrf->vrf_id instead since we keep a copy of the pim->vrf pointer. This will remove some crashes where we expect the pim->vrf_id to be usable and it's not. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-02*: fix all backetsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-03-20pimd: Note when rpf_update failsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-20pimd: Prevent use after freeDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10Merge pull request #5877 from donaldsharp/pim_shutdown_cleanupDonatas Abraitis
Pim shutdown cleanup
2020-03-06pimd: Remove possibility of trying to send Register when no RPFDonald Sharp
On shutdown processing we may have gotten a interface down event which might clear the rpf interface and we might trigger a work queue item on the vxlan_sg to send a NULL register. Ensure that we cannot attempt to do the impossible. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06pimd: When shutting down stop the vxlan worker threadDonald Sharp
Upon shutdown stop the vxlan worker thread. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06pimd: Upon vrf deletion actually clean up memoryDonald Sharp
VRF deletion events here calling hash_clean() with nothing to clean up the vxlan_sg's associated with it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06pimd: mute termination device on the origination mroute on type modsAnuradha Karuppiah
An mroute can transition from non-origination to a vxlan origination mroute. In that case we need to re-evaluate if the interfaces in the OIL need to be muted; pimreg and termination device need to be muted (if they were previously un-muted). Dump in a problem state: ======================= root@TORC11:~# 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.100 y uplink-1 pimreg(I ), ipmr-lo( J ) 1 36.0.0.11 239.1.1.100 n peerlink-3.4094 ipmr-lo( * ), uplink-1( J ), uplink-2( J ), peerlink-3.4094( V ) PS: ipmr-lo should have M set in (36.0.0.11,239.1.1.100) Ticket: CM-26747 Signed-off-by: Anuradha Karuppiah <anuradhak@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-02-28*: change hash_backet to hash_bucketDonald Sharp
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-27Revert "*: change hash_backet to hash_bucket"Jafar Al-Gharaibeh
This reverts commit 3895c42a2eb534a70ef25412547e798c1c1ef5a1. LabN CI update needs to be coordinated before merging this Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-02-26*: change hash_backet to hash_bucketDonald Sharp
It's been a year search and destroy. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-20pimd: fix SA reportsMark Stapp
Fix a couple of SA warnings introduced recently; replace some 'strcpy' calls. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-14pimd: handle ipmr-lo operational state changesAnuradha Karuppiah
ipmr-lo is an internally added device used for multicast vxlan tunnel termination. This device is not expected to be managed by the admin however in the case it is accidentally shut we need to be able handle it by recovering when it is "no shut" again. Ticket: CM-24985 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: remove peerlink_rif from the orig-mroute OIL when it is oper downAnuradha Karuppiah
In an anycast VTEP setup the peerlink_rif is added as a static OIF to the originating mroute (bypassing the pim state machine). This is needed to ensure both MLAG switches rx a copy of encapsulated BUM flow. We were not handling link state changes on this static OIF resulting in the wrong vifi being used in the OIL (because of vifi re-allocation). This commit re-acts to oper state changes by deleting the OIF on link down and re-adding it on link up. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: stop overloading SRC_IGMP upstream for vxlan local membershipAnuradha Karuppiah
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-14pimd: force update inherited OIL when vxlan local membership is createdAnuradha Karuppiah
When local member is added the (*, G) entry may already be in a JOINED state. In that case the OIL is not updated i.e. pim_channel_add_oif is not happening for ipmr-lo. Because of this the traffic associated with the multicast vxlan tunnel is pulled down to the VTEP but not terminated by the kernel. This change force updates the OIL anytime ipmr-lo is added or removed as a local member. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: increase RPF metric via the peerlink_rif by plus-10Anuradha Karuppiah
The RPF cost is incremented by 10 if the RPF interface is the peerlink-rif. This is used to force the MLAG switch with the lowest cost to the RPF to become the MLAG DF. If a switch has to go via the peerlink-rif to get to the RP or source it simplly cannot be the designated forwarder. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: inherit MLAG DF role from the parent (*, G) entryAnuradha Karuppiah
DF election is only run for (*,G) entries i.e. election is skipped for (S,G) entries that are setup as a result of SPT switchover. (S,G) entries inherit the DF role from the parent (*,G) entry. So the DF is responsible for terminating all sources associated with a group. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pim: DF election for tunnel termination mroutes in an anycast-VTEP setupAnuradha Karuppiah
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-14pimd: register with MLAG on the first VxLAN SGAnuradha Karuppiah
Channel with the MLAG daemon is setup on the first VxLAN BUM MDT or pim-mlag AA SVI. This channel is used for - 1. rxing MLAG status status updates (peer state, role etc.) 2. for syncing active-active upstream entries with the peer MLAG switch. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: add caller string prefix to pim_rpf_update logsAnuradha Karuppiah
No functional change; log enhancements only. 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>