aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLucy Liu <lucy.liu@intel.com>2009-07-22 10:07:33 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-23 14:05:31 -0400
commit601278659d5717b4f7a14fbc9f2b9d559bba6aef (patch)
tree8f283d6b9266277181907bb2cf37570a3b052443 /drivers/net
parent0d5515894fd5b9e9402ef76e9a7e704fd26e0e5f (diff)
ixgbe: Don't priority tag control frames in DCB mode
Certain types of control packets (LLDP, LACP, etc.) are not supposed to have a priority tag or vlan tag inserted. Ixgbe driver is currently priority tagging everything (if packet is not on a VLAN interface). This patch modifies DCB mode, so that packets marked with skb priority TC_PRIO_CONTROL are not priority tagged. It also transmits these packets on the highest priority traffic class. Programs (like dcbd) can set the skb priority using a socket option. Or, a tc filter can be configured to set the priority value. Using the value TC_PRIO_CONTROL (7) has the benefit that it is already defined in the kernel, and the bonding LACP code already sets the skb->priority field to this value. Signed-off-by: Lucy Liu <lucy.liu@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')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a2119d79ccdd..47a3c6d70569 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -34,6 +34,7 @@
34#include <linux/in.h> 34#include <linux/in.h>
35#include <linux/ip.h> 35#include <linux/ip.h>
36#include <linux/tcp.h> 36#include <linux/tcp.h>
37#include <linux/pkt_sched.h>
37#include <linux/ipv6.h> 38#include <linux/ipv6.h>
38#include <net/checksum.h> 39#include <net/checksum.h>
39#include <net/ip6_checksum.h> 40#include <net/ip6_checksum.h>
@@ -5126,9 +5127,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5126 int count = 0; 5127 int count = 0;
5127 unsigned int f; 5128 unsigned int f;
5128 5129
5129 r_idx = skb->queue_mapping;
5130 tx_ring = &adapter->tx_ring[r_idx];
5131
5132 if (adapter->vlgrp && vlan_tx_tag_present(skb)) { 5130 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
5133 tx_flags |= vlan_tx_tag_get(skb); 5131 tx_flags |= vlan_tx_tag_get(skb);
5134 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5132 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
@@ -5138,11 +5136,19 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5138 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5136 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5139 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5137 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5140 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5138 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
5141 tx_flags |= (skb->queue_mapping << 13); 5139 if (skb->priority != TC_PRIO_CONTROL) {
5142 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5140 tx_flags |= (skb->queue_mapping << 13);
5143 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5141 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5142 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5143 } else {
5144 skb->queue_mapping =
5145 adapter->ring_feature[RING_F_DCB].indices-1;
5146 }
5144 } 5147 }
5145 5148
5149 r_idx = skb->queue_mapping;
5150 tx_ring = &adapter->tx_ring[r_idx];
5151
5146 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 5152 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
5147 (skb->protocol == htons(ETH_P_FCOE))) 5153 (skb->protocol == htons(ETH_P_FCOE)))
5148 tx_flags |= IXGBE_TX_FLAGS_FCOE; 5154 tx_flags |= IXGBE_TX_FLAGS_FCOE;