Skip to content

Commit

Permalink
Trivial: Use VxlanAddDelTunnelV3 instead of V2
Browse files Browse the repository at this point in the history
VxlanAddDelTunnelV2 was deprecated (see [1]), change it to
VxlanAddDelTunnelV3 and update the related log messages also.

[1]: FDio/govpp@8debdf0

Change-Id: I018c94c0b9d1501876c5070cb3e16733eb453506
Signed-off-by: Lajos Katona <lajos.katona@est.tech>
  • Loading branch information
elajkat committed Mar 12, 2024
1 parent c7e7e23 commit 2157279
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pkg/networkservice/mechanisms/vxlan/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func addDel(ctx context.Context, conn *networkservice.Connection, vppConn api.Co
WithField("vppapi", "AddNodeNext").Debug("completed")

now = time.Now()
vxlanAddDelTunnel := &vxlan.VxlanAddDelTunnelV2{
vxlanAddDelTunnelV3 := &vxlan.VxlanAddDelTunnelV3{
IsAdd: isAdd,
Instance: ^uint32(0),
SrcAddress: types.ToVppAddress(mechanism.SrcIP()),
Expand All @@ -95,21 +95,22 @@ func addDel(ctx context.Context, conn *networkservice.Connection, vppConn api.Co
DstPort: port,
}
if !isClient {
vxlanAddDelTunnel.SrcAddress = types.ToVppAddress(mechanism.DstIP())
vxlanAddDelTunnel.DstAddress = types.ToVppAddress(mechanism.SrcIP())
vxlanAddDelTunnelV3.SrcAddress = types.ToVppAddress(mechanism.DstIP())
vxlanAddDelTunnelV3.DstAddress = types.ToVppAddress(mechanism.SrcIP())
}
rsp, err := vxlan.NewServiceClient(vppConn).VxlanAddDelTunnelV2(ctx, vxlanAddDelTunnel)

rsp, err := vxlan.NewServiceClient(vppConn).VxlanAddDelTunnelV3(ctx, vxlanAddDelTunnelV3)
if err != nil {
return errors.Wrap(err, "vppapi VxlanAddDelTunnelV2 returned error")
return errors.Wrap(err, "vppapi VxlanAddDelTunnelV3 returned error")
}
log.FromContext(ctx).
WithField("isAdd", isAdd).
WithField("swIfIndex", rsp.SwIfIndex).
WithField("SrcAddress", vxlanAddDelTunnel.SrcAddress).
WithField("DstAddress", vxlanAddDelTunnel.DstAddress).
WithField("Vni", vxlanAddDelTunnel.Vni).
WithField("SrcAddress", vxlanAddDelTunnelV3.SrcAddress).
WithField("DstAddress", vxlanAddDelTunnelV3.DstAddress).
WithField("Vni", vxlanAddDelTunnelV3.Vni).
WithField("duration", time.Since(now)).
WithField("vppapi", "VxlanAddDelTunnel").Debug("completed")
WithField("vppapi", "VxlanAddDelTunnelV3").Debug("completed")
if isAdd {
ifindex.Store(ctx, isClient, rsp.SwIfIndex)
} else {
Expand Down

0 comments on commit 2157279

Please sign in to comment.