Skip to content

Commit

Permalink
feat(evpn): remove prints
Browse files Browse the repository at this point in the history
Signed-off-by: Saikumar, Banoth <[email protected]>
  • Loading branch information
Inbanoth committed Oct 10, 2024
1 parent 0fb5134 commit ea574f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/opiproject/opi-evpn-bridge/pkg/infradb"
netlink_polling "github.com/opiproject/opi-evpn-bridge/pkg/netlink"
"github.com/opiproject/opi-evpn-bridge/pkg/utils"
p4client "github.com/opiproject/opi-evpn-bridge/pkg/vendor_plugins/intel-e2000/p4runtime/p4driverapi"
p4client "github.com/opiproject/opi-intel-bridge/pkg/evpn/vendor_plugins/intel-e2000/p4runtime/p4driverapi"
binarypack "github.com/roman-kachanovsky/go-binary-pack/binary-pack"
)

Expand Down Expand Up @@ -614,18 +614,18 @@ func _deleteTcamEntry(vrfID uint32, direction int, prefix interface{}) (p4client
// PhyPort structure of phy ports
type PhyPort struct {
id int
vsi int
vsi uint16
mac string
}

// PhyPortInit initializes the phy port
func (p PhyPort) PhyPortInit(id int, vsi string, mac string) PhyPort {
p.id = id
val, err := strconv.ParseInt(vsi, 10, 32)
val, err := strconv.ParseUint(vsi, 10, 16)
if err != nil {
panic(err)
}
p.vsi = int(val)
p.vsi = uint16(val)
p.mac = mac

return p
Expand Down Expand Up @@ -773,18 +773,18 @@ func (e *EcmpDispatcher) EcmpDispatcherInit(nexthop []*netlink_polling.NexthopSt

// GrpcPairPort structure
type GrpcPairPort struct {
vsi int
vsi uint16
mac string
peer map[string]string
}

// GrpcPairPortInit get the vsi+16
func (g GrpcPairPort) GrpcPairPortInit(vsi string, mac string) GrpcPairPort {
val, err := strconv.ParseInt(vsi, 10, 32)
val, err := strconv.ParseUint(vsi, 10, 16)
if err != nil {
panic(err)
}
g.vsi = int(val)
g.vsi = uint16(val)
g.mac = mac
return g
}
Expand Down Expand Up @@ -1145,7 +1145,6 @@ func (l L3Decoder) translateAddedRoute(route netlink_polling.RouteStruct) []inte
ecmp.runWebsterAlg()
entries = ecmp.addEcmpDispatcher(entries)
}
fmt.Printf("Inside translateAddedRoute Entries :%+v", entries)
route.Nexthops = []*netlink_polling.NexthopStruct{}
route.Nexthops = ecmp.Nexthop
ecmpFlag = true
Expand All @@ -1166,17 +1165,14 @@ func (l L3Decoder) translateDeletedRoute(route netlink_polling.RouteStruct) []in

var ecmp EcmpDispatcher
if len(route.Nexthops) > 1 {
fmt.Printf("Inside translateDeletedRoute")
if !ecmp.EcmpDispatcherInit(route.Nexthops, route.Vrf) {
return entries
}
ecmp.id, refCount = ecmpIndexPool.Release_id(ecmp.key, route.Key)
fmt.Printf("ecmo id :%+v , refCount = %v", ecmp.id, refCount)
if refCount == 0 {
ecmp.runWebsterAlg()
entries = ecmp.delEcmpDispatcher(entries)
}
fmt.Printf("Inside translateDeletedRoute Entries :%+v", entries)
route.Nexthops = []*netlink_polling.NexthopStruct{}
route.Nexthops = ecmp.Nexthop
ecmpFlag = true
Expand Down Expand Up @@ -1591,7 +1587,7 @@ func (l L3Decoder) StaticAdditions() []interface{} {
},
)
for _, port := range l._grpcPorts {
var peerVsi, err = strconv.ParseInt(port.peer["vsi"], 10, 64)
var peerVsi, err = strconv.ParseUint(port.peer["vsi"], 10, 16)
if err != nil {
panic(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/opiproject/opi-evpn-bridge/pkg/infradb/subscriberframework/eventbus"
nm "github.com/opiproject/opi-evpn-bridge/pkg/netlink"
eb "github.com/opiproject/opi-evpn-bridge/pkg/netlink/eventbus"
p4client "github.com/opiproject/opi-evpn-bridge/pkg/vendor_plugins/intel-e2000/p4runtime/p4driverapi"
p4client "github.com/opiproject/opi-intel-bridge/pkg/evpn/vendor_plugins/intel-e2000/p4runtime/p4driverapi"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
Expand Down

0 comments on commit ea574f1

Please sign in to comment.