DOCA Documentation v2.5.1 LTS
1.0

NVIDIA DOCA Socket Relay

This document describes DOCA Socket Relay architecture, usage, etc.

DOCA Socket Relay allows Unix Domain Socket (AF_UNIX family) server applications to be offloaded to the DPU while communication between the two sides is proxied by DOCA Comm Channel.

Socket relay only supports SOCK_STREAM communication with a limit of 512 AF_UNIX application clients.

The tool is coupled to the client AF_UNIX server application. That is, a socket relay instance should be initiated per AF_UNIX server application.

image2023-4-9_16-37-54-version-1-modificationdate-1702686672617-api-v2.png

Socket relay is transparent to the application except for the following TCP flows:

  • Connection termination must be done by the host side application only

  • Once a FIN packet (shutdown system call has been made) is sent by the host side application, data cannot be transferred between the DPU and the host, and the connection must be closed.

The following details the communication flow between the client and server:

  • The AF_UNIX client application connects to the socket relay AF_UNIX server in the same way as in the original flow

  • The AF_UNIX client application sends SOCK_STREAM packets

  • The socket relay (host) AF_UNIX server receives the client application packets, and the Comm Channel client sends them on the channel

  • The socket relay (DPU) Comm Channel server receives the client application packets and the AF_UNIX client sends them to the user's AF_UNIX server application

Windows 10 build 17063 is the minimal Windows version to run DOCA Socket Relay on a Windows host.

NVIDIA® BlueField®-2 firmware version 24.35.1012 or higher.

To execute DOCA Socket Relay:

Copy
Copied!
            

Usage: doca_socket_relay [DOCA Flags] [Program Flags]   DOCA Flags: -h, --help Print a help synopsis -v, --version Print program version information -l, --log-level Set the (numeric) log level for the program <10=DISABLE, 20=CRITICAL, 30=ERROR, 40=WARNING, 50=INFO, 60=DEBUG, 70=TRACE> --sdk-log-level Set the SDK (numeric) log level for the program <10=DISABLE, 20=CRITICAL, 30=ERROR, 40=WARNING, 50=INFO, 60=DEBUG, 70=TRACE> -j, --json <path> Parse all command flags from an input json file   Program Flags: -s, --socket Unix domain socket path, host side will bind to and DPU connect to -n, --cc-name Comm Channel service name -p, --pci-addr DOCA Comm Channel device PCI address -r, --rep-pci DOCA Comm Channel device representor PCI address (needed only on DPU)

For example (DPU side):

Copy
Copied!
            

doca_socket_relay -s /tmp/sr_server.socket -n cc_channel -p 03:00.0 -r b1:00.0

To run doca_socket_relay using a JSON file:

Copy
Copied!
            

doca_socket_relay --json [json_file]

For example:

Copy
Copied!
            

doca_socket_relay --json /tmp/doca_socket_relay.json

Refer to the DOCA Arg Parser for more information.

Flag Type

Short Flag

Long Flag/JSON Key

Description

JSON Content

General flags

h

help

Prints a help synopsis

N/A

v

version

Prints program version information

N/A

l

log-level

Set the log level for the application:

  • DISABLE=10

  • CRITICAL=20

  • ERROR=30

  • WARNING=40

  • INFO=50

  • DEBUG=60

  • TRACE=70 ( requires compilation with TRACE log level support )

Copy
Copied!
            

"log-level": 60

N/A

sdk-log-level

SDK log events are currently unsupported for this tool

N/A

j

json

Parse all command flags from an input JSON file

N/A

Program flags

s

socket

AF_UNIX (SOCK_STREAM) path. On the host, this is the path of the socket relay AF_UNIX server for the client's application to connect to. On the DPU, this is the path of the client AF_UNIX server application.

Warning

This flag is mandatory.

Copy
Copied!
            

"socket": "/tmp/uds-server.socket"

n

cc-name

Comm Channel service name

Warning

This flag is mandatory.

Copy
Copied!
            

"cc-name": sr_channel

p

pci-addr

DOCA Comm Channel device PCIe address

Warning

This flag is mandatory.

Copy
Copied!
            

"pci-addr": b1:00.1

r

rep-pci

DOCA Comm Channel device representor PCIe address

Warning

This flag is available and mandatory only on the DPU.

Copy
Copied!
            

"rep-pci": b1:02.2

© Copyright 2023, NVIDIA. Last updated on Mar 5, 2024.