Skip to content

Commit 57efd44

Browse files
Alexander Duyckdavem330
authored andcommitted
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: <[email protected]> Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Phil Schmitt <[email protected]> Tested-by: Ross Brattain <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a2842a1 commit 57efd44

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ enum ixgbe_ring_state_t {
196196
__IXGBE_HANG_CHECK_ARMED,
197197
__IXGBE_RX_RSC_ENABLED,
198198
__IXGBE_RX_CSUM_UDP_ZERO_ERR,
199-
__IXGBE_RX_FCOE_BUFSZ,
199+
__IXGBE_RX_FCOE,
200200
};
201201

202202
#define check_for_tx_hang(ring) \
@@ -290,7 +290,7 @@ struct ixgbe_ring_feature {
290290
#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192)
291291
static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring)
292292
{
293-
return test_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state) ? 1 : 0;
293+
return test_bit(__IXGBE_RX_FCOE, &ring->state) ? 1 : 0;
294294
}
295295
#else
296296
#define ixgbe_rx_pg_order(_ring) 0

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
634634
f = &adapter->ring_feature[RING_F_FCOE];
635635
if ((rxr_idx >= f->mask) &&
636636
(rxr_idx < f->mask + f->indices))
637-
set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state);
637+
set_bit(__IXGBE_RX_FCOE, &ring->state);
638638
}
639639

640640
#endif /* IXGBE_FCOE */

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,17 +1058,17 @@ static inline void ixgbe_rx_hash(struct ixgbe_ring *ring,
10581058
#ifdef IXGBE_FCOE
10591059
/**
10601060
* 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
10621062
* @rx_desc: advanced rx descriptor
10631063
*
10641064
* Returns : true if it is FCoE pkt
10651065
*/
1066-
static inline bool ixgbe_rx_is_fcoe(struct ixgbe_adapter *adapter,
1066+
static inline bool ixgbe_rx_is_fcoe(struct ixgbe_ring *ring,
10671067
union ixgbe_adv_rx_desc *rx_desc)
10681068
{
10691069
__le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
10701070

1071-
return (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
1071+
return test_bit(__IXGBE_RX_FCOE, &ring->state) &&
10721072
((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) ==
10731073
(cpu_to_le16(IXGBE_ETQF_FILTER_FCOE <<
10741074
IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT)));
@@ -1549,6 +1549,12 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
15491549
skb->truesize -= ixgbe_rx_bufsz(rx_ring);
15501550
}
15511551

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
15521558
/* if skb_pad returns an error the skb was freed */
15531559
if (unlikely(skb->len < 60)) {
15541560
int pad_len = 60 - skb->len;
@@ -1775,7 +1781,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
17751781

17761782
#ifdef IXGBE_FCOE
17771783
/* 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)) {
17791785
ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb);
17801786
if (!ddp_bytes) {
17811787
dev_kfree_skb_any(skb);

0 commit comments

Comments
 (0)