MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bnxt_config_vlan_hw_stripping

Function bnxt_config_vlan_hw_stripping

dpdk/drivers/net/bnxt/bnxt_ethdev.c:2732–2772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2730}
2731
2732static int
2733bnxt_config_vlan_hw_stripping(struct bnxt *bp, uint64_t rx_offloads)
2734{
2735 struct bnxt_vnic_info *vnic = bnxt_get_default_vnic(bp);
2736 int rc;
2737
2738 /* Destroy, recreate and reconfigure the default vnic */
2739 rc = bnxt_free_one_vnic(bp, bp->vnic_queue_db.dflt_vnic_id);
2740 if (rc)
2741 return rc;
2742
2743 /* setup the default vnic details*/
2744 bnxt_vnic_queue_db_update_dlft_vnic(bp);
2745
2746 rc = bnxt_setup_one_vnic(bp, bp->vnic_queue_db.dflt_vnic_id);
2747 if (rc)
2748 return rc;
2749
2750 if (bp->eth_dev->data->dev_conf.rxmode.offloads &
2751 RTE_ETH_RX_OFFLOAD_VLAN_FILTER) {
2752 rc = bnxt_add_vlan_filter(bp, 0);
2753 if (rc)
2754 return rc;
2755 rc = bnxt_restore_vlan_filters(bp);
2756 if (rc)
2757 return rc;
2758 } else {
2759 rc = bnxt_add_mac_filter(bp, vnic, NULL, 0, 0);
2760 if (rc)
2761 return rc;
2762 }
2763
2764 rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
2765 if (rc)
2766 return rc;
2767
2768 PMD_DRV_LOG(DEBUG, "VLAN Strip Offload: %d\n",
2769 !!(rx_offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP));
2770
2771 return rc;
2772}
2773
2774static int
2775bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask)

Callers 1

bnxt_vlan_offload_set_opFunction · 0.85

Calls 8

bnxt_get_default_vnicFunction · 0.85
bnxt_free_one_vnicFunction · 0.85
bnxt_setup_one_vnicFunction · 0.85
bnxt_add_vlan_filterFunction · 0.85
bnxt_add_mac_filterFunction · 0.85

Tested by

no test coverage detected