Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ena/ena_datapath.c
Show All 24 Lines | |||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_rss.h" | |||||
#include "ena.h" | #include "ena.h" | ||||
#include "ena_datapath.h" | #include "ena_datapath.h" | ||||
#ifdef DEV_NETMAP | #ifdef DEV_NETMAP | ||||
#include "ena_netmap.h" | #include "ena_netmap.h" | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
/********************************************************************* | /********************************************************************* | ||||
* Static functions prototypes | * Static functions prototypes | ||||
▲ Show 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, | ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, | ||||
struct mbuf *mbuf) | struct mbuf *mbuf) | ||||
{ | { | ||||
struct ena_adapter *adapter = rx_ring->adapter; | struct ena_adapter *adapter = rx_ring->adapter; | ||||
if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { | if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { | ||||
mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; | mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; | ||||
#ifdef RSS | |||||
/* | |||||
* Hardware and software RSS are in agreement only when both are | |||||
* configured to Toeplitz algorithm. This driver configures | |||||
* that algorithm only when software RSS is enabled and uses it. | |||||
*/ | |||||
if (adapter->ena_dev->rss.hash_func != ENA_ADMIN_TOEPLITZ && | |||||
ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN) { | |||||
M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); | |||||
return; | |||||
} | |||||
#endif | |||||
if (ena_rx_ctx->frag && | if (ena_rx_ctx->frag && | ||||
(ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { | (ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { | ||||
M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); | M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); | ||||
return; | return; | ||||
} | } | ||||
switch (ena_rx_ctx->l3_proto) { | switch (ena_rx_ctx->l3_proto) { | ||||
▲ Show 20 Lines • Show All 765 Lines • Show Last 20 Lines |