/* SPDX-License-Identifier: GPL-2.0+ */ enum hwpa_backend_rv { HWPA_BACKEND_SUCCESS, /* required */ HWPA_BACKEND_ERR_NO_ACCELERATOR, HWPA_BACKEND_ERR_NO_FREE_HWS, HWPA_BACKEND_ERR_CREATION, HWPA_BACKEND_ERR_REMOVAL, HWPA_BACKEND_ERR_NO_MEM, HWPA_BACKEND_ERR_NO_FLOW_ID, HWPA_BACKEND_ERR_WAN_IG_MAC, HWPA_BACKEND_ERR_WAN_EG_MAC, HWPA_BACKEND_ERR_PROBE, HWPA_BACKEND_ERR_BAD_HIERARCHY, HWPA_BACKEND_ERR_INTERNAL, HWPA_BACKEND_ERR_NO_MATCH, HWPA_BACKEND_ERR_BAD_VLAN, }; #define HWPA_BACKEND_RV_DESC_INITIALIZER \ {\ [HWPA_BACKEND_SUCCESS] = "success",\ \ [HWPA_BACKEND_ERR_NO_ACCELERATOR] = "No matching accelerator",\ [HWPA_BACKEND_ERR_NO_FREE_HWS] = "No free hw session",\ [HWPA_BACKEND_ERR_CREATION] = "hws creation error",\ [HWPA_BACKEND_ERR_REMOVAL] = "hws removal error",\ [HWPA_BACKEND_ERR_NO_MEM] = "no memory",\ [HWPA_BACKEND_ERR_NO_FLOW_ID] = "ssdk flow id broken",\ [HWPA_BACKEND_ERR_WAN_IG_MAC] = "wan ig mac not registered",\ [HWPA_BACKEND_ERR_WAN_EG_MAC] = "wan eg mac not registered",\ [HWPA_BACKEND_ERR_PROBE] = "probe failed",\ [HWPA_BACKEND_ERR_BAD_HIERARCHY] = "bad hierarchy",\ [HWPA_BACKEND_ERR_INTERNAL] = "internal error",\ [HWPA_BACKEND_ERR_NO_MATCH] = "hws not matching tuple",\ [HWPA_BACKEND_ERR_BAD_VLAN] = "unsupported or bad vlan",\ } #define HWPA_VALID_L2 \ { { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_VLAN }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ #define HWPA_VALID_L3 \ { { .type = AVM_PA_IPV4 }, \ { .type = AVM_PA_PORTS }, \ { .type = AVM_PA_NUM_MATCH_TYPES }, }, \ \ { { .type = AVM_PA_IPV6 }, \ { .type = AVM_PA_PORTS }, \ { .type = AVM_PA_NUM_MATCH_TYPES }, }, \ /* No encapsulation yet */ #define HWPA_VALID_L3_L2ENCAP #define HWPA_VALID_L3_L3ENCAP /* Take bsessions into consideration for HW offload */ #define HWPA_BESSIONS_ALLOWED 1 int try_to_accelerate(avm_pid_handle pid_handle, struct sk_buff *skb);