summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-03-26 21:36:43 +0100
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-04-20 17:33:21 +0200
commit6a5de0ad483b568221ef0eca5d9205ff5d2d08c0 (patch)
tree33e77c41877c66dd5095aa6672dc3a3436c27751 /pimd
parentpimd: provide an api to force stop kat on an upstream entry (diff)
downloadfrr-6a5de0ad483b568221ef0eca5d9205ff5d2d08c0.tar.xz
frr-6a5de0ad483b568221ef0eca5d9205ff5d2d08c0.zip
pimd: provide a mechanism to pin the IIF for an SG entry
In the case of vxlan origination entries IIF is set to - 1. lo for single VTEPs 2. MLAG-ISL for VTEPs multihomed via MLAG. This commit creates the necessary infrastructure by - 1. allowing the IIF to be set statically (without RPF lookup) 2. and by preventing next-hop-tracking registration PS: Note that I have skipped additional checks in pim_upstream_del intentionally i.e. an attempt will be made to remove nexthop-tracking for the upstream entry (with STATIC_IIF) which will fail because of the up-entry not being in the nh's hash table. Ideally we should maintain a nh pointer in the up-entry to prevent this unnecessary processing. In the abscence of that I wanted to avoid spraying STATIC_IIF checks all over. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_rpf.c3
-rw-r--r--pimd/pim_upstream.c27
-rw-r--r--pimd/pim_upstream.h10
3 files changed, 38 insertions, 2 deletions
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 8cc8b7481..afe3886aa 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -204,6 +204,9 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
struct prefix src, grp;
bool neigh_needed = true;
+ if (PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags))
+ return PIM_RPF_OK;
+
if (up->upstream_addr.s_addr == INADDR_ANY) {
zlog_debug("%s: RP is not configured yet for %s",
__PRETTY_FUNCTION__, up->sg_str);
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 85f58555e..050e87ab2 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -647,6 +647,23 @@ int pim_upstream_compare(void *arg1, void *arg2)
return 0;
}
+void pim_upstream_fill_static_iif(struct pim_upstream *up,
+ struct interface *incoming)
+{
+ up->rpf.source_nexthop.interface = incoming;
+
+ /* reset other parameters to matched a connected incoming interface */
+ up->rpf.source_nexthop.mrib_nexthop_addr.family = AF_INET;
+ up->rpf.source_nexthop.mrib_nexthop_addr.u.prefix4.s_addr =
+ PIM_NET_INADDR_ANY;
+ up->rpf.source_nexthop.mrib_metric_preference =
+ ZEBRA_CONNECT_DISTANCE_DEFAULT;
+ up->rpf.source_nexthop.mrib_route_metric = 0;
+ up->rpf.rpf_addr.family = AF_INET;
+ up->rpf.rpf_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY;
+
+}
+
static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
struct prefix_sg *sg,
struct interface *incoming,
@@ -712,13 +729,19 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
if (up->sg.src.s_addr != INADDR_ANY)
wheel_add_item(pim->upstream_sg_wheel, up);
- if (up->upstream_addr.s_addr == INADDR_ANY)
+ if (PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags)) {
+ pim_upstream_fill_static_iif(up, incoming);
+ pim_ifp = up->rpf.source_nexthop.interface->info;
+ assert(pim_ifp);
+ up->channel_oil = pim_channel_oil_add(pim,
+ &up->sg, pim_ifp->mroute_vif_index);
+ } else if (up->upstream_addr.s_addr == INADDR_ANY) {
/* Create a dummmy channel oil with incoming ineterface MAXVIFS,
* since RP is not configured
*/
up->channel_oil = pim_channel_oil_add(pim, &up->sg, MAXVIFS);
- else {
+ } else {
rpf_result = pim_rpf_update(pim, up, NULL, 1);
if (rpf_result == PIM_RPF_FAILURE) {
if (PIM_DEBUG_TRACE)
diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h
index 5eb230a76..c0bd9137d 100644
--- a/pimd/pim_upstream.h
+++ b/pimd/pim_upstream.h
@@ -43,6 +43,11 @@
* lack of BUM traffic.
*/
#define PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY (1 << 9)
+/* for pim vxlan we need to pin the IIF to lo or MLAG-ISL on the
+ * originating VTEP. This flag allows that by setting IIF to the
+ * value specified and preventing next-hop-tracking on the entry
+ */
+#define PIM_UPSTREAM_FLAG_MASK_STATIC_IIF (1 << 10)
#define PIM_UPSTREAM_FLAG_ALL 0xFFFFFFFF
#define PIM_UPSTREAM_FLAG_TEST_DR_JOIN_DESIRED(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED)
@@ -55,6 +60,7 @@
#define PIM_UPSTREAM_FLAG_TEST_SEND_SG_RPT_PRUNE(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_SEND_SG_RPT_PRUNE)
#define PIM_UPSTREAM_FLAG_TEST_SRC_LHR(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_SRC_LHR)
#define PIM_UPSTREAM_FLAG_TEST_DISABLE_KAT_EXPIRY(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY)
+#define PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_STATIC_IIF)
#define PIM_UPSTREAM_FLAG_SET_DR_JOIN_DESIRED(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED)
#define PIM_UPSTREAM_FLAG_SET_DR_JOIN_DESIRED_UPDATED(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED_UPDATED)
@@ -66,6 +72,7 @@
#define PIM_UPSTREAM_FLAG_SET_SEND_SG_RPT_PRUNE(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_SEND_SG_RPT_PRUNE)
#define PIM_UPSTREAM_FLAG_SET_SRC_LHR(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_SRC_LHR)
#define PIM_UPSTREAM_FLAG_SET_DISABLE_KAT_EXPIRY(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY)
+#define PIM_UPSTREAM_FLAG_SET_STATIC_IIF(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_STATIC_IIF)
#define PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED)
#define PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED_UPDATED(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED_UPDATED)
@@ -77,6 +84,7 @@
#define PIM_UPSTREAM_FLAG_UNSET_SEND_SG_RPT_PRUNE(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_SEND_SG_RPT_PRUNE)
#define PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_SRC_LHR)
#define PIM_UPSTREAM_FLAG_UNSET_DISABLE_KAT_EXPIRY(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY)
+#define PIM_UPSTREAM_FLAG_UNSET_STATIC_IIF(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_STATIC_IIF)
enum pim_upstream_state {
PIM_UPSTREAM_NOTJOINED,
@@ -256,4 +264,6 @@ unsigned int pim_upstream_hash_key(void *arg);
bool pim_upstream_equal(const void *arg1, const void *arg2);
struct pim_upstream *pim_upstream_keep_alive_timer_proc(
struct pim_upstream *up);
+void pim_upstream_fill_static_iif(struct pim_upstream *up,
+ struct interface *incoming);
#endif /* PIM_UPSTREAM_H */