Skip to content

Commit 15d04c6

Browse files
a-r-ncopybara-github
authored andcommitted
set_multiqueue: make x4 "multinic accelerator"; extend IDPF ring length beyond a4x-max
Makes the previously a4x-max-specific IDPF ring length change apply to any machine type in the "multinic accelerator" list. Given the curent list, the only machines this applies for are a4x-max and x4. The remaining machines are VM-only and don't have IRDMA support, so will either use VIRTIO_NET or GVNIC only. PiperOrigin-RevId: 875217306
1 parent 93c87f1 commit 15d04c6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/usr/bin/google_set_multiqueue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ function get_metadata() {
5252
}
5353

5454
A4X_ALL_CPUS_MASK="0000ffff,ffffffff,ffffffff,ffffffff,ffffffff"
55-
A4X_RX_RING_LENGTH="2048"
56-
A4X_TX_RING_LENGTH="1024"
55+
IDPF_RX_RING_LENGTH="2048"
56+
IDPF_TX_RING_LENGTH="1024"
5757

5858
function is_decimal_int() {
5959
[ "${1}" -eq "${1}" ] > /dev/null 2>&1
@@ -179,7 +179,9 @@ function is_multinic_accelerator_platform() {
179179
|| "$machine_type" == *"a4-highgpu-"* \
180180
|| "$machine_type" == *"a4x-highgpu-"* \
181181
|| "$machine_type" == *"a4x-maxgpu-"* \
182-
|| "$machine_type" == *"c4x-"* ]] || return 1
182+
|| "$machine_type" == *"c4x-"* \
183+
|| "$machine_type" == *"x4-"* \
184+
]] || return 1
183185
return 0
184186
}
185187

@@ -508,16 +510,13 @@ for ((node=0; node<num_numa_nodes; node++)); do
508510
continue
509511
fi
510512

511-
# For IDPF at least, we need to reconfigure ring size before setting IRQ affinity,
512-
# since adjusting the ring size destroys the IRQ affinity settings.
513-
if [[ $machine_type == *"a4x-maxgpu-"* ]]; then
514-
ethtool -G "$nic_name" rx "$A4X_RX_RING_LENGTH" tx "$A4X_TX_RING_LENGTH"
515-
fi
516-
517513
# For non-gvnic/idpf devices (e.g. mlx5), the IRQ bindings will be handled by the device's driver.
518514
if is_gvnic "$nic_name"; then
519515
bind_cores_index=$(set_irq_range_gve "$nic_name" "$bind_cores_index" "${node_irq_ranges[@]}")
520516
elif is_idpf "$nic_name"; then
517+
# We need to reconfigure ring size before setting IRQ affinity, because
518+
# adjusting the ring size destroys the IRQ affinity settings.
519+
ethtool -G "$nic_name" rx "$IDPF_RX_RING_LENGTH" tx "$IDPF_TX_RING_LENGTH"
521520
bind_cores_index=$(set_irq_range_idpf "$nic_name" "$bind_cores_index" "${node_irq_ranges[@]}")
522521
else
523522
echo "$nic_name is not a gvnic/idpf device, not setting irq affinity on this device"

0 commit comments

Comments
 (0)