diff --git a/router/fastdp.go b/router/fastdp.go index 6a867f9d..d0c5a43f 100644 --- a/router/fastdp.go +++ b/router/fastdp.go @@ -32,7 +32,7 @@ type FastDatapath struct { lock sync.Mutex // guards state and synchronises use of dpif dpif *odp.Dpif dp odp.DatapathHandle - mtu int // [1] + iface *net.Interface deleteFlowsCount uint64 missCount uint64 missHandlers map[odp.VportID]missHandler @@ -59,10 +59,6 @@ type FastDatapath struct { // forwarders by remote peer forwarders map[mesh.PeerName]*fastDatapathForwarder - - // [1] The mtu from the datapath netdev (which should match the - // mtus on all the veths hooked up to the datapath). We validate - // that we are able to support that mtu. } func NewFastDatapath(dpName string, port int) (*FastDatapath, error) { @@ -92,7 +88,7 @@ func NewFastDatapath(dpName string, port int) (*FastDatapath, error) { dpname: dpName, dpif: dpif, dp: dp, - mtu: iface.MTU, + iface: iface, missHandlers: make(map[odp.VportID]missHandler), sendToPort: nil, sendToMAC: make(map[MAC]bridgeSender), @@ -665,7 +661,7 @@ func (fwd *fastDatapathForwarder) sendHeartbeat() { // the heartbeat payload consists of the 64-bit connection uid // followed by the 16-bit packet size. - buf := make([]byte, EthernetOverhead+fwd.fastdp.mtu) + buf := make([]byte, EthernetOverhead+fwd.fastdp.iface.MTU) binary.BigEndian.PutUint64(buf[EthernetOverhead:], fwd.connUID) binary.BigEndian.PutUint16(buf[EthernetOverhead+8:], uint16(len(buf)))