Merge ~kajiya/+git/gce-compute-image-packages:ubuntu/noble-update-to-20240307.00 into ~ubuntu-core-dev/+git/gce-compute-image-packages:ubuntu/noble

Proposed by Chloé Smith
Status: Merged
Merged at revision: 06098b58e3252ddc4d8424a74082139f0aa26689
Proposed branch: ~kajiya/+git/gce-compute-image-packages:ubuntu/noble-update-to-20240307.00
Merge into: ~ubuntu-core-dev/+git/gce-compute-image-packages:ubuntu/noble
Diff against target: 174 lines (+56/-21)
5 files modified
OWNERS (+5/-2)
debian/changelog (+12/-0)
src/lib/udev/google_nvme_id (+1/-1)
src/usr/bin/google_set_hostname (+2/-1)
src/usr/bin/google_set_multiqueue (+36/-17)
Reviewer Review Type Date Requested Status
Utkarsh Gupta Approve
Review via email: mp+466396@code.launchpad.net

Commit message

Update upstream source from tag 'upstream/20240307.00' (LP: #2066314)

To post a comment you must log in.
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Thanks, this looks good. I've adjusted the d/ch a bit and sponsored your upload:

$ dput ubuntu ../gce-compute-image-packages_20240307.00-0ubuntu1\~24.04.0_source.changes
Uploading gce-compute-image-packages using ftp to ubuntu (host: upload.ubuntu.com; directory: /ubuntu)
running supported-distribution: check whether the target distribution is currently supported (using distro-info)
{'allowed': ['release', 'proposed', 'backports', 'security'], 'known': ['release', 'proposed', 'updates', 'backports', 'security']}
running required-fields: check whether a field is present and non-empty in the changes file
running checksum: verify checksums before uploading
running suite-mismatch: check the target distribution for common errors
running check-debs: makes sure the upload contains a binary package
running gpg: check GnuPG signatures before the upload
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~24.04.0.dsc
Uploading gce-compute-image-packages_20240307.00.orig.tar.xz
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~24.04.0.debian.tar.xz
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~24.04.0_source.buildinfo
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~24.04.0_source.changes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/OWNERS b/OWNERS
2index 80fc96d..59fca61 100644
3--- a/OWNERS
4+++ b/OWNERS
5@@ -2,12 +2,15 @@
6 # See the OWNERS docs at https://go.k8s.io/owners
7
8 approvers:
9+ - a-crate
10+ - ajorg
11 - bkatyl
12 - chaitanyakulkarni28
13 - dorileo
14+ - drewhli
15+ - elicriffield
16+ - gaughen
17 - jjerger
18 - karnvadaliya
19 - koln67
20- - quintonamore
21- - vorakl
22 - zmarano
23diff --git a/debian/changelog b/debian/changelog
24index a3dba1e..b3a055d 100644
25--- a/debian/changelog
26+++ b/debian/changelog
27@@ -1,3 +1,15 @@
28+gce-compute-image-packages (20240307.00-0ubuntu1~24.04.0) noble; urgency=medium
29+
30+ * Rebuild for Noble Numbat (LP: #2066314)
31+
32+ -- Chloé 'kajiya' Smith <chloe.smith@canonical.com> Thu, 23 May 2024 15:48:02 +0100
33+
34+gce-compute-image-packages (20240307.00-0ubuntu1) oracular; urgency=medium
35+
36+ * New upstream version 20240307.00. (LP: #2066314)
37+
38+ -- Chloé 'kajiya' Smith <chloe.smith@canonical.com> Tue, 21 May 2024 14:03:23 +0100
39+
40 gce-compute-image-packages (20230808.00-0ubuntu2) noble; urgency=medium
41
42 * debian/99-gce.rules:
43diff --git a/src/lib/udev/google_nvme_id b/src/lib/udev/google_nvme_id
44index ef02963..f0bba67 100755
45--- a/src/lib/udev/google_nvme_id
46+++ b/src/lib/udev/google_nvme_id
47@@ -69,7 +69,7 @@ function get_namespace_device_name() {
48 fi
49
50 local device_name
51- device_name="$(echo "$nvme_json" | grep device_name | sed -e 's/.*"device_name":[ \t]*"\([a-zA-Z0-9_-]\+\)".*/\1/')"
52+ device_name="$(echo "$nvme_json" | grep device_name | sed -e 's/.*"device_name":[ \t]*"\([.a-zA-Z0-9_-]\+\)".*/\1/')"
53
54 # Error if our device name is empty
55 if [[ -z "$device_name" ]]; then
56diff --git a/src/usr/bin/google_set_hostname b/src/usr/bin/google_set_hostname
57index 317768f..05a0412 100755
58--- a/src/usr/bin/google_set_hostname
59+++ b/src/usr/bin/google_set_hostname
60@@ -62,7 +62,8 @@ if [ -n "$new_host_name" ] && [ "${new_host_name%%.*}" != "$old_hostname" ] && !
61 # Restart rsyslog to update the hostname.
62 systemctl=$(which systemctl 2> /dev/null)
63 if [ -x "$systemctl" ]; then
64- hasrsyslog=$($systemctl | grep rsyslog | cut -f1 -d' ')
65+ # See man 5 systemd.unit for systemd unit naming rules
66+ hasrsyslog=$($systemctl | grep rsyslog | grep -oE '[a-zA-Z0-9:-_.\]+\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)')
67 if [ ! -z "$hasrsyslog" ]; then
68 $systemctl -q --no-block restart "$hasrsyslog"
69 fi
70diff --git a/src/usr/bin/google_set_multiqueue b/src/usr/bin/google_set_multiqueue
71index fa87a1e..8e51934 100755
72--- a/src/usr/bin/google_set_multiqueue
73+++ b/src/usr/bin/google_set_multiqueue
74@@ -45,7 +45,7 @@ function set_channels() {
75
76 function set_irq_range() {
77 local -r nic="$1"
78- local core="$2"
79+ local bind_cores_begin="$2"
80
81 # The user may not have this $nic configured on their VM, if not, just skip
82 # it, no need to error out.
83@@ -53,16 +53,26 @@ function set_irq_range() {
84 return;
85 fi
86
87+
88 # We count the number of rx queues and assume number of rx queues == tx
89- # queues. Currently the GVE configuration at boot is 16 rx + 16 tx.
90+ # queues. The number of queues shown in the sysfs stands for the initial
91+ # queues while the number of IRQs stands for the max queues. The number of
92+ # initial queues should be always less than or equal to that of the max
93+ # queues.
94+ core=$bind_cores_begin
95+ num_irqs=$(( $(ls /sys/class/net/"$nic"/device/msi_irqs | wc -l) / 2 ))
96 num_q=$(ls -1 /sys/class/net/"$nic"/queues/ | grep rx | wc -l)
97
98 echo "Setting irq binding for "$nic" to core [$core - $((core + num_q - 1))] ..."
99
100 irqs=($(ls /sys/class/net/"$nic"/device/msi_irqs | sort -g))
101- for ((queue = 0; queue < "$num_q"; queue++)); do
102- tx_irq=${irqs[$queue]}
103- rx_irq=${irqs[$((queue + num_q))]}
104+ for ((irq = 0; irq < "$num_irqs"; irq++)); do
105+ tx_irq=${irqs[$irq]}
106+ rx_irq=${irqs[$((irq + num_irqs))]}
107+
108+ # Only allocate $num_q cores to the IRQs and queues. If the number of IRQs
109+ # is more than that of queues, the CPUs will be wrapped around.
110+ core=$(( bind_cores_begin + irq % num_q ))
111
112 # this is GVE's TX irq. See gve_tx_idx_to_ntfy().
113 echo "$core" > /proc/irq/"$tx_irq"/smp_affinity_list
114@@ -70,23 +80,32 @@ function set_irq_range() {
115 # this is GVE's RX irq. See gve_rx_idx_to_ntfy().
116 echo "$core" > /proc/irq/"$rx_irq"/smp_affinity_list
117
118- # XPS (Transmit Packet Steering) allows a core to decide which queue to
119- # select if its mask is found in one of the queue's xps_cpus
120- cp /proc/irq/"$tx_irq"/smp_affinity /sys/class/net/"$nic"/queues/tx-"$queue"/xps_cpus
121-
122- echo -en "$nic:q-$queue: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq bind to $core"
123- echo -e " \txps_cpus bind to $(cat /sys/class/net/"$nic"/queues/tx-"$queue"/xps_cpus)"
124+ # Check if the queue exists at present because the number of IRQs equals
125+ # the max number of queues allocated and could be greater than the current
126+ # number of queues.
127+ tx_queue=/sys/class/net/"$nic"/queues/tx-"$irq"
128+ if ls $tx_queue 1> /dev/null 2>&1; then
129+ # XPS (Transmit Packet Steering) allows a core to decide which queue to
130+ # select if its mask is found in one of the queue's xps_cpus
131+ cp /proc/irq/"$tx_irq"/smp_affinity $tx_queue/xps_cpus
132+
133+ echo -en "$nic:q-$irq: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq bind to $core"
134+ echo -e " \txps_cpus bind to $(cat $tx_queue/xps_cpus)"
135+ else
136+ echo -e "$nic:q-$irq: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq bind to $core"
137+ fi
138
139- core=$((core + 1))
140 done
141 }
142
143-# returns 0 (success) if it's running on a3 platform.
144+# returns 0 (success) if it's running on a3 or a3plus platform.
145 function is_a3_platform() {
146- machine_type=$(curl -H "Metadata-Flavor: Google" \
147+ machine_type=$(curl -m 1 -H "Metadata-Flavor: Google" \
148 http://169.254.169.254/computeMetadata/v1/instance/machine-type)
149
150- [[ "$machine_type" == *"a3-highgpu-8g"* ]] || return 1
151+ [[ "$machine_type" == *"a3-highgpu-8g"* \
152+ || "$machine_type" == *"a3-ultragpu-8g"* \
153+ || "$machine_type" == *"a3-megagpu-8g"* ]] || return 1
154
155 return 0
156 }
157@@ -234,7 +253,7 @@ fi
158
159 # IRQ binding for numa 0, CPUs [0, 51] and [104, 155] are for numa 0.
160 numa0_irq_start=1
161-find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 basename | grep -v lo | while read nic_name; do
162+find /sys/class/net -type l | xargs -L 1 realpath | grep '/sys/devices/pci' | sort | xargs -L 1 basename | while read nic_name; do
163 nic_numa_node=$(cat /sys/class/net/"$nic_name"/device/numa_node)
164 if [[ $nic_numa_node -ne 0 ]]; then
165 continue
166@@ -256,7 +275,7 @@ done
167
168 # IRQ binding for numa 1, CPUs [52, 103] and [156, 207] are for numa 1.
169 numa1_irq_start=52
170-find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 basename | grep -v lo | while read nic_name; do
171+find /sys/class/net -type l | xargs -L 1 realpath | grep '/sys/devices/pci' | sort | xargs -L 1 basename | while read nic_name; do
172 nic_numa_node=$(cat /sys/class/net/"$nic_name"/device/numa_node)
173 if [[ $nic_numa_node -ne 1 ]]; then
174 continue

Subscribers

People subscribed via source and target branches