Subject: Re: [PATCH 2/8] dcbnl: Shorten all command handling functions

From: John Fastabend <[email-masked]>
Date: Wed, 20 Jun 2012 23:04:49 -0700

On 6/13/2012 5:54 AM, Thomas Graf wrote:
> Allocating and sending the skb in dcb_doit() allows for much
> shorter and cleaner command handling functions.
>
> The huge switch statement is replaced with an array based definition
> of the handling function and reply message type.
>
> Signed-off-by: Thomas Graf <[email-masked]>
> ---
>   net/dcb/dcbnl.c |  722 +++++++++++++------------------------------------------
>   1 files changed, 172 insertions(+), 550 deletions(-)
>

[...]

> @@ -1054,32 +885,27 @@ static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlattr **tb,
>   		}
>   	}
>
> -	ret = dcbnl_reply(0, RTM_SETDCB,
> -			  (dir ? DCB_CMD_PGRX_SCFG : DCB_CMD_PGTX_SCFG),
> -			  DCB_ATTR_PG_CFG, pid, seq, flags);
> +	ret = nla_put_u8(skb, (dir ? DCB_CMD_PGRX_SCFG : DCB_CMD_PGTX_SCFG), 0);

Previously, this returned DCB_ATTR_PG_CFG now it is returning RX or TX
variants. Although I like this implementation better I think in order
to not break user space application we should keep the previous
behavior. At least one app is checking these return codes.

I'll post a patch shortly. Thomas if you ACK it that would be great.

Thanks,
John