diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-12-22 12:57:02 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-12-22 12:57:02 -0500 |
commit | 4b7bd364700d9ac8372eff48832062b936d0793b (patch) | |
tree | 0dbf78c95456a0b02d07fcd473281f04a87e266d /drivers/net/ixgbe/ixgbe_main.c | |
parent | c0d8768af260e2cbb4bf659ae6094a262c86b085 (diff) | |
parent | 90a8a73c06cc32b609a880d48449d7083327e11a (diff) |
Merge branch 'master' into for-next
Conflicts:
MAINTAINERS
arch/arm/mach-omap2/pm24xx.c
drivers/scsi/bfa/bfa_fcpim.c
Needed to update to apply fixes for which the old branch was too
outdated.
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 2bd3eb4ee5a1..eee0b298bd36 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -764,8 +764,9 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
764 | #ifdef IXGBE_FCOE | 764 | #ifdef IXGBE_FCOE |
765 | /* adjust for FCoE Sequence Offload */ | 765 | /* adjust for FCoE Sequence Offload */ |
766 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) | 766 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) |
767 | && (skb->protocol == htons(ETH_P_FCOE)) && | 767 | && skb_is_gso(skb) |
768 | skb_is_gso(skb)) { | 768 | && vlan_get_protocol(skb) == |
769 | htons(ETH_P_FCOE)) { | ||
769 | hlen = skb_transport_offset(skb) + | 770 | hlen = skb_transport_offset(skb) + |
770 | sizeof(struct fc_frame_header) + | 771 | sizeof(struct fc_frame_header) + |
771 | sizeof(struct fcoe_crc_eof); | 772 | sizeof(struct fcoe_crc_eof); |
@@ -4770,6 +4771,9 @@ void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter) | |||
4770 | adapter->rx_ring[i] = NULL; | 4771 | adapter->rx_ring[i] = NULL; |
4771 | } | 4772 | } |
4772 | 4773 | ||
4774 | adapter->num_tx_queues = 0; | ||
4775 | adapter->num_rx_queues = 0; | ||
4776 | |||
4773 | ixgbe_free_q_vectors(adapter); | 4777 | ixgbe_free_q_vectors(adapter); |
4774 | ixgbe_reset_interrupt_capability(adapter); | 4778 | ixgbe_reset_interrupt_capability(adapter); |
4775 | } | 4779 | } |
@@ -5823,7 +5827,7 @@ static void ixgbe_watchdog_task(struct work_struct *work) | |||
5823 | 5827 | ||
5824 | static int ixgbe_tso(struct ixgbe_adapter *adapter, | 5828 | static int ixgbe_tso(struct ixgbe_adapter *adapter, |
5825 | struct ixgbe_ring *tx_ring, struct sk_buff *skb, | 5829 | struct ixgbe_ring *tx_ring, struct sk_buff *skb, |
5826 | u32 tx_flags, u8 *hdr_len) | 5830 | u32 tx_flags, u8 *hdr_len, __be16 protocol) |
5827 | { | 5831 | { |
5828 | struct ixgbe_adv_tx_context_desc *context_desc; | 5832 | struct ixgbe_adv_tx_context_desc *context_desc; |
5829 | unsigned int i; | 5833 | unsigned int i; |
@@ -5841,7 +5845,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5841 | l4len = tcp_hdrlen(skb); | 5845 | l4len = tcp_hdrlen(skb); |
5842 | *hdr_len += l4len; | 5846 | *hdr_len += l4len; |
5843 | 5847 | ||
5844 | if (skb->protocol == htons(ETH_P_IP)) { | 5848 | if (protocol == htons(ETH_P_IP)) { |
5845 | struct iphdr *iph = ip_hdr(skb); | 5849 | struct iphdr *iph = ip_hdr(skb); |
5846 | iph->tot_len = 0; | 5850 | iph->tot_len = 0; |
5847 | iph->check = 0; | 5851 | iph->check = 0; |
@@ -5880,7 +5884,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5880 | type_tucmd_mlhl = (IXGBE_TXD_CMD_DEXT | | 5884 | type_tucmd_mlhl = (IXGBE_TXD_CMD_DEXT | |
5881 | IXGBE_ADVTXD_DTYP_CTXT); | 5885 | IXGBE_ADVTXD_DTYP_CTXT); |
5882 | 5886 | ||
5883 | if (skb->protocol == htons(ETH_P_IP)) | 5887 | if (protocol == htons(ETH_P_IP)) |
5884 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; | 5888 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; |
5885 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; | 5889 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; |
5886 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); | 5890 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); |
@@ -5906,16 +5910,10 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5906 | return false; | 5910 | return false; |
5907 | } | 5911 | } |
5908 | 5912 | ||
5909 | static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb) | 5913 | static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb, |
5914 | __be16 protocol) | ||
5910 | { | 5915 | { |
5911 | u32 rtn = 0; | 5916 | u32 rtn = 0; |
5912 | __be16 protocol; | ||
5913 | |||
5914 | if (skb->protocol == cpu_to_be16(ETH_P_8021Q)) | ||
5915 | protocol = ((const struct vlan_ethhdr *)skb->data)-> | ||
5916 | h_vlan_encapsulated_proto; | ||
5917 | else | ||
5918 | protocol = skb->protocol; | ||
5919 | 5917 | ||
5920 | switch (protocol) { | 5918 | switch (protocol) { |
5921 | case cpu_to_be16(ETH_P_IP): | 5919 | case cpu_to_be16(ETH_P_IP): |
@@ -5943,7 +5941,7 @@ static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb) | |||
5943 | default: | 5941 | default: |
5944 | if (unlikely(net_ratelimit())) | 5942 | if (unlikely(net_ratelimit())) |
5945 | e_warn(probe, "partial checksum but proto=%x!\n", | 5943 | e_warn(probe, "partial checksum but proto=%x!\n", |
5946 | skb->protocol); | 5944 | protocol); |
5947 | break; | 5945 | break; |
5948 | } | 5946 | } |
5949 | 5947 | ||
@@ -5952,7 +5950,8 @@ static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb) | |||
5952 | 5950 | ||
5953 | static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | 5951 | static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, |
5954 | struct ixgbe_ring *tx_ring, | 5952 | struct ixgbe_ring *tx_ring, |
5955 | struct sk_buff *skb, u32 tx_flags) | 5953 | struct sk_buff *skb, u32 tx_flags, |
5954 | __be16 protocol) | ||
5956 | { | 5955 | { |
5957 | struct ixgbe_adv_tx_context_desc *context_desc; | 5956 | struct ixgbe_adv_tx_context_desc *context_desc; |
5958 | unsigned int i; | 5957 | unsigned int i; |
@@ -5981,7 +5980,7 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | |||
5981 | IXGBE_ADVTXD_DTYP_CTXT); | 5980 | IXGBE_ADVTXD_DTYP_CTXT); |
5982 | 5981 | ||
5983 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 5982 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
5984 | type_tucmd_mlhl |= ixgbe_psum(adapter, skb); | 5983 | type_tucmd_mlhl |= ixgbe_psum(adapter, skb, protocol); |
5985 | 5984 | ||
5986 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); | 5985 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); |
5987 | /* use index zero for tx checksum offload */ | 5986 | /* use index zero for tx checksum offload */ |
@@ -6179,7 +6178,7 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | |||
6179 | } | 6178 | } |
6180 | 6179 | ||
6181 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | 6180 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, |
6182 | int queue, u32 tx_flags) | 6181 | int queue, u32 tx_flags, __be16 protocol) |
6183 | { | 6182 | { |
6184 | struct ixgbe_atr_input atr_input; | 6183 | struct ixgbe_atr_input atr_input; |
6185 | struct tcphdr *th; | 6184 | struct tcphdr *th; |
@@ -6190,7 +6189,7 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | |||
6190 | u8 l4type = 0; | 6189 | u8 l4type = 0; |
6191 | 6190 | ||
6192 | /* Right now, we support IPv4 only */ | 6191 | /* Right now, we support IPv4 only */ |
6193 | if (skb->protocol != htons(ETH_P_IP)) | 6192 | if (protocol != htons(ETH_P_IP)) |
6194 | return; | 6193 | return; |
6195 | /* check if we're UDP or TCP */ | 6194 | /* check if we're UDP or TCP */ |
6196 | if (iph->protocol == IPPROTO_TCP) { | 6195 | if (iph->protocol == IPPROTO_TCP) { |
@@ -6257,10 +6256,13 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
6257 | { | 6256 | { |
6258 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 6257 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
6259 | int txq = smp_processor_id(); | 6258 | int txq = smp_processor_id(); |
6260 | |||
6261 | #ifdef IXGBE_FCOE | 6259 | #ifdef IXGBE_FCOE |
6262 | if ((skb->protocol == htons(ETH_P_FCOE)) || | 6260 | __be16 protocol; |
6263 | (skb->protocol == htons(ETH_P_FIP))) { | 6261 | |
6262 | protocol = vlan_get_protocol(skb); | ||
6263 | |||
6264 | if ((protocol == htons(ETH_P_FCOE)) || | ||
6265 | (protocol == htons(ETH_P_FIP))) { | ||
6264 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { | 6266 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { |
6265 | txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1); | 6267 | txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1); |
6266 | txq += adapter->ring_feature[RING_F_FCOE].mask; | 6268 | txq += adapter->ring_feature[RING_F_FCOE].mask; |
@@ -6303,6 +6305,9 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6303 | int tso; | 6305 | int tso; |
6304 | int count = 0; | 6306 | int count = 0; |
6305 | unsigned int f; | 6307 | unsigned int f; |
6308 | __be16 protocol; | ||
6309 | |||
6310 | protocol = vlan_get_protocol(skb); | ||
6306 | 6311 | ||
6307 | if (vlan_tx_tag_present(skb)) { | 6312 | if (vlan_tx_tag_present(skb)) { |
6308 | tx_flags |= vlan_tx_tag_get(skb); | 6313 | tx_flags |= vlan_tx_tag_get(skb); |
@@ -6323,8 +6328,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6323 | /* for FCoE with DCB, we force the priority to what | 6328 | /* for FCoE with DCB, we force the priority to what |
6324 | * was specified by the switch */ | 6329 | * was specified by the switch */ |
6325 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED && | 6330 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED && |
6326 | (skb->protocol == htons(ETH_P_FCOE) || | 6331 | (protocol == htons(ETH_P_FCOE) || |
6327 | skb->protocol == htons(ETH_P_FIP))) { | 6332 | protocol == htons(ETH_P_FIP))) { |
6328 | #ifdef CONFIG_IXGBE_DCB | 6333 | #ifdef CONFIG_IXGBE_DCB |
6329 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 6334 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
6330 | tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK | 6335 | tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK |
@@ -6334,7 +6339,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6334 | } | 6339 | } |
6335 | #endif | 6340 | #endif |
6336 | /* flag for FCoE offloads */ | 6341 | /* flag for FCoE offloads */ |
6337 | if (skb->protocol == htons(ETH_P_FCOE)) | 6342 | if (protocol == htons(ETH_P_FCOE)) |
6338 | tx_flags |= IXGBE_TX_FLAGS_FCOE; | 6343 | tx_flags |= IXGBE_TX_FLAGS_FCOE; |
6339 | } | 6344 | } |
6340 | #endif | 6345 | #endif |
@@ -6368,9 +6373,10 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6368 | tx_flags |= IXGBE_TX_FLAGS_FSO; | 6373 | tx_flags |= IXGBE_TX_FLAGS_FSO; |
6369 | #endif /* IXGBE_FCOE */ | 6374 | #endif /* IXGBE_FCOE */ |
6370 | } else { | 6375 | } else { |
6371 | if (skb->protocol == htons(ETH_P_IP)) | 6376 | if (protocol == htons(ETH_P_IP)) |
6372 | tx_flags |= IXGBE_TX_FLAGS_IPV4; | 6377 | tx_flags |= IXGBE_TX_FLAGS_IPV4; |
6373 | tso = ixgbe_tso(adapter, tx_ring, skb, tx_flags, &hdr_len); | 6378 | tso = ixgbe_tso(adapter, tx_ring, skb, tx_flags, &hdr_len, |
6379 | protocol); | ||
6374 | if (tso < 0) { | 6380 | if (tso < 0) { |
6375 | dev_kfree_skb_any(skb); | 6381 | dev_kfree_skb_any(skb); |
6376 | return NETDEV_TX_OK; | 6382 | return NETDEV_TX_OK; |
@@ -6378,7 +6384,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6378 | 6384 | ||
6379 | if (tso) | 6385 | if (tso) |
6380 | tx_flags |= IXGBE_TX_FLAGS_TSO; | 6386 | tx_flags |= IXGBE_TX_FLAGS_TSO; |
6381 | else if (ixgbe_tx_csum(adapter, tx_ring, skb, tx_flags) && | 6387 | else if (ixgbe_tx_csum(adapter, tx_ring, skb, tx_flags, |
6388 | protocol) && | ||
6382 | (skb->ip_summed == CHECKSUM_PARTIAL)) | 6389 | (skb->ip_summed == CHECKSUM_PARTIAL)) |
6383 | tx_flags |= IXGBE_TX_FLAGS_CSUM; | 6390 | tx_flags |= IXGBE_TX_FLAGS_CSUM; |
6384 | } | 6391 | } |
@@ -6392,7 +6399,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6392 | test_bit(__IXGBE_FDIR_INIT_DONE, | 6399 | test_bit(__IXGBE_FDIR_INIT_DONE, |
6393 | &tx_ring->reinit_state)) { | 6400 | &tx_ring->reinit_state)) { |
6394 | ixgbe_atr(adapter, skb, tx_ring->queue_index, | 6401 | ixgbe_atr(adapter, skb, tx_ring->queue_index, |
6395 | tx_flags); | 6402 | tx_flags, protocol); |
6396 | tx_ring->atr_count = 0; | 6403 | tx_ring->atr_count = 0; |
6397 | } | 6404 | } |
6398 | } | 6405 | } |