Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225165
b: refs/heads/master
c: 8307fa3
h: refs/heads/master
i:
  225163: c629c43
v: v3
  • Loading branch information
Vladislav Zolotarov authored and David S. Miller committed Dec 16, 2010
1 parent 706a62a commit 3155ba7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec6ba945211b1c1f97d3d19fe60f166c9a92241d
refs/heads/master: 8307fa3e86a83924dd7f8310ce1e051f34986fe8
29 changes: 29 additions & 0 deletions trunk/drivers/net/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,35 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw)
netif_tx_disable(bp->dev);
}

u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)
{
#ifdef BCM_CNIC
struct bnx2x *bp = netdev_priv(dev);
if (NO_FCOE(bp))
return skb_tx_hash(dev, skb);
else {
struct ethhdr *hdr = (struct ethhdr *)skb->data;
u16 ether_type = ntohs(hdr->h_proto);

/* Skip VLAN tag if present */
if (ether_type == ETH_P_8021Q) {
struct vlan_ethhdr *vhdr =
(struct vlan_ethhdr *)skb->data;

ether_type = ntohs(vhdr->h_vlan_encapsulated_proto);
}

/* If ethertype is FCoE or FIP - use FCoE ring */
if ((ether_type == ETH_P_FCOE) || (ether_type == ETH_P_FIP))
return bnx2x_fcoe(bp, index);
}
#endif
/* Select a none-FCoE queue: if FCoE is enabled, exclude FCoE L2 ring
*/
return __skb_tx_hash(dev, skb,
dev->real_num_tx_queues - FCOE_CONTEXT_USE);
}

void bnx2x_set_num_queues(struct bnx2x *bp)
{
switch (bp->multi_mode) {
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode);
/* hard_xmit callback */
netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev);

/* select_queue callback */
u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb);

int bnx2x_change_mac_addr(struct net_device *dev, void *p);

/* NAPI poll Rx part */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8977,6 +8977,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
.ndo_open = bnx2x_open,
.ndo_stop = bnx2x_close,
.ndo_start_xmit = bnx2x_start_xmit,
.ndo_select_queue = bnx2x_select_queue,
.ndo_set_multicast_list = bnx2x_set_rx_mode,
.ndo_set_mac_address = bnx2x_change_mac_addr,
.ndo_validate_addr = eth_validate_addr,
Expand Down

0 comments on commit 3155ba7

Please sign in to comment.