1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015-2020
11 #include <rte_common.h>
12 #include <rte_ethdev.h>
14 #include "txgbe_logs.h"
15 #include "base/txgbe.h"
16 #include "txgbe_ethdev.h"
17 #include "txgbe_rxtx.h"
20 txgbe_is_vf(struct rte_eth_dev *dev)
22 struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
24 switch (hw->mac.type) {
25 case txgbe_mac_raptor_vf:
33 txgbe_get_rx_queue_offloads(struct rte_eth_dev *dev __rte_unused)
35 return DEV_RX_OFFLOAD_VLAN_STRIP;
39 txgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
42 struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
43 struct rte_eth_dev_sriov *sriov = &RTE_ETH_DEV_SRIOV(dev);
45 offloads = DEV_RX_OFFLOAD_IPV4_CKSUM |
46 DEV_RX_OFFLOAD_UDP_CKSUM |
47 DEV_RX_OFFLOAD_TCP_CKSUM |
48 DEV_RX_OFFLOAD_KEEP_CRC |
49 DEV_RX_OFFLOAD_JUMBO_FRAME |
50 DEV_RX_OFFLOAD_VLAN_FILTER |
51 DEV_RX_OFFLOAD_RSS_HASH |
52 DEV_RX_OFFLOAD_SCATTER;
54 if (!txgbe_is_vf(dev))
55 offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
56 DEV_RX_OFFLOAD_QINQ_STRIP |
57 DEV_RX_OFFLOAD_VLAN_EXTEND);
60 * RSC is only supported by PF devices in a non-SR-IOV
63 if (hw->mac.type == txgbe_mac_raptor && !sriov->active)
64 offloads |= DEV_RX_OFFLOAD_TCP_LRO;
66 if (hw->mac.type == txgbe_mac_raptor)
67 offloads |= DEV_RX_OFFLOAD_MACSEC_STRIP;
69 offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
75 txgbe_get_tx_queue_offloads(struct rte_eth_dev *dev)
83 txgbe_get_tx_port_offloads(struct rte_eth_dev *dev)
85 uint64_t tx_offload_capa;
88 DEV_TX_OFFLOAD_VLAN_INSERT |
89 DEV_TX_OFFLOAD_IPV4_CKSUM |
90 DEV_TX_OFFLOAD_UDP_CKSUM |
91 DEV_TX_OFFLOAD_TCP_CKSUM |
92 DEV_TX_OFFLOAD_SCTP_CKSUM |
93 DEV_TX_OFFLOAD_TCP_TSO |
94 DEV_TX_OFFLOAD_UDP_TSO |
95 DEV_TX_OFFLOAD_UDP_TNL_TSO |
96 DEV_TX_OFFLOAD_IP_TNL_TSO |
97 DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
98 DEV_TX_OFFLOAD_GRE_TNL_TSO |
99 DEV_TX_OFFLOAD_IPIP_TNL_TSO |
100 DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
101 DEV_TX_OFFLOAD_MULTI_SEGS;
103 if (!txgbe_is_vf(dev))
104 tx_offload_capa |= DEV_TX_OFFLOAD_QINQ_INSERT;
106 tx_offload_capa |= DEV_TX_OFFLOAD_MACSEC_INSERT;
108 tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
110 return tx_offload_capa;