aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-06-25 17:54:46 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-26 19:44:34 -0400
commit57efd44c8cad440fb00ef8078cb018ab2f221373 (patch)
treeae668ec3ef9cd5590416d38fee4341bce8ed39a3 /drivers/net
parenta2842a1e66329798d66563b52faec1a299ec4f73 (diff)
ixgbe: Do not pad FCoE frames as this can cause issues with FCoE DDP
FCoE target mode was experiencing issues due to the fact that we were sending up data frames that were padded to 60 bytes after the DDP logic had already stripped the frame down to 52 or 56 depending on the use of VLANs. This was resulting in the FCoE DDP logic having issues since it thought the frame still had data in it due to the padding. To resolve this, adding code so that we do not pad FCoE frames prior to handling them to the stack. CC: <stable@vger.kernel.org> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@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/ethernet/intel/ixgbe/ixgbe.h4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c14
3 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 3ef3c5284e52..7af291e236bf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -196,7 +196,7 @@ enum ixgbe_ring_state_t {
196 __IXGBE_HANG_CHECK_ARMED, 196 __IXGBE_HANG_CHECK_ARMED,
197 __IXGBE_RX_RSC_ENABLED, 197 __IXGBE_RX_RSC_ENABLED,
198 __IXGBE_RX_CSUM_UDP_ZERO_ERR, 198 __IXGBE_RX_CSUM_UDP_ZERO_ERR,
199 __IXGBE_RX_FCOE_BUFSZ, 199 __IXGBE_RX_FCOE,
200}; 200};
201 201
202#define check_for_tx_hang(ring) \ 202#define check_for_tx_hang(ring) \
@@ -290,7 +290,7 @@ struct ixgbe_ring_feature {
290#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192) 290#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192)
291static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring) 291static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring)
292{ 292{
293 return test_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state) ? 1 : 0; 293 return test_bit(__IXGBE_RX_FCOE, &ring->state) ? 1 : 0;
294} 294}
295#else 295#else
296#define ixgbe_rx_pg_order(_ring) 0 296#define ixgbe_rx_pg_order(_ring) 0
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index af1a5314b494..c377706e81a8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -634,7 +634,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
634 f = &adapter->ring_feature[RING_F_FCOE]; 634 f = &adapter->ring_feature[RING_F_FCOE];
635 if ((rxr_idx >= f->mask) && 635 if ((rxr_idx >= f->mask) &&
636 (rxr_idx < f->mask + f->indices)) 636 (rxr_idx < f->mask + f->indices))
637 set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); 637 set_bit(__IXGBE_RX_FCOE, &ring->state);
638 } 638 }
639 639
640#endif /* IXGBE_FCOE */ 640#endif /* IXGBE_FCOE */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index cbb05d65960f..18ca3bcadf0c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1058,17 +1058,17 @@ static inline void ixgbe_rx_hash(struct ixgbe_ring *ring,
1058#ifdef IXGBE_FCOE 1058#ifdef IXGBE_FCOE
1059/** 1059/**
1060 * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type 1060 * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type
1061 * @adapter: address of board private structure 1061 * @ring: structure containing ring specific data
1062 * @rx_desc: advanced rx descriptor 1062 * @rx_desc: advanced rx descriptor
1063 * 1063 *
1064 * Returns : true if it is FCoE pkt 1064 * Returns : true if it is FCoE pkt
1065 */ 1065 */
1066static inline bool ixgbe_rx_is_fcoe(struct ixgbe_adapter *adapter, 1066static inline bool ixgbe_rx_is_fcoe(struct ixgbe_ring *ring,
1067 union ixgbe_adv_rx_desc *rx_desc) 1067 union ixgbe_adv_rx_desc *rx_desc)
1068{ 1068{
1069 __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; 1069 __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
1070 1070
1071 return (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 1071 return test_bit(__IXGBE_RX_FCOE, &ring->state) &&
1072 ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) == 1072 ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) ==
1073 (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE << 1073 (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE <<
1074 IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT))); 1074 IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT)));
@@ -1549,6 +1549,12 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1549 skb->truesize -= ixgbe_rx_bufsz(rx_ring); 1549 skb->truesize -= ixgbe_rx_bufsz(rx_ring);
1550 } 1550 }
1551 1551
1552#ifdef IXGBE_FCOE
1553 /* do not attempt to pad FCoE Frames as this will disrupt DDP */
1554 if (ixgbe_rx_is_fcoe(rx_ring, rx_desc))
1555 return false;
1556
1557#endif
1552 /* if skb_pad returns an error the skb was freed */ 1558 /* if skb_pad returns an error the skb was freed */
1553 if (unlikely(skb->len < 60)) { 1559 if (unlikely(skb->len < 60)) {
1554 int pad_len = 60 - skb->len; 1560 int pad_len = 60 - skb->len;
@@ -1775,7 +1781,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
1775 1781
1776#ifdef IXGBE_FCOE 1782#ifdef IXGBE_FCOE
1777 /* if ddp, not passing to ULD unless for FCP_RSP or error */ 1783 /* if ddp, not passing to ULD unless for FCP_RSP or error */
1778 if (ixgbe_rx_is_fcoe(adapter, rx_desc)) { 1784 if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) {
1779 ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); 1785 ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb);
1780 if (!ddp_bytes) { 1786 if (!ddp_bytes) {
1781 dev_kfree_skb_any(skb); 1787 dev_kfree_skb_any(skb);