Skip to content

Instantly share code, notes, and snippets.

View jianzzha's full-sized avatar

Jianzhu Zhang jianzzha

  • Red Hat
  • Raleigh, North Carolina
  • 18:19 (UTC -04:00)
View GitHub Profile
@jianzzha
jianzzha / dut-PTP-testpmd-steps
Last active January 9, 2024 17:49
XXV710-trex-vlan-PTP-PF
# cat /etc/sysconfig/phc2sys
OPTIONS="-a -r -r -n 24"
[root@53Y9R53 ~]# systemctl status phc2sys
● phc2sys.service - Synchronize system clock or PTP hardware clock (PHC)
Loaded: loaded (/usr/lib/systemd/system/phc2sys.service; enabled; preset: disabled)
Active: active (running) since Fri 2023-12-08 19:43:28 EST; 32min ago
Main PID: 672234 (phc2sys)
Tasks: 1 (limit: 1120505)
Memory: 472.0K
@jianzzha
jianzzha / boot-ai-iso-with-console
Last active April 3, 2023 05:32
How to boot the AI discovery with VM console access
#!/usr/bin/bash
# important: download the minimum iso image, not the full image iso
export MEMORY=16384
export VCPUS=4
export MASTER_MAC_BASE=52:54:00:f9:8e:2
export WORKER_MAC=52:54:00:f9:8e:30
export CDROM=/var/www/html/discovery_image_test.iso
export QCOWS=/var/lib/libvirt/images
mkdir -p /mnt/ai
umount /mnt/ai
step 1: apply the subscription
cat <<EOF | oc create -f -
apiVersion: v1
kind: Namespace
metadata:
labels:
openshift.io/run-level: "1"
name: openshift-performance-addon
---
@jianzzha
jianzzha / gist:050293ae28af8d585f059b18b6916533
Last active January 10, 2022 13:24
How to pxe boot Assisted installer ISO image
1) Download the discovery iso image, small size bootable is ok, no need to download the full image
2) mkdir -p /mnt/iso && mount -o ro,loop *iso /mnt/iso && mkdir -p /mnt/efiboot
&& mount -o loop,ro /mnt/iso/images/efiboot.img /mnt/efiboot
3) optionally install web server if downloading from openshift mirror is slow. Assume the http root directory is /var/www/html,
curl -L -o /var/www/html/rhcos-live-rootfs.x86_64.img https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.9/4.9.0/rhcos-live-rootfs.x86_64.img
4) install dnsmasq and tftp service. Assume tftp root is /var/lib/tftpboot
/bin/cp -f /mnt/iso/images/*.img /var/lib/tftpboot
/bin/cp -f /mnt/iso/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot
/bin/cp -f /mnt/efiboot/EFI/redhat/{shimx64.efi,grubx64.efi} /var/lib/tftpboot
cat <<EOF > /var/lib/tftpboot/grub.cfg
oc delete -f create-fec-vf.yaml
sriovfecclusterconfig.sriovfec.intel.com "config" deleted
lspci | grep acc
b5:00.0 Processing accelerators: Intel Corporation Device 0d5c
Capacity:
intel.com/intel_fec_acc100: 5
Allocatable:
intel.com/intel_fec_acc100: 0
### update /etc/pki/tls/openssl.cnf and update this section
[ v3_ca ]
subjectAltName=IP:192.168.222.1
### create self cert
sudo mkdir -p /opt/registry/{auth,certs,data}
host_fqdn=192.168.222.1
cert_c="US"
cert_s="Massachussets"
@jianzzha
jianzzha / gist:e824b28c174172e8d90f3c2cba900e1d
Last active May 29, 2021 00:33
flexran-build-step-20.11.6
subscription-manager register
subscription-manager attach --auto
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
yum groupinstall -y 'Development Tools'
yum install -y git patch tar zip unzip python3 cmake3 libstdc++-static elfutils-libelf-devel zlib-devel numactl-devel libhugetlbfs-devel
pip3 install meson && pip3 install ninja
mkdir -p /opt && cd /opt && git clone git://dpdk.org/dpdk-stable dpdk
cd /opt/dpdk && git checkout 20.11 && patch -p1 < dpdk_20.11_20.11.5.patch
cd /opt && tar zxvf system_studio_2019_update_5_ultimate_edition.tar.gz
cd /opt/system_studio_2019_update_5_ultimate_edition && sed -i -r -e 's/^ACCEPT_EULA=.*/ACCEPT_EULA=accept/' -e 's/^ACTIVATION_TYPE=.*/ACTIVATION_TYPE=license_file/' -e 's%^#?ACTIVATION_LICENSE_FILE=.*%ACTIVATION_LICENSE_FILE=/opt/flexran_license.lic%' silent.cfg
@jianzzha
jianzzha / install.sh
Created July 21, 2020 16:30
ocs+cnv+performance profile setup sequence
function wait_pods_in_namespace () {
ns=${1:-default}
echo "wait pods in ${ns} ready"
while true; do
sleep 3s
count=$(oc get pods -n ${ns} | egrep -v 'Running|Complete|found' | wc -l)
if ((count == 1)); then
break;
fi
done
@jianzzha
jianzzha / install.sh
Created July 21, 2020 16:30
ocs+cnv+performance profile setup sequence
function wait_pods_in_namespace () {
ns=${1:-default}
echo "wait pods in ${ns} ready"
while true; do
sleep 3s
count=$(oc get pods -n ${ns} | egrep -v 'Running|Complete|found' | wc -l)
if ((count == 1)); then
break;
fi
done
@jianzzha
jianzzha / 1024B-1thread-intra-node
Last active June 20, 2020 19:15
ovn-intra-node-w/o-ACL
Starting 1 threads running profile:tcp-stream-1024b-1i ... 0.00 seconds
Txn1 0 / 1.00(s) = 0 1op/s
Txn2 5.92GB / 60.26(s) = 843.80Mb/s 103003op/s
Txn3 0 / 0.00(s) = 0 0op/s
-------------------------------------------------------------------------------
Total 5.92GB / 62.36(s) = 815.35Mb/s 99529op/s
Netstat statistics for this run
-------------------------------------------------------------------------------
Nic opkts/s ipkts/s obits/s ibits/s