summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2019-02-13 14:52:06 -0800
committerShentubot <shentubot@google.com>2019-02-13 14:53:03 -0800
commite0b3d3323fbb4b27280f0087427bb04c3e71238b (patch)
tree4ad81ee05445e0f11a9c1c6fe1227bf49ecbbbab /runsc
parent0e84ae72e086c77cea066000a898b7bc951ba790 (diff)
Add support for using PACKET_RX_RING to receive packets.
PACKET_RX_RING allows the use of an mmapped buffer to receive packets from the kernel. This should cut down the number of host syscalls that need to be made to receive packets when the underlying fd is a socket of the AF_PACKET type. PiperOrigin-RevId: 233834998 Change-Id: I8060025c6ced206986e94cc46b8f382b81bfa47f
Diffstat (limited to 'runsc')
-rw-r--r--runsc/boot/network.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/runsc/boot/network.go b/runsc/boot/network.go
index 83d56f93a..0cadf48d6 100644
--- a/runsc/boot/network.go
+++ b/runsc/boot/network.go
@@ -135,12 +135,12 @@ func (n *Network) CreateLinksAndRoutes(args *CreateLinksAndRoutesArgs, _ *struct
mac := tcpip.LinkAddress(generateRndMac())
linkEP := fdbased.New(&fdbased.Options{
- FD: newFD,
- MTU: uint32(link.MTU),
- EthernetHeader: true,
- HandleLocal: true,
- Address: mac,
- UseRecvMMsg: true,
+ FD: newFD,
+ MTU: uint32(link.MTU),
+ EthernetHeader: true,
+ HandleLocal: true,
+ Address: mac,
+ PacketDispatchMode: fdbased.PacketMMap,
})
log.Infof("Enabling interface %q with id %d on addresses %+v (%v)", link.Name, nicID, link.Addresses, mac)