diff options
author | sephe <sephe@FreeBSD.org> | 2016-06-07 04:51:50 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-06-07 04:51:50 +0000 |
commit | 7acd138965d96ffd22d5af9e51a5cc261951eb6a (patch) | |
tree | 8816b0f75c831a8e5070bc0b18af1929b457914e | |
parent | be6cf145bec7e3658cd25477592f21b906de159e (diff) | |
download | FreeBSD-src-7acd138965d96ffd22d5af9e51a5cc261951eb6a.zip FreeBSD-src-7acd138965d96ffd22d5af9e51a5cc261951eb6a.tar.gz |
net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash properties
Reviewed by: hps, erj, tuexen
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6688
-rw-r--r-- | sys/dev/cxgb/cxgb_sge.c | 3 | ||||
-rw-r--r-- | sys/dev/e1000/if_igb.c | 2 | ||||
-rw-r--r-- | sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c | 12 | ||||
-rw-r--r-- | sys/dev/ixgbe/ix_txrx.c | 2 | ||||
-rw-r--r-- | sys/dev/ixl/ixl_txrx.c | 6 | ||||
-rw-r--r-- | sys/dev/mlx5/mlx5_en/mlx5_en_rx.c | 4 | ||||
-rw-r--r-- | sys/dev/qlxgbe/ql_isr.c | 4 | ||||
-rw-r--r-- | sys/dev/qlxge/qls_isr.c | 2 | ||||
-rw-r--r-- | sys/net/flowtable.c | 2 | ||||
-rw-r--r-- | sys/net/if_vxlan.c | 3 | ||||
-rw-r--r-- | sys/netinet/sctp_input.c | 2 | ||||
-rw-r--r-- | sys/netinet/sctp_pcb.c | 2 | ||||
-rw-r--r-- | sys/ofed/drivers/net/mlx4/en_rx.c | 2 |
13 files changed, 23 insertions, 23 deletions
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index c83bd66..76d40d81 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2900,7 +2900,8 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget) eop = get_packet(adap, drop_thresh, qs, mh, r); if (eop) { if (r->rss_hdr.hash_type && !adap->timestamp) { - M_HASHTYPE_SET(mh->mh_head, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mh->mh_head, + M_HASHTYPE_OPAQUE_HASH); mh->mh_head->m_pkthdr.flowid = rss_hash; } } diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 120111d..83e1e83 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -5154,7 +5154,7 @@ igb_rxeof(struct igb_queue *que, int count, int *done) default: /* XXX fallthrough */ M_HASHTYPE_SET(rxr->fmp, - M_HASHTYPE_OPAQUE); + M_HASHTYPE_OPAQUE_HASH); } } else { #ifndef IGB_LEGACY_TX diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c index 04e998e..1199d20 100644 --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -1300,6 +1300,7 @@ netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; int size, do_lro = 0, do_csum = 1; + int hash_type = M_HASHTYPE_OPAQUE_HASH; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return (0); @@ -1430,8 +1431,6 @@ skip: } if (hash_info != NULL && hash_value != NULL) { - int hash_type = M_HASHTYPE_OPAQUE; - rxr->hn_rss_pkts++; m_new->m_pkthdr.flowid = hash_value->hash_value; if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == @@ -1465,14 +1464,15 @@ skip: break; } } - M_HASHTYPE_SET(m_new, hash_type); } else { - if (hash_value != NULL) + if (hash_value != NULL) { m_new->m_pkthdr.flowid = hash_value->hash_value; - else + } else { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; - M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE); + hash_type = M_HASHTYPE_OPAQUE; + } } + M_HASHTYPE_SET(m_new, hash_type); /* * Note: Moved RX completion back to hv_nv_on_receive() so all diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index 2f5663f..61c2ef0 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -1964,7 +1964,7 @@ ixgbe_rxeof(struct ix_queue *que) #endif default: M_HASHTYPE_SET(sendmp, - M_HASHTYPE_OPAQUE); + M_HASHTYPE_OPAQUE_HASH); } } else { sendmp->m_pkthdr.flowid = que->msix; diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c index fc57f4e..d3aa7bf 100644 --- a/sys/dev/ixl/ixl_txrx.c +++ b/sys/dev/ixl/ixl_txrx.c @@ -1453,10 +1453,10 @@ ixl_ptype_to_hash(u8 ptype) ex = decoded.outer_frag; if (!decoded.known) - return M_HASHTYPE_OPAQUE; + return M_HASHTYPE_OPAQUE_HASH; if (decoded.outer_ip == I40E_RX_PTYPE_OUTER_L2) - return M_HASHTYPE_OPAQUE; + return M_HASHTYPE_OPAQUE_HASH; /* Note: anything that gets to this point is IP */ if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { @@ -1492,7 +1492,7 @@ ixl_ptype_to_hash(u8 ptype) } } /* We should never get here!! */ - return M_HASHTYPE_OPAQUE; + return M_HASHTYPE_OPAQUE_HASH; } #endif /* RSS */ diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c index 230dfcc..6bc2c17 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c @@ -222,11 +222,11 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV6); break; default: /* Other */ - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); break; } #else - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); #endif } else { mb->m_pkthdr.flowid = rq->ix; diff --git a/sys/dev/qlxgbe/ql_isr.c b/sys/dev/qlxgbe/ql_isr.c index c94a068..766e3cb 100644 --- a/sys/dev/qlxgbe/ql_isr.c +++ b/sys/dev/qlxgbe/ql_isr.c @@ -159,7 +159,7 @@ qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_t *sgc, uint32_t sds_idx) if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); mpf->m_pkthdr.flowid = sgc->rss_hash; - M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); (*ifp->if_input)(ifp, mpf); @@ -324,7 +324,7 @@ qla_lro_intr(qla_host_t *ha, qla_sgl_lro_t *sgc, uint32_t sds_idx) mpf->m_pkthdr.csum_data = 0xFFFF; mpf->m_pkthdr.flowid = sgc->rss_hash; - M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); diff --git a/sys/dev/qlxge/qls_isr.c b/sys/dev/qlxge/qls_isr.c index 1eb833e..9b571f5 100644 --- a/sys/dev/qlxge/qls_isr.c +++ b/sys/dev/qlxge/qls_isr.c @@ -190,7 +190,7 @@ qls_rx_comp(qla_host_t *ha, uint32_t rxr_idx, uint32_t cq_idx, q81_rx_t *cq_e) if ((cq_e->flags1 & Q81_RX_FLAGS1_RSS_MATCH_MASK)) { rxr->rss_int++; mp->m_pkthdr.flowid = cq_e->rss; - M_HASHTYPE_SET(mp, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mp, M_HASHTYPE_OPAQUE_HASH); } if (cq_e->flags0 & (Q81_RX_FLAGS0_TE | Q81_RX_FLAGS0_NU | Q81_RX_FLAGS0_IE)) { diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c index 35aff00..b837a8e 100644 --- a/sys/net/flowtable.c +++ b/sys/net/flowtable.c @@ -689,7 +689,7 @@ flowtable_lookup(sa_family_t sa, struct mbuf *m, struct route *ro) return (EHOSTUNREACH); if (M_HASHTYPE_GET(m) == M_HASHTYPE_NONE) { - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE_HASH); m->m_pkthdr.flowid = fle->f_hash; } diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index a5631fc..f830b06 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -2237,8 +2237,7 @@ vxlan_pick_source_port(struct vxlan_softc *sc, struct mbuf *m) range = sc->vxl_max_port - sc->vxl_min_port + 1; /* check if flowid is set and not opaque */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE && - M_HASHTYPE_GET(m) != M_HASHTYPE_OPAQUE) + if (M_HASHTYPE_ISHASH(m)) hash = m->m_pkthdr.flowid; else hash = jenkins_hash(m->m_data, ETHER_HDR_LEN, diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 1fff331..f5ea529 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -6236,7 +6236,7 @@ sctp_input(struct mbuf **mp, int *offp, int proto SCTP_UNUSED) tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); m->m_pkthdr.flowid = flowid; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE_HASH); } cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 704e5d9..36e4c01 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4070,7 +4070,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, net->flowid = stcb->asoc.my_vtag ^ ntohs(stcb->rport) ^ ntohs(stcb->sctp_ep->sctp_lport); - net->flowtype = M_HASHTYPE_OPAQUE; + net->flowtype = M_HASHTYPE_OPAQUE_HASH; if (netp) { *netp = net; } diff --git a/sys/ofed/drivers/net/mlx4/en_rx.c b/sys/ofed/drivers/net/mlx4/en_rx.c index f4425af..2711b22 100644 --- a/sys/ofed/drivers/net/mlx4/en_rx.c +++ b/sys/ofed/drivers/net/mlx4/en_rx.c @@ -619,7 +619,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud /* forward Toeplitz compatible hash value */ mb->m_pkthdr.flowid = be32_to_cpu(cqe->immed_rss_invalid); - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); mb->m_pkthdr.rcvif = dev; if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) { |