INNER CODE UNIT · Go

FullDuplexRxTx

deepflowio/deepflow · server/libs/xdppacket/cmd/xdp/main.go:338

func FullDuplexRxTx() {
	xp, err := NewXDPPacket(*Ifname, OptQueueCount(*queueCount),
		actualXdpMode, actualIOMode, actualPollTimeOut, OptNumFrames(*FrameNum))
	if err != nil {
		log.Errorf("new xdp socket failed as %v", err)
		return
	}
	defer xp.Close()

	if *StatsInterval > 0 {
		go func() {
			oldStats := XDPStats{}
			stats := xp.GetStats()
			for range time.NewTicker(time.Duration(*StatsInterval) * time.Second).C {
				if xp.CheckIfXDPSocketClosed() {
					break
				}
				fmt.Println(stats.Minus(oldStats))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…