Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2868

kernel-2.6.18-238.el5.src.rpm

From: Doug Ledford <dledford@redhat.com>
Date: Sat, 22 Aug 2009 09:03:21 -0400
Subject: [net] mlx4_en fix for vlan traffic
Message-id: DE3C75E1-8FF5-407C-ADCD-66D8C4256E36@redhat.com
O-Subject: [Patch RHEL5] mlx4_en fix for vlan traffic
Bugzilla: 514141

This is for bug 514141.  One big endian arches, vlan traffic is not
handled properly in the mlx4_en driver specifically when using LRO.
This fixes that.  Patch is upstream to Roland Drier (mlx4_en isn't in
Linus' kernel yet, but it is in Roland's tree) and tested by
reporter.  Built and tested lightly by me, but I don't have a vlan
setup so I really could only do DOA for non-vlan mode.  Built through
brew:

https://brewweb.devel.redhat.com/taskinfo?taskID=1940489

commit 73eb3bfe09ab8f5bc3d14b1afc7d88f7d4b76d56
Author: Doug Ledford <dledford@redhat.com>
Date:   Fri Aug 21 18:22:00 2009 -0400

    [mlx4] Fix endianess issue in mlx4 vlan code

    Signed-off-by: Doug Ledford <dledford@redhat.com>

diff --git a/drivers/net/mlx4/en_lro.c b/drivers/net/mlx4/en_lro.c
index a987b21..79122c7 100644
--- a/drivers/net/mlx4/en_lro.c
+++ b/drivers/net/mlx4/en_lro.c
@@ -356,7 +356,7 @@ int mlx4_en_lro_rx(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring,
 
 	if (lro) {
 		/* Check VLAN tag */
-		if (cqe->vlan_my_qpn & MLX4_CQE_VLAN_PRESENT_MASK) {
+		if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) {
 			if (cqe->sl_vid != lro->vlan_prio || !lro->has_vlan) {
 				mlx4_en_lro_flush_single(priv, ring, lro);
 				goto sync_device;
@@ -454,7 +454,7 @@ new_session:
 						tcp_data_len);
 
 			/* Handle vlans */
-			if (cqe->vlan_my_qpn & MLX4_CQE_VLAN_PRESENT_MASK) {
+			if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) {
 				lro->vlan_prio = cqe->sl_vid;
 				lro->has_vlan = 1;
 			} else