google / google/gopacket

"pfring NewRing error: no such device" when trying to open pfring ZC interface from zbalance_ipc

Open
#147 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
6.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

PF_RING in ZC-mode comes with a program zbalance_ipc that can send the output of one or more ZC-queues to different virtual PF_RING interfaces that end up with names like "zc:99@0" and "zc:99@1" etc.

When using gopacket (which otherwise works fine with normal ZC-interfaces like e.g. "zc:eth3") a "no such device" error is returned. As far as I can tell there is nothing special happening inside NewRing() besides calling C.pfring_open(). Using these virtual interfaces work fine with the example programs that come with PF_RING.

Is this somehow a bug with gopacket? It seems to be doing basically the same thing as the C-examples I've seen that work fine, but returns the error.

Code that fails:

```
log.Printf("Opening pf_ring on interface %q", *iface)
ring, err = pfring.NewRing(*iface, uint32(*snaplen), pfring.FlagPromisc) // <- fails
if err != nil {
log.Printf("Error: %s, Ring: %v\n", err, ring)
return
}

err = ring.Enable()
if err != nil {
log.Printf("Error: %s\n", err)
return
}

packetSources = append(packetSources, gopacket.NewPacketSource(ring, layers.LinkTypeEthernet))

log.Printf("New pf_ring.")
defer ring.Close()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.