aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_fcoe.c
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-12-03 06:32:22 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 18:43:20 -0500
commit61a0f421ceccd52d0d893daf743b04c225ba5ef0 (patch)
tree5837bb8dd5e668c5aeac70a26331b9445d1dc34f /drivers/net/ixgbe/ixgbe_fcoe.c
parent69ee472f2706371ca639de49b06df91615c07d8d (diff)
ixgbe: use known user priority for FCoE when DCB is enabled
Store the user priority for FCoE and use it directly for outgoing FCoE traffic when DCB is enabled. Signed-off-by: Yi Zou <yi.zou@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_fcoe.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_fcoe.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index edecdc853c14..da32a108a7b4 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -499,6 +499,10 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
499 struct ixgbe_hw *hw = &adapter->hw; 499 struct ixgbe_hw *hw = &adapter->hw;
500 struct ixgbe_fcoe *fcoe = &adapter->fcoe; 500 struct ixgbe_fcoe *fcoe = &adapter->fcoe;
501 struct ixgbe_ring_feature *f = &adapter->ring_feature[RING_F_FCOE]; 501 struct ixgbe_ring_feature *f = &adapter->ring_feature[RING_F_FCOE];
502#ifdef CONFIG_IXGBE_DCB
503 u8 tc;
504 u32 up2tc;
505#endif
502 506
503 /* create the pool for ddp if not created yet */ 507 /* create the pool for ddp if not created yet */
504 if (!fcoe->pool) { 508 if (!fcoe->pool) {
@@ -540,6 +544,17 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
540 IXGBE_FCRXCTRL_FCOELLI | 544 IXGBE_FCRXCTRL_FCOELLI |
541 IXGBE_FCRXCTRL_FCCRCBO | 545 IXGBE_FCRXCTRL_FCCRCBO |
542 (FC_FCOE_VER << IXGBE_FCRXCTRL_FCOEVER_SHIFT)); 546 (FC_FCOE_VER << IXGBE_FCRXCTRL_FCOEVER_SHIFT));
547#ifdef CONFIG_IXGBE_DCB
548 up2tc = IXGBE_READ_REG(&adapter->hw, IXGBE_RTTUP2TC);
549 for (i = 0; i < MAX_USER_PRIORITY; i++) {
550 tc = (u8)(up2tc >> (i * IXGBE_RTTUP2TC_UP_SHIFT));
551 tc &= (MAX_TRAFFIC_CLASS - 1);
552 if (fcoe->tc == tc) {
553 fcoe->up = i;
554 break;
555 }
556 }
557#endif
543} 558}
544 559
545/** 560/**
@@ -671,19 +686,7 @@ out_disable:
671 */ 686 */
672u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter) 687u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter)
673{ 688{
674 int i; 689 return 1 << adapter->fcoe.up;
675 u8 tc;
676 u32 up2tc;
677
678 up2tc = IXGBE_READ_REG(&adapter->hw, IXGBE_RTTUP2TC);
679 for (i = 0; i < MAX_USER_PRIORITY; i++) {
680 tc = (u8)(up2tc >> (i * IXGBE_RTTUP2TC_UP_SHIFT));
681 tc &= (MAX_TRAFFIC_CLASS - 1);
682 if (adapter->fcoe.tc == tc)
683 return 1 << i;
684 }
685
686 return 0;
687} 690}
688 691
689/** 692/**
@@ -710,6 +713,7 @@ u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up)
710 up2tc >>= (i * IXGBE_RTTUP2TC_UP_SHIFT); 713 up2tc >>= (i * IXGBE_RTTUP2TC_UP_SHIFT);
711 up2tc &= (MAX_TRAFFIC_CLASS - 1); 714 up2tc &= (MAX_TRAFFIC_CLASS - 1);
712 adapter->fcoe.tc = (u8)up2tc; 715 adapter->fcoe.tc = (u8)up2tc;
716 adapter->fcoe.up = i;
713 return 0; 717 return 0;
714 } 718 }
715 } 719 }