aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x/bnx2x_cmn.c
diff options
context:
space:
mode:
authorVladislav Zolotarov <vladz@broadcom.com>2010-12-13 00:44:09 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-16 16:15:54 -0500
commit8307fa3e86a83924dd7f8310ce1e051f34986fe8 (patch)
treee3e018d2d9505db8c6586f1f03fb92fa6ec23f7f /drivers/net/bnx2x/bnx2x_cmn.c
parentec6ba945211b1c1f97d3d19fe60f166c9a92241d (diff)
bnx2x: add a select queue callback
This callback required to allow FCoE traffic to be sent on separate priority queue from other L2 traffic, which is managed by PFC in HW. Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Shmulik Ravid-Rabinovitz <shmulikr@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_cmn.c')
-rw-r--r--drivers/net/bnx2x/bnx2x_cmn.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index fa12365faec2..10eef5434386 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -1167,6 +1167,35 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw)
1167 netif_tx_disable(bp->dev); 1167 netif_tx_disable(bp->dev);
1168} 1168}
1169 1169
1170u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)
1171{
1172#ifdef BCM_CNIC
1173 struct bnx2x *bp = netdev_priv(dev);
1174 if (NO_FCOE(bp))
1175 return skb_tx_hash(dev, skb);
1176 else {
1177 struct ethhdr *hdr = (struct ethhdr *)skb->data;
1178 u16 ether_type = ntohs(hdr->h_proto);
1179
1180 /* Skip VLAN tag if present */
1181 if (ether_type == ETH_P_8021Q) {
1182 struct vlan_ethhdr *vhdr =
1183 (struct vlan_ethhdr *)skb->data;
1184
1185 ether_type = ntohs(vhdr->h_vlan_encapsulated_proto);
1186 }
1187
1188 /* If ethertype is FCoE or FIP - use FCoE ring */
1189 if ((ether_type == ETH_P_FCOE) || (ether_type == ETH_P_FIP))
1190 return bnx2x_fcoe(bp, index);
1191 }
1192#endif
1193 /* Select a none-FCoE queue: if FCoE is enabled, exclude FCoE L2 ring
1194 */
1195 return __skb_tx_hash(dev, skb,
1196 dev->real_num_tx_queues - FCOE_CONTEXT_USE);
1197}
1198
1170void bnx2x_set_num_queues(struct bnx2x *bp) 1199void bnx2x_set_num_queues(struct bnx2x *bp)
1171{ 1200{
1172 switch (bp->multi_mode) { 1201 switch (bp->multi_mode) {