Skip to content

Commit

Permalink
Rename fastpath to datapath everywhere (omec-project#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Osiński authored Mar 21, 2022
1 parent 173ccf8 commit bfdf415
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 75 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ test-up4-integration-docker:
docker-compose -f test/integration/infra/docker-compose.yml rm -fsv
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker-compose -f test/integration/infra/docker-compose.yml build $(DOCKER_BUILD_ARGS)
docker-compose -f test/integration/infra/docker-compose.yml up -d
MODE=docker FASTPATH=up4 go test -v -count=1 -failfast ./test/integration/...
MODE=docker DATAPATH=up4 go test -v -count=1 -failfast ./test/integration/...
docker-compose -f test/integration/infra/docker-compose.yml rm -fsv

test-bess-integration-native:
MODE=native FASTPATH=bess go test \
MODE=native DATAPATH=bess go test \
-v \
-count=1 \
-failfast \
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ This UPF implementation is actively used as part of [the Aether platform](https:
The UPF implementation consists of two layers:

- **PFCP Agent:** (_pfcpiface_) a Go-based implementation of the PFCP northbound API used to interact with the mobile core control plane.
- **Fastpath:** responsible for the actual data plane packet processing.
- **Datapath:** responsible for the actual data plane packet processing.

The PFCP Agent implements fastpath plugins that translate
PFCP messages to fastpath-specific configurations. We currently support two fastpath implementations:
- BESS: a software-based fastpath built on top of the [Berkeley Extensible Software Switch](https://github.com/NetSys/bess/) (BESS) framework.
The PFCP Agent implements datapath plugins that translate
PFCP messages to datapath-specific configurations. We currently support two datapath implementations:
- BESS: a software-based datapath built on top of the [Berkeley Extensible Software Switch](https://github.com/NetSys/bess/) (BESS) framework.
Please see the ONFConnect 2019 [talk](https://www.youtube.com/watch?v=fqJGWcwcOxE) for more details. You can also see demo videos [here](https://www.youtube.com/watch?v=KxK64jalKHw) and [here](https://youtu.be/rWnZuJeUWi4).
- [UP4](https://github.com/omec-project/up4): an implementation leveraging ONOS and P4-programmable switches to realize a hardware-based fastpath.
- [UP4](https://github.com/omec-project/up4): an implementation leveraging ONOS and P4-programmable switches to realize a hardware-based datapath.

The combination of PFCP Agent and UP4 is usually referred to as P4-UPF. While BESS-UPF denotes the combination of PFCP Agent and the BESS fastpath.
The combination of PFCP Agent and UP4 is usually referred to as P4-UPF. While BESS-UPF denotes the combination of PFCP Agent and the BESS datapath.

PFCP Agent internally abstracts different fastpaths using a common API, while the different plug-ins can use spcific southbound protocols to communicate with the different fastpath instances. Support for new fastpaths can be provided by implementing new plugins.
PFCP Agent internally abstracts different datapaths using a common API, while the different plug-ins can use spcific southbound protocols to communicate with the different datapath instances. Support for new datapaths can be provided by implementing new plugins.

### Feature List

Expand Down Expand Up @@ -75,7 +75,7 @@ Refer to [the SD-Fabric documentation](https://docs.sd-fabric.org/master/advance

## Getting started

This repository provides code to build two Docker images: `pfcpiface` (the PFCP Agent) and `bess` (the BESS-based fastpath).
This repository provides code to build two Docker images: `pfcpiface` (the PFCP Agent) and `bess` (the BESS-based datapath).

To build all Docker images run:

Expand Down Expand Up @@ -111,10 +111,10 @@ The UPF project currently implements three types of tests:
make test
```

**E2E integration tests** that verify the inter-working between the PFCP Agent and a fastpath.
**E2E integration tests** that verify the inter-working between the PFCP Agent and a datapath.
We provide two modes of E2E integration tests: `native` and `docker`.
The `native` mode invokes Go objects directly from the `go test` framework, thus it makes the test cases easier to debug.
The `docker` mode uses fully Dockerized environment and runs all components (the PFCP Agent and a fastpath mock) as Docker containers. It ensures the correct behavior of the package produced by the UPF project.
The `docker` mode uses fully Dockerized environment and runs all components (the PFCP Agent and a datapath mock) as Docker containers. It ensures the correct behavior of the package produced by the UPF project.

To run E2E integration tests for UP4 in the `docker` mode use:

Expand All @@ -130,12 +130,12 @@ make test-bess-integration-native

> NOTE! The `docker` mode for BESS-UPF and the `native` mode for UP4 are not implemented yet.
**PTF tests for BESS-UPF** verify the BESS-based implementation of the UPF fastpath (data plane).
**PTF tests for BESS-UPF** verify the BESS-based implementation of the UPF datapath (data plane).
Follow the included [README](./ptf/README.md) to run PTF tests for BESS-UPF.

## Contributing

The UPF project welcomes new contributors. Feel free to propose a new feature, integrate a new UPF fastpath or fix bugs!
The UPF project welcomes new contributors. Feel free to propose a new feature, integrate a new UPF datapath or fix bugs!

Before contributing, please follow the below guidelines:

Expand Down
22 changes: 11 additions & 11 deletions conf/ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def configure_flow_profiles(self, iface):
if iface == "core":
self.flow_profiles = [6, 9]

def init_fastpath(self, **kwargs):
def init_datapath(self, **kwargs):
# Initialize PMDPort and RX/TX modules
name = self.name
fast = PMDPort(name="{}Fast".format(name), **kwargs)
Expand All @@ -91,7 +91,7 @@ def init_fastpath(self, **kwargs):
for qid in range(self.num_q):
fpi = QueueInc(name="{}Q{}FastPI".format(name, qid), port=fast.name, qid=qid)
fpi.connect(next_mod=self.fpi)
# Attach fastpath to worker"s root TC
# Attach datapath to worker"s root TC
fpi.attach_task(wid=qid)

fpo = QueueOut(name="{}Q{}FastPO".format(name, qid), port=fast.name, qid=qid)
Expand Down Expand Up @@ -126,11 +126,11 @@ def init_port(self, idx, conf_mode):

if conf_mode in ['af_xdp', 'linux']:
try:
# Initialize kernel fastpath.
# Initialize kernel datapath.
# AF_XDP requires that num_rx_qs == num_tx_qs
kwargs = {"vdev" : "net_af_xdp{},iface={},start_queue=0,queue_count={}"
.format(idx, name, num_q), "num_out_q": num_q, "num_inc_q": num_q}
self.init_fastpath(**kwargs)
self.init_datapath(**kwargs)
except:
if conf_mode == 'linux':
print('Failed to create AF_XDP socket for {}. Retrying with AF_PACKET socket...'.format(name))
Expand All @@ -141,10 +141,10 @@ def init_port(self, idx, conf_mode):

if conf_mode == 'af_packet':
try:
# Initialize kernel fastpath
# Initialize kernel datapath
kwargs = {"vdev" : "net_af_packet{},iface={},qpairs={}"
.format(idx, name, num_q), "num_out_q": num_q, "num_inc_q": num_q}
self.init_fastpath(**kwargs)
self.init_datapath(**kwargs)
except:
print('Failed to create AF_PACKET socket for {}. Exiting...'.format(name))
sys.exit()
Expand All @@ -155,7 +155,7 @@ def init_port(self, idx, conf_mode):
self.bpf = BPF(name="{}FastBPF".format(name))
self.bpf.clear()

# Attach fastpath to worker"s root TC
# Attach datapath to worker"s root TC
self.fpi.attach_task(wid=0)

if conf_mode == 'dpdk':
Expand All @@ -164,24 +164,24 @@ def init_port(self, idx, conf_mode):
if pci is not None:
kwargs = {"pci": pci, "num_out_q": num_q, "num_inc_q": num_q, "hwcksum": self.hwcksum, "flow_profiles": self.flow_profiles}
try:
self.init_fastpath(**kwargs)
self.init_datapath(**kwargs)
except:
kwargs = None
print("Unable to initialize {} fastpath using alias {},\
print("Unable to initialize {} datapath using alias {},\
falling back to scan'.format(name, pci))
if kwargs is None:
# Fallback to scanning ports
# if port list is empty, scan for dpdk_ports first
if not dpdk_ports and scan_dpdk_ports() == False:
print('Registered dpdk ports do not exist.')
sys.exit()
# Initialize DPDK fastpath
# Initialize DPDK datapath
fidx = dpdk_ports.get(mac_by_interface(name))
if fidx is None:
raise Exception(
'Registered port for {} not detected!'.format(name))
kwargs = {"port_id": fidx, "num_out_q": num_q, "num_inc_q": num_q, "hwcksum": self.hwcksum, "flow_profiles": self.flow_profiles}
self.init_fastpath(**kwargs)
self.init_datapath(**kwargs)

# Initialize kernel slowpath port and RX/TX modules
try:
Expand Down
2 changes: 1 addition & 1 deletion docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ To start UPF in simulation mode:

#### [Pktgen](../conf/pktgen.bess)

Pktgen allows us to test the upf pipeline with external fastpath interfaces.
Pktgen allows us to test the upf pipeline with external datapath interfaces.
This can be done either using a single machine or two machines.

> Make sure the mode is not set to sim in scripts/docker_setup.sh and upf.json
Expand Down
Binary file modified docs/images/upf-overview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions pfcpiface/fastpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ func (u upfMsgType) String() string {
}
}

type fastPath interface {
type datapath interface {
/* Close any pending sessions */
exit()
/* setup internal parameters and channel with fastPath */
/* setup internal parameters and channel with datapath */
setUpfInfo(u *upf, conf *Conf)
/* set up slice info */
addSliceInfo(sliceInfo *SliceInfo) error
/* write endMarker to fastpath */
/* write endMarker to datapath */
sendEndMarkers(endMarkerList *[][]byte) error
/* write pdr/far/qer to fastpath */
/* write pdr/far/qer to datapath */
// "master" function to send create/update/delete messages to UPF.
// "new" PacketForwardingRules are only used for update messages to UPF.
// TODO: we should have better CRUD API, with a single function per message type.
sendMsgToUPF(method upfMsgType, all PacketForwardingRules, new PacketForwardingRules) uint8
/* check of communication channel to fastpath is setup */
/* check of communication channel to datapath is setup */
isConnected(accessIP *net.IP) bool
summaryLatencyJitter(uc *upfCollector, ch chan<- prometheus.Metric)
portStats(uc *upfCollector, ch chan<- prometheus.Metric)
Expand Down
4 changes: 2 additions & 2 deletions pfcpiface/messages_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

var errFlowDescAbsent = errors.New("flow description not present")
var errFastpathDown = errors.New("fastpath down")
var errDatapathDown = errors.New("datapath down")
var errReqRejected = errors.New("request rejected")

func (pConn *PFCPConn) sendAssociationRequest() {
Expand Down Expand Up @@ -149,7 +149,7 @@ func (pConn *PFCPConn) handleAssociationSetupRequest(msg message.Message) (messa

if !upf.isConnected() {
asres.Cause = ie.NewCause(ie.CauseRequestRejected)
return asres, errProcess(errFastpathDown)
return asres, errProcess(errDatapathDown)
}

if pConn.ts.remote.IsZero() {
Expand Down
12 changes: 6 additions & 6 deletions pfcpiface/messages_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// errors
var (
ErrWriteToFastpath = errors.New("write to FastPath failed")
ErrWriteToDatapath = errors.New("write to datapath failed")
ErrAssocNotFound = errors.New("no association found for NodeID")
ErrAllocateSession = errors.New("unable to allocate new PFCP session")
)
Expand Down Expand Up @@ -136,7 +136,7 @@ func (pConn *PFCPConn) handleSessionEstablishmentRequest(msg message.Message) (m
cause := upf.sendMsgToUPF(upfMsgTypeAdd, session.PacketForwardingRules, updated)
if cause == ie.CauseRequestRejected {
pConn.RemoveSession(session)
return errProcessReply(ErrWriteToFastpath,
return errProcessReply(ErrWriteToDatapath,
ie.CauseRequestRejected)
}

Expand Down Expand Up @@ -333,7 +333,7 @@ func (pConn *PFCPConn) handleSessionModificationRequest(msg message.Message) (me

cause := upf.sendMsgToUPF(upfMsgTypeMod, session.PacketForwardingRules, updated)
if cause == ie.CauseRequestRejected {
return sendError(ErrWriteToFastpath)
return sendError(ErrWriteToDatapath)
}

if upf.enableEndMarker {
Expand Down Expand Up @@ -397,7 +397,7 @@ func (pConn *PFCPConn) handleSessionModificationRequest(msg message.Message) (me

cause = upf.sendMsgToUPF(upfMsgTypeDel, deleted, PacketForwardingRules{})
if cause == ie.CauseRequestRejected {
return sendError(ErrWriteToFastpath)
return sendError(ErrWriteToDatapath)
}

err := pConn.store.PutSession(session)
Expand Down Expand Up @@ -447,7 +447,7 @@ func (pConn *PFCPConn) handleSessionDeletionRequest(msg message.Message) (messag

cause := upf.sendMsgToUPF(upfMsgTypeDel, session.PacketForwardingRules, PacketForwardingRules{})
if cause == ie.CauseRequestRejected {
return sendError(ErrWriteToFastpath)
return sendError(ErrWriteToDatapath)
}

if err := releaseAllocatedIPs(upf.ippool, &session); err != nil {
Expand Down Expand Up @@ -557,7 +557,7 @@ func (pConn *PFCPConn) handleSessionReportResponse(msg message.Message) error {
upfMsgTypeDel, sessItem.PacketForwardingRules, PacketForwardingRules{})
if cause == ie.CauseRequestRejected {
return errProcess(
ErrOperationFailedWithParam("delete session from fastpath", "seid", seid))
ErrOperationFailedWithParam("delete session from datapath", "seid", seid))
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pfcpiface/pfcpiface.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type PFCPIface struct {
conf Conf

node *PFCPNode
fp fastPath
fp datapath
upf *upf

httpSrv *http.Server
Expand Down
2 changes: 1 addition & 1 deletion pfcpiface/up4.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (up4 *UP4) initApplicationIDs() {

// This function ensures that PFCP Agent is connected to UP4.
// Returns true if the connection is already established.
// FIXME: the argument should be removed from fastpath API
// FIXME: the argument should be removed from datapath API
func (up4 *UP4) isConnected(accessIP *net.IP) bool {
up4.connectedMu.Lock()
defer up4.connectedMu.Unlock()
Expand Down
12 changes: 6 additions & 6 deletions pfcpiface/upf.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type upf struct {
sliceInfo *SliceInfo
readTimeout time.Duration

fastPath
datapath
maxReqRetries uint8
respTimeout time.Duration
enableHBTimer bool
Expand All @@ -75,7 +75,7 @@ const (
)

func (u *upf) isConnected() bool {
return u.fastPath.isConnected(&u.accessIP)
return u.datapath.isConnected(&u.accessIP)
}

func (u *upf) addSliceInfo(sliceInfo *SliceInfo) error {
Expand All @@ -85,10 +85,10 @@ func (u *upf) addSliceInfo(sliceInfo *SliceInfo) error {

u.sliceInfo = sliceInfo

return u.fastPath.addSliceInfo(sliceInfo)
return u.datapath.addSliceInfo(sliceInfo)
}

func NewUPF(conf *Conf, fp fastPath) *upf {
func NewUPF(conf *Conf, fp datapath) *upf {
var (
err error
nodeID string
Expand Down Expand Up @@ -120,7 +120,7 @@ func NewUPF(conf *Conf, fp fastPath) *upf {
coreIface: conf.CoreIface.IfName,
ippoolCidr: conf.CPIface.UEIPPool,
nodeID: nodeID,
fastPath: fp,
datapath: fp,
dnn: conf.CPIface.Dnn,
peers: conf.CPIface.Peers,
reportNotifyChan: make(chan uint64, 1024),
Expand Down Expand Up @@ -173,7 +173,7 @@ func NewUPF(conf *Conf, fp fastPath) *upf {
}
}

u.fastPath.setUpfInfo(u, conf)
u.datapath.setUpfInfo(u, conf)

return u
}
2 changes: 1 addition & 1 deletion pfcpiface/web_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ func handleSliceConfig(nwSlice *NetworkSlice, upf *upf) {

err := upf.addSliceInfo(&sliceInfo)
if err != nil {
log.Errorln("adding slice info to fastpath failed : ", err)
log.Errorln("adding slice info to datapath failed : ", err)
}
}
4 changes: 2 additions & 2 deletions test/integration/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

func init() {
if isFastpathUP4() && isModeDocker() {
if isDatapathUP4() && isModeDocker() {
initForwardingPipelineConfig()
}
}
Expand Down Expand Up @@ -518,7 +518,7 @@ func testUEAttachDetach(t *testing.T, testcase *testCase) {
testUEAttach(t, testcase)
testUEDetach(t, testcase)

if isFastpathUP4() {
if isDatapathUP4() {
// clear Applications table
// FIXME: Temporary solution. They should be cleared by pfcpiface, see SDFAB-960
p4rtClient, _ := providers.ConnectP4rt("127.0.0.1:50001", TimeBasedElectionId())
Expand Down
10 changes: 5 additions & 5 deletions test/integration/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ func UP4ConfigUPFBasedIPAllocation() pfcpiface.Conf {
return config
}

func GetConfig(fastpath string, configType uint32) pfcpiface.Conf {
switch fastpath {
case FastpathUP4:
func GetConfig(datapath string, configType uint32) pfcpiface.Conf {
switch datapath {
case DatapathUP4:
switch configType {
case ConfigDefault:
return UP4ConfigDefault()
case ConfigUPFBasedIPAllocation:
return UP4ConfigUPFBasedIPAllocation()
}
case FastpathBESS:
case DatapathBESS:
switch configType {
case ConfigDefault:
return BESSConfigDefault()
Expand All @@ -112,7 +112,7 @@ func GetConfig(fastpath string, configType uint32) pfcpiface.Conf {
}
}

panic("Wrong fastpath or config type provided")
panic("Wrong datapath or config type provided")

return pfcpiface.Conf{}
}
Loading

0 comments on commit bfdf415

Please sign in to comment.