* changes:
Enable BTF for maps loaded by NetBpfLoad
Add method to get key value type ids
Add method to load btf into kernel
Add method to update btf_var_secinfo.offset
Add method to update btf_type.size for BTF_KIND_DATASEC
Maciej Żenczykowskiauthored and Gerrit Code Reviewcommited 2025-03-18 17:04:56 -07:00
BPF_ANNOTATE_KV_PAIR is used to tell the bpf loader about the btf
key_type and value_type of a bpf map.
This CL adds a method to get key value type ids from
BPF_ANNOTATE_KV_PAIR
Bug: 403381101
Test: boot
Change-Id: If308d49b64b38f65991a0a8177e5072d54e2cdf6
Motomu Utsumiauthored and Maciej Żenczykowskicommited 2025-03-18 12:15:39 -07:00
size in btf_type of BTF_KIND_DATASEC is 0 at compilation time.
So bpf loader needs to update to actual size based on ELF's section
size.
Bug: 403381101
Test: boot
Change-Id: I78fb26a5b8eeb120044b5737667f472fac51d79f
Motomu Utsumiauthored and Maciej Żenczykowskicommited 2025-03-18 11:46:16 -07:00
As ConnectivityService is ready to accept messages about a network
agent, it should process messages immediately and before messages
from other agents are processed.
This is because of minute ordering issues between the agent process,
ConnectivityService and the network stack. In particular, as the agent
is created, ConnectivityService requests the NetworkMonitor from the
network stack ; while this is happening, the process creating the
agent may have sent a bunch of other messages... including, but not
limited to, disconnects or creation of other agents.
The operative case is the case where a disconnect is in the queue.
agent1.register
→ CS creates the monitor for agent 1
agent1.unregisterAfterReplacement
→ CS enqueues in agent1 pending creation of the monitor
agent2.register
→ CS creates the monitor for agent 2
monitor for agent 1 is created
→ CS posts a message to complete agent 1 creation
monitor for agent 2 is created
→ CS posts a message to complete agent 2 creation
agent 1 creation completes
→ CS re-posts the unregisterAfterReplacement message
agent 2 creation completes
...and this is where things fail, because unregistering agent 1
isn't processed yet. If they use the same interface (which is
a common use case for unregisterAfterReplacement) then this
creation will fail.
To address this, this patch will process all agent1 messages
synchronously as the creation completes. It will solve the case
above, and it passes all tests for early network creation.
However, it is worth noting that this is not actually correct,
because it does not guarantee that all messages are processed
in order. Namely, two agents have separate queues and
therefore if they send interleaved messages while CS is
waiting for the NetworkMonitor to be created, the order of
these messages will be lost. e.g.
agent1.register
agent2.register
agent1.unregisterAfterReplacement
The case above SHOULD fail if the agents have the same
interface, but with this patch it will likely succeed because
the call to agent1.unregisterAfterReplacement will be received
while the two NetworkMonitor are being created, and then
be processed as agent1 finishes registration.
The correct change, therefore, would really enqueue all
messages when *any* agent (of the same process at least)
is being created. However, it is arguable whether it's worth
building that change over this one, and it is even arguable
whether the behavior of this here change might not be
better, insofar as two agent messages are generally
unrelated to each other except for unregistering.
Test: CtsNetTestCases ConnectivityCoverageTests
Change-Id: Idf75e4e96c67a456cf0979a79321603b46e8c99c
Now that the system server has a queue doing this job,
the queue on the network agent side can be removed.
Test: ConnectivityCoverageTests, CtsNetTestCases
Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b
* changes:
Reapply "Add a queue system server-side for NetworkAgent"
Reapply "Unify registration and NM assignment in NAI"
Reapply "Return the registry in registerNetworkAgent."
Jean Chalardauthored and Gerrit Code Reviewcommited 2025-03-18 03:19:07 -07:00
This commit updates ApfIntegrationTest to reflect the latest
requirements for supporting APFv6 and APFv6.1, including their
respective memory requirements.
Test: TH
Change-Id: I29e8e692eaf8e378fea99bda36c752d9d729ed86
Device Owner and Carrier-privileged tethering usage relies on starting
tethering without TETHER_PRIVILEGE permission. Add utilities to
CtsTetheringUtils to do this.
Bug: 295979433
Test: atest DeviceOwnerTest TetheringManagerTest
Change-Id: Id3eba71481e27ccfa32f2b0588b8a74c490c5311
Quang Anh Luongcommited 2025-03-18 16:24:39 +09:00
This change corrects a missing function error, which was renamed in aosp/3545962.
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I2f51702adfa48f2207ef4dd79f641c8f57d15ac7
Separate 'running' flag out into 'running' and 'sigterm',
and make SIGTERM handler the only thing that sets 'sigterm'.
running is cleared via catastrophic errors, ie. EOF and ENETDOWN
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8254c3f4643d60feff1cb32aaa9784dca18e138c
Maciej Żenczykowskicommited 2025-03-17 22:53:32 -07:00
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit a5ec9b4112.
Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: I71abf9d02bdd34a4de80157a3f42bdfee6f6617e
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 30fcf820f9.
Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: I57f25f5e6481106255df0ab69558e351eb938f68
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 653d5f1ef4.
Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: If6b1541981803dc84de57b48adb13d40c9997fa0
* changes:
[Thread] unregister all country code callbacks when CountryCode is not needed
[Thread] do not set the country code again if the co-processor doesn't support it
Zhanglong Xiaauthored and Gerrit Code Reviewcommited 2025-03-17 22:10:39 -07:00
Move the existing helper methods to acquire carrier privileges in
NetworkAgentTest.kt to CarrierConfigRule where it can be reused by other
CTS tests. Also reset the carrier service package override in the rule
cleanup.
Bug: 216524590
Test: atest NetworkAgentTest
Change-Id: Id907a2d641aa61838119e2be65654b9796464498
Quang Anh Luongcommited 2025-03-18 13:05:01 +09:00
This commit unregisters all country code callbacks (WiFi, Telephony and
Location) when the CountryCode module detects that the co-processor
doesn't support setting the country code.
Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#setCountryCodeNotSupported_returnUnsupportedFeatureError_unregisterAllCallbacks
Change-Id: I65d57e0e826202ad696335200645bf6d78c8b87c
Some the co-processors do not support setting the country code. This
commit enables the CountryCode module doesn't set the country again
after it knows that the co-processor doesn't support setting the
country code.
Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#setCountryCodeNotSupported_returnUnsupportedFeatureError_countryCodeNotSetAgain
Change-Id: I8ca1f7aed3774a086e114e91d8100fb7fe9e3664