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

Add IPv6 flow for traceflowConnectionTrackFlows #2054

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions pkg/agent/openflow/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,31 +705,32 @@ func (c *client) kubeProxyFlows(category cookie.Category) []binding.Flow {
func (c *client) traceflowConnectionTrackFlows(dataplaneTag uint8, packet *binding.Packet, srcOFPort uint32, timeout uint16, category cookie.Category) []binding.Flow {
connectionTrackStateTable := c.pipeline[conntrackStateTable]
var flows []binding.Flow

if packet == nil {
flowBuilder := connectionTrackStateTable.BuildFlow(priorityLow + 1).
MatchProtocol(binding.ProtocolIP).
MatchIPDSCP(dataplaneTag).
SetHardTimeout(timeout).
Cookie(c.cookieAllocator.Request(category).Raw())
if c.enableProxy {
flowBuilder = flowBuilder.
Action().ResubmitToTable(sessionAffinityTable).
Action().ResubmitToTable(serviceLBTable)
} else {
flowBuilder = flowBuilder.
Action().ResubmitToTable(connectionTrackStateTable.GetNext())
}
flows = append(flows, flowBuilder.Done())
for _, ipProtocol := range c.ipProtocols {
flowBuilder := connectionTrackStateTable.BuildFlow(priorityLow + 1).
MatchProtocol(ipProtocol).
MatchIPDSCP(dataplaneTag).
SetHardTimeout(timeout).
Cookie(c.cookieAllocator.Request(category).Raw())
if c.enableProxy {
flowBuilder = flowBuilder.
Action().ResubmitToTable(sessionAffinityTable).
Action().ResubmitToTable(serviceLBTable)
} else {
flowBuilder = flowBuilder.
Action().ResubmitToTable(connectionTrackStateTable.GetNext())
}
flows = append(flows, flowBuilder.Done())

flows = append(flows, connectionTrackStateTable.BuildFlow(priorityLow+2).
MatchProtocol(binding.ProtocolIP).
MatchIPDSCP(dataplaneTag).
MatchCTStateTrk(true).MatchCTStateRpl(true).
SetHardTimeout(timeout).
Cookie(c.cookieAllocator.Request(category).Raw()).
Action().Drop().
Done())
flows = append(flows, connectionTrackStateTable.BuildFlow(priorityLow+2).
MatchProtocol(ipProtocol).
MatchIPDSCP(dataplaneTag).
MatchCTStateTrk(true).MatchCTStateRpl(true).
SetHardTimeout(timeout).
Cookie(c.cookieAllocator.Request(category).Raw()).
Action().Drop().
Done())
}
} else {
flowBuilder := connectionTrackStateTable.BuildFlow(priorityLow).
MatchInPort(srcOFPort).
Expand Down Expand Up @@ -937,7 +938,7 @@ func (c *client) l2ForwardCalcFlow(dstMAC net.HardwareAddr, ofPort uint32, skipI
func (c *client) traceflowL2ForwardOutputFlows(dataplaneTag uint8, liveTraffic bool, timeout uint16, category cookie.Category) []binding.Flow {
flows := []binding.Flow{}
l2FwdOutTable := c.pipeline[L2ForwardingOutTable]
for _, ipProtocol := range []binding.Protocol{binding.ProtocolIP, binding.ProtocolIPv6} {
for _, ipProtocol := range c.ipProtocols {
if c.encapMode.SupportsEncap() {
// SendToController and Output if output port is tunnel port.
flows = append(flows, l2FwdOutTable.BuildFlow(priorityNormal+3).
Expand Down