From 2516de944aa307d983a74e952f5276e568fa0891 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Tue, 11 Jun 2019 03:22:30 +0000 Subject: records a flowid in the mbuf if the rx cqe provides an rx hash value. jmatthew@ says we need to configure the hw to populate that, but i can put this in now in preparation for it. --- sys/dev/pci/if_mcx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/dev/pci/if_mcx.c b/sys/dev/pci/if_mcx.c index a09718f67f2..1681f78e2b1 100644 --- a/sys/dev/pci/if_mcx.c +++ b/sys/dev/pci/if_mcx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mcx.c,v 1.22 2019/06/10 23:05:52 dlg Exp $ */ +/* $OpenBSD: if_mcx.c,v 1.23 2019/06/11 03:22:29 dlg Exp $ */ /* * Copyright (c) 2017 David Gwynne @@ -5653,6 +5653,11 @@ mcx_process_rx(struct mcx_softc *sc, struct mcx_cq_entry *cqe, m->m_pkthdr.len = m->m_len = bemtoh32(&cqe->cq_byte_cnt); + if (cqe->cq_rx_hash_type) { + m->m_pkthdr.ph_flowid = M_FLOWID_VALID | + betoh32(cqe->cq_rx_hash); + } + if (c->c_tdiff) { uint64_t t = bemtoh64(&cqe->cq_timestamp) - c->c_timestamp; t *= c->c_udiff; -- cgit v1.2.3