diff --git a/qca/qca-nss-ecm/Makefile b/qca/qca-nss-ecm/Makefile index 307f3a2..b256f6c 100644 --- a/qca/qca-nss-ecm/Makefile +++ b/qca/qca-nss-ecm/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-nss-ecm -PKG_RELEASE=1 +PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-nss-ecm.git PKG_SOURCE_PROTO:=git diff --git a/qca/qca-nss-ecm/patches/0001-treewide-componentize-the-module-even-more.patch b/qca/qca-nss-ecm/patches/0001-treewide-componentize-the-module-even-more.patch index 87079cb..69fbd8b 100644 --- a/qca/qca-nss-ecm/patches/0001-treewide-componentize-the-module-even-more.patch +++ b/qca/qca-nss-ecm/patches/0001-treewide-componentize-the-module-even-more.patch @@ -23,7 +23,7 @@ Signed-off-by: Ansuel Smith + ECM_INTERFACE_PPPOE_ENABLE=y +endif ccflags-$(ECM_INTERFACE_PPPOE_ENABLE) += -DECM_INTERFACE_PPPOE_ENABLE - + # ############################################################################# +# Define ECM_INTERFACE_L2TPV2_PPTP_ENABLE=y in order +# to enable support for l2tpv2 or PPTP detection. @@ -36,7 +36,7 @@ Signed-off-by: Ansuel Smith # ############################################################################# @@ -160,6 +168,12 @@ endif ccflags-$(ECM_INTERFACE_PPP_ENABLE) += -DECM_INTERFACE_PPP_ENABLE - + # ############################################################################# +# Define ECM_INTERFACE_GRE_ENABLE=y in order +# to enable support for GRE detection. @@ -56,7 +56,7 @@ Signed-off-by: Ansuel Smith + ECM_INTERFACE_VLAN_ENABLE=y +endif ccflags-$(ECM_INTERFACE_VLAN_ENABLE) += -DECM_INTERFACE_VLAN_ENABLE - + # ############################################################################# @@ -284,7 +300,9 @@ ccflags-$(ECM_CLASSIFIER_OVS_ENABLE) += # ############################################################################# @@ -68,7 +68,7 @@ Signed-off-by: Ansuel Smith +endif ecm-$(ECM_CLASSIFIER_MARK_ENABLE) += ecm_classifier_mark.o ccflags-$(ECM_CLASSIFIER_MARK_ENABLE) += -DECM_CLASSIFIER_MARK_ENABLE - + @@ -308,7 +326,9 @@ ccflags-$(ECM_CLASSIFIER_NL_ENABLE) += - # ############################################################################# # Define ECM_CLASSIFIER_DSCP_ENABLE=y in order to enable DSCP classifier. @@ -90,7 +90,7 @@ Signed-off-by: Ansuel Smith +endif ecm-$(ECM_CLASSIFIER_PCC_ENABLE) += ecm_classifier_pcc.o ccflags-$(ECM_CLASSIFIER_PCC_ENABLE) += -DECM_CLASSIFIER_PCC_ENABLE - + @@ -368,27 +390,36 @@ ccflags-$(ECM_NON_PORTED_SUPPORT_ENABLE) # ############################################################################# # Define ECM_STATE_OUTPUT_ENABLE=y to support XML state output @@ -101,7 +101,7 @@ Signed-off-by: Ansuel Smith +endif ecm-$(ECM_STATE_OUTPUT_ENABLE) += ecm_state.o ccflags-$(ECM_STATE_OUTPUT_ENABLE) += -DECM_STATE_OUTPUT_ENABLE - + # ############################################################################# # Define ECM_DB_ADVANCED_STATS_ENABLE to support XML state output # ############################################################################# @@ -110,7 +110,7 @@ Signed-off-by: Ansuel Smith + ECM_DB_ADVANCED_STATS_ENABLE=y +endif ccflags-$(ECM_DB_ADVANCED_STATS_ENABLE) += -DECM_DB_ADVANCED_STATS_ENABLE - + # ############################################################################# # Define ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE=y in order to enable # the database to track relationships between objects. @@ -120,7 +120,7 @@ Signed-off-by: Ansuel Smith + ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE=y +endif ccflags-$(ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE) += -DECM_DB_XREF_ENABLE - + # ############################################################################# # Define ECM_TRACKER_DPI_SUPPORT_ENABLE=y in order to enable support for # deep packet inspection and tracking of data with the trackers. @@ -129,7 +129,7 @@ Signed-off-by: Ansuel Smith + ECM_TRACKER_DPI_SUPPORT_ENABLE=y +endif ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE) += -DECM_TRACKER_DPI_SUPPORT_ENABLE - + # ############################################################################# @@ -396,14 +427,18 @@ ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE # support for the database keeping lists of connections that are assigned @@ -140,7 +140,7 @@ Signed-off-by: Ansuel Smith + ECM_DB_CLASSIFIER_TYPE_ASSIGNMENTS_TRACK_ENABLE=y +endif ccflags-$(ECM_DB_CLASSIFIER_TYPE_ASSIGNMENTS_TRACK_ENABLE) += -DECM_DB_CTA_TRACK_ENABLE - + # ############################################################################# # Define ECM_BAND_STEERING_ENABLE=y in order to enable # band steering feature. @@ -150,7 +150,7 @@ Signed-off-by: Ansuel Smith + ECM_BAND_STEERING_ENABLE=y +endif ccflags-$(ECM_BAND_STEERING_ENABLE) += -DECM_BAND_STEERING_ENABLE - + # ############################################################################# --- a/ecm_db/ecm_db_connection.c +++ b/ecm_db/ecm_db_connection.c @@ -161,9 +161,9 @@ Signed-off-by: Ansuel Smith +#ifdef ECM_DB_ADVANCED_STATS_ENABLE int32_t i; +#endif - + DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed\n", ci); - + @@ -545,7 +547,9 @@ EXPORT_SYMBOL(ecm_db_connection_data_tot */ void ecm_db_connection_data_totals_update_dropped(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets) @@ -171,13 +171,13 @@ Signed-off-by: Ansuel Smith +#ifdef ECM_DB_ADVANCED_STATS_ENABLE int32_t i; +#endif - + DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed\n", ci); - + @@ -1539,6 +1543,7 @@ void ecm_db_connection_defunct_all(void) } EXPORT_SYMBOL(ecm_db_connection_defunct_all); - + +#ifdef ECM_INTERFACE_OVS_BRIDGE_ENABLE /* * ecm_db_connection_defunct_by_classifier() @@ -187,13 +187,13 @@ Signed-off-by: Ansuel Smith } } +#endif - + /* * ecm_db_connection_defunct_by_port() @@ -1994,6 +2000,7 @@ struct ecm_db_node_instance *ecm_db_conn } EXPORT_SYMBOL(ecm_db_connection_node_get_and_ref); - + +#ifdef ECM_DB_XREF_ENABLE /* * ecm_db_connection_mapping_get_and_ref_next() @@ -203,7 +203,7 @@ Signed-off-by: Ansuel Smith } EXPORT_SYMBOL(ecm_db_connection_iface_get_and_ref_next); +#endif - + /* * ecm_db_connection_mapping_get_and_ref() --- a/ecm_db/ecm_db_node.c @@ -218,7 +218,7 @@ Signed-off-by: Ansuel Smith #endif +#endif DEBUG_CHECK_MAGIC(ni, ECM_DB_NODE_INSTANCE_MAGIC, "%px: magic failed\n", ni); - + spin_lock_bh(&ecm_db_lock); @@ -489,9 +491,11 @@ EXPORT_SYMBOL(ecm_db_node_iface_get_and_ void ecm_db_node_add(struct ecm_db_node_instance *ni, struct ecm_db_iface_instance *ii, uint8_t *address, @@ -231,7 +231,7 @@ Signed-off-by: Ansuel Smith +#endif ecm_db_node_hash_t hash_index; struct ecm_db_listener_instance *li; - + --- a/ecm_interface.c +++ b/ecm_interface.c @@ -1483,6 +1483,7 @@ struct neighbour *ecm_interface_ipv6_nei @@ -240,16 +240,16 @@ Signed-off-by: Ansuel Smith { +#ifdef ECM_INTERFACE_PPTP_ENABLE struct net_device *in; - + /* @@ -1507,6 +1508,7 @@ bool ecm_interface_is_pptp(struct sk_buf } - + dev_put(in); +#endif return false; } - + @@ -1519,6 +1521,7 @@ bool ecm_interface_is_pptp(struct sk_buf */ bool ecm_interface_is_l2tp_packet_by_version(struct sk_buff *skb, const struct net_device *out, int ver) @@ -257,35 +257,35 @@ Signed-off-by: Ansuel Smith +#ifdef ECM_INTERFACE_L2TPV2_PPTP_ENABLE uint32_t flag = 0; struct net_device *in; - + @@ -1551,6 +1554,7 @@ bool ecm_interface_is_l2tp_packet_by_ver } - + dev_put(in); +#endif return false; } - + @@ -1563,6 +1567,7 @@ bool ecm_interface_is_l2tp_packet_by_ver */ bool ecm_interface_is_l2tp_pptp(struct sk_buff *skb, const struct net_device *out) { +#ifdef ECM_INTERFACE_L2TPV2_PPTP_ENABLE struct net_device *in; - + /* @@ -1585,6 +1590,7 @@ bool ecm_interface_is_l2tp_pptp(struct s } - + dev_put(in); +#endif return false; } - + @@ -7120,6 +7126,7 @@ static void ecm_interface_regenerate_con return; } - + +#ifdef ECM_DB_XREF_ENABLE for (dir = 0; dir < ECM_DB_OBJ_DIR_MAX; dir++) { /* @@ -295,7 +295,7 @@ Signed-off-by: Ansuel Smith } } +#endif - + #ifdef ECM_MULTICAST_ENABLE /* --- a/frontends/ecm_front_end_common.c @@ -307,7 +307,7 @@ Signed-off-by: Ansuel Smith +#ifdef ECM_INTERFACE_GRE_ENABLE struct net_device *dev; struct gre_base_hdr *greh; - + @@ -502,10 +503,12 @@ bool ecm_front_end_gre_proto_is_accel_al /* * Case 1: PPTP locally terminated @@ -318,7 +318,7 @@ Signed-off-by: Ansuel Smith return true; } +#endif - + /* * Case 2: PPTP pass through @@ -613,6 +616,10 @@ bool ecm_front_end_gre_proto_is_accel_al @@ -330,5 +330,5 @@ Signed-off-by: Ansuel Smith + return false; +#endif } - + #ifdef ECM_CLASSIFIER_DSCP_ENABLE diff --git a/qca/qca-nss-ecm/patches/0002-treewide-rework-ipv6_dev_find_and_hold.patch b/qca/qca-nss-ecm/patches/0002-treewide-rework-ipv6_dev_find_and_hold.patch index d53a4c0..532c868 100644 --- a/qca/qca-nss-ecm/patches/0002-treewide-rework-ipv6_dev_find_and_hold.patch +++ b/qca/qca-nss-ecm/patches/0002-treewide-rework-ipv6_dev_find_and_hold.patch @@ -2,7 +2,7 @@ +++ b/ecm_interface.c @@ -336,7 +336,7 @@ static struct net_device *ecm_interface_ struct net_device *dev; - + ECM_IP_ADDR_TO_NIN6_ADDR(addr6, addr); - dev = (struct net_device *)ipv6_dev_find(&init_net, &addr6, 1); + dev = (struct net_device *)ipv6_dev_find_and_hold(&init_net, &addr6, 1); @@ -23,7 +23,7 @@ @@ -102,6 +102,10 @@ #endif #endif - + +#ifdef ECM_IPV6_ENABLE +#include "ecm_front_end_ipv6.h" +#endif @@ -43,7 +43,7 @@ @@ -588,7 +592,7 @@ bool ecm_front_end_gre_proto_is_accel_al return false; } - + - dev = ipv6_dev_find(&init_net, &(tuple->dst.u3.in6), 1); + dev = ipv6_dev_find_and_hold(&init_net, &(tuple->dst.u3.in6), 1); if (dev) { diff --git a/qca/qca-nss-ecm/patches/0003-treewide-rework-debugfs-api-to-new-implementation.patch b/qca/qca-nss-ecm/patches/0003-treewide-rework-debugfs-api-to-new-implementation.patch index e3dd608..2d72576 100644 --- a/qca/qca-nss-ecm/patches/0003-treewide-rework-debugfs-api-to-new-implementation.patch +++ b/qca/qca-nss-ecm/patches/0003-treewide-rework-debugfs-api-to-new-implementation.patch @@ -43,7 +43,7 @@ Signed-off-by: Ansuel Smith @@ -760,26 +760,14 @@ int ecm_classifier_default_init(struct d return -1; } - + - if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry, - (u32 *)&ecm_classifier_default_enabled)) { - DEBUG_ERROR("Failed to create ecm deafult classifier enabled file in debugfs\n"); @@ -52,7 +52,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry, + (u32 *)&ecm_classifier_default_enabled); - + - if (!debugfs_create_u32("accel_mode", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry, - (u32 *)&ecm_classifier_default_accel_mode)) { - DEBUG_ERROR("Failed to create ecm deafult classifier accel_mode file in debugfs\n"); @@ -61,7 +61,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("accel_mode", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry, + (u32 *)&ecm_classifier_default_accel_mode); - + - if (!debugfs_create_u32("accel_delay_pkts", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry, - (u32 *)&ecm_classifier_accel_delay_pkts)) { - DEBUG_ERROR("Failed to create accel delay packet counts in debugfs\n"); @@ -70,7 +70,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("accel_delay_pkts", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry, + (u32 *)&ecm_classifier_accel_delay_pkts); - + return 0; } --- a/ecm_classifier_dscp.c @@ -78,7 +78,7 @@ Signed-off-by: Ansuel Smith @@ -816,12 +816,8 @@ int ecm_classifier_dscp_init(struct dent return -1; } - + - if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_dscp_dentry, - (u32 *)&ecm_classifier_dscp_enabled)) { - DEBUG_ERROR("Failed to create dscp enabled file in debugfs\n"); @@ -87,7 +87,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_dscp_dentry, + (u32 *)&ecm_classifier_dscp_enabled); - + return 0; } --- a/ecm_classifier_emesh.c @@ -95,7 +95,7 @@ Signed-off-by: Ansuel Smith @@ -2059,33 +2059,17 @@ int ecm_classifier_emesh_sawf_init(struc return -1; } - + - if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, - (u32 *)&ecm_classifier_emesh_enabled)) { - DEBUG_ERROR("Failed to create ecm emesh classifier enabled file in debugfs\n"); @@ -104,7 +104,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, + (u32 *)&ecm_classifier_emesh_enabled); - + - if (!debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, - (u32 *)&ecm_classifier_emesh_latency_config_enabled)) { - DEBUG_ERROR("Failed to create ecm emesh classifier latency config enabled file in debugfs\n"); @@ -113,7 +113,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, + (u32 *)&ecm_classifier_emesh_latency_config_enabled); - + - if (!debugfs_create_u32("sawf_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, - (u32 *)&ecm_classifier_sawf_enabled)) { - DEBUG_ERROR("Failed to create ecm sawf classifier enabled file in debugfs\n"); @@ -122,7 +122,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("sawf_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, + (u32 *)&ecm_classifier_sawf_enabled); - + - if (!debugfs_create_u32("cake_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, - (u32 *)&ecm_classifier_sawf_cake_enabled)) { - DEBUG_ERROR("Failed to create ecm sawf cake enabled file in debugfs\n"); @@ -131,7 +131,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("cake_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, + (u32 *)&ecm_classifier_sawf_cake_enabled); - + if (!debugfs_create_file("udp_ipsec_port", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry, NULL, &ecm_classifier_sawf_emesh_udp_ipsec_port_fops)) { --- a/ecm_classifier_hyfi.c @@ -139,7 +139,7 @@ Signed-off-by: Ansuel Smith @@ -1111,11 +1111,8 @@ int ecm_classifier_hyfi_rules_init(struc goto classifier_task_cleanup; } - + - if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_hyfi_dentry, - (u32 *)&ecm_classifier_hyfi_enabled)) { - DEBUG_ERROR("Failed to create ecm hyfi classifier enabled file in debugfs\n"); @@ -147,7 +147,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_hyfi_dentry, + (u32 *)&ecm_classifier_hyfi_enabled); - + if (!debugfs_create_file("cmd", S_IWUSR, ecm_classifier_hyfi_dentry, NULL, &ecm_classifier_hyfi_cmd_fops)) { --- a/ecm_classifier_mark.c @@ -155,7 +155,7 @@ Signed-off-by: Ansuel Smith @@ -753,12 +753,8 @@ int ecm_classifier_mark_init(struct dent return -1; } - + - if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_mark_dentry, - (u32 *)&ecm_classifier_mark_enabled)) { - DEBUG_ERROR("Failed to create mark enabled file in debugfs\n"); @@ -164,7 +164,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_mark_dentry, + (u32 *)&ecm_classifier_mark_enabled); - + return 0; } --- a/ecm_classifier_ovs.c @@ -172,7 +172,7 @@ Signed-off-by: Ansuel Smith @@ -2265,12 +2265,8 @@ int ecm_classifier_ovs_init(struct dentr return -1; } - + - if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_ovs_dentry, - (u32 *)&ecm_classifier_ovs_enabled)) { - DEBUG_ERROR("Failed to create ovs enabled file in debugfs\n"); @@ -181,7 +181,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_ovs_dentry, + (u32 *)&ecm_classifier_ovs_enabled); - + return 0; } --- a/ecm_classifier_pcc.c @@ -189,7 +189,7 @@ Signed-off-by: Ansuel Smith @@ -1246,12 +1246,8 @@ int ecm_classifier_pcc_init(struct dentr return -1; } - + - if (!debugfs_create_u32("enabled", S_IRUGO, ecm_classifier_pcc_dentry, - (u32 *)&ecm_classifier_pcc_enabled)) { - DEBUG_ERROR("Failed to create pcc enabled file in debugfs\n"); @@ -198,7 +198,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("enabled", S_IRUGO, ecm_classifier_pcc_dentry, + (u32 *)&ecm_classifier_pcc_enabled); - + return 0; } --- a/ecm_conntrack_notifier.c @@ -206,7 +206,7 @@ Signed-off-by: Ansuel Smith @@ -429,12 +429,8 @@ int ecm_conntrack_notifier_init(struct d return -1; } - + - if (!debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_conntrack_notifier_dentry, - (u32 *)&ecm_conntrack_notifier_stopped)) { - DEBUG_ERROR("Failed to create ecm conntrack notifier stopped file in debugfs\n"); @@ -215,7 +215,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_conntrack_notifier_dentry, + (u32 *)&ecm_conntrack_notifier_stopped); - + #ifdef CONFIG_NF_CONNTRACK_EVENTS /* --- a/ecm_db/ecm_db_connection.c @@ -231,7 +231,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("connection_count", S_IRUGO, dentry, + (u32 *)&ecm_db_connection_count); - + if (!debugfs_create_file("connection_count_simple", S_IRUGO, dentry, NULL, &ecm_db_connection_count_simple_fops)) { --- a/ecm_db/ecm_db_host.c @@ -239,7 +239,7 @@ Signed-off-by: Ansuel Smith @@ -771,11 +771,8 @@ EXPORT_SYMBOL(ecm_db_host_alloc); bool ecm_db_host_init(struct dentry *dentry) { - + - if (!debugfs_create_u32("host_count", S_IRUGO, dentry, - (u32 *)&ecm_db_host_count)) { - DEBUG_ERROR("Failed to create ecm db host count file in debugfs\n"); @@ -247,7 +247,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("host_count", S_IRUGO, dentry, + (u32 *)&ecm_db_host_count); - + ecm_db_host_table = vzalloc(sizeof(struct ecm_db_host_instance *) * ECM_DB_HOST_HASH_SLOTS); if (!ecm_db_host_table) { --- a/ecm_db/ecm_db_iface.c @@ -263,7 +263,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("iface_count", S_IRUGO, dentry, + (u32 *)&ecm_db_iface_count); - + return true; } --- a/ecm_db/ecm_db_mapping.c @@ -279,7 +279,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("mapping_count", S_IRUGO, dentry, + (u32 *)&ecm_db_mapping_count); - + ecm_db_mapping_table = vzalloc(sizeof(struct ecm_db_mapping_instance *) * ECM_DB_MAPPING_HASH_SLOTS); if (!ecm_db_mapping_table) { --- a/ecm_db/ecm_db_node.c @@ -295,7 +295,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("node_count", S_IRUGO, dentry, + (u32 *)&ecm_db_node_count); - + ecm_db_node_table = vzalloc(sizeof(struct ecm_db_node_instance *) * ECM_DB_NODE_HASH_SLOTS); if (!ecm_db_node_table) { --- a/ecm_state.c @@ -303,7 +303,7 @@ Signed-off-by: Ansuel Smith @@ -894,17 +894,11 @@ int ecm_state_init(struct dentry *dentry return -1; } - + - if (!debugfs_create_u32("state_dev_major", S_IRUGO, ecm_state_dentry, - (u32 *)&ecm_state_dev_major_id)) { - DEBUG_ERROR("Failed to create ecm state dev major file in debugfs\n"); @@ -311,7 +311,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("state_dev_major", S_IRUGO, ecm_state_dentry, + (u32 *)&ecm_state_dev_major_id); - + - if (!debugfs_create_u32("state_file_output_mask", S_IRUGO | S_IWUSR, ecm_state_dentry, - (u32 *)&ecm_state_file_output_mask)) { - DEBUG_ERROR("Failed to create ecm state output mask file in debugfs\n"); @@ -319,7 +319,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("state_file_output_mask", S_IRUGO | S_IWUSR, ecm_state_dentry, + (u32 *)&ecm_state_file_output_mask); - + /* * Register a char device that we will use to provide a dump of our state --- a/frontends/cmn/ecm_bond_notifier.c @@ -327,7 +327,7 @@ Signed-off-by: Ansuel Smith @@ -241,12 +241,8 @@ int ecm_bond_notifier_init(struct dentry return -1; } - + - if (!debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_bond_notifier_dentry, - (u32 *)&ecm_bond_notifier_stopped)) { - DEBUG_ERROR("Failed to create ecm bond notifier stopped file in debugfs\n"); @@ -336,7 +336,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_bond_notifier_dentry, + (u32 *)&ecm_bond_notifier_stopped); - + /* * Register Link Aggregation callbacks with the bonding driver --- a/frontends/ecm_front_end_ipv4.c @@ -352,7 +352,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("front_end_ipv4_stop", S_IRUGO | S_IWUSR, dentry, + (u32 *)&ecm_front_end_ipv4_stopped); - + return ecm_ipv4_init(dentry); } --- a/frontends/ecm_front_end_ipv6.c @@ -368,7 +368,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("front_end_ipv6_stop", S_IRUGO | S_IWUSR, dentry, + (u32 *)&ecm_front_end_ipv6_stopped); - + return ecm_ipv6_init(dentry); } --- a/frontends/nss/ecm_nss_ipv4.c @@ -376,7 +376,7 @@ Signed-off-by: Ansuel Smith @@ -1009,41 +1009,23 @@ int ecm_nss_ipv4_init(struct dentry *den return result; } - + - if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_no_action_limit_default)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 no_action_limit_default file in debugfs\n"); @@ -384,7 +384,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_no_action_limit_default); - + - if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_driver_fail_limit_default)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 driver_fail_limit_default file in debugfs\n"); @@ -392,7 +392,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_driver_fail_limit_default); - + - if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_nack_limit_default)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 nack_limit_default file in debugfs\n"); @@ -400,7 +400,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_nack_limit_default); - + - if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_accelerated_count)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 accelerated_count file in debugfs\n"); @@ -408,7 +408,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_accelerated_count); - + - if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_pending_accel_count)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 pending_accel_count file in debugfs\n"); @@ -416,7 +416,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_pending_accel_count); - + - if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_pending_decel_count)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 pending_decel_count file in debugfs\n"); @@ -424,13 +424,13 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_pending_decel_count); - + if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, NULL, &ecm_nss_ipv4_accel_limit_mode_fops)) { @@ -1074,11 +1056,8 @@ int ecm_nss_ipv4_init(struct dentry *den goto task_cleanup; } - + - if (!debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, - (u32 *)&ecm_nss_ipv4_vlan_passthrough_enable)) { - DEBUG_ERROR("Failed to create ecm nss ipv4 vlan passthrough file in debugfs\n"); @@ -438,7 +438,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry, + (u32 *)&ecm_nss_ipv4_vlan_passthrough_enable); - + #ifdef ECM_NON_PORTED_SUPPORT_ENABLE if (!ecm_nss_non_ported_ipv4_debugfs_init(ecm_nss_ipv4_dentry)) { --- a/frontends/nss/ecm_nss_ipv6.c @@ -446,7 +446,7 @@ Signed-off-by: Ansuel Smith @@ -986,41 +986,23 @@ int ecm_nss_ipv6_init(struct dentry *den return result; } - + - if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_no_action_limit_default)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 no_action_limit_default file in debugfs\n"); @@ -454,7 +454,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_no_action_limit_default); - + - if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_driver_fail_limit_default)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 driver_fail_limit_default file in debugfs\n"); @@ -462,7 +462,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_driver_fail_limit_default); - + - if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_nack_limit_default)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 nack_limit_default file in debugfs\n"); @@ -470,7 +470,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_nack_limit_default); - + - if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_accelerated_count)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 accelerated_count file in debugfs\n"); @@ -478,7 +478,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_accelerated_count); - + - if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_pending_accel_count)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 pending_accel_count file in debugfs\n"); @@ -486,7 +486,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_pending_accel_count); - + - if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_pending_decel_count)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 pending_decel_count file in debugfs\n"); @@ -494,13 +494,13 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_pending_decel_count); - + if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, NULL, &ecm_nss_ipv6_accel_limit_mode_fops)) { @@ -1051,11 +1033,8 @@ int ecm_nss_ipv6_init(struct dentry *den goto task_cleanup; } - + - if (!debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, - (u32 *)&ecm_nss_ipv6_vlan_passthrough_enable)) { - DEBUG_ERROR("Failed to create ecm nss ipv6 vlan passthrough file in debugfs\n"); @@ -508,7 +508,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry, + (u32 *)&ecm_nss_ipv6_vlan_passthrough_enable); - + #ifdef ECM_NON_PORTED_SUPPORT_ENABLE if (!ecm_nss_non_ported_ipv6_debugfs_init(ecm_nss_ipv6_dentry)) { --- a/frontends/nss/ecm_nss_multicast_ipv4.c @@ -526,7 +526,7 @@ Signed-off-by: Ansuel Smith - DEBUG_ERROR("Failed to create ecm nss ipv4 multicast_accelerated_count file in debugfs\n"); - return false; - } - + return true; } @@ -2645,11 +2639,8 @@ void ecm_nss_multicast_ipv4_stop(int num @@ -540,7 +540,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("ecm_nss_multicast_ipv4_stop", S_IRUGO | S_IWUSR, dentry, + (u32 *)&ecm_front_end_ipv4_mc_stopped); - + /* * Register multicast update callback to MCS snooper --- a/frontends/nss/ecm_nss_multicast_ipv6.c @@ -558,7 +558,7 @@ Signed-off-by: Ansuel Smith - DEBUG_ERROR("Failed to create ecm nss ipv6 multicast_accelerated_count file in debugfs\n"); - return false; - } - + return true; } @@ -2580,11 +2574,8 @@ void ecm_nss_multicast_ipv6_stop(int num @@ -572,7 +572,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("ecm_nss_multicast_ipv6_stop", S_IRUGO | S_IWUSR, dentry, + (u32 *)&ecm_front_end_ipv6_mc_stopped); - + /* * Register multicast update callback to MCS snooper --- a/frontends/nss/ecm_nss_non_ported_ipv4.c @@ -588,7 +588,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry, + (u32 *)&ecm_nss_non_ported_ipv4_accelerated_count); - + return true; } --- a/frontends/nss/ecm_nss_non_ported_ipv6.c @@ -604,7 +604,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry, + (u32 *)&ecm_nss_non_ported_ipv6_accelerated_count); - + return true; } --- a/frontends/nss/ecm_nss_ported_ipv4.c @@ -616,7 +616,7 @@ Signed-off-by: Ansuel Smith - struct dentry *udp_dentry; + debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry, + &ecm_nss_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_UDP]); - + - udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry, - &ecm_nss_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_UDP]); - if (!udp_dentry) { @@ -625,7 +625,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, + &ecm_nss_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP]); - + - if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, - &ecm_nss_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP])) { - DEBUG_ERROR("Failed to create ecm nss ipv4 tcp_accelerated_count file in debugfs\n"); @@ -645,7 +645,7 @@ Signed-off-by: Ansuel Smith - struct dentry *udp_dentry; + debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry, + &ecm_nss_ported_ipv6_accelerated_count[ECM_FRONT_END_PORTED_PROTO_UDP]); - + - udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry, - &ecm_nss_ported_ipv6_accelerated_count[ECM_FRONT_END_PORTED_PROTO_UDP]); - if (!udp_dentry) { @@ -661,14 +661,14 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, + &ecm_nss_ported_ipv6_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP]); - + return true; } --- a/frontends/sfe/ecm_sfe_ipv4.c +++ b/frontends/sfe/ecm_sfe_ipv4.c @@ -949,48 +949,27 @@ int ecm_sfe_ipv4_init(struct dentry *den } - + #ifdef CONFIG_XFRM - if (!debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_reject_acceleration_for_ipsec)) { @@ -678,7 +678,7 @@ Signed-off-by: Ansuel Smith + debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_reject_acceleration_for_ipsec); #endif - + - if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_no_action_limit_default)) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 no_action_limit_default file in debugfs\n"); @@ -686,7 +686,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_no_action_limit_default); - + - if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_driver_fail_limit_default)) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 driver_fail_limit_default file in debugfs\n"); @@ -694,7 +694,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_driver_fail_limit_default); - + - if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_nack_limit_default)) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 nack_limit_default file in debugfs\n"); @@ -702,7 +702,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_nack_limit_default); - + - if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_accelerated_count)) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 accelerated_count file in debugfs\n"); @@ -710,7 +710,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_accelerated_count); - + - if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_pending_accel_count)) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 pending_accel_count file in debugfs\n"); @@ -718,7 +718,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_pending_accel_count); - + - if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv4_dentry, - (u32 *)&ecm_sfe_ipv4_pending_decel_count)) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 pending_decel_count file in debugfs\n"); @@ -726,14 +726,14 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv4_dentry, + (u32 *)&ecm_sfe_ipv4_pending_decel_count); - + if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry, NULL, &ecm_sfe_ipv4_accel_limit_mode_fops)) { --- a/frontends/sfe/ecm_sfe_ipv6.c +++ b/frontends/sfe/ecm_sfe_ipv6.c @@ -944,48 +944,27 @@ int ecm_sfe_ipv6_init(struct dentry *den } - + #ifdef CONFIG_XFRM - if (!debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_reject_acceleration_for_ipsec)) { @@ -743,7 +743,7 @@ Signed-off-by: Ansuel Smith + debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_reject_acceleration_for_ipsec); #endif - + - if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_no_action_limit_default)) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 no_action_limit_default file in debugfs\n"); @@ -751,7 +751,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_no_action_limit_default); - + - if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_driver_fail_limit_default)) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 driver_fail_limit_default file in debugfs\n"); @@ -759,7 +759,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_driver_fail_limit_default); - + - if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_nack_limit_default)) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 nack_limit_default file in debugfs\n"); @@ -767,7 +767,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_nack_limit_default); - + - if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_accelerated_count)) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 accelerated_count file in debugfs\n"); @@ -775,7 +775,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_accelerated_count); - + - if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_pending_accel_count)) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 pending_accel_count file in debugfs\n"); @@ -783,7 +783,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_pending_accel_count); - + - if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv6_dentry, - (u32 *)&ecm_sfe_ipv6_pending_decel_count)) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 pending_decel_count file in debugfs\n"); @@ -791,7 +791,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv6_dentry, + (u32 *)&ecm_sfe_ipv6_pending_decel_count); - + if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry, NULL, &ecm_sfe_ipv6_accel_limit_mode_fops)) { --- a/frontends/sfe/ecm_sfe_non_ported_ipv4.c @@ -807,7 +807,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry, + (u32 *)&ecm_sfe_non_ported_ipv4_accelerated_count); - + return true; } --- a/frontends/sfe/ecm_sfe_non_ported_ipv6.c @@ -823,7 +823,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry, + (u32 *)&ecm_sfe_non_ported_ipv6_accelerated_count); - + return true; } --- a/frontends/sfe/ecm_sfe_ported_ipv4.c @@ -831,7 +831,7 @@ Signed-off-by: Ansuel Smith @@ -2070,12 +2070,8 @@ bool ecm_sfe_ported_ipv4_debugfs_init(st return false; } - + - if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, - &ecm_sfe_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP])) { - DEBUG_ERROR("Failed to create ecm sfe ipv4 tcp_accelerated_count file in debugfs\n"); @@ -840,7 +840,7 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, + &ecm_sfe_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP]); - + return true; } --- a/frontends/sfe/ecm_sfe_ported_ipv6.c @@ -848,7 +848,7 @@ Signed-off-by: Ansuel Smith @@ -2018,12 +2018,8 @@ bool ecm_sfe_ported_ipv6_debugfs_init(st return false; } - + - if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, - &ecm_sfe_ported_ipv6_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP])) { - DEBUG_ERROR("Failed to create ecm sfe ipv6 tcp_accelerated_count file in debugfs\n"); @@ -857,6 +857,6 @@ Signed-off-by: Ansuel Smith - } + debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry, + &ecm_sfe_ported_ipv6_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP]); - + return true; } diff --git a/qca/qca-nss-ecm/patches/0004-qca-nss-ecm-resolve-the-cpu-high-load-regarding-ecm.patch b/qca/qca-nss-ecm/patches/0004-qca-nss-ecm-resolve-the-cpu-high-load-regarding-ecm.patch index 0047693..b5f3876 100644 --- a/qca/qca-nss-ecm/patches/0004-qca-nss-ecm-resolve-the-cpu-high-load-regarding-ecm.patch +++ b/qca/qca-nss-ecm/patches/0004-qca-nss-ecm-resolve-the-cpu-high-load-regarding-ecm.patch @@ -18,15 +18,15 @@ Signed-off-by: Dirk Buchwalder buchwalder@posteo.de @@ -700,7 +700,7 @@ static void ecm_nss_ipv4_stats_sync_req_ } spin_unlock_bh(&ecm_nss_ipv4_lock); - + - usleep_range(ECM_NSS_IPV4_STATS_SYNC_UDELAY - 100, ECM_NSS_IPV4_STATS_SYNC_UDELAY); + msleep_interruptible(ECM_NSS_IPV4_STATS_SYNC_UDELAY / 1000); - + /* * If index is 0, we are starting a new round, but if we still have time remain @@ -714,7 +714,7 @@ static void ecm_nss_ipv4_stats_sync_req_ } - + if (time_after(ecm_nss_ipv4_next_req_time, current_jiffies)) { - msleep(jiffies_to_msecs(ecm_nss_ipv4_next_req_time - current_jiffies)); + msleep_interruptible(jiffies_to_msecs(ecm_nss_ipv4_next_req_time - current_jiffies)); @@ -38,15 +38,15 @@ Signed-off-by: Dirk Buchwalder buchwalder@posteo.de @@ -676,7 +676,7 @@ static void ecm_nss_ipv6_stats_sync_req_ } spin_unlock_bh(&ecm_nss_ipv6_lock); - + - usleep_range(ECM_NSS_IPV6_STATS_SYNC_UDELAY - 100, ECM_NSS_IPV6_STATS_SYNC_UDELAY); + msleep_interruptible(ECM_NSS_IPV6_STATS_SYNC_UDELAY / 1000); - + /* * If index is 0, we are starting a new round, but if we still have time remain @@ -690,7 +690,7 @@ static void ecm_nss_ipv6_stats_sync_req_ } - + if (time_after(ecm_nss_ipv6_next_req_time, current_jiffies)) { - msleep(jiffies_to_msecs(ecm_nss_ipv6_next_req_time - current_jiffies)); + msleep_interruptible(jiffies_to_msecs(ecm_nss_ipv6_next_req_time - current_jiffies)); diff --git a/qca/qca-nss-ecm/patches/0005-ecm_interface-switch-to-kernel_recvmsg-api.patch b/qca/qca-nss-ecm/patches/0005-ecm_interface-switch-to-kernel_recvmsg-api.patch index a3e07aa..cf26480 100644 --- a/qca/qca-nss-ecm/patches/0005-ecm_interface-switch-to-kernel_recvmsg-api.patch +++ b/qca/qca-nss-ecm/patches/0005-ecm_interface-switch-to-kernel_recvmsg-api.patch @@ -25,7 +25,7 @@ Signed-off-by: Ansuel Smith +#else + struct kvec iov; +#endif - + iov.iov_base = buf; iov.iov_len = len; @@ -8024,7 +8028,8 @@ static int ecm_interface_wifi_event_rx(s @@ -40,11 +40,11 @@ Signed-off-by: Ansuel Smith #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)) @@ -8035,6 +8040,9 @@ static int ecm_interface_wifi_event_rx(s set_fs(oldfs); - + return size; +#else + return kernel_recvmsg(sock, &msg, &iov, 1, iov.iov_len, 0); +#endif } - + /* diff --git a/qca/qca-nss-ecm/patches/0006-treewide-rework-notifier-changes-for-5.15.patch b/qca/qca-nss-ecm/patches/0006-treewide-rework-notifier-changes-for-5.15.patch index e2ff5ee..2e61c46 100644 --- a/qca/qca-nss-ecm/patches/0006-treewide-rework-notifier-changes-for-5.15.patch +++ b/qca/qca-nss-ecm/patches/0006-treewide-rework-notifier-changes-for-5.15.patch @@ -24,12 +24,12 @@ Subject: [PATCH] treewide: rework notifier changes for 5.15 - struct nf_ct_event *item = (struct nf_ct_event *)ptr; -#endif struct nf_conn *ct = item->ct; - + /* @@ -387,23 +380,17 @@ static int ecm_conntrack_event(unsigned return NOTIFY_DONE; } - + -#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS -/* - * struct notifier_block ecm_conntrack_notifier @@ -53,7 +53,7 @@ Subject: [PATCH] treewide: rework notifier changes for 5.15 #endif +}; #endif - + /* @@ -436,12 +423,16 @@ int ecm_conntrack_notifier_init(struct d /* @@ -70,7 +70,7 @@ Subject: [PATCH] treewide: rework notifier changes for 5.15 +#else + nf_conntrack_register_notifier(&init_net, &ecm_conntrack_notifier); +#endif - + /* * Hold netns reference to keep the basic conntrack alive and @@ -483,7 +474,11 @@ void ecm_conntrack_notifier_exit(void) diff --git a/qca/qca-nss-ecm/patches/0008-ecm_tracker_datagram-drop-static-for-EXPORT_SYMBOL.patch b/qca/qca-nss-ecm/patches/0008-ecm_tracker_datagram-drop-static-for-EXPORT_SYMBOL.patch index aa95ce1..aa3e4d9 100644 --- a/qca/qca-nss-ecm/patches/0008-ecm_tracker_datagram-drop-static-for-EXPORT_SYMBOL.patch +++ b/qca/qca-nss-ecm/patches/0008-ecm_tracker_datagram-drop-static-for-EXPORT_SYMBOL.patch @@ -29,7 +29,7 @@ Signed-off-by: Ansuel Smith +int32_t ecm_tracker_datagram_datagram_size_get(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i) { struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti; - + @@ -412,7 +412,7 @@ static int32_t ecm_tracker_datagram_data * ecm_tracker_datagram_datagram_read() * Read size bytes from datagram at index i into the buffer diff --git a/qca/qca-nss-ecm/patches/0009-frontends-drop-udp_get_timeouts-and-use-standard-ups.patch b/qca/qca-nss-ecm/patches/0009-frontends-drop-udp_get_timeouts-and-use-standard-ups.patch index ad5ec6a..00139a4 100644 --- a/qca/qca-nss-ecm/patches/0009-frontends-drop-udp_get_timeouts-and-use-standard-ups.patch +++ b/qca/qca-nss-ecm/patches/0009-frontends-drop-udp_get_timeouts-and-use-standard-ups.patch @@ -23,7 +23,7 @@ instead or relying on a downstream api not present upstream. + struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct)); + timeouts = un->timeouts; } - + spin_lock_bh(&ct->lock); --- a/frontends/nss/ecm_nss_ipv6.c +++ b/frontends/nss/ecm_nss_ipv6.c @@ -35,7 +35,7 @@ instead or relying on a downstream api not present upstream. + struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct)); + timeouts = un->timeouts; } - + spin_lock_bh(&ct->lock); --- a/frontends/sfe/ecm_sfe_ipv4.c +++ b/frontends/sfe/ecm_sfe_ipv4.c @@ -47,7 +47,7 @@ instead or relying on a downstream api not present upstream. + struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct)); + timeouts = un->timeouts; } - + spin_lock_bh(&ct->lock); --- a/frontends/sfe/ecm_sfe_ipv6.c +++ b/frontends/sfe/ecm_sfe_ipv6.c @@ -59,5 +59,5 @@ instead or relying on a downstream api not present upstream. + struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct)); + timeouts = un->timeouts; } - + spin_lock_bh(&ct->lock); diff --git a/qca/qca-nss-ecm/patches/0010-ecm_interface-fix-ppp-generic-function-calls-for-5.15.patch b/qca/qca-nss-ecm/patches/0010-ecm_interface-fix-ppp-generic-function-calls-for-5.15.patch index cc36b25..9748e92 100644 --- a/qca/qca-nss-ecm/patches/0010-ecm_interface-fix-ppp-generic-function-calls-for-5.15.patch +++ b/qca/qca-nss-ecm/patches/0010-ecm_interface-fix-ppp-generic-function-calls-for-5.15.patch @@ -3,12 +3,12 @@ @@ -3612,7 +3612,7 @@ identifier_update: if (skb && (skb->skb_iif == dev->ifindex)) { struct pppol2tp_common_addr info; - + - if (__ppp_is_multilink(dev) > 0) { + if (ppp_is_multilink(dev) > 0) { DEBUG_TRACE("%px: Net device: %px is MULTILINK PPP - Unknown to the ECM\n", feci, dev); type_info.unknown.os_specific_ident = dev_interface_num; - + @@ -3622,7 +3622,7 @@ identifier_update: ii = ecm_interface_unknown_interface_establish(&type_info.unknown, dev_name, dev_interface_num, ae_interface_num, dev_mtu); return ii; diff --git a/qca/qca-nss-ecm/patches/900-treewide-export-ipv4-and-ipv6-symbols.patch b/qca/qca-nss-ecm/patches/900-treewide-export-ipv4-and-ipv6-symbols.patch index 599156f..7bb4fb3 100644 --- a/qca/qca-nss-ecm/patches/900-treewide-export-ipv4-and-ipv6-symbols.patch +++ b/qca/qca-nss-ecm/patches/900-treewide-export-ipv4-and-ipv6-symbols.patch @@ -1,34 +1,34 @@ --- a/frontends/nss/ecm_nss_common.c +++ b/frontends/nss/ecm_nss_common.c @@ -67,6 +67,7 @@ bool ecm_nss_ipv6_is_conn_limit_reached( - + return false; } +EXPORT_SYMBOL(ecm_nss_ipv6_is_conn_limit_reached); #endif - + /* @@ -116,3 +117,4 @@ bool ecm_nss_ipv4_is_conn_limit_reached( - + return false; } +EXPORT_SYMBOL(ecm_nss_ipv4_is_conn_limit_reached); --- a/frontends/nss/ecm_nss_non_ported_ipv4.c +++ b/frontends/nss/ecm_nss_non_ported_ipv4.c @@ -1824,6 +1824,7 @@ struct ecm_front_end_connection_instance - + return feci; } +EXPORT_SYMBOL(ecm_nss_non_ported_ipv4_connection_instance_alloc); - + /* * ecm_nss_non_ported_ipv4_debugfs_init() --- a/frontends/nss/ecm_nss_non_ported_ipv4.h +++ b/frontends/nss/ecm_nss_non_ported_ipv4.h @@ -19,7 +19,7 @@ - + extern bool ecm_nss_non_ported_ipv4_debugfs_init(struct dentry *dentry); - + -extern struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv4_connection_instance_alloc( +struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv4_connection_instance_alloc( uint32_t accel_flags, @@ -37,19 +37,19 @@ --- a/frontends/nss/ecm_nss_non_ported_ipv6.c +++ b/frontends/nss/ecm_nss_non_ported_ipv6.c @@ -1650,6 +1650,7 @@ struct ecm_front_end_connection_instance - + return feci; } +EXPORT_SYMBOL(ecm_nss_non_ported_ipv6_connection_instance_alloc); - + /* * ecm_nss_non_ported_ipv6_debugfs_init() --- a/frontends/nss/ecm_nss_non_ported_ipv6.h +++ b/frontends/nss/ecm_nss_non_ported_ipv6.h @@ -19,7 +19,7 @@ - + extern bool ecm_nss_non_ported_ipv6_debugfs_init(struct dentry *dentry); - + -extern struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv6_connection_instance_alloc( +struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv6_connection_instance_alloc( uint32_t accel_flags, @@ -58,19 +58,19 @@ --- a/frontends/nss/ecm_nss_ported_ipv4.c +++ b/frontends/nss/ecm_nss_ported_ipv4.c @@ -1884,6 +1884,7 @@ struct ecm_front_end_connection_instance - + return feci; } +EXPORT_SYMBOL(ecm_nss_ported_ipv4_connection_instance_alloc); - + /* * ecm_nss_ported_ipv4_debugfs_init() --- a/frontends/nss/ecm_nss_ported_ipv4.h +++ b/frontends/nss/ecm_nss_ported_ipv4.h @@ -19,7 +19,7 @@ - + extern bool ecm_nss_ported_ipv4_debugfs_init(struct dentry *dentry); - + -extern struct ecm_front_end_connection_instance *ecm_nss_ported_ipv4_connection_instance_alloc( +struct ecm_front_end_connection_instance *ecm_nss_ported_ipv4_connection_instance_alloc( uint32_t accel_flags, @@ -79,19 +79,19 @@ --- a/frontends/nss/ecm_nss_ported_ipv6.c +++ b/frontends/nss/ecm_nss_ported_ipv6.c @@ -1797,6 +1797,7 @@ struct ecm_front_end_connection_instance - + return feci; } +EXPORT_SYMBOL(ecm_nss_ported_ipv6_connection_instance_alloc); - + /* * ecm_nss_ported_ipv6_debugfs_init() --- a/frontends/nss/ecm_nss_ported_ipv6.h +++ b/frontends/nss/ecm_nss_ported_ipv6.h @@ -19,7 +19,7 @@ - + extern bool ecm_nss_ported_ipv6_debugfs_init(struct dentry *dentry); - + -extern struct ecm_front_end_connection_instance *ecm_nss_ported_ipv6_connection_instance_alloc( +struct ecm_front_end_connection_instance *ecm_nss_ported_ipv6_connection_instance_alloc( uint32_t accel_flags, diff --git a/qca/qca-nss-ecm/patches/901-qca-nss-ecm-fix-a-memcpy-overflow-in-ecm_db.patch b/qca/qca-nss-ecm/patches/901-qca-nss-ecm-fix-a-memcpy-overflow-in-ecm_db.patch index 529c792..c994e49 100644 --- a/qca/qca-nss-ecm/patches/901-qca-nss-ecm-fix-a-memcpy-overflow-in-ecm_db.patch +++ b/qca/qca-nss-ecm/patches/901-qca-nss-ecm-fix-a-memcpy-overflow-in-ecm_db.patch @@ -48,14 +48,15 @@ Signed-off-By: Francis Le Bourse */ - ipv6_addr_prefix(&prefix_addr, &ecm_in6, cfg->fc_dst_len); + ipv6_addr_prefix(&prefix_addr, &ecm_in6, min(128, cfg->fc_dst_len)); - + DEBUG_TRACE("dest addr prefix: %pI6 prefix_len: %d ecm_in6: %pI6\n", &prefix_addr, cfg->fc_dst_len, &ecm_in6); - + @@ -326,7 +326,7 @@ static int ecm_db_ipv6_route_table_updat * Compute ECM connection's prefix source address by masking it with the * route config's destination address prefix length. */ - ipv6_addr_prefix(&prefix_addr, &ecm_in6, cfg->fc_dst_len); + ipv6_addr_prefix(&prefix_addr, &ecm_in6, min(128, cfg->fc_dst_len)); - + DEBUG_TRACE("src addr prefix: %pI6 prefix_len: %d ecm_in6: %pI6\n", &prefix_addr, cfg->fc_dst_len, &ecm_in6); +