[B2G][Tarako][Data Usage] User is not receiving the data usage alert

RESOLVED WORKSFORME

Status

defect
RESOLVED WORKSFORME
5 years ago
5 years ago

People

(Reporter: rpribble, Assigned: ying.xu)

Tracking

unspecified
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-b2g:1.3T+, b2g-v1.3 unaffected, b2g-v1.3T affected, b2g-v1.4 unaffected, b2g-v2.0 unaffected)

Details

(Whiteboard: [tarako-exploratory][sprd321606][POVB])

Attachments

(3 attachments)

Posted file Logcat.txt
Description:
User is not receiving a data usage alert.

Repro Steps:
1) Update device to BuildID: 20140602014001
2) Launch Data Usage app
3) Navigate through FTE without turning on Data Alert option
4) Tap settings icon in upper right
5) Enable data usage alert (set to 1 MB during testing)

Actual:
No data usage alert is ever received.

Expected:
Data usage alert is received according to user's settings.

Environmental Variables:
Device: Tarako 1.3T
BuildID: 20140602014001
Gaia: 335486c42498fa7a93c21e4d6121199728602ab8
Gecko: 55e4d83019e5
Version: 28.1
Firmware Version: SP6821a-Gonk-4.0-4-29

Notes: Logcat is from time of setting the data usage alert setting to 1MB, to ending at 1.26MB without receiving an alert.

Repro frequency: 100%
See attached: Logcat
This issue does not repro on the Buri v1.3 MOZ ril.

v1.3 Environmental Variables:
Device: Buri v1.3 MOZ
BuildID: 20140529024024
Gaia: 5bd226b03a2d63dfe9df204f7c0afb9984e8fd42
Gecko: 42ef074f380f
Version: 28.0
Firmware Version: v1.2-device.cfg

User received the 1MB data usage alert at 2.97MB.

---------------------------------------------------

This issue does not repro on the Flame v1.4 MOZ ril.

v1.4 Environmental Variables:
Device: Flame v1.4 MOZ
BuildID: 20140530000202
Gaia: fe612fd21389193a8e593aa718831602e5086a62
Gecko: 25011f9a8f26
Version: 30.0
Firmware Version: v10G-2

User received the 1MB data usage alert at 2.36MB.

---------------------------------------------------

This issue DOES repro on the Flame v2.0 MOZ ril.

Environmental Variables:
Device: Flame v2.0 MOZ
BuildID: 20140530040207
Gaia: 26d8fcab9b61f46451600f39c51e0387ef3c4f88
Gecko: e6f113c83095
Version: 32.0a1
RIL Version:
Firmware Version: v10G-2

User never receives a data use alert after passing their limit.
Update: I received a data use alert around 1 hour and 30 minutes after surpassing the 1MB limit. Perhaps similar to bug 858017 (comment 2)?
blocking-b2g: --- → 1.3T?
Component: General → Gaia::Cost Control
Marina, do you mind taking a quick look? thanks
Flags: needinfo?(mri)
ni? reporter or QAWANTED, is this happening only for this specific STR where you set the alert to be less than what you have already used?

does this happen when you set the alert to be something reasonable as an end user and start to use the data towards the limit? in such case, is data alert working? Thanks
Flags: needinfo?(rpribble)
Keywords: qawanted
I tested this on Flame 2.0 Latest build 6/3, the bug did NOT occur for me. I correctly got alerts that I had set to trigger.

Starting Usage: 248kb
Alert Limit: 10mb
Result: Alert Fired Correctly at 10mb

Starting Usage: 10mb
Alert Limit: 20mb
Result: Alert Fired Correctly at 20mb

Flame 2.0
Environmental Variables
Device: Flame 2.0
Build ID: 20140603013002
Gecko: https://hg.mozilla.org/mozilla-central/rev/f28005b84ed0
Gaia: 61cd07a8b5fa017777db6d345e00afb4fb8789b7
Platform Version: 32.0a1
Firmware Version: v10G-2

-----------------------------------------------------

On Tarako 1.3, No matter what limit I set, I would never receive an alert.


Starting Usage: 248kb
Alert Limit: 10mb
Result: NO alert occurred at or around 10mb

Starting Usage: 12mb
Alert Limit: 25mb
Result: NO alert occurred at or around 25mb

1.3T Environmental Variables:
Device: Tarako 1.3T
BuildID: 20140603051834
Gaia: fe4b20403e6fee8b54a69aa872bfb35cbc9af651
Gecko: 76574e67f699
Version: 28.1
Firmware Version: sp6821a-gonk-4.0-5-12


Both of these tests as you can see had limits beyond current usage.
Keywords: qawanted
QA Contact: croesch
Flags: needinfo?(rpribble)
Hi,
could be a firmware problem? I don't have a flame device, but with hamachi the alarms doesn't work with the 1.2 firmware version. (https://bugzilla.mozilla.org/show_bug.cgi?id=990669#c8)

Only for discard another problem, could you please check that the following modules are enabled in config file?:

For that:
*adb pull /proc/config.gz
*unzip the file
*check that the following modules are enabled:
  CONFIG_IP_NF_RAW
  CONFIG_IP6_NF_TARGET_LOG
  CONFIG_IP6_NF_FILTER
  CONFIG_IP6_NF_MANGLE
  CONFIG_IP6_NF_TARGET_REJECT
  CONFIG_IP6_NF_TARGET_REJECT_SKERR
  CONFIG_IP6_NF_RAW
  CONFIG_IP6_NF_IPTABLES

Regards
Flags: needinfo?(mri)
/proc/config.gz does not exist on the Tarako.  Is there any other place that the config file might reside?

(In reply to marina rodríguez [:mai] from comment #6)
> Hi,
> could be a firmware problem? I don't have a flame device, but with hamachi
> the alarms doesn't work with the 1.2 firmware version.
> (https://bugzilla.mozilla.org/show_bug.cgi?id=990669#c8)
> 
> Only for discard another problem, could you please check that the following
> modules are enabled in config file?:
> 
> For that:
> *adb pull /proc/config.gz
> *unzip the file
> *check that the following modules are enabled:
>   CONFIG_IP_NF_RAW
>   CONFIG_IP6_NF_TARGET_LOG
>   CONFIG_IP6_NF_FILTER
>   CONFIG_IP6_NF_MANGLE
>   CONFIG_IP6_NF_TARGET_REJECT
>   CONFIG_IP6_NF_TARGET_REJECT_SKERR
>   CONFIG_IP6_NF_RAW
>   CONFIG_IP6_NF_IPTABLES
> 
> Regards
Flags: needinfo?(mri)
hi James, can your team also check comment 6? Thanks
Flags: needinfo?(james.zhang)
1.3T+
this should have worked before.
could we get regression window? Thanks
blocking-b2g: 1.3T? → 1.3T+
I don't think tarako support IPV6.
Assignee: nobody → sam.hua
Flags: needinfo?(james.zhang)
(In reply to Joe Cheng [:jcheng] from comment #9)
> 1.3T+
> this should have worked before.
> could we get regression window? Thanks

Regression window is unavailable - this occurs in the earliest build we have access to.
Environmental Variables:
Device: Tarako 1.3T
Build ID: 20140414111336
Gaia: 23488b1a45221c17e6a32fdd4c9d0fdbdcf2d021
Gecko: 72055108f470
Version: 28.1 (1.3T) 
Firmware Version: SP6821a-Gonk-4.0-5-12

I set the data usage alert to 1mb, and then used 4.24mb of mobile usage and have yet to receive an alert after 10 minutes.
Keywords: regression
From the log in comment0. 
I think the usage app has started ,then get killed.
so we never recieve the alert.

06-02 16:41:05.898: E/OomLogger(86): [Kill]: lowmem_shrink select 778 (Usage), adj 10, size 5364, to kill
06-02 16:41:05.898: E/OomLogger(86): [Kill]: lowmem_shrink send sigkill to 778 (Usage), adj 10, size 5364
(In reply to ying.xu from comment #12)
> From the log in comment0. 
> I think the usage app has started ,then get killed.
> so we never recieve the alert.
> 
> 06-02 16:41:05.898: E/OomLogger(86): [Kill]: lowmem_shrink select 778
> (Usage), adj 10, size 5364, to kill
> 06-02 16:41:05.898: E/OomLogger(86): [Kill]: lowmem_shrink send sigkill to
> 778 (Usage), adj 10, size 5364

did a test by myself, confirm this.
(In reply to ying.xu from comment #13)

> did a test by myself, confirm this.

I'm sorry, the killing log was the case Usage was put at background manually.

the bug do exist.
Posted file main.log
enable debug option in costcontrol
and capture the log
If you haven't got the /proc/config.gz file, where is detailed the kernel params info, you can check if kernel is ok with the commands detailed at https://bugzilla.mozilla.org/show_bug.cgi?id=960974#c3
(In reply to Albert [:albert] from comment #16)
> If you haven't got the /proc/config.gz file, where is detailed the kernel
> params info, you can check if kernel is ok with the commands detailed at
> https://bugzilla.mozilla.org/show_bug.cgi?id=960974#c3

tarako also disabled ipv6 module in kernel.

root@android:/proc/net/xt_quota # ip6tables -L
ip6tables v1.4.11.1: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
(In reply to Albert [:albert] from comment #16)
> If you haven't got the /proc/config.gz file, where is detailed the kernel
> params info, you can check if kernel is ok with the commands detailed at
> https://bugzilla.mozilla.org/show_bug.cgi?id=960974#c3

I enabled all the configs below
 CONFIG_IP_NF_RAW
  CONFIG_IP6_NF_TARGET_LOG
  CONFIG_IP6_NF_FILTER
  CONFIG_IP6_NF_MANGLE
  CONFIG_IP6_NF_TARGET_REJECT
  CONFIG_IP6_NF_TARGET_REJECT_SKERR
  CONFIG_IP6_NF_RAW
  CONFIG_IP6_NF_IPTABLES

but got some errors
root@android:/proc/net/xt_quota # ip6tables -A INPUT -m owner --socket-exists
ip6tables: No chain/target/match by that name.

1|root@android:/proc/net/xt_quota # ip6tables -A costly_shared -m owner --socket-exists
ip6tables: No chain/target/match by that name.

1|root@android:/proc/net/xt_quota # ip6tables -A costly_wlan0 -m owner --socke>
ip6tables: No chain/target/match by that name.
and
root@android:/proc/net/xt_quota # cat veth0                                    
9223372036853062084
Flags: needinfo?(mri)
Flags: needinfo?(acperez)
(In reply to ying.xu from comment #18)
> (In reply to Albert [:albert] from comment #16)
> > If you haven't got the /proc/config.gz file, where is detailed the kernel
> > params info, you can check if kernel is ok with the commands detailed at
> > https://bugzilla.mozilla.org/show_bug.cgi?id=960974#c3
> 
> I enabled all the configs below
>  CONFIG_IP_NF_RAW
>   CONFIG_IP6_NF_TARGET_LOG
>   CONFIG_IP6_NF_FILTER
>   CONFIG_IP6_NF_MANGLE
>   CONFIG_IP6_NF_TARGET_REJECT
>   CONFIG_IP6_NF_TARGET_REJECT_SKERR
>   CONFIG_IP6_NF_RAW
>   CONFIG_IP6_NF_IPTABLES
> 
> but got some errors
> root@android:/proc/net/xt_quota # ip6tables -A INPUT -m owner --socket-exists
> ip6tables: No chain/target/match by that name.
> 
> 1|root@android:/proc/net/xt_quota # ip6tables -A costly_shared -m owner
> --socket-exists
> ip6tables: No chain/target/match by that name.
> 
> 1|root@android:/proc/net/xt_quota # ip6tables -A costly_wlan0 -m owner
> --socke>
> ip6tables: No chain/target/match by that name.

Is very strange that you are able to set INPUT -A chain and then it says no chain for command ip6tables -A INPUT -m owner --socket-exists

Maybe a typo error?

At least, if you have a value for xt_quota is a good signal.

Can we have the kernel image for testing?
Flags: needinfo?(acperez)
(In reply to Albert [:albert] from comment #20)

> Maybe a typo error?

NO

> At least, if you have a value for xt_quota is a good signal.
> 
> Can we have the kernel image for testing?

I uploaded it as an attachment
Flags: needinfo?(acperez)
I found these code run fault

void NetworkUtils::setQuota(CommandChain* aChain,
                            CommandCallback aCallback,
                            NetworkResultOptions& aResult)
{
  char command[MAX_COMMAND_SIZE];
  snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld", GET_CHAR(mIfname), LLONG_MAX);

  doCommand(command, aChain, aCallback);
}

command should be "bandwidth setiquota veth0 999998152"

(gdb) p *aChain
$39 = {mIndex = 1, mParams = {mId = 14, mCmd = {<nsAString_internal> = {
        mData = 0x4294b608 u"enableNetworkInterfaceAlarm", mLength = 27, mFlags = 5}, <No data fields>}, fields>}, mIfname = {<nsAString_internal> = {
        mData = 0x42933888 u"veth0", mLength = 5, mFlags = 5}, <No data fields>}, 
{<nsAString_internal> = {mData = 0x421e5824 u"", mLength = 0, mFlags = 1}, <No data fields>}, 
    mThreshold = 999998152}, mCommands = 0x421593bc, mLength = 4, 
  mError = 0x412ffae1 <NetworkUtils::networkInterfaceAlarmFail(NetworkParams&, mozilla::dom::NetworkResultOptions&)>}

(gdb) p command
$41 = "bandwidth setiquota veth0 9223372036854775807", '\000' <repeats 33 times>"\360,
Whiteboard: [tarako-exploratory] → [tarako-exploratory][sprd321606]
Flags: needinfo?(dlee)
(In reply to ying.xu from comment #22)
> I found these code run fault
> 
> void NetworkUtils::setQuota(CommandChain* aChain,
>                             CommandCallback aCallback,
>                             NetworkResultOptions& aResult)
> {
>   char command[MAX_COMMAND_SIZE];
>   snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld",
> GET_CHAR(mIfname), LLONG_MAX);
> 
>   doCommand(command, aChain, aCallback);
> }
> 
> command should be "bandwidth setiquota veth0 999998152"
> 
> (gdb) p *aChain
> $39 = {mIndex = 1, mParams = {mId = 14, mCmd = {<nsAString_internal> = {
>         mData = 0x4294b608 u"enableNetworkInterfaceAlarm", mLength = 27,
> mFlags = 5}, <No data fields>}, fields>}, mIfname = {<nsAString_internal> = {
>         mData = 0x42933888 u"veth0", mLength = 5, mFlags = 5}, <No data
> fields>}, 
> {<nsAString_internal> = {mData = 0x421e5824 u"", mLength = 0, mFlags = 1},
> <No data fields>}, 
>     mThreshold = 999998152}, mCommands = 0x421593bc, mLength = 4, 
>   mError = 0x412ffae1
> <NetworkUtils::networkInterfaceAlarmFail(NetworkParams&,
> mozilla::dom::NetworkResultOptions&)>}
> 
> (gdb) p command
> $41 = "bandwidth setiquota veth0 9223372036854775807", '\000' <repeats 33
> times>"\360,

After calling "bandwidth setiquota veth0 command", NetworkUtils should then call
"bandwidth setinterfacealert veth0 999998152" according to your case. It should notify alarm
when exceed this threshold.
Flags: needinfo?(dlee)
sorry typo for first line, "bandwidth setiquota veth0 9223372036854775807"
(In reply to ying.xu from comment #21)
> Created attachment 8438224 [details]
> bootimg.zip enable the ipv6 config
> 
> (In reply to Albert [:albert] from comment #20)
> 
> > Maybe a typo error?
> 
> NO
> 
> > At least, if you have a value for xt_quota is a good signal.
> > 
> > Can we have the kernel image for testing?
> 
> I uploaded it as an attachment

Sorry, I tried to get a tarako for testing but we haven't got any.
Flags: needinfo?(acperez)
(In reply to ying.xu from comment #22)
> I found these code run fault
> 
> void NetworkUtils::setQuota(CommandChain* aChain,
>                             CommandCallback aCallback,
>                             NetworkResultOptions& aResult)
> {
>   char command[MAX_COMMAND_SIZE];
>   snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld",
> GET_CHAR(mIfname), LLONG_MAX);
> 
>   doCommand(command, aChain, aCallback);
> }
> 
> command should be "bandwidth setiquota veth0 999998152"
> 
> (gdb) p *aChain
> $39 = {mIndex = 1, mParams = {mId = 14, mCmd = {<nsAString_internal> = {
>         mData = 0x4294b608 u"enableNetworkInterfaceAlarm", mLength = 27,
> mFlags = 5}, <No data fields>}, fields>}, mIfname = {<nsAString_internal> = {
>         mData = 0x42933888 u"veth0", mLength = 5, mFlags = 5}, <No data
> fields>}, 
> {<nsAString_internal> = {mData = 0x421e5824 u"", mLength = 0, mFlags = 1},
> <No data fields>}, 
>     mThreshold = 999998152}, mCommands = 0x421593bc, mLength = 4, 
>   mError = 0x412ffae1
> <NetworkUtils::networkInterfaceAlarmFail(NetworkParams&,
> mozilla::dom::NetworkResultOptions&)>}
> 
> (gdb) p command
> $41 = "bandwidth setiquota veth0 9223372036854775807", '\000' <repeats 33
> times>"\360,

You mean that the problem is the quota's value?
(In reply to Albert [:albert] from comment #25)

> Sorry, I tried to get a tarako for testing but we haven't got any.

It seems I need to fix this first.
Can you find someone looking at this?

E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A costly_shared -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A costly_shared -m owner --socket-exists res=256


D/NetworkUtils(   85): disableNetworkInterfaceAlarms: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth removeiquota veth0' command...
D/NetworkUtils(   85): Sending 'bandwidth removeiquota veth0' command to netd.
E/BandwidthController(   87): No such iface veth0 to delete
D/NetworkUtils(   85): Receiving "bandwidth removeiquota veth0" command response from netd.
D/NetworkUtils(   85):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils(   85): disableNetworkInterfaceAlarms: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth removeiquota veth0' command...
D/NetworkUtils(   85): Sending 'bandwidth removeiquota veth0' command to netd.
E/BandwidthController(   87): No such iface veth0 to delete
D/NetworkUtils(   85): Receiving "bandwidth removeiquota veth0" command response from netd.
D/NetworkUtils(   85):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils(   85): setNetworkInterfaceAlarms: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth setinterfacealert veth0 20963572' command...
D/NetworkUtils(   85): Sending 'bandwidth setinterfacealert veth0 20963572' command to netd.
E/BandwidthController(   87): Need to have a prior interface quota set to set an alert
D/NetworkUtils(   85): Receiving "bandwidth setinterfacealert veth0 20963572" command response from netd.
D/NetworkUtils(   85):           ==> Code: 400  Reason: Bandwidth command failed

D/NetworkUtils(   85): enableNetworkInterfaceAlarm: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth enable' command...
D/NetworkUtils(   85): Sending 'bandwidth enable' command to netd.
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A costly_shared -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A costly_shared -m owner --socket-exists res=256
D/NetworkUtils(   85): Receiving "bandwidth enable" command response from netd.
D/NetworkUtils(   85):           ==> Code: 200  Reason: Bandwidth command succeeeded
D/NetworkUtils(   85): Preparing to send 'bandwidth setiquota veth0' command...
D/NetworkUtils(   85): Sending 'bandwidth setiquota veth0' command to netd.
D/NetworkUtils(   85): Receiving "bandwidth setiquota veth0" command response from netd.
D/NetworkUtils(   85):           ==> Code: 500  Reason: Usage: bandwidth setiquota <interface> <bytes>
D/NetworkUtils(   85): disableNetworkInterfaceAlarms: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth removeiquota veth0' command...
D/NetworkUtils(   85): Sending 'bandwidth removeiquota veth0' command to netd.
E/BandwidthController(   87): No such iface veth0 to delete
D/NetworkUtils(   85): Receiving "bandwidth removeiquota veth0" command response from netd.
D/NetworkUtils(   85):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils(   85): disableNetworkInterfaceAlarms: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth removeiquota veth0' command...
D/NetworkUtils(   85): Sending 'bandwidth removeiquota veth0' command to netd.
E/BandwidthController(   87): No such iface veth0 to delete
D/NetworkUtils(   85): Receiving "bandwidth removeiquota veth0" command response from netd.
D/NetworkUtils(   85):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils(   85): setNetworkInterfaceAlarms: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth setinterfacealert veth0 963572' command...
D/NetworkUtils(   85): Sending 'bandwidth setinterfacealert veth0 963572' command to netd.
E/BandwidthController(   87): Need to have a prior interface quota set to set an alert
D/NetworkUtils(   85): Receiving "bandwidth setinterfacealert veth0 963572" command response from netd.
D/NetworkUtils(   85):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils(   85): enableNetworkInterfaceAlarm: veth0
D/NetworkUtils(   85): Preparing to send 'bandwidth enable' command...
D/NetworkUtils(   85): Sending 'bandwidth enable' command to netd.
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A costly_shared -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A costly_shared -m owner --socket-exists res=256
D/NetworkUtils(   85): Receiving "bandwidth enable" command response from netd.
D/NetworkUtils(   85):           ==> Code: 200  Reason: Bandwidth command succeeeded
D/NetworkUtils(   85): Preparing to send 'bandwidth setiquota veth0' command...
D/NetworkUtils(   85): Sending 'bandwidth setiquota veth0' command to netd.
D/NetworkUtils(   85): Receiving "bandwidth setiquota veth0" command response from netd.
D/NetworkUtils(   85):           ==> Code: 500  Reason: Usage: bandwidth setiquota <interface> <bytes>
(In reply to Albert [:albert] from comment #26)
> >  char command[MAX_COMMAND_SIZE];
> >   snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld",
> > GET_CHAR(mIfname), LLONG_MAX);

> You mean that the problem is the quota's value?

 I don't understand why there is %lld and LLONG_MAX here.
and not set command[MAX_COMMAND_SIZE] to zero at the begin of the function.
with this patch
@@ -550,8 +550,8 @@ void NetworkUtils::setQuota(CommandChain* aChain,
                             CommandCallback aCallback,
                             NetworkResultOptions& aResult)
 {
-  char command[MAX_COMMAND_SIZE];
-  snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld", GET_CHAR(mIfname), LLONG_MAX);
+  char command[MAX_COMMAND_SIZE] = {0};
+  snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %ld", GET_CHAR(mIfname), GET_FIELD(mThreshold));
 
   doCommand(command, aChain, aCallback);
 }


I can get these log

D/NetworkUtils( 5011): Receiving broadcast message from netd.
D/NetworkUtils( 5011):           ==> Code: 600  Reason: Iface linkstate veth0 down
D/NetworkUtils( 5011): Receiving broadcast message from netd.
D/NetworkUtils( 5011):           ==> Code: 600  Reason: Iface linkstate veth0 up
D/NetworkUtils( 5011): disableNetworkInterfaceAlarms: veth0
D/NetworkUtils( 5011): Preparing to send 'bandwidth removeiquota veth0' command...
D/NetworkUtils( 5011): Sending 'bandwidth removeiquota veth0' command to netd.
E/BandwidthController(   87): No such iface veth0 to delete
D/NetworkUtils( 5011): Receiving "bandwidth removeiquota veth0" command response from netd.
D/NetworkUtils( 5011):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils( 5011): setNetworkInterfaceAlarms: veth0
D/NetworkUtils( 5011): Preparing to send 'bandwidth setinterfacealert veth0 10999840' command...
D/NetworkUtils( 5011): Sending 'bandwidth setinterfacealert veth0 10999840' command to netd.
E/BandwidthController(   87): Need to have a prior interface quota set to set an alert
D/NetworkUtils( 5011): Receiving "bandwidth setinterfacealert veth0 10999840" command response from netd.
D/NetworkUtils( 5011):           ==> Code: 400  Reason: Bandwidth command failed
D/NetworkUtils( 5011): enableNetworkInterfaceAlarm: veth0
D/NetworkUtils( 5011): Preparing to send 'bandwidth enable' command...
D/NetworkUtils( 5011): Sending 'bandwidth enable' command to netd.
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A costly_shared -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A costly_shared -m owner --socket-exists res=256
D/NetworkUtils( 5011): Receiving "bandwidth enable" command response from netd.
D/NetworkUtils( 5011):           ==> Code: 200  Reason: Bandwidth command succeeeded
D/NetworkUtils( 5011): Preparing to send 'bandwidth setiquota veth0 10999840' command...
D/NetworkUtils( 5011): Sending 'bandwidth setiquota veth0 10999840' command to netd.
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A costly_veth0 -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A costly_veth0 -m owner --socket-exists res=256
E/BandwidthController(   87): Failed set quota rule
E/BandwidthController(   87): No such iface veth0 to delete
D/NetworkUtils( 5011): Receiving "bandwidth setiquota veth0 10999840" command response from netd.
D/NetworkUtils( 5011):           ==> Code: 400  Reason: Bandwidth command failed

still failed
Assignee: sam.hua → ying.xu
what is the ETA for this? is this something will be fixed in sprint5?
Flags: needinfo?(ying.xu)
(In reply to Wesley Huang [:wesley_huang] from comment #30)
> what is the ETA for this? is this something will be fixed in sprint5?

We have some trouble. These commands still run failed. Could you find someone on your side to look at this?

E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A INPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A OUTPUT -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables -A costly_shared -m owner --socket-exists res=256
E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables -A costly_shared -m owner --socket-exists res=256
Flags: needinfo?(ying.xu)
It will increase about 300KB RAM on kernel side, I think we should disable feature due to low memory device.
What do you think about?
Any update on this ?
no any progress due to Comment 32
ni? Joe and Marvin to see if comment 32 is the path we are taking.
Flags: needinfo?(mkhoo)
Flags: needinfo?(jcheng)
instead removing have we ask anyone who can look at the problem?
Flags: needinfo?(mkhoo)
Marina, wonder if you are able to provide further input on comment 31? thanks
Flags: needinfo?(jcheng) → needinfo?(mri)
Sorry, 
we don't have a tarako device. We cannot work on the bug without the device.
Regards
Flags: needinfo?(mri)
(In reply to ying.xu from comment #31)
> (In reply to Wesley Huang [:wesley_huang] from comment #30)
> > what is the ETA for this? is this something will be fixed in sprint5?
> 
> We have some trouble. These commands still run failed. Could you find
> someone on your side to look at this?
> 
> E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables
> -A INPUT -m owner --socket-exists res=256
> E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables
> -A INPUT -m owner --socket-exists res=256
> E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables
> -A OUTPUT -m owner --socket-exists res=256
> E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables
> -A OUTPUT -m owner --socket-exists res=256
> E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/iptables
> -A costly_shared -m owner --socket-exists res=256
> E/BandwidthController(   87): runIptablesCmd(): failed /system/bin/ip6tables
> -A costly_shared -m owner --socket-exists res=256

Just checked the kernel config, CONFIG_IP_NF_MATCH_OWNER and IPv6 are disabled in Tarako kernel config.
This is why these iptables commands not working. As James Zhang mentioned in comment #32, this is due to low memory device.

Change this case as POVB.

Hi! James,

Please close this case if you wouldn't enable CONFIG_IP_NF_MATCH_OWNER and IPv6 as final conclusion.
Thanks

--
Keven
Flags: needinfo?(james.zhang)
Whiteboard: [tarako-exploratory][sprd321606] → [tarako-exploratory][sprd321606][POVB]
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(james.zhang)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.