Skip to content

Commit 8c95f77

Browse files
Sathya Perladavem330
authored andcommitted
bnxt_en: add support for Flower based vxlan encap/decap offload
This patch adds IPv4 vxlan encap/decap action support to TC-flower offload. For vxlan encap, the driver maintains a tunnel encap hash-table. When a new flow with a tunnel encap action arrives, this table is looked up; if an encap entry exists, it uses the already programmed encap_record_handle as the tunnel_handle in the hwrm_cfa_flow_alloc cmd. Else, a new encap node is added and the L2 header fields are queried via a route lookup. hwrm_cfa_encap_record_alloc cmd is used to create a new encap record and the encap_record_handle is used as the tunnel_handle while adding the flow. For vxlan decap, the driver maintains a tunnel decap hash-table. When a new flow with a tunnel decap action arrives, this table is looked up; if a decap entry exists, it uses the already programmed decap_filter_handle as the tunnel_handle in the hwrm_cfa_flow_alloc cmd. Else, a new decap node is added and a decap_filter_handle is alloc'd via the hwrm_cfa_decap_filter_alloc cmd. This handle is used as the tunnel_handle while adding the flow. The code to issue the HWRM FW cmds is introduced in a follow-up patch. Signed-off-by: Sathya Perla <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f850396 commit 8c95f77

File tree

4 files changed

+631
-12
lines changed

4 files changed

+631
-12
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,15 @@ struct bnxt_tc_info {
965965
/* hash table to store L2 keys of TC flows */
966966
struct rhashtable l2_table;
967967
struct rhashtable_params l2_ht_params;
968+
/* hash table to store L2 keys for TC tunnel decap */
969+
struct rhashtable decap_l2_table;
970+
struct rhashtable_params decap_l2_ht_params;
971+
/* hash table to store tunnel decap entries */
972+
struct rhashtable decap_table;
973+
struct rhashtable_params decap_ht_params;
974+
/* hash table to store tunnel encap entries */
975+
struct rhashtable encap_table;
976+
struct rhashtable_params encap_ht_params;
968977

969978
/* lock to atomically add/del an l2 node when a flow is
970979
* added or deleted.

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int bnxt_dl_register(struct bnxt *bp)
2929
if (!pci_find_ext_capability(bp->pdev, PCI_EXT_CAP_ID_SRIOV))
3030
return 0;
3131

32-
if (bp->hwrm_spec_code < 0x10800) {
32+
if (bp->hwrm_spec_code < 0x10803) {
3333
netdev_warn(bp->dev, "Firmware does not support SR-IOV E-Switch SWITCHDEV mode.\n");
3434
return -ENOTSUPP;
3535
}

0 commit comments

Comments
 (0)