lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Jun 2008 16:28:12 -0700
From:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To:	davem@...emloft.net, jeff@...zik.org
Cc:	peter.p.waskiewicz.jr@...el.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] net: Fix consumers of skb->queue_mapping to use lower 8
	bits

From: PJ Waskiewicz <peter.p.waskiewicz.jr@...el.com>

This patch will cause the consumers of skb->queue_mapping to only use the
lower 8 bits, so drivers can use the upper 8 bits for CPU index.

Signed-off-by: PJ Waskiewicz <peter.p.waskiewicz.jr@...el.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
---

 drivers/net/ixgbe/ixgbe_main.c |    2 +-
 include/linux/skbuff.h         |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 0d37c90..7b39394 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3244,7 +3244,7 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
 	len -= skb->data_len;
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
-	r_idx = (adapter->num_tx_queues - 1) & skb->queue_mapping;
+	r_idx = (adapter->num_tx_queues - 1) & (skb->queue_mapping & 0xff);
 #endif
 	tx_ring = &adapter->tx_ring[r_idx];
 
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 299ec4b..0246827 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1672,14 +1672,14 @@ static inline void skb_init_secmark(struct sk_buff *skb)
 static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
 {
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
-	skb->queue_mapping = queue_mapping;
+	skb->queue_mapping = (queue_mapping & 0xff);
 #endif
 }
 
 static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
 {
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
-	return skb->queue_mapping;
+	return (skb->queue_mapping & 0xff);
 #else
 	return 0;
 #endif
@@ -1688,7 +1688,7 @@ static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
 static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
 {
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
-	to->queue_mapping = from->queue_mapping;
+	to->queue_mapping = (from->queue_mapping & 0xff);
 #endif
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ