Skip to content

Commit df91a3f

Browse files
updated based on yang-model review feedback
1 parent df096dc commit df91a3f

File tree

2 files changed

+31
-34
lines changed

2 files changed

+31
-34
lines changed

config/plugins/sonic-fine-grained-ecmp_yang.py

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -219,28 +219,23 @@ def FG_NHG():
219219
)
220220
@click.option(
221221
"--bucket-size",
222-
help="total hash bucket size desired, recommended value of Lowest Common Multiple of 1..\
223-
{max # of next-hops}[mandatory]",
222+
help="total hash bucket size desired, recommended value of Lowest Common
223+
Multiple of 1..{max # of next-hops}[mandatory]",
224224
)
225225
@click.option(
226226
"--match-mode",
227-
help="The filtering method used to identify when to use Fine Grained vs regular route handling. \
228-
nexthop-based looks to next-hop IP to filter routes and uses fine grained ecmp when nexthop \
229-
IPs matches FG_NHG_MEMBER IPs. route-based looks to prefix to filter routes, and uses fine \
230-
grained ecmp when the route prefix matches the FG_NHG_PREFIX prefix.[mandatory]",
231-
)
232-
@click.option(
233-
"--nhg-mode",
234-
help="static-nhg : List of nexthops needs to be statically configured in FG_NHG_MEMBER table. \
235-
dynamic-nhg : List of nexthops will be dynamically derived from the route updates.",
227+
help="The filtering method used to identify when to use Fine Grained vs regular route handling.
228+
-- nexthop-based filters on nexthop IPs only.
229+
-- route-based filters on both prefix and nexthop IPs.
230+
-- prefix-based filters on prefix only.[mandatory]",
236231
)
237232
@click.option(
238233
"--max-next-hops",
239-
help="Applicable only when nhg_mode = dynamic-nhg. Maximum number of nexthops that will be \
240-
received in route updates for any of the prefixes that match FG_NHG_PREFIX for this FG_NHG.",
234+
help="Applicable only for match_mode = prefix-based. Maximum number of nexthops that will be
235+
received in route updates for any of the prefixes that match FG_NHG_PREFIX for this FG_NHG.[mandatory]",
241236
)
242237
@clicommon.pass_db
243-
def FG_NHG_add(db, name, bucket_size, match_mode, nhg_mode, max_next_hops):
238+
def FG_NHG_add(db, name, bucket_size, match_mode, max_next_hops):
244239
""" Add object in FG_NHG. """
245240

246241
table = "FG_NHG"
@@ -250,8 +245,6 @@ def FG_NHG_add(db, name, bucket_size, match_mode, nhg_mode, max_next_hops):
250245
data["bucket_size"] = bucket_size
251246
if match_mode is not None:
252247
data["match_mode"] = match_mode
253-
if nhg_mode is not None:
254-
data["nhg_mode"] = nhg_mode
255248
if max_next_hops is not None:
256249
data["max_next_hops"] = max_next_hops
257250

@@ -269,28 +262,23 @@ def FG_NHG_add(db, name, bucket_size, match_mode, nhg_mode, max_next_hops):
269262
)
270263
@click.option(
271264
"--bucket-size",
272-
help="total hash bucket size desired, recommended value of Lowest Common Multiple of 1..\
273-
{max # of next-hops}[mandatory]",
265+
help="total hash bucket size desired, recommended value of Lowest Common
266+
Multiple of 1..{max # of next-hops}[mandatory]",
274267
)
275268
@click.option(
276269
"--match-mode",
277-
help="The filtering method used to identify when to use Fine Grained vs regular route handling. \
278-
nexthop-based looks to next-hop IP to filter routes and uses fine grained ecmp when nexthop \
279-
IPs matches FG_NHG_MEMBER IPs. route-based looks to prefix to filter routes, and uses fine grained \
280-
ecmp when the route prefix matches the FG_NHG_PREFIX prefix.[mandatory]",
281-
)
282-
@click.option(
283-
"--nhg-mode",
284-
help="static-nhg : List of nexthops needs to be statically configured in FG_NHG_MEMBER table. \
285-
dynamic-nhg : List of nexthops will be dynamically derived from the route updates.",
270+
help="The filtering method used to identify when to use Fine Grained vs regular route handling.
271+
-- nexthop-based filters on nexthop IPs only.
272+
-- route-based filters on both prefix and nexthop IPs.
273+
-- prefix-based filters on prefix only.[mandatory]",
286274
)
287275
@click.option(
288276
"--max-next-hops",
289-
help="Applicable only when nhg_mode = dynamic-nhg. Maximum number of nexthops that will be received in \
290-
route updates for any of the prefixes that match FG_NHG_PREFIX for this FG_NHG.",
277+
help="Applicable only for match_mode = prefix-based. Maximum number of nexthops that will be
278+
received in route updates for any of the prefixes that match FG_NHG_PREFIX for this FG_NHG.[mandatory]",
291279
)
292280
@clicommon.pass_db
293-
def FG_NHG_update(db, name, bucket_size, match_mode, nhg_mode, max_next_hops):
281+
def FG_NHG_update(db, name, bucket_size, match_mode, max_next_hops):
294282
""" Add object in FG_NHG. """
295283

296284
table = "FG_NHG"
@@ -300,8 +288,6 @@ def FG_NHG_update(db, name, bucket_size, match_mode, nhg_mode, max_next_hops):
300288
data["bucket_size"] = bucket_size
301289
if match_mode is not None:
302290
data["match_mode"] = match_mode
303-
if nhg_mode is not None:
304-
data["nhg_mode"] = nhg_mode
305291
if max_next_hops is not None:
306292
data["max_next_hops"] = max_next_hops
307293

show/plugins/sonic-fine-grained-ecmp_yang.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ def FG_NHG(db):
5454

5555
"BUCKET SIZE",
5656
"MATCH MODE",
57-
"NHG MODE",
5857
"MAX NEXT HOPS",
59-
6058
]
6159

6260
body = []
@@ -97,6 +95,19 @@ def FG_NHG(db):
9795
that match FG_NHG_PREFIX for this FG_NHG.', 'is-leaf-list': False, 'is-mandatory': False, 'group': ''}
9896
),
9997
]
98+
format_attr_value(
99+
entry,
100+
{'name': 'bucket_size', 'description': 'total hash bucket size desired, recommended value of Lowest Common\nMultiple of 1..{max # of next-hops}', 'is-leaf-list': False, 'is-mandatory': True, 'group': ''}
101+
),
102+
format_attr_value(
103+
entry,
104+
{'name': 'match_mode', 'description': 'The filtering method used to identify when to use Fine Grained vs regular route handling.\n -- nexthop-based filters on nexthop IPs only.\n -- route-based filters on both prefix and nexthop IPs.\n -- prefix-based filters on prefix only.', 'is-leaf-list': False, 'is-mandatory': True, 'group': ''}
105+
),
106+
format_attr_value(
107+
entry,
108+
{'name': 'max_next_hops', 'description': 'Applicable only for match_mode = prefix-based. Maximum number of nexthops that will be\nreceived in route updates for any of the prefixes that match FG_NHG_PREFIX for this FG_NHG.', 'is-leaf-list': False, 'is-mandatory': True, 'group': ''}
109+
),
110+
]
100111

101112
body.append(row)
102113

0 commit comments

Comments
 (0)