diff mbox series

[iproute2-next] action police: make 'mtu' could be set independently in police action

Message ID 20200628014602.13002-1-po.liu@nxp.com
State Superseded
Delegated to: David Ahern
Headers show
Series [iproute2-next] action police: make 'mtu' could be set independently in police action | expand

Commit Message

Po Liu June 28, 2020, 1:46 a.m. UTC
Current police action must set 'rate' and 'burst'. 'mtu' parameter
set the max frame size and could be set alone without 'rate' and 'burst'
in some situation. Offloading to hardware for example, 'mtu' could limit
the flow max frame size.

Signed-off-by: Po Liu <po.liu@nxp.com>
---
 tc/m_police.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stephen Hemminger June 28, 2020, 8:16 p.m. UTC | #1
On Sun, 28 Jun 2020 09:46:02 +0800
Po Liu <po.liu@nxp.com> wrote:

> Current police action must set 'rate' and 'burst'. 'mtu' parameter
> set the max frame size and could be set alone without 'rate' and 'burst'
> in some situation. Offloading to hardware for example, 'mtu' could limit
> the flow max frame size.
> 
> Signed-off-by: Po Liu <po.liu@nxp.com>
> ---
>  tc/m_police.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tc/m_police.c b/tc/m_police.c
> index a5bc20c0..89497f67 100644
> --- a/tc/m_police.c
> +++ b/tc/m_police.c
> @@ -161,8 +161,8 @@ action_ctrl_ok:
>  		return -1;
>  
>  	/* Must at least do late binding, use TB or ewma policing */
> -	if (!rate64 && !avrate && !p.index) {
> -		fprintf(stderr, "\"rate\" or \"avrate\" MUST be specified.\n");
> +	if (!rate64 && !avrate && !p.index && !mtu) {
> +		fprintf(stderr, "\"rate\" or \"avrate\" or \"mtu\"MUST be specified.\n");

Missing blank.
Your message will come out as:
"rate" or "avrate" or "mtu"MUST be specified.


The quotes aren't adding to the readability, why not just remove them instead.
diff mbox series

Patch

diff --git a/tc/m_police.c b/tc/m_police.c
index a5bc20c0..89497f67 100644
--- a/tc/m_police.c
+++ b/tc/m_police.c
@@ -161,8 +161,8 @@  action_ctrl_ok:
 		return -1;
 
 	/* Must at least do late binding, use TB or ewma policing */
-	if (!rate64 && !avrate && !p.index) {
-		fprintf(stderr, "\"rate\" or \"avrate\" MUST be specified.\n");
+	if (!rate64 && !avrate && !p.index && !mtu) {
+		fprintf(stderr, "\"rate\" or \"avrate\" or \"mtu\"MUST be specified.\n");
 		return -1;
 	}