mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 08:12:53 +00:00
nss-drv: backport 12.5 ipq50xx fixes
First attempt at backporting the 12.5 ipq50xx fixes to 11.4. Fixes compilation errors, but not tested on hardware yet. Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
parent
709ddc324a
commit
18a9e76182
161
qca-nss-drv/patches-11.4/0030-backport-12.5-ipq50xx-fixes.patch
Normal file
161
qca-nss-drv/patches-11.4/0030-backport-12.5-ipq50xx-fixes.patch
Normal file
@ -0,0 +1,161 @@
|
||||
--- a/nss_data_plane/hal/nss_ipq50xx.c
|
||||
+++ b/nss_data_plane/hal/nss_ipq50xx.c
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -65,11 +67,15 @@ void nss_data_plane_hal_set_features(str
|
||||
dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES;
|
||||
|
||||
/*
|
||||
+ * We advertise checksum offload for VLANs.
|
||||
* Synopsys GMAC does not support checksum offload for QinQ VLANs.
|
||||
- * Hence, we do not advertise checksum offload support for VLANs.
|
||||
+ * However, we are dependent on netdev ops ndo_features_check to block
|
||||
+ * QinQ VLAN TSO/checksum offload.
|
||||
*/
|
||||
- dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES &
|
||||
- (~(NETIF_F_RXCSUM | NETIF_F_HW_CSUM));
|
||||
+ dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES;
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))
|
||||
+ dpc->dev->vlan_features &= ~NETIF_F_UFO;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -82,34 +88,37 @@ void nss_data_plane_hal_stats_sync(struc
|
||||
|
||||
spin_lock_bh(&nss_data_plane_hal_gmac_stats_lock);
|
||||
|
||||
- gmac_stats->rx_bytes += stats->if_stats.rx_bytes;
|
||||
- gmac_stats->rx_packets += stats->if_stats.rx_packets;
|
||||
- gmac_stats->rx_errors += stats->estats.rx_errors;
|
||||
- gmac_stats->rx_receive_errors += stats->estats.rx_receive_errors;
|
||||
- gmac_stats->rx_descriptor_errors += stats->estats.rx_descriptor_errors;
|
||||
- gmac_stats->rx_late_collision_errors += stats->estats.rx_late_collision_errors;
|
||||
- gmac_stats->rx_dribble_bit_errors += stats->estats.rx_dribble_bit_errors;
|
||||
- gmac_stats->rx_length_errors += stats->estats.rx_length_errors;
|
||||
- gmac_stats->rx_ip_header_errors += stats->estats.rx_ip_header_errors;
|
||||
- gmac_stats->rx_ip_payload_errors += stats->estats.rx_ip_payload_errors;
|
||||
- gmac_stats->rx_no_buffer_errors += stats->estats.rx_no_buffer_errors;
|
||||
- gmac_stats->rx_transport_csum_bypassed += stats->estats.rx_transport_csum_bypassed;
|
||||
-
|
||||
- gmac_stats->tx_bytes += stats->if_stats.tx_bytes;
|
||||
- gmac_stats->tx_packets += stats->if_stats.tx_packets;
|
||||
- gmac_stats->tx_collisions += stats->estats.tx_collisions;
|
||||
- gmac_stats->tx_errors += stats->estats.tx_errors;
|
||||
- gmac_stats->tx_jabber_timeout_errors += stats->estats.tx_jabber_timeout_errors;
|
||||
- gmac_stats->tx_frame_flushed_errors += stats->estats.tx_frame_flushed_errors;
|
||||
- gmac_stats->tx_loss_of_carrier_errors += stats->estats.tx_loss_of_carrier_errors;
|
||||
- gmac_stats->tx_no_carrier_errors += stats->estats.tx_no_carrier_errors;
|
||||
- gmac_stats->tx_late_collision_errors += stats->estats.tx_late_collision_errors;
|
||||
- gmac_stats->tx_excessive_collision_errors += stats->estats.tx_excessive_collision_errors;
|
||||
- gmac_stats->tx_excessive_deferral_errors += stats->estats.tx_excessive_deferral_errors;
|
||||
- gmac_stats->tx_underflow_errors += stats->estats.tx_underflow_errors;
|
||||
- gmac_stats->tx_ip_header_errors += stats->estats.tx_ip_header_errors;
|
||||
- gmac_stats->tx_ip_payload_errors += stats->estats.tx_ip_payload_errors;
|
||||
- gmac_stats->tx_dropped += stats->estats.tx_dropped;
|
||||
+ gmac_stats->rx_stats.rx_bytes += stats->if_stats.rx_bytes;
|
||||
+ gmac_stats->rx_stats.rx_packets += stats->if_stats.rx_packets;
|
||||
+ gmac_stats->rx_stats.rx_errors += stats->estats.rx_errors;
|
||||
+ gmac_stats->rx_stats.rx_descriptor_errors += stats->estats.rx_descriptor_errors;
|
||||
+ gmac_stats->rx_stats.rx_late_collision_errors += stats->estats.rx_late_collision_errors;
|
||||
+ gmac_stats->rx_stats.rx_dribble_bit_errors += stats->estats.rx_dribble_bit_errors;
|
||||
+ gmac_stats->rx_stats.rx_length_errors += stats->estats.rx_length_errors;
|
||||
+ gmac_stats->rx_stats.rx_ip_header_errors += stats->estats.rx_ip_header_errors;
|
||||
+ gmac_stats->rx_stats.rx_ip_payload_errors += stats->estats.rx_ip_payload_errors;
|
||||
+ gmac_stats->rx_stats.rx_no_buffer_errors += stats->estats.rx_no_buffer_errors;
|
||||
+ gmac_stats->rx_stats.rx_transport_csum_bypassed += stats->estats.rx_transport_csum_bypassed;
|
||||
+ gmac_stats->rx_stats.rx_missed += stats->estats.rx_missed;
|
||||
+ gmac_stats->rx_stats.rx_fifo_overflows += stats->estats.fifo_overflows;
|
||||
+ gmac_stats->rx_stats.rx_scatter_errors += stats->estats.rx_scatter_errors;
|
||||
+
|
||||
+ gmac_stats->tx_stats.tx_bytes += stats->if_stats.tx_bytes;
|
||||
+ gmac_stats->tx_stats.tx_packets += stats->if_stats.tx_packets;
|
||||
+ gmac_stats->tx_stats.tx_collisions += stats->estats.tx_collisions;
|
||||
+ gmac_stats->tx_stats.tx_errors += stats->estats.tx_errors;
|
||||
+ gmac_stats->tx_stats.tx_jabber_timeout_errors += stats->estats.tx_jabber_timeout_errors;
|
||||
+ gmac_stats->tx_stats.tx_frame_flushed_errors += stats->estats.tx_frame_flushed_errors;
|
||||
+ gmac_stats->tx_stats.tx_loss_of_carrier_errors += stats->estats.tx_loss_of_carrier_errors;
|
||||
+ gmac_stats->tx_stats.tx_no_carrier_errors += stats->estats.tx_no_carrier_errors;
|
||||
+ gmac_stats->tx_stats.tx_late_collision_errors += stats->estats.tx_late_collision_errors;
|
||||
+ gmac_stats->tx_stats.tx_excessive_collision_errors += stats->estats.tx_excessive_collision_errors;
|
||||
+ gmac_stats->tx_stats.tx_excessive_deferral_errors += stats->estats.tx_excessive_deferral_errors;
|
||||
+ gmac_stats->tx_stats.tx_underflow_errors += stats->estats.tx_underflow_errors;
|
||||
+ gmac_stats->tx_stats.tx_ip_header_errors += stats->estats.tx_ip_header_errors;
|
||||
+ gmac_stats->tx_stats.tx_ip_payload_errors += stats->estats.tx_ip_payload_errors;
|
||||
+ gmac_stats->tx_stats.tx_dropped += stats->estats.tx_dropped;
|
||||
+ gmac_stats->tx_stats.tx_ts_create_errors += stats->estats.tx_ts_create_errors;
|
||||
|
||||
gmac_stats->hw_errs[0] += stats->estats.hw_errs[0];
|
||||
gmac_stats->hw_errs[1] += stats->estats.hw_errs[1];
|
||||
@@ -121,36 +130,6 @@ void nss_data_plane_hal_stats_sync(struc
|
||||
gmac_stats->hw_errs[7] += stats->estats.hw_errs[7];
|
||||
gmac_stats->hw_errs[8] += stats->estats.hw_errs[8];
|
||||
gmac_stats->hw_errs[9] += stats->estats.hw_errs[9];
|
||||
- gmac_stats->rx_missed += stats->estats.rx_missed;
|
||||
-
|
||||
- gmac_stats->fifo_overflows += stats->estats.fifo_overflows;
|
||||
- gmac_stats->rx_scatter_errors += stats->estats.rx_scatter_errors;
|
||||
- gmac_stats->tx_ts_create_errors += stats->estats.tx_ts_create_errors;
|
||||
- gmac_stats->gmac_total_ticks += stats->estats.gmac_total_ticks;
|
||||
- gmac_stats->gmac_worst_case_ticks += stats->estats.gmac_worst_case_ticks;
|
||||
- gmac_stats->gmac_iterations += stats->estats.gmac_iterations;
|
||||
- gmac_stats->tx_pause_frames += stats->estats.tx_pause_frames;
|
||||
- gmac_stats->mmc_rx_overflow_errors += stats->estats.mmc_rx_overflow_errors;
|
||||
- gmac_stats->mmc_rx_watchdog_timeout_errors += stats->estats.mmc_rx_watchdog_timeout_errors;
|
||||
- gmac_stats->mmc_rx_crc_errors += stats->estats.mmc_rx_crc_errors;
|
||||
- gmac_stats->mmc_rx_ip_header_errors += stats->estats.mmc_rx_ip_header_errors;
|
||||
- gmac_stats->mmc_rx_octets_g += stats->estats.mmc_rx_octets_g;
|
||||
- gmac_stats->mmc_rx_ucast_frames += stats->estats.mmc_rx_ucast_frames;
|
||||
- gmac_stats->mmc_rx_bcast_frames += stats->estats.mmc_rx_bcast_frames;
|
||||
- gmac_stats->mmc_rx_mcast_frames += stats->estats.mmc_rx_mcast_frames;
|
||||
- gmac_stats->mmc_rx_undersize += stats->estats.mmc_rx_undersize;
|
||||
- gmac_stats->mmc_rx_oversize += stats->estats.mmc_rx_oversize;
|
||||
- gmac_stats->mmc_rx_jabber += stats->estats.mmc_rx_jabber;
|
||||
- gmac_stats->mmc_rx_octets_gb += stats->estats.mmc_rx_octets_gb;
|
||||
- gmac_stats->mmc_rx_frag_frames_g += stats->estats.mmc_rx_frag_frames_g;
|
||||
- gmac_stats->mmc_tx_octets_g += stats->estats.mmc_tx_octets_g;
|
||||
- gmac_stats->mmc_tx_ucast_frames += stats->estats.mmc_tx_ucast_frames;
|
||||
- gmac_stats->mmc_tx_bcast_frames += stats->estats.mmc_tx_bcast_frames;
|
||||
- gmac_stats->mmc_tx_mcast_frames += stats->estats.mmc_tx_mcast_frames;
|
||||
- gmac_stats->mmc_tx_deferred += stats->estats.mmc_tx_deferred;
|
||||
- gmac_stats->mmc_tx_single_col += stats->estats.mmc_tx_single_col;
|
||||
- gmac_stats->mmc_tx_multiple_col += stats->estats.mmc_tx_multiple_col;
|
||||
- gmac_stats->mmc_tx_octets_gb += stats->estats.mmc_tx_octets_gb;
|
||||
|
||||
spin_unlock_bh(&nss_data_plane_hal_gmac_stats_lock);
|
||||
}
|
||||
@@ -161,25 +140,7 @@ void nss_data_plane_hal_stats_sync(struc
|
||||
uint16_t nss_data_plane_hal_get_mtu_sz(uint16_t mtu)
|
||||
{
|
||||
/*
|
||||
- * GMACs support 3 Modes
|
||||
- * Normal Mode Payloads upto 1522 Bytes ( 1500 + 14 + 4(Vlan) + 4(CRC))
|
||||
- * Mini Jumbo Mode Payloads upto 2000 Bytes (1978 + 14 + 4(Vlan) + 4 (CRC))
|
||||
- * Full Jumbo Mode payloads upto 9022 Bytes (9000 + 14 + 4(Vlan) + 4 (CRC))
|
||||
- */
|
||||
-
|
||||
- /*
|
||||
- * The configured MTU value on a GMAC interface should be one of these
|
||||
- * cases. Finding the Needed MTU size that is required for GMAC to
|
||||
- * successfully receive the frame.
|
||||
+ * Return MTU value as is.
|
||||
*/
|
||||
- if (mtu <= NSS_DP_GMAC_NORMAL_FRAME_MTU) {
|
||||
- return NSS_DP_GMAC_NORMAL_FRAME_MTU;
|
||||
- }
|
||||
- if (mtu <= NSS_DP_GMAC_MINI_JUMBO_FRAME_MTU) {
|
||||
- return NSS_DP_GMAC_MINI_JUMBO_FRAME_MTU;
|
||||
- }
|
||||
- if (mtu <= NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU) {
|
||||
- return NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU;
|
||||
- }
|
||||
- return 0;
|
||||
+ return mtu;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user