[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <561D0A60.6030605@cogentembedded.com>
Date: Tue, 13 Oct 2015 16:42:56 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net
Cc: Greg Bowers <gregory.j.bowers@...el.com>, netdev@...r.kernel.org,
nhorman@...hat.com, sassmann@...hat.com, jogreene@...hat.com
Subject: Re: [net-next 06/17] i40e: Convert CEE App TLV selector to IEEE
selector
Hello.
On 10/13/2015 8:53 AM, Jeff Kirsher wrote:
> From: Greg Bowers <gregory.j.bowers@...el.com>
>
> Changes the parsing of CEE App TLVs to fill in the App selector in struct
> i40e_dcbx_config with the IEEE App selector so the caller doesn't have to
> consider whether the App came from a CEE or IEEE DCBX negotiation.
>
> Change-ID: Ia7d9d664cde04d2ebcc9822fd22e4929c6edab3a
> Signed-off-by: Greg Bowers <gregory.j.bowers@...el.com>
> Tested-by: Andrew Bowers <andrewx.bowers@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_dcb.c | 16 ++++++++++++----
> drivers/net/ethernet/intel/i40e/i40e_type.h | 2 ++
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.c b/drivers/net/ethernet/intel/i40e/i40e_dcb.c
> index 251a841..2691277 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_dcb.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.c
[...]
> @@ -397,9 +397,17 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,
> break;
> }
> dcbcfg->app[i].priority = up;
> - /* Get Selector from lower 2 bits */
> - dcbcfg->app[i].selector = (app->upper_oui_sel &
> - I40E_CEE_APP_SELECTOR_MASK);
> +
> + /* Get Selector from lower 2 bits, and convert to IEEE */
> + selector = (app->upper_oui_sel & I40E_CEE_APP_SELECTOR_MASK);
> + if (selector == I40E_CEE_APP_SEL_ETHTYPE)
> + dcbcfg->app[i].selector = I40E_APP_SEL_ETHTYPE;
> + else if (selector == I40E_CEE_APP_SEL_TCPIP)
> + dcbcfg->app[i].selector = I40E_APP_SEL_TCPIP;
> + else
> + /* Keep selector as it is for unknown types */
> + dcbcfg->app[i].selector = selector;
The above is asking to be a *switch* statement.
[...]
MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists