diff options
-rw-r--r-- | ipacm/inc/IPACM_Lan.h | 4 | ||||
-rw-r--r-- | ipacm/inc/IPACM_Wlan.h | 2 | ||||
-rw-r--r-- | ipacm/src/IPACM_Lan.cpp | 4 | ||||
-rw-r--r-- | ipacm/src/IPACM_OffloadManager.cpp | 38 | ||||
-rw-r--r-- | ipacm/src/IPACM_Wan.cpp | 5 | ||||
-rw-r--r-- | ipacm/src/IPACM_Wlan.cpp | 1 |
6 files changed, 43 insertions, 11 deletions
diff --git a/ipacm/inc/IPACM_Lan.h b/ipacm/inc/IPACM_Lan.h index 83b2211..bf815c5 100644 --- a/ipacm/inc/IPACM_Lan.h +++ b/ipacm/inc/IPACM_Lan.h @@ -396,8 +396,8 @@ private: { for(num_v6 =0;num_v6 < get_client_memptr(eth_client, clt_indx)->route_rule_set_v6;num_v6++) { - /* send client-v6 delete to pcie modem only with global ipv6 with tx_index = 0 one time*/ - if(is_global_ipv6_addr(get_client_memptr(eth_client, clt_indx)->v6_addr[num_v6]) && (IPACM_Wan::backhaul_mode == Q6_MHI_WAN) && (tx_index == 0) + /* send client-v6 delete to pcie modem only with global ipv6 with tx_index = 1 one time*/ + if(is_global_ipv6_addr(get_client_memptr(eth_client, clt_indx)->v6_addr[num_v6]) && (IPACM_Wan::backhaul_mode == Q6_MHI_WAN) && (get_client_memptr(eth_client, clt_indx)->v6_rt_rule_id[num_v6] > 0)) { IPACMDBG_H("Delete client index %d ipv6 RT-rules for %d-st ipv6 for rule-id:%d\n", clt_indx,num_v6, diff --git a/ipacm/inc/IPACM_Wlan.h b/ipacm/inc/IPACM_Wlan.h index f7508db..9c828ee 100644 --- a/ipacm/inc/IPACM_Wlan.h +++ b/ipacm/inc/IPACM_Wlan.h @@ -189,7 +189,7 @@ private: for(num_v6 =0;num_v6 < get_client_memptr(wlan_client, clt_indx)->route_rule_set_v6;num_v6++) { /* send client-v6 delete to pcie modem only with global ipv6 with tx_index = 0 one time*/ - if(is_global_ipv6_addr(get_client_memptr(wlan_client, clt_indx)->v6_addr[num_v6]) && (IPACM_Wan::backhaul_mode == Q6_MHI_WAN) && (tx_index == 0) + if(is_global_ipv6_addr(get_client_memptr(wlan_client, clt_indx)->v6_addr[num_v6]) && (IPACM_Wan::backhaul_mode == Q6_MHI_WAN) && (get_client_memptr(wlan_client, clt_indx)->v6_rt_rule_id[num_v6] > 0)) { IPACMDBG_H("Delete client index %d ipv6 RT-rules for %d-st ipv6 for rule-id:%d\n", clt_indx,num_v6, diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp index 8067053..9dfac2e 100644 --- a/ipacm/src/IPACM_Lan.cpp +++ b/ipacm/src/IPACM_Lan.cpp @@ -2425,7 +2425,7 @@ int IPACM_Lan::handle_eth_client_route_rule(uint8_t *mac_addr, ipa_ip_type iptyp IPACMDBG_H("tx:%d, rt rule hdl=%x ip-type: %d\n", tx_index, get_client_memptr(eth_client, eth_index)->eth_rt_hdl[tx_index].eth_rt_rule_hdl_v6_wan[v6_num], iptype); - /* send client-v6 info to pcie modem only with global ipv6 with tx_index = 0 one time*/ + /* send client-v6 info to pcie modem only with global ipv6 with tx_index = 1 one time*/ if(is_global_ipv6_addr(get_client_memptr(eth_client, eth_index)->v6_addr[v6_num]) && (IPACM_Wan::backhaul_mode == Q6_MHI_WAN)) { if (add_connection(eth_index, v6_num)) @@ -6132,7 +6132,7 @@ int IPACM_Lan::add_connection(int client_index, int v6_num) } get_client_memptr(eth_client, client_index)->v6_rt_rule_id[v6_num] = pFilteringTable->rules[0].flt_rule_hdl; - + IPACMDBG_H("%d-st client v6_num %d: id handle 0x%x\n", client_index, v6_num, get_client_memptr(eth_client, client_index)->v6_rt_rule_id[v6_num]); fail: close(fd); if(pFilteringTable != NULL) diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp index 0e6a53e..7919413 100644 --- a/ipacm/src/IPACM_OffloadManager.cpp +++ b/ipacm/src/IPACM_OffloadManager.cpp @@ -603,7 +603,7 @@ RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, ui return FAIL_INPUT_CHECK; } - IPACMDBG_H("SET_DATA_QUOTA %s %llu", quota.interface_name, (long long)mb); + IPACMDBG_H("SET_DATA_QUOTA %s %llu\n", quota.interface_name, (long long)mb); rc = ioctl(fd, WAN_IOC_SET_DATA_QUOTA, "a); @@ -778,12 +778,14 @@ IPACM_OffloadManager* IPACM_OffloadManager::GetInstance() bool IPACM_OffloadManager::search_framwork_cache(char * interface_name) { bool rel = false; + bool cache_need = false; /* IPACM needs to kee old FDs, can't clear */ IPACMDBG_H("check netdev(%s)\n", interface_name); for(int i = 0; i < MAX_EVENT_CACHE ;i++) { + cache_need = false; if(event_cache[i].valid == true) { //do the compare @@ -793,14 +795,40 @@ bool IPACM_OffloadManager::search_framwork_cache(char * interface_name) { IPACMDBG_H("found netdev (%s) in entry (%d) with event (%d)\n", interface_name, i, event_cache[i].event); /* post event again */ - if (event_cache[i].event == IPA_DOWNSTREAM_ADD) + if (event_cache[i].event == IPA_DOWNSTREAM_ADD) { + /* check if downsteam netdev driver finished its configuration on IPA-HW for ipv4 and ipv6 */ + if (event_cache[i].prefix_cache.fam == V4 && IPACM_Iface::ipacmcfg->CheckNatIfaces(event_cache[i].dev_name, IPA_IP_v4)) + cache_need = true; + if (event_cache[i].prefix_cache.fam == V6 && IPACM_Iface::ipacmcfg->CheckNatIfaces(event_cache[i].dev_name, IPA_IP_v6)) + cache_need = true; + if (cache_need) { + IPACMDBG_H("still need cache (%d), index (%d) ip-family (%d)\n", cache_need, i, event_cache[i].prefix_cache.fam); + break; + } else { + IPACMDBG_H("no need cache (%d), handling it event (%d)\n", cache_need, event_cache[i].event); addDownstream(interface_name, event_cache[i].prefix_cache); - else if (event_cache[i].event == IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT) + } + } else if (event_cache[i].event == IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT) { + /* check if upstream netdev driver finished its configuration on IPA-HW for ipv4 and ipv6 */ + if (event_cache[i].prefix_cache.fam == V4 && IPACM_Iface::ipacmcfg->CheckNatIfaces(event_cache[i].dev_name, IPA_IP_v4)) + cache_need = true; + if (event_cache[i].prefix_cache_v6.fam == V6 && IPACM_Iface::ipacmcfg->CheckNatIfaces(event_cache[i].dev_name, IPA_IP_v6)) + cache_need = true; + if (cache_need) { + IPACMDBG_H("still need cache (%d), index (%d)\n", cache_need, i); + break; + } else { + IPACMDBG_H("no need cache (%d), handling it event (%d)\n", cache_need, event_cache[i].event); setUpstream(interface_name, event_cache[i].prefix_cache, event_cache[i].prefix_cache_v6); - else - IPACMERR("wrong event cached (%d)", event_cache[i].event); + } + } else { + IPACMERR("wrong event cached (%d) index (%d)\n", event_cache[i].event, i); + } + + /* reset entry */ event_cache[i].valid = false; rel = true; + IPACMDBG_H("reset entry (%d)", i); } } } diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp index 823fe96..498f3b6 100644 --- a/ipacm/src/IPACM_Wan.cpp +++ b/ipacm/src/IPACM_Wan.cpp @@ -1345,6 +1345,7 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param) else if(m_is_sta_mode == Q6_MHI_WAN) { /* only need cleanup rt-rule*/ + del_dft_firewall_rules(IPA_IP_v4); handle_route_del_evt(IPA_IP_v4); } else @@ -1379,6 +1380,7 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param) else if(m_is_sta_mode == Q6_MHI_WAN) { /* only need cleanup rt-rule*/ + del_dft_firewall_rules(IPA_IP_v6); handle_route_del_evt(IPA_IP_v6); } @@ -7321,7 +7323,8 @@ fail: int IPACM_Wan::delete_offload_frag_rule() { - int len, res = true; + int res = IPACM_SUCCESS; + int len; ipa_ioc_del_flt_rule *pFilteringTable = NULL; struct ipa_flt_rule_del flt_rule_entry; diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp index 173c41f..b7fb9ff 100644 --- a/ipacm/src/IPACM_Wlan.cpp +++ b/ipacm/src/IPACM_Wlan.cpp @@ -2526,6 +2526,7 @@ int IPACM_Wlan::add_connection(int client_index, int v6_num) } get_client_memptr(wlan_client, client_index)->v6_rt_rule_id[v6_num] = pFilteringTable->rules[0].flt_rule_hdl; + IPACMDBG_H("%d-st client v6_num %d: id handle 0x%x\n", client_index, v6_num, get_client_memptr(wlan_client, client_index)->v6_rt_rule_id[v6_num]); fail: close(fd); |