aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-02-23 00:57:52 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-12 07:11:11 -0500
commitdc166e22ede5ffb46b5b18b99ba0321ae545f89b (patch)
tree7e83a3db691fae1502f49453888762e9325e76d7
parentf8628d404505e61bfc63638744656ede69227766 (diff)
ixgbe: DCB remove ixgbe_fcoe_getapp routine
Remove ixgbe_fcoe_getapp() and use the generic kernel routine instead. Also add application priority to the kernel maintained list on setapp so applications and stacks can query the value. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c28
-rw-r--r--drivers/net/ixgbe/ixgbe_fcoe.c15
2 files changed, 13 insertions, 30 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 8d139f7b393a..d4b2914376db 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -542,24 +542,15 @@ static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
542static u8 ixgbe_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id) 542static u8 ixgbe_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id)
543{ 543{
544 struct ixgbe_adapter *adapter = netdev_priv(netdev); 544 struct ixgbe_adapter *adapter = netdev_priv(netdev);
545 u8 rval = 0; 545 struct dcb_app app = {
546 .selector = idtype,
547 .protocol = id,
548 };
546 549
547 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) 550 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
548 return rval; 551 return 0;
549 552
550 switch (idtype) { 553 return dcb_getapp(netdev, &app);
551 case DCB_APP_IDTYPE_ETHTYPE:
552#ifdef IXGBE_FCOE
553 if (id == ETH_P_FCOE)
554 rval = ixgbe_fcoe_getapp(adapter);
555#endif
556 break;
557 case DCB_APP_IDTYPE_PORTNUM:
558 break;
559 default:
560 break;
561 }
562 return rval;
563} 554}
564 555
565/** 556/**
@@ -576,10 +567,17 @@ static u8 ixgbe_dcbnl_setapp(struct net_device *netdev,
576{ 567{
577 struct ixgbe_adapter *adapter = netdev_priv(netdev); 568 struct ixgbe_adapter *adapter = netdev_priv(netdev);
578 u8 rval = 1; 569 u8 rval = 1;
570 struct dcb_app app = {
571 .selector = idtype,
572 .protocol = id,
573 .priority = up
574 };
579 575
580 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) 576 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
581 return rval; 577 return rval;
582 578
579 rval = dcb_setapp(netdev, &app);
580
583 switch (idtype) { 581 switch (idtype) {
584 case DCB_APP_IDTYPE_ETHTYPE: 582 case DCB_APP_IDTYPE_ETHTYPE:
585#ifdef IXGBE_FCOE 583#ifdef IXGBE_FCOE
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index 00af15a9cdc6..dba7d77588ef 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -813,21 +813,6 @@ out_disable:
813 813
814#ifdef CONFIG_IXGBE_DCB 814#ifdef CONFIG_IXGBE_DCB
815/** 815/**
816 * ixgbe_fcoe_getapp - retrieves current user priority bitmap for FCoE
817 * @adapter : ixgbe adapter
818 *
819 * Finds out the corresponding user priority bitmap from the current
820 * traffic class that FCoE belongs to. Returns 0 as the invalid user
821 * priority bitmap to indicate an error.
822 *
823 * Returns : 802.1p user priority bitmap for FCoE
824 */
825u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter)
826{
827 return 1 << adapter->fcoe.up;
828}
829
830/**
831 * ixgbe_fcoe_setapp - sets the user priority bitmap for FCoE 816 * ixgbe_fcoe_setapp - sets the user priority bitmap for FCoE
832 * @adapter : ixgbe adapter 817 * @adapter : ixgbe adapter
833 * @up : 802.1p user priority bitmap 818 * @up : 802.1p user priority bitmap