* [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
@ 2018-03-19 17:20 Roopa Prabhu
2018-03-19 17:54 ` Stephen Hemminger
0 siblings, 1 reply; 5+ messages in thread
From: Roopa Prabhu @ 2018-03-19 17:20 UTC (permalink / raw)
To: dsahern; +Cc: netdev, nikolay
From: Roopa Prabhu <roopa@cumulusnetworks.com>
NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
Provide a bridge command option to allow a user to set
NTF_EXT_LEARNED on a bridge fdb entry.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
bridge/fdb.c | 4 +++-
man/man8/bridge.8 | 8 +++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index 205b4fa..4dbc894 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -36,7 +36,7 @@ static void usage(void)
{
fprintf(stderr,
"Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
- " [ self ] [ master ] [ use ] [ router ]\n"
+ " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
" [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
" [ port PORT] [ vni VNI ] [ via DEV ]\n"
" bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
@@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
vid = atoi(*argv);
} else if (matches(*argv, "use") == 0) {
req.ndm.ndm_flags |= NTF_USE;
+ } else if (matches(*argv, "extern_learn") == 0) {
+ req.ndm.ndm_flags |= NTF_EXT_LEARNED;
} else {
if (strcmp(*argv, "to") == 0)
NEXT_ARG();
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index 05512b0..e7f7148 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
.B dev
.IR DEV " { "
.BR local " | " static " | " dynamic " } [ "
-.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
+.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
.B dst
.IR IPADDR " ] [ "
.B vni
@@ -414,6 +414,12 @@ route shortcircuit enabled.
indicate to the kernel that the fdb entry is in use.
.sp
+.B extern_learn
+- this entry was learned externally. This option can be used to
+indicate to the kernel that an entry was hardware or user-space
+controller learnt dynamic entry. Kernel will not age such an entry.
+.sp
+
.in -8
The next command line parameters apply only
when the specified device
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
2018-03-19 17:20 [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries Roopa Prabhu
@ 2018-03-19 17:54 ` Stephen Hemminger
2018-03-19 17:56 ` David Ahern
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2018-03-19 17:54 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: dsahern, netdev, nikolay
On Mon, 19 Mar 2018 10:20:10 -0700
Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
> Provide a bridge command option to allow a user to set
> NTF_EXT_LEARNED on a bridge fdb entry.
>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> ---
> bridge/fdb.c | 4 +++-
> man/man8/bridge.8 | 8 +++++++-
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/bridge/fdb.c b/bridge/fdb.c
> index 205b4fa..4dbc894 100644
> --- a/bridge/fdb.c
> +++ b/bridge/fdb.c
> @@ -36,7 +36,7 @@ static void usage(void)
> {
> fprintf(stderr,
> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
> - " [ self ] [ master ] [ use ] [ router ]\n"
> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
> vid = atoi(*argv);
> } else if (matches(*argv, "use") == 0) {
> req.ndm.ndm_flags |= NTF_USE;
> + } else if (matches(*argv, "extern_learn") == 0) {
> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
> } else {
> if (strcmp(*argv, "to") == 0)
> NEXT_ARG();
> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
> index 05512b0..e7f7148 100644
> --- a/man/man8/bridge.8
> +++ b/man/man8/bridge.8
> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
> .B dev
> .IR DEV " { "
> .BR local " | " static " | " dynamic " } [ "
> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
> .B dst
> .IR IPADDR " ] [ "
> .B vni
> @@ -414,6 +414,12 @@ route shortcircuit enabled.
> indicate to the kernel that the fdb entry is in use.
> .sp
>
> +.B extern_learn
> +- this entry was learned externally. This option can be used to
> +indicate to the kernel that an entry was hardware or user-space
> +controller learnt dynamic entry. Kernel will not age such an entry.
> +.sp
> +
> .in -8
> The next command line parameters apply only
> when the specified device
What about displaying the flag as well?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
2018-03-19 17:54 ` Stephen Hemminger
@ 2018-03-19 17:56 ` David Ahern
2018-03-19 18:05 ` Roopa Prabhu
0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2018-03-19 17:56 UTC (permalink / raw)
To: Stephen Hemminger, Roopa Prabhu; +Cc: netdev, nikolay
On 3/19/18 11:54 AM, Stephen Hemminger wrote:
> On Mon, 19 Mar 2018 10:20:10 -0700
> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
>> Provide a bridge command option to allow a user to set
>> NTF_EXT_LEARNED on a bridge fdb entry.
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>> ---
>> bridge/fdb.c | 4 +++-
>> man/man8/bridge.8 | 8 +++++++-
>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/bridge/fdb.c b/bridge/fdb.c
>> index 205b4fa..4dbc894 100644
>> --- a/bridge/fdb.c
>> +++ b/bridge/fdb.c
>> @@ -36,7 +36,7 @@ static void usage(void)
>> {
>> fprintf(stderr,
>> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
>> - " [ self ] [ master ] [ use ] [ router ]\n"
>> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
>> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
>> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
>> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
>> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
>> vid = atoi(*argv);
>> } else if (matches(*argv, "use") == 0) {
>> req.ndm.ndm_flags |= NTF_USE;
>> + } else if (matches(*argv, "extern_learn") == 0) {
>> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
>> } else {
>> if (strcmp(*argv, "to") == 0)
>> NEXT_ARG();
>> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
>> index 05512b0..e7f7148 100644
>> --- a/man/man8/bridge.8
>> +++ b/man/man8/bridge.8
>> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
>> .B dev
>> .IR DEV " { "
>> .BR local " | " static " | " dynamic " } [ "
>> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
>> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
>> .B dst
>> .IR IPADDR " ] [ "
>> .B vni
>> @@ -414,6 +414,12 @@ route shortcircuit enabled.
>> indicate to the kernel that the fdb entry is in use.
>> .sp
>>
>> +.B extern_learn
>> +- this entry was learned externally. This option can be used to
>> +indicate to the kernel that an entry was hardware or user-space
>> +controller learnt dynamic entry. Kernel will not age such an entry.
>> +.sp
>> +
>> .in -8
>> The next command line parameters apply only
>> when the specified device
>
>
> What about displaying the flag as well?
>
Also, I believe other commands have converged on 'external' for the keyword.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
2018-03-19 17:56 ` David Ahern
@ 2018-03-19 18:05 ` Roopa Prabhu
2018-03-20 15:30 ` David Ahern
0 siblings, 1 reply; 5+ messages in thread
From: Roopa Prabhu @ 2018-03-19 18:05 UTC (permalink / raw)
To: David Ahern; +Cc: Stephen Hemminger, netdev, Nikolay Aleksandrov
On Mon, Mar 19, 2018 at 10:56 AM, David Ahern <dsahern@gmail.com> wrote:
> On 3/19/18 11:54 AM, Stephen Hemminger wrote:
>> On Mon, 19 Mar 2018 10:20:10 -0700
>> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>>
>>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>
>>> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
>>> Provide a bridge command option to allow a user to set
>>> NTF_EXT_LEARNED on a bridge fdb entry.
>>>
>>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>>> ---
>>> bridge/fdb.c | 4 +++-
>>> man/man8/bridge.8 | 8 +++++++-
>>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/bridge/fdb.c b/bridge/fdb.c
>>> index 205b4fa..4dbc894 100644
>>> --- a/bridge/fdb.c
>>> +++ b/bridge/fdb.c
>>> @@ -36,7 +36,7 @@ static void usage(void)
>>> {
>>> fprintf(stderr,
>>> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
>>> - " [ self ] [ master ] [ use ] [ router ]\n"
>>> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
>>> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
>>> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
>>> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
>>> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
>>> vid = atoi(*argv);
>>> } else if (matches(*argv, "use") == 0) {
>>> req.ndm.ndm_flags |= NTF_USE;
>>> + } else if (matches(*argv, "extern_learn") == 0) {
>>> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
>>> } else {
>>> if (strcmp(*argv, "to") == 0)
>>> NEXT_ARG();
>>> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
>>> index 05512b0..e7f7148 100644
>>> --- a/man/man8/bridge.8
>>> +++ b/man/man8/bridge.8
>>> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
>>> .B dev
>>> .IR DEV " { "
>>> .BR local " | " static " | " dynamic " } [ "
>>> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
>>> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
>>> .B dst
>>> .IR IPADDR " ] [ "
>>> .B vni
>>> @@ -414,6 +414,12 @@ route shortcircuit enabled.
>>> indicate to the kernel that the fdb entry is in use.
>>> .sp
>>>
>>> +.B extern_learn
>>> +- this entry was learned externally. This option can be used to
>>> +indicate to the kernel that an entry was hardware or user-space
>>> +controller learnt dynamic entry. Kernel will not age such an entry.
>>> +.sp
>>> +
>>> .in -8
>>> The next command line parameters apply only
>>> when the specified device
>>
>>
>> What about displaying the flag as well?
>>
>
> Also, I believe other commands have converged on 'external' for the keyword.
There is already code to display it and it displays it as
'extern_learn' (hence the choice of extern_learn)
static void fdb_print_flags(FILE *fp, unsigned int flags)
{
....
if (flags & NTF_EXT_LEARNED)
print_string(PRINT_ANY, NULL, "%s ", "extern_learn");
....
}
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
2018-03-19 18:05 ` Roopa Prabhu
@ 2018-03-20 15:30 ` David Ahern
0 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2018-03-20 15:30 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: Stephen Hemminger, netdev, Nikolay Aleksandrov
On 3/19/18 12:05 PM, Roopa Prabhu wrote:
> On Mon, Mar 19, 2018 at 10:56 AM, David Ahern <dsahern@gmail.com> wrote:
>> On 3/19/18 11:54 AM, Stephen Hemminger wrote:
>>> On Mon, 19 Mar 2018 10:20:10 -0700
>>> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>>>
>>>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>>
>>>> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
>>>> Provide a bridge command option to allow a user to set
>>>> NTF_EXT_LEARNED on a bridge fdb entry.
>>>>
>>>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>> ---
>>>> bridge/fdb.c | 4 +++-
>>>> man/man8/bridge.8 | 8 +++++++-
>>>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/bridge/fdb.c b/bridge/fdb.c
>>>> index 205b4fa..4dbc894 100644
>>>> --- a/bridge/fdb.c
>>>> +++ b/bridge/fdb.c
>>>> @@ -36,7 +36,7 @@ static void usage(void)
>>>> {
>>>> fprintf(stderr,
>>>> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
>>>> - " [ self ] [ master ] [ use ] [ router ]\n"
>>>> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
>>>> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
>>>> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
>>>> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
>>>> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
>>>> vid = atoi(*argv);
>>>> } else if (matches(*argv, "use") == 0) {
>>>> req.ndm.ndm_flags |= NTF_USE;
>>>> + } else if (matches(*argv, "extern_learn") == 0) {
>>>> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
>>>> } else {
>>>> if (strcmp(*argv, "to") == 0)
>>>> NEXT_ARG();
>>>> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
>>>> index 05512b0..e7f7148 100644
>>>> --- a/man/man8/bridge.8
>>>> +++ b/man/man8/bridge.8
>>>> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
>>>> .B dev
>>>> .IR DEV " { "
>>>> .BR local " | " static " | " dynamic " } [ "
>>>> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
>>>> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
>>>> .B dst
>>>> .IR IPADDR " ] [ "
>>>> .B vni
>>>> @@ -414,6 +414,12 @@ route shortcircuit enabled.
>>>> indicate to the kernel that the fdb entry is in use.
>>>> .sp
>>>>
>>>> +.B extern_learn
>>>> +- this entry was learned externally. This option can be used to
>>>> +indicate to the kernel that an entry was hardware or user-space
>>>> +controller learnt dynamic entry. Kernel will not age such an entry.
>>>> +.sp
>>>> +
>>>> .in -8
>>>> The next command line parameters apply only
>>>> when the specified device
>>>
>>>
>>> What about displaying the flag as well?
>>>
>>
>> Also, I believe other commands have converged on 'external' for the keyword.
>
>
> There is already code to display it and it displays it as
> 'extern_learn' (hence the choice of extern_learn)
>
> static void fdb_print_flags(FILE *fp, unsigned int flags)
>
> {
>
> ....
>
>
> if (flags & NTF_EXT_LEARNED)
>
> print_string(PRINT_ANY, NULL, "%s ", "extern_learn");
>
> ....
> }
>
ok. Applied to iproute2-next
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-20 15:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19 17:20 [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries Roopa Prabhu
2018-03-19 17:54 ` Stephen Hemminger
2018-03-19 17:56 ` David Ahern
2018-03-19 18:05 ` Roopa Prabhu
2018-03-20 15:30 ` David Ahern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).