Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions Doc/User Manual/DPU_SDK12_with_OVS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# How to use ovs/dpdk

## 1. update DPU to sdk12
1. Refer to Appendix C of the User Manual.

2. Download URL of busybox

http://pan.asterfusion.com/index.php?mod=shares&sid=ZktTZEE2QkFwMG1qMWdJUng4aHlyT1FyeWNMM3ZxcWM2eldJYnlJRA

3. Download URL of OS installation package

http://pan.asterfusion.com/index.php?mod=shares&sid=ZktTZEE2QkFwMG1qMWcwVW01OTQ4dUY2a3Nhc3ZLeVd1R0tJYVNZTQ

## 2. get driver
1. Refer to 7.1 of the User Manual

2. You can first use
lsmod | grep octeon
to check whether the driver already exists on the host.
If it does, you need to run rmmod first, wait for the NIC to finish restarting, and then run insmod again

##3. compile ovs/dpdk on DPU
1. complie dpdk
* get dpdk source
git clone https://github.com/asterfusion/Helium_DPU/tree/main/ET3600/dpdk-24.11
* compile dpdk
export DPDK_DIR=/home/admin/Helium_DPU-main/ET3600/dpdk-24.11

export DPDK_BUILD=$DPDK_DIR/build
meson build
ninja -C build
ninja -C build install
ldconfig
pkg-config --modversion libdpdk //make sure dpdk installed succssfully
2. complie ovs
* download ovs-3.6.1
* compile ovs with dpdk
cd openvswitch-3.6.1
./configure --with-dpdk=shared
make
make install
3. insmod ovs driver on DPU
* get driver
http://pan.asterfusion.com/index.php?mod=shares&sid=ZktTZEE2QkFwMG1qMWc0V21wNHItdVo3bEpLdDdfdVM3R2FKYXlNTQ
* insmod drivers
insmod nsh.ko
insmod openvswitch.ko
## How to use ovs
1 .start ovs
export PATH=$PATH:/usr/local/share/openvswitch/scripts

sysctl -w vm.nr_hugepages=32
ovs-vsctl set Open_vSwitch . other_config:dpdk-init=true
ovs-vsctl set Open_vSwitch . other_config:dpdk-socket-mem="1024"
ovs-vsctl set Open_vSwitch . other_config:dpdk-lcore-list="0,1"

ovs-ctl restart
2 . dpdk bind
./dpdk-devbind.py -b vfio-pci 0002:02:00.0 0002:03:00.0 0002:0f:00.2 0002:0f:00.3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after bind, how to see the port and add openflow to show it works ok

Verify binding status:
./dpdk-devbind.py -s
Expected output:
Network devices using DPDK-compatible driver
============================================
0002:02:00.0 'Device a063' drv=vfio-pci unused=
0002:03:00.0 'Device a063' drv=vfio-pci unused=
0002:0f:00.2 'Device a063' drv=vfio-pci unused=
0002:0f:00.3 'Device a063' drv=vfio-pci unused=
3 . create bridge and add if to bridge
ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
ovs-vsctl add-port br0 sdp1 -- set Interface sdp1 type=dpdk options:dpdk-devargs=0002:0f:00.2
ovs-vsctl add-port br0 sdp2 -- set Interface sdp2 type=dpdk options:dpdk-devargs=0002:0f:00.3
ovs-vsctl add-port br0 eth2 -- set Interface eth1 type=dpdk options:dpdk-devargs=0002:02:00.0
ovs-vsctl add-port br0 eth2 -- set Interface eth2 type=dpdk options:dpdk-devargs=0002:03:00.0


* you can use this to check interface config
ovs-vsctl list interface sdp1
4 . flow config
ovs-ofctl add-flow br0 "in_port=sdp1 action=output:eth1"
ovs-ofctl add-flow br0 "in_port=eth1 action=output:sdp1"
ovs-ofctl add-flow br0 "in_port=sdp2 action=output:eth2"
ovs-ofctl add-flow br0 "in_port=eth2 action=output:sdp2"
* after connect the physical ports eth1 and eth2,The traffic flow in the flow table is
sdp1 → eth1 → eth2 → sdp2
sdp2 → eth2 → eth1 → sdp1
if you tcpreplay from sdp1 on host,the traffic will from sdp1 on host ->sdp1 on dpu->eth1->eth2->sdp2 on dpu ,and last you can tcpdump on sdp2 on host
5 . show flow counters
ovs-ofctl dump-flows br0
Expected output:
cookie=0x0, duration=12s, table=0, n_packets=248, n_bytes=19840, in_port=1 actions=output:2

145 changes: 145 additions & 0 deletions Doc/User Manual/ET2500_5G_Module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
## 1 Check that the driver is loaded correctly

- cd /sys/bus/usb/drivers
check *option、qmi_wwan_q、cdc_mbim* exist

The RM520N should support both `qmi_wwan_q` and `cdc_mbim` driver modes. Currently, `cdc_mbim` is being used.

- check driver insmod

```bash
lsmod | grep qmi_wwan_q
```

- if driver not exists,get lastest kernel source code from github

https://github.com/asterfusion/DPU_linux_kernel.git

## 2 Check Hardware

- The SIM card is properly inserted
- The antenna is connected

## 3 Compile busybox

- download url :[https://busybox.net](https://busybox.net/)
- config

```bash
sed -i 's/CONFIG_SHA1_HWACCEL=y/# CONFIG_SHA1_HWACCEL is not set/' .config
make oldconfig
//make sure CONFIG_UDHCPC is on
```

- compile

```bash
sudo apt install libncurses-dev
make
make install
```

- copy default file to default path

```bash
sudo cp example/udhcp/simple.script /usr/share/udhcpc/default.script
// Copy this file to the current system directory. If udhcpc does not exist, create it manually.

```

## 3 Compile Quectel_QConnectManager

```
git clone https://github.com/asterfusion/Helium_DPU.git
cd Helium_DPU/ET2500/Quectel_QConnectManager
make

```

## 4 **Dial-up Internet access**

```
cd Quectel_QConnectManager_Linux_V1.6.8
sudo ./quectel-CM -s cment &

```

### Dial-up connection established log

```
02-04_10:07:36:544] QConnectManager_Linux_V1.6.8
[02-04_10:07:36:544] Find /sys/bus/usb/devices/4-1.2 idVendor=0x2c7c idProduct=0x801, bus=0x004, dev=0x003
[02-04_10:07:36:544] Auto find qmichannel = /dev/cdc-wdm0
[02-04_10:07:36:544] Auto find usbnet_adapter = wwx023bd8b8f158
[02-04_10:07:36:544] netcard driver = qmi_wwan_q, driver version = V1.2.9
[02-04_10:07:36:544] qmap_mode = 1, qmap_version = 9, qmap_size = 31744, muxid = 0x81, qmap_netcard = wwan0_1
[02-04_10:07:36:544] Modem works in QMI mode
[02-04_10:07:36:580] /proc/4745/fd/7 -> /dev/cdc-wdm0
[02-04_10:07:36:580] /proc/4745/exe -> /home/admin/Quectel_QConnectManager_Linux_V1.6.8/quectel-CM
[02-04_10:07:36:582] requestDeactivateDefaultPDP WdsConnectionIPv4Handle
admin@sonic:~/Quectel_QConnectManager_Linux_V1.6.8$ [02-04_10:07:36:991] ip link set dev wwx023bd8b8f158 down
[02-04_10:07:36:999] ip addr flush dev wwan0_1
[02-04_10:07:37:005] ip link set dev wwan0_1 down
[02-04_10:07:37:183] QmiWwanThread exit
[02-04_10:07:37:189] qmi_main exit
[02-04_10:07:38:582] cdc_wdm_fd = 7
[02-04_10:07:38:654] Get clientWDS = 15
[02-04_10:07:38:687] Get clientDMS = 1
[02-04_10:07:38:719] Get clientNAS = 3
[02-04_10:07:38:751] Get clientUIM = 2
[02-04_10:07:38:783] Get clientWDA = 1
[02-04_10:07:38:814] requestBaseBandVersion RM520NCNAAR05A02M4G
[02-04_10:07:38:846] qmap_settings.rx_urb_size = 31744
[02-04_10:07:38:846] qmap_settings.ul_data_aggregation_max_datagrams = 11
[02-04_10:07:38:846] qmap_settings.ul_data_aggregation_max_size = 8192
[02-04_10:07:38:846] qmap_settings.dl_minimum_padding = 0
[02-04_10:07:38:974] requestGetSIMStatus SIMStatus: SIM_READY //如果未ready,检查sim卡状态
[02-04_10:07:39:039] requestGetProfile[pdp:1 index:1] cment///0/IPV4
[02-04_10:07:39:039] requestSetProfile[pdp:1 index:1] cment///0/IPV4
[02-04_10:07:39:039] no need to set skip the rest
[02-04_10:07:39:071] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_SA //如果未attached,检查天线和信号
[02-04_10:07:39:103] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[02-04_10:07:39:103] ip link set dev wwx023bd8b8f158 down
[02-04_10:07:39:104] ip addr flush dev wwan0_1
[02-04_10:07:39:107] ip link set dev wwan0_1 down
[02-04_10:07:39:615] requestSetupDataCall WdsConnectionIPv4Handle: 0xe2bfdb40
[02-04_10:07:39:743] ip link set dev wwx023bd8b8f158 up
[02-04_10:07:39:748] ip link set dev wwan0_1 up
[02-04_10:07:39:751] busybox udhcpc -f -n -q -t 5 -i wwan0_1
udhcpc: started, v1.35.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 10.139.61.221, server 10.139.61.222
udhcpc: lease of 10.139.61.221 obtained from 10.139.61.222, lease time 7200
[02-04_10:07:39:867] ip -4 address flush dev wwan0_1
[02-04_10:07:39:869] ip -4 address add 10.139.61.221/30 dev wwan0_1
[02-04_10:07:39:870] ip -4 route add default via 10.139.61.222 dev wwan0_1
[1]- Done sudo ./quectel-CM -s cment

```

## 5 AT command

USB2 is an AT serial port device. Use a serial terminal tool to connect to the serial port.
minicom /dev/tty/USB2

### Check Signal Status

**Command:**

```
AT+QENG="SERVINGCELL"
```

**Response:**

```
+QENG:"servingcell","NOCONN","NR5G-SA","TDD",460,00,A0117F003,287,1000D7,504990,41,12,-99,-13,0,1,20
```

```cpp
// Focus mainly on the network type:// NR5G-SA : 5G Standalone
// NR5G-NSA : 5G Non-Standalone
// LTE : 4G
// -99 indicates the signal received power; values <= -110 indicate very poor signal
// -13 indicates the reference signal received quality; values < -15 indicate very poor quality
```
36 changes: 36 additions & 0 deletions ET2500/Quectel_QConnectManager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 2.4)

project(quectel-CM)
add_definitions(-Wall -Wextra -Werror -O1)
option(USE_QRTR "Enable QRTR" OFF)

set( QL_CM_SRC
QmiWwanCM.c GobiNetCM.c main.c QCQMUX.c QMIThread.c util.c qmap_bridge_mode.c mbim-cm.c device.c
atc.c atchannel.c at_tok.c
udhcpc.c
)

if(USE_QRTR)
add_definitions(-DCONFIG_QRTR)
set( QRTR_SRC qrtr.c rmnetctl.c)
endif()

add_executable(quectel-CM ${QL_CM_SRC} ${QRTR_SRC})
target_link_libraries(quectel-CM PUBLIC pthread)
install (TARGETS quectel-CM DESTINATION bin)

add_executable(quectel-qmi-proxy quectel-qmi-proxy.c)
target_link_libraries(quectel-qmi-proxy PUBLIC pthread)
install (TARGETS quectel-qmi-proxy DESTINATION bin)

add_executable(quectel-mbim-proxy quectel-mbim-proxy.c)
target_link_libraries(quectel-mbim-proxy PUBLIC pthread)
install (TARGETS quectel-mbim-proxy DESTINATION bin)

add_executable(quectel-atc-proxy quectel-atc-proxy.c atchannel.c at_tok.c util.c)
target_link_libraries(quectel-atc-proxy PUBLIC pthread)
install (TARGETS quectel-atc-proxy DESTINATION bin)

#add_executable(quectel-qrtr-proxy quectel-qrtr-proxy.c)
#target_link_libraries(quectel-qrtr-proxy PUBLIC pthread)
#install (TARGETS quectel-qrtr-proxy DESTINATION bin)
Loading
Loading