summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authorhiren <hiren@FreeBSD.org>2015-04-24 23:26:44 +0000
committerhiren <hiren@FreeBSD.org>2015-04-24 23:26:44 +0000
commitb09afc6f3f088fa610e8e85066b0efc23f29fee1 (patch)
treede613f73923e17e263a2e466febe13b7dc30ceaf /sys/ofed
parent0c3758f009b82212c1c351b8dabdbb5e6b28b85a (diff)
downloadFreeBSD-src-b09afc6f3f088fa610e8e85066b0efc23f29fee1.zip
FreeBSD-src-b09afc6f3f088fa610e8e85066b0efc23f29fee1.tar.gz
MFC r275358 r275483 r276982 - Removing M_FLOWID by hps@
r275358: Start process of removing the use of the deprecated "M_FLOWID" flag from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. r275483: Remove M_FLOWID from SCTP code. r276982: Remove no longer used "M_FLOWID" flag from mbuf.h and update the netisr manpage. Note: The FreeBSD version has been bumped. Reviewed by: hps, tuexen Sponsored by: Limelight Networks
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/drivers/net/mlx4/en_rx.c2
-rw-r--r--sys/ofed/drivers/net/mlx4/en_tx.c19
2 files changed, 10 insertions, 11 deletions
diff --git a/sys/ofed/drivers/net/mlx4/en_rx.c b/sys/ofed/drivers/net/mlx4/en_rx.c
index 1c9b1e6..e011b87 100644
--- a/sys/ofed/drivers/net/mlx4/en_rx.c
+++ b/sys/ofed/drivers/net/mlx4/en_rx.c
@@ -604,7 +604,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
}
mb->m_pkthdr.flowid = cq->ring;
- mb->m_flags |= M_FLOWID;
+ M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE);
mb->m_pkthdr.rcvif = dev;
if (be32_to_cpu(cqe->vlan_my_qpn) &
MLX4_CQE_VLAN_PRESENT_MASK) {
diff --git a/sys/ofed/drivers/net/mlx4/en_tx.c b/sys/ofed/drivers/net/mlx4/en_tx.c
index a785d07..115dd0b 100644
--- a/sys/ofed/drivers/net/mlx4/en_tx.c
+++ b/sys/ofed/drivers/net/mlx4/en_tx.c
@@ -720,8 +720,11 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct mbuf *mb)
up = (vlan_tag >> 13) % MLX4_EN_NUM_UP;
}
#endif
- /* hash mbuf */
- queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom);
+ /* check if flowid is set */
+ if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE)
+ queue_index = mb->m_pkthdr.flowid;
+ else
+ queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom);
return ((queue_index % rings_p_up) + (up * rings_p_up));
}
@@ -1066,15 +1069,11 @@ mlx4_en_transmit(struct ifnet *dev, struct mbuf *m)
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_tx_ring *ring;
struct mlx4_en_cq *cq;
- int i = 0, err = 0;
+ int i, err = 0;
+
+ /* Compute which queue to use */
+ i = mlx4_en_select_queue(dev, m);
- /* Which queue to use */
- if ((m->m_flags & (M_FLOWID | M_VLANTAG)) == M_FLOWID) {
- i = m->m_pkthdr.flowid % (priv->tx_ring_num - 1);
- }
- else {
- i = mlx4_en_select_queue(dev, m);
- }
ring = priv->tx_ring[i];
if (spin_trylock(&ring->tx_lock)) {
OpenPOWER on IntegriCloud