[Open-FCoE] [PATCH] fcoeplumb: setup tc filter for ETH_P_FCOE, not ETH_P_802_3

Chris Leech christopher.leech at intel.com
Fri Apr 3 23:05:47 UTC 2009


The FCoE changes from 2.6.29 to 2.6.30 include chaning the
skb->protocol field from ETH_P_802_3 to ETH_P_FCOE.  This impacts the
tc filters used to map FCoE frames to the correct traffic class for DCB.

This patch changes the tc filter setup in the fcoeplumb script to match.
This is needed for 2.6.30 FCoE use with DCB, but is not backwards
compatible with the 2.6.29 kernel code.

---

 fcoeplumb.in |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fcoeplumb.in b/fcoeplumb.in
index a25bb5e..9b9680c 100755
--- a/fcoeplumb.in
+++ b/fcoeplumb.in
@@ -120,7 +120,7 @@ find_skbedit_filter()
 		x3 = 0
 		queue = 8
 	}
-	/^filter.*parent.*protocol 802_3.* handle '$FILTER_ID'/ {
+	/^filter.*parent.*protocol '$FCOE_ETHERTYPE'.* handle '$FILTER_ID'/ {
 		if (x1 == 0 && x2 == 0 && x3 == 0)
 			x1 = 1
 	}
@@ -149,17 +149,17 @@ delete_skbedit_filter()
 	[ "$DEBUG" = "yes" ] && $LOGGER \
 		"tc filter delete dev $ifname skbedit queue_mapping $queue"
 	PARENT=`tc filter show dev $ifname | awk \
-		'/^filter.*parent.*protocol 802_3.* handle '$FILTER_ID'/ \
+		'/^filter.*parent.*protocol '$FCOE_ETHERTYPE'.* handle '$FILTER_ID'/ \
 		{ print $3 }'`
 	PRIO=`tc filter show dev $ifname | awk \
-		'/^filter.*parent.*protocol 802_3.* handle '$FILTER_ID'/ \
+		'/^filter.*parent.*protocol '$FCOE_ETHERTYPE'.* handle '$FILTER_ID'/ \
 		{ print $7 }'`
 	tc filter delete dev $ifname parent $PARENT \
-		protocol 802_3 pref $PRIO handle $FILTER_ID basic match \
+		protocol $FCOE_ETHERTYPE pref $PRIO handle $FILTER_ID basic match \
 		'cmp(u16' at 12 layer 1 mask 0xffff eq $FCOE_ETHERTYPE')' \
 		action skbedit queue_mapping $queue
 	tc filter delete dev $ifname parent $PARENT \
-		protocol 802_3 pref $PRIO basic
+		protocol $FCOE_ETHERTYPE pref $PRIO basic
 }
 
 add_skbedit_filter()
@@ -170,7 +170,7 @@ add_skbedit_filter()
 
 	[ "$DEBUG" = "yes" ] && $LOGGER \
 		"tc filter add dev $ifname skbedit queue_mapping $queue"
-	tc filter add dev $ifname parent $qdisc_id protocol 802_3 \
+	tc filter add dev $ifname parent $qdisc_id protocol $FCOE_ETHERTYPE \
 		handle $FILTER_ID basic match 'cmp(u16' at 12 \
 		layer 1 mask 0xffff eq $FCOE_ETHERTYPE')' \
 		action skbedit queue_mapping $queue
@@ -184,13 +184,13 @@ replace_skbedit_filter()
 	[ "$DEBUG" = "yes" ] && $LOGGER \
 		"tc filter replace dev $ifname skbedit queue_mapping $queue"
 	PARENT=`tc filter show dev $ifname | awk \
-		'/^filter.*parent.*protocol 802_3.* handle '$FILTER_ID'/ \
+		'/^filter.*parent.*protocol '$FCOE_ETHERTYPE'.* handle '$FILTER_ID'/ \
 		{ print $3 }'`
 	PRIO=`tc filter show dev $ifname | \
-		awk '/^filter.*parent.*protocol 802_3.* handle '$FILTER_ID'/ \
+		awk '/^filter.*parent.*protocol '$FCOE_ETHERTYPE'.* handle '$FILTER_ID'/ \
 		{ print $7 }'`
 	tc filter replace dev $ifname parent $PARENT protocol \
-		802_3 pref $PRIO handle $FILTER_ID basic match \
+		$FCOE_ETHERTYPE pref $PRIO handle $FILTER_ID basic match \
 		'cmp(u16' at 12 layer 1 mask 0xffff eq $FCOE_ETHERTYPE')' \
 		action skbedit queue_mapping $queue
 }




More information about the devel mailing list