Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: pass correct parameter format of macvtap for acrn vm #9565

Open
hongzhanchen opened this issue Apr 28, 2024 · 1 comment
Open

runtime: pass correct parameter format of macvtap for acrn vm #9565

hongzhanchen opened this issue Apr 28, 2024 · 1 comment
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.

Comments

@hongzhanchen
Copy link

cgroupns
Kernel Version: 5.15.71-acrn-service-vm-dirty
Operating System: Ubuntu 22.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 6.505GiB
ID: 80145696-8142-46fb-97d9-c1eace2dba59
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: supochen
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false


</p>
</details>
<details>
<summary><tt>systemctl show docker</tt></summary>
<p>

Type=notify
Restart=always
NotifyAccess=main
RestartUSec=2s
TimeoutStartUSec=infinity
TimeoutStopUSec=1min 30s
TimeoutAbortUSec=1min 30s
TimeoutStartFailureMode=terminate
TimeoutStopFailureMode=terminate
RuntimeMaxUSec=infinity
WatchdogUSec=0
WatchdogTimestamp=n/a
WatchdogTimestampMonotonic=0
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=2154
ControlPID=0
FileDescriptorStoreMax=0
NFileDescriptorStore=0
StatusErrno=0
Result=success
ReloadResult=success
CleanResult=success
UID=[not set]
GID=[not set]
NRestarts=0
OOMPolicy=continue
ExecMainStartTimestamp=Sun 2024-04-28 14:46:18 CST
ExecMainStartTimestampMonotonic=3563482681
ExecMainExitTimestamp=n/a
ExecMainExitTimestampMonotonic=0
Please check attached file for
kata.log
output of kata-collect-data.sh

Description of problem

Fail to ping gateway on host vm side 172.19.0.1

Expected result

/ # ping 172.19.0.1
PING 172.19.0.1 (172.19.0.1): 56 data bytes
64 bytes from 172.19.0.1: seq=0 ttl=64 time=1.034 ms
64 bytes from 172.19.0.1: seq=1 ttl=64 time=0.174 ms

Actual result

unreachable

Further information

According to https://projectacrn.github.io/3.0/developer-guides/hld/virtio-net.html
we need to pass tap=tap0_kata for macvtap but currently pass just pass tap0_kata
which is not recognized by acrn.

suggested patch

diff --git a/src/runtime/virtcontainers/acrn_arch_base.go b/src/runtime/virtcontainers/acrn_arch_base.go
index fa8ce0fe6..278c76045 100644
--- a/src/runtime/virtcontainers/acrn_arch_base.go
+++ b/src/runtime/virtcontainers/acrn_arch_base.go
@@ -426,7 +426,7 @@ func (netdev NetDevice) AcrnNetdevParam() []string {
deviceParams = append(deviceParams, netdev.IFName)
deviceParams = append(deviceParams, fmt.Sprintf(",mac=%s", netdev.MACAddress))
case MACVTAP:

  •   deviceParams = append(deviceParams, netdev.IFName)
    
  •   deviceParams = append(deviceParams, fmt.Sprintf("tap=%s", netdev.IFName))
      deviceParams = append(deviceParams, fmt.Sprintf(",mac=%s", netdev.MACAddress))
    
    default:
    deviceParams = append(deviceParams, netdev.IFName)
    --
    2.34.1
@hongzhanchen hongzhanchen added bug Incorrect behaviour needs-review Needs to be assessed by the team. labels Apr 28, 2024
@Apokleos
Copy link
Contributor

Hi @hongzhanchen Cloud you please pull request and fix the bug ?

hongzhanchen added a commit to hongzhanchen/kata-containers that referenced this issue Apr 28, 2024
According to https://projectacrn.github.io/3.0/developer-guides/hld/virtio-net.html
we need to pass tap=tap0_kata for macvtap to fix issue kata-containers#9565

Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.
Projects
Issue backlog
  
To do
Development

No branches or pull requests

2 participants