Patch "igc: Include the length/type field and VLAN tag in queueMaxSDU" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    igc: Include the length/type field and VLAN tag in queueMaxSDU

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     igc-include-the-length-type-field-and-vlan-tag-in-qu.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 94e338939954b57bd1507d45a8dfdadaee968f5b
Author: Tan Tee Min <tee.min.tan@xxxxxxxxxxxxxxx>
Date:   Fri Jun 9 11:28:42 2023 +0800

    igc: Include the length/type field and VLAN tag in queueMaxSDU
    
    [ Upstream commit 25102893e409bc02761ab82dbcfa092006404790 ]
    
    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: 92a0dcb8427d ("igc: offload queue max SDU from tc-taprio")
    Signed-off-by: Tan Tee Min <tee.min.tan@xxxxxxxxxxxxxxx>
    Reviewed-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@xxxxxxxxx>
    Tested-by: Naama Meir <naamax.meir@xxxxxxxxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 826556e609800..e7bd2c60ee383 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -1575,16 +1575,9 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
 	if (adapter->qbv_transition || tx_ring->oper_gate_closed)
 		goto out_drop;
 
-	if (tx_ring->max_sdu > 0) {
-		u32 max_sdu = 0;
-
-		max_sdu = tx_ring->max_sdu +
-			  (skb_vlan_tagged(first->skb) ? VLAN_HLEN : 0);
-
-		if (first->bytecount > max_sdu) {
-			adapter->stats.txdrop++;
-			goto out_drop;
-		}
+	if (tx_ring->max_sdu > 0 && first->bytecount > tx_ring->max_sdu) {
+		adapter->stats.txdrop++;
+		goto out_drop;
 	}
 
 	if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
@@ -6215,7 +6208,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
 		struct net_device *dev = adapter->netdev;
 
 		if (qopt->max_sdu[i])
-			ring->max_sdu = qopt->max_sdu[i] + dev->hard_header_len;
+			ring->max_sdu = qopt->max_sdu[i] + dev->hard_header_len - ETH_TLEN;
 		else
 			ring->max_sdu = 0;
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux