Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package google-guest-configs for 
openSUSE:Factory checked in at 2023-08-16 14:17:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/google-guest-configs (Old)
 and      /work/SRC/openSUSE:Factory/.google-guest-configs.new.11712 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "google-guest-configs"

Wed Aug 16 14:17:25 2023 rev:16 rq:1104058 version:20230808.00

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/google-guest-configs/google-guest-configs.changes    
    2023-06-27 23:18:06.547900940 +0200
+++ 
/work/SRC/openSUSE:Factory/.google-guest-configs.new.11712/google-guest-configs.changes
     2023-08-16 14:17:30.295149163 +0200
@@ -1,0 +2,12 @@
+Tue Aug 15 13:49:04 UTC 2023 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Update to version 20230808.00
+  * 64-gce-disk-removal.rules: delete (#51)
+- from version 20230801.00
+  * Replace xxd with dd for google_nvme_id (#56)
+- from version 20230729.00
+  * Setup irq binding for a3 8g vm (#57)
+- from version 20230724.00
+  * Debian packaging: add xxd dependency (#55)
+
+-------------------------------------------------------------------

Old:
----
  google-guest-configs-20230626.00.tar.gz

New:
----
  google-guest-configs-20230808.00.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ google-guest-configs.spec ++++++
--- /var/tmp/diff_new_pack.izdceo/_old  2023-08-16 14:17:31.023154260 +0200
+++ /var/tmp/diff_new_pack.izdceo/_new  2023-08-16 14:17:31.027154288 +0200
@@ -23,7 +23,7 @@
 %define _udevdir %(pkg-config --variable udev_dir udev)
 %endif
 Name:           google-guest-configs
-Version:        20230626.00
+Version:        20230808.00
 Release:        0
 Summary:        Google Cloud Guest Configs
 License:        Apache-2.0

++++++ google-guest-configs-20230626.00.tar.gz -> 
google-guest-configs-20230808.00.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20230626.00/src/lib/udev/google_nvme_id 
new/guest-configs-20230808.00/src/lib/udev/google_nvme_id
--- old/guest-configs-20230626.00/src/lib/udev/google_nvme_id   2023-06-23 
23:25:28.000000000 +0200
+++ new/guest-configs-20230808.00/src/lib/udev/google_nvme_id   2023-08-08 
17:33:56.000000000 +0200
@@ -58,7 +58,7 @@
 #######################################
 function get_namespace_device_name() {
   local nvme_json
-  nvme_json="$("$nvme_cli_bin" id-ns -b "$1" | xxd -p -seek 384 | xxd -p -r)"
+  nvme_json="$("$nvme_cli_bin" id-ns -b "$1" | dd bs=1 skip=384 2>/dev/null)"
   if [[ $? -ne 0 ]]; then
     return 1
   fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20230626.00/src/lib/udev/rules.d/64-gce-disk-removal.rules 
new/guest-configs-20230808.00/src/lib/udev/rules.d/64-gce-disk-removal.rules
--- 
old/guest-configs-20230626.00/src/lib/udev/rules.d/64-gce-disk-removal.rules    
    2023-06-23 23:25:28.000000000 +0200
+++ 
new/guest-configs-20230808.00/src/lib/udev/rules.d/64-gce-disk-removal.rules    
    1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-# Copyright 2016 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-#     distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# When a disk is removed, unmount any remaining attached volumes.
-
-ACTION=="remove", SUBSYSTEM=="block", KERNEL=="sd*|vd*|nvme*", RUN+="/bin/sh 
-c '/bin/umount -fl /dev/$name && /usr/bin/logger -p daemon.warn -s WARNING: 
hot-removed /dev/$name that was still mounted, data may have been corrupted'"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20230626.00/src/usr/bin/google_set_multiqueue 
new/guest-configs-20230808.00/src/usr/bin/google_set_multiqueue
--- old/guest-configs-20230626.00/src/usr/bin/google_set_multiqueue     
2023-06-23 23:25:28.000000000 +0200
+++ new/guest-configs-20230808.00/src/usr/bin/google_set_multiqueue     
2023-08-08 17:33:56.000000000 +0200
@@ -43,6 +43,54 @@
   ethtool -L "${1}" combined "${2}" > /dev/null 2>&1
 }
 
+function set_irq_range() {
+  local -r nic="$1"
+  local core="$2"
+
+  # The user may not have this $nic configured on their VM, if not, just skip
+  # it, no need to error out.
+  if [ ! -d "/sys/class/net/"$nic"/device" ]; then
+    return;
+  fi
+
+  # We count the number of rx queues and assume number of rx queues == tx
+  # queues. Currently the GVE configuration at boot is 16 rx + 16 tx.
+  num_q=$(ls -1 /sys/class/net/"$nic"/queues/ | grep rx | wc -l)
+
+  echo "Setting irq binding for "$nic" to core [$core - $((core + num_q - 1))] 
..."
+
+  irqs=($(ls /sys/class/net/"$nic"/device/msi_irqs | sort -g))
+  for ((queue = 0; queue < "$num_q"; queue++)); do
+    tx_irq=${irqs[$queue]}
+    rx_irq=${irqs[$((queue + num_q))]}
+
+    # this is GVE's TX irq. See gve_tx_idx_to_ntfy().
+    echo "$core" > /proc/irq/"$tx_irq"/smp_affinity_list
+
+    # this is GVE's RX irq. See gve_rx_idx_to_ntfy().
+    echo "$core" > /proc/irq/"$rx_irq"/smp_affinity_list
+
+    # XPS (Transmit Packet Steering) allows a core to decide which queue to
+    # select if its mask is found in one of the queue's xps_cpus
+    cp /proc/irq/"$tx_irq"/smp_affinity 
/sys/class/net/"$nic"/queues/tx-"$queue"/xps_cpus
+
+    echo -en "$nic:q-$queue: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq 
bind to $core"
+    echo -e " \txps_cpus bind to $(cat 
/sys/class/net/"$nic"/queues/tx-"$queue"/xps_cpus)"
+
+    core=$((core + 1))
+  done
+}
+
+# returns 0 (success) if it's running on a3 platform.
+function is_a3_platform() {
+  machine_type=$(curl -H "Metadata-Flavor: Google" \
+    http://169.254.169.254/computeMetadata/v1/instance/machine-type)
+
+  [[ "$machine_type" == *"a3-highgpu-8g"* ]] || return 1
+
+  return 0
+}
+
 echo "Running $(basename $0)."
 VIRTIO_NET_DEVS=/sys/bus/virtio/drivers/virtio_net/virtio*
 
@@ -160,3 +208,70 @@
   echo ${xps_string} > $q
   printf "Queue %d XPS=%s for %s\n" $queue_num `cat $q` $q
 done | sort -n -k2
+
+if ! is_a3_platform; then
+  exit
+fi
+
+
+# Assign IRQ binding for network interfaces based on pci bus ordering.
+# 
+# Below logics explains how we rank interfaces by pci bus order.
+# > find /sys/class/net -type l | xargs -L 1 realpath | sort
+# /sys/devices/pci0000:00/0000:00:0b.0/net/enp0s11
+# 
/sys/devices/pci0000:01/0000:01:00.0/0000:02:00.0/0000:03:02.0/0000:06:00.0/net/enp6s0
+# 
/sys/devices/pci0000:07/0000:07:00.0/0000:08:00.0/0000:09:02.0/0000:0c:00.0/net/enp12s0
+# 
/sys/devices/pci0000:81/0000:81:00.0/0000:82:00.0/0000:83:02.0/0000:86:00.0/net/enp134s0
+# 
/sys/devices/pci0000:87/0000:87:00.0/0000:88:00.0/0000:89:02.0/0000:8c:00.0/net/enp140s0
+# /sys/devices/virtual/net/lo
+#
+# > find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 
basename | grep -v lo
+# enp0s11
+# enp6s0
+# enp12s0
+# enp134s0
+# enp140s0
+
+# IRQ binding for numa 0, CPUs [0, 51] and [104, 155] are for numa 0.
+numa0_irq_start=1
+find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 basename 
| grep -v lo | while read nic_name; do
+  nic_numa_node=$(cat /sys/class/net/"$nic_name"/device/numa_node)
+  if [[ $nic_numa_node -ne 0 ]]; then
+    continue
+  fi
+
+  nic_num_queues=$(ls -1 /sys/class/net/"$nic_name"/queues/ | grep rx | wc -l)
+  bind_cores_begin=$numa0_irq_start
+  bind_cores_end=$((bind_cores_begin + nic_num_queues))
+
+  if [[ $bind_cores_begin -lt 51 ]] && [[ $bind_cores_end -gt 51 ]]; then
+    bind_cores_begin=104
+    bind_cores_end=$((bind_cores_begin + nic_num_queues))
+  fi
+
+  set_irq_range "$nic_name" "$bind_cores_begin"
+
+  numa0_irq_start=$bind_cores_end
+done
+
+# IRQ binding for numa 1, CPUs [52, 103] and [156, 207] are for numa 1.
+numa1_irq_start=52
+find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 basename 
| grep -v lo | while read nic_name; do
+  nic_numa_node=$(cat /sys/class/net/"$nic_name"/device/numa_node)
+  if [[ $nic_numa_node -ne 1 ]]; then
+    continue
+  fi
+
+  nic_num_queues=$(ls -1 /sys/class/net/"$nic_name"/queues/ | grep rx | wc -l)
+  bind_cores_begin=$numa1_irq_start
+  bind_cores_end=$((bind_cores_begin + nic_num_queues))
+
+  if [[ $bind_cores_begin -lt 103 ]] && [[ $bind_cores_end -gt 103 ]]; then
+    bind_cores_begin=156
+    bind_cores_end=$((bind_cores_begin + nic_num_queues))
+  fi
+
+  set_irq_range "$nic_name" "$bind_cores_begin"
+
+  numa1_irq_start=$bind_cores_end
+done

Reply via email to