Skip to content

Commit

Permalink
Fix udprpc task ID (oxidecomputer#1046)
Browse files Browse the repository at this point in the history
Previously, `udprpc` assumed the target task was at generation 0.

This also adds `udprpc` and `udpbroadcast` to the Gimletlet image, and removes a
vestigal constant.
  • Loading branch information
mkeeter authored Jan 3, 2023
1 parent 2732730 commit 68a0a14
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
34 changes: 33 additions & 1 deletion app/gimletlet/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ task-slots = ["sys"]

[tasks.net]
name = "task-net"
stacksize = 3800
stacksize = 6040
priority = 3
features = ["h753", "vlan", "gimletlet-nic"]
max-sizes = {flash = 131072, ram = 32768, sram1 = 16384}
Expand All @@ -170,6 +170,15 @@ start = true
interrupts = {"eth.irq" = 0b1, "tim16.irq" = 0b10}
task-slots = ["sys", "spi_driver" ]

[tasks.udprpc]
name = "task-udprpc"
priority = 6
max-sizes = {flash = 32768, ram = 8192}
stacksize = 4096
start = true
task-slots = ["net"]
features = ["vlan"]

[tasks.udpecho]
name = "task-udpecho"
priority = 4
Expand All @@ -179,6 +188,15 @@ start = true
task-slots = ["net"]
features = ["vlan"]

[tasks.udpbroadcast]
name = "task-udpbroadcast"
priority = 6
max-sizes = {flash = 16384, ram = 8192}
stacksize = 4096
start = true
task-slots = ["net"]
features = ["vlan"]

[tasks.control_plane_agent]
name = "task-control-plane-agent"
priority = 7
Expand Down Expand Up @@ -323,13 +341,27 @@ cs = [{port = "E", pin = 11}]
[config.net]
vlan = { start = 0x301, count = 2 }

[config.net.sockets.broadcast]
kind = "udp"
owner = {name = "udpbroadcast", notification = 1}
port = 997
tx = { packets = 3, bytes = 1024 }
rx = { packets = 3, bytes = 1024 }

[config.net.sockets.echo]
kind = "udp"
owner = {name = "udpecho", notification = 1}
port = 7
tx = { packets = 3, bytes = 1024 }
rx = { packets = 3, bytes = 1024 }

[config.net.sockets.rpc]
kind = "udp"
owner = {name = "udprpc", notification = 1}
port = 998
tx = { packets = 3, bytes = 1024 }
rx = { packets = 3, bytes = 1024 }

[config.net.sockets.control_plane_agent]
kind = "udp"
owner = {name = "control_plane_agent", notification = 0b01}
Expand Down
5 changes: 4 additions & 1 deletion task/udprpc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ fn main() -> ! {
// u32 return code from the `sys_send` call.
let tx_data =
&mut tx_data_buf[REPLY_PREFIX_SIZE..][..nreply];

let task_id =
sys_refresh_task_id(TaskId(header.task.get()));
let (rc, len) = sys_send(
TaskId(header.task.get()),
task_id,
header.op.get(),
rx_data,
tx_data,
Expand Down

0 comments on commit 68a0a14

Please sign in to comment.