Skip to content

Commit 2510289

Browse files
Tan Tee Minanguy11
authored andcommitted
igc: Include the length/type field and VLAN tag in queueMaxSDU
IEEE 802.1Q does not have clear definitions of what constitutes an SDU (Service Data Unit), but IEEE Std 802.3 clause 3.1.2 does define the MAC service primitives and clause 3.2.7 does define the MAC Client Data for Q-tagged frames. It shows that the mac_service_data_unit (MSDU) does NOT contain the preamble, destination and source address, or FCS. The MSDU does contain the length/type field, MAC client data, VLAN tag and any padding data (prior to the FCS). Thus, the maximum 802.3 frame size that is allowed to be transmitted should be QueueMaxSDU (MSDU) + 16 (6 byte SA + 6 byte DA + 4 byte FCS). Fixes: 92a0dcb ("igc: offload queue max SDU from tc-taprio") Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com> Reviewed-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com> Tested-by: Naama Meir <naamax.meir@linux.intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 9ac3fc2 commit 2510289

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,16 +1575,9 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
15751575
if (adapter->qbv_transition || tx_ring->oper_gate_closed)
15761576
goto out_drop;
15771577

1578-
if (tx_ring->max_sdu > 0) {
1579-
u32 max_sdu = 0;
1580-
1581-
max_sdu = tx_ring->max_sdu +
1582-
(skb_vlan_tagged(first->skb) ? VLAN_HLEN : 0);
1583-
1584-
if (first->bytecount > max_sdu) {
1585-
adapter->stats.txdrop++;
1586-
goto out_drop;
1587-
}
1578+
if (tx_ring->max_sdu > 0 && first->bytecount > tx_ring->max_sdu) {
1579+
adapter->stats.txdrop++;
1580+
goto out_drop;
15881581
}
15891582

15901583
if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
@@ -6231,7 +6224,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
62316224
struct net_device *dev = adapter->netdev;
62326225

62336226
if (qopt->max_sdu[i])
6234-
ring->max_sdu = qopt->max_sdu[i] + dev->hard_header_len;
6227+
ring->max_sdu = qopt->max_sdu[i] + dev->hard_header_len - ETH_TLEN;
62356228
else
62366229
ring->max_sdu = 0;
62376230
}

0 commit comments

Comments
 (0)