* [Intel-wired-lan] [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in queueMaxSDU
@ 2023-06-09 3:28 tee.min.tan
2023-06-11 11:17 ` Zulkifli, Muhammad Husaini
2023-06-27 6:22 ` naamax.meir
0 siblings, 2 replies; 3+ messages in thread
From: tee.min.tan @ 2023-06-09 3:28 UTC (permalink / raw)
To: intel-wired-lan; +Cc: anthony.l.nguyen
From: Tan Tee Min <tee.min.tan@linux.intel.com>
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@linux.intel.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index bbb431d..4349718 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) &&
@@ -6178,7 +6171,8 @@ 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;
}
--
1.9.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Intel-wired-lan] [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in queueMaxSDU
2023-06-09 3:28 [Intel-wired-lan] [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in queueMaxSDU tee.min.tan
@ 2023-06-11 11:17 ` Zulkifli, Muhammad Husaini
2023-06-27 6:22 ` naamax.meir
1 sibling, 0 replies; 3+ messages in thread
From: Zulkifli, Muhammad Husaini @ 2023-06-11 11:17 UTC (permalink / raw)
To: Tan, Tee Min, intel-wired-lan@osuosl.org; +Cc: Nguyen, Anthony L
> Subject: [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in
> queueMaxSDU
>
> From: Tan Tee Min <tee.min.tan@linux.intel.com>
>
> 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@linux.intel.com>
Reviewed-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_main.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index bbb431d..4349718 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)
> && @@ -6178,7 +6171,8 @@ 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;
> }
> --
> 1.9.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Intel-wired-lan] [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in queueMaxSDU
2023-06-09 3:28 [Intel-wired-lan] [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in queueMaxSDU tee.min.tan
2023-06-11 11:17 ` Zulkifli, Muhammad Husaini
@ 2023-06-27 6:22 ` naamax.meir
1 sibling, 0 replies; 3+ messages in thread
From: naamax.meir @ 2023-06-27 6:22 UTC (permalink / raw)
To: tee.min.tan, intel-wired-lan; +Cc: anthony.l.nguyen
On 6/9/2023 06:28, tee.min.tan@intel.com wrote:
> From: Tan Tee Min <tee.min.tan@linux.intel.com>
>
> 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@linux.intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_main.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-27 6:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 3:28 [Intel-wired-lan] [PATCH iwl-net v1] igc: Include the length/type field and VLAN tag in queueMaxSDU tee.min.tan
2023-06-11 11:17 ` Zulkifli, Muhammad Husaini
2023-06-27 6:22 ` naamax.meir
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox