NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
psp_gw_pkt_rss.cpp File Reference
#include <rte_ethdev.h>
#include <rte_ether.h>
#include <rte_arp.h>
#include <rte_icmp.h>
#include <netinet/icmp6.h>
#include <doca_log.h>
#include <psp_gw_config.h>
#include <psp_gw_flows.h>
#include <psp_gw_pkt_rss.h>
#include <psp_gw_svc_impl.h>
Include dependency graph for psp_gw_pkt_rss.cpp:

Go to the source code of this file.

Macros

#define MAX_RX_BURST_SIZE   256
 

Functions

 DOCA_LOG_REGISTER (PSP_RSS)
 
static bool is_ns_request (struct rte_ether_hdr *eth_hdr, uint16_t ether_type)
 determine whether a given packet or request corresponds to a "Neighbor Solicitation" More...
 
static void handle_packet (struct lcore_params *params, uint16_t port_id, uint16_t queue_id, rte_ether_addr *port_src_mac, struct rte_mbuf *packet)
 High-level Rx Queue packet handler routine Optionally logs the packet to the console. Passes the packet to the PSP Service so it can decide whether to negotiate a new tunnel. More...
 
int lcore_pkt_proc_func (void *lcore_args)
 The entry point for each L-Core's main processing loop. Each L-Core polls a different Rx queue on the Host PF(s). If the packet indicates the need for a new tunnel to be established, it will be passed to the psp_svc object. Note multiple such packets may be received during the creation of the tunnel; in any case, they will be resubmitted to the encryption pipeline once the new flow has been created. More...
 
bool reinject_packet (struct rte_mbuf *packet, uint16_t port_id)
 Used by the psp_svc to re-inject a packet via the Host PF Tx queue after a new tunnel has been established. More...
 
uint16_t handle_arp (struct rte_mempool *mpool, uint16_t port_id, uint16_t queue_id, rte_ether_addr *port_src_mac, const struct rte_mbuf *request_pkt, uint32_t arp_response_meta_flag)
 Used to reply to an ARP request. More...
 
uint16_t handle_neighbor_solicitation (struct rte_mempool *mpool, uint16_t port_id, uint16_t queue_id, rte_ether_addr *port_src_mac, const struct rte_mbuf *request_pkt, uint32_t na_response_meta_flag)
 Used to reply to a Neighbor Solicitation packet. More...
 

Variables

static uint16_t max_tx_retries = 10
 

Macro Definition Documentation

◆ MAX_RX_BURST_SIZE

#define MAX_RX_BURST_SIZE   256

Definition at line 41 of file psp_gw_pkt_rss.cpp.

Function Documentation

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( PSP_RSS  )

◆ handle_arp()

uint16_t handle_arp ( struct rte_mempool *  mpool,
uint16_t  port_id,
uint16_t  queue_id,
rte_ether_addr *  port_src_mac,
const struct rte_mbuf *  request_pkt,
uint32_t  arp_response_meta_flag 
)

Used to reply to an ARP request.

@mpool [in]: the mempool to allocate the response packet from @port_id [in]: the port on which to send the ARP response @queue_id [in]: the queue on which to send the ARP response @port_src_mac [in]: the source mac address of the port @request_pkt [in]: the ARP request packet @arp_response_meta_flag [in]: the metadata flag to set on the ARP response

Returns
: number of ARP packets handled (currently only one packet is supported)

Definition at line 199 of file psp_gw_pkt_rss.cpp.

◆ handle_neighbor_solicitation()

uint16_t handle_neighbor_solicitation ( struct rte_mempool *  mpool,
uint16_t  port_id,
uint16_t  queue_id,
rte_ether_addr *  port_src_mac,
const struct rte_mbuf *  request_pkt,
uint32_t  na_response_meta_flag 
)

Used to reply to a Neighbor Solicitation packet.

@mpool [in]: the mempool to allocate the response packet from @port_id [in]: the port on which to send the Neighbor Solicitation response @queue_id [in]: the queue on which to send the Neighbor Solicitation response @port_src_mac [in]: the source mac address of the port @request_pkt [in]: the Neighbor Solicitation packet @na_response_meta_flag [in]: the metadata flag to set on the Neighbor Solicitation response

Returns
: number of Neighbor Solicitation packets handled (currently only one packet is supported)

Definition at line 261 of file psp_gw_pkt_rss.cpp.

◆ handle_packet()

static void handle_packet ( struct lcore_params params,
uint16_t  port_id,
uint16_t  queue_id,
rte_ether_addr *  port_src_mac,
struct rte_mbuf *  packet 
)
static

High-level Rx Queue packet handler routine Optionally logs the packet to the console. Passes the packet to the PSP Service so it can decide whether to negotiate a new tunnel.

@params [in]: the parameters to the lcore routines @port_id [in]: the port_id from which the packet was received @queue_id [in]: the queue index from which the packet was received @port_src_mac [in]: the source mac address of the port @packet [in]: the received packet buffer

Definition at line 84 of file psp_gw_pkt_rss.cpp.

◆ is_ns_request()

static bool is_ns_request ( struct rte_ether_hdr *  eth_hdr,
uint16_t  ether_type 
)
static

determine whether a given packet or request corresponds to a "Neighbor Solicitation"

@params [in]: the parameters to the lcore routines @eth_hdr [in]: a pointer to the ethernet header of the pakcet @ether_type [in]: the packet ethernet type

Definition at line 52 of file psp_gw_pkt_rss.cpp.

◆ lcore_pkt_proc_func()

int lcore_pkt_proc_func ( void *  lcore_args)

The entry point for each L-Core's main processing loop. Each L-Core polls a different Rx queue on the Host PF(s). If the packet indicates the need for a new tunnel to be established, it will be passed to the psp_svc object. Note multiple such packets may be received during the creation of the tunnel; in any case, they will be resubmitted to the encryption pipeline once the new flow has been created.

@lcore_args [in]: a pointer to an lcore_params struct

Returns
: 0 on success (the main loop exited normally), negative value otherwise

Definition at line 134 of file psp_gw_pkt_rss.cpp.

◆ reinject_packet()

bool reinject_packet ( struct rte_mbuf *  packet,
uint16_t  port_id 
)

Used by the psp_svc to re-inject a packet via the Host PF Tx queue after a new tunnel has been established.

@packet [in]: the packet to submit into the egress pipeline @port_id [in]: the port on which to send the packet, usually the host PF

Returns
: true if the packet was successfully sent, false if too many retries failed

Definition at line 182 of file psp_gw_pkt_rss.cpp.

Variable Documentation

◆ max_tx_retries

uint16_t max_tx_retries = 10
static

Definition at line 43 of file psp_gw_pkt_rss.cpp.