Skip to content

Commit

Permalink
cxgb4 : Only pass app selector of 0 or 3 to firmware
Browse files Browse the repository at this point in the history
This keeps app format passed to firmware the same irrespective
of DCBx version in use.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Anish Bhatt authored and David S. Miller committed Jul 21, 2015
1 parent b52effd commit a44e7b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,9 @@ static int __cxgb4_getapp(struct net_device *dev, u8 app_idtype, u16 app_id,
*/
static int cxgb4_getapp(struct net_device *dev, u8 app_idtype, u16 app_id)
{
return __cxgb4_getapp(dev, app_idtype, app_id, 0);
/* Convert app_idtype to firmware format before querying */
return __cxgb4_getapp(dev, app_idtype == DCB_APP_IDTYPE_ETHTYPE ?
app_idtype : 3, app_id, 0);
}

/* Write a new Application User Priority Map for the specified Application ID
Expand Down Expand Up @@ -1133,7 +1135,7 @@ static int cxgb4_getpeerapp_tbl(struct net_device *dev, struct dcb_app *table)
if (!pcmd.u.dcb.app_priority.protocolid)
break;

table[i].selector = pcmd.u.dcb.app_priority.sel_field;
table[i].selector = (pcmd.u.dcb.app_priority.sel_field + 1);
table[i].protocol =
be16_to_cpu(pcmd.u.dcb.app_priority.protocolid);
table[i].priority =
Expand Down

0 comments on commit a44e7b7

Please sign in to comment.