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

Proposed by Chloé Smith
Status: Merged
Merged at revision: 7b4ac0b87b175e9aeb37070c48ecca7c40c2170d
Proposed branch: ~kajiya/+git/gce-compute-image-packages:ubuntu/master-update-to-20240307.00
Merge into: ~ubuntu-core-dev/+git/gce-compute-image-packages:ubuntu/master
Diff against target: 168 lines (+50/-21)
5 files modified
OWNERS (+5/-2)
debian/changelog (+6/-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+466198@code.launchpad.net

Commit message

Update to upstream tag 20240307.00 (LP: #2066314)

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

Thanks, Chlo. I just had to adjust the d/ch entry per the usual standard line which gbp generates. But everything looks good. No vendoring required in the package, no complicated build, and no lintian shenanigans. I've sponsored the upload:

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

Subscribers

People subscribed via source and target branches