aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2007-07-06 16:36:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:16:21 -0400
commitf25f4e44808f0f6c9875d94ef1c41ef86c288eb2 (patch)
treed7809dd5e957f1626185326d0c3438ff9a04d350 /include/linux/skbuff.h
parenta093bf006e09a305e95ff0938c0a18b7520aef67 (diff)
[CORE] Stack changes to add multiqueue hardware support API
Add the multiqueue hardware device support API to the core network stack. Allow drivers to allocate multiple queues and manage them at the netdev level if they choose to do so. Added a new field to sk_buff, namely queue_mapping, for drivers to know which tx_ring to select based on OS classification of the flow. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 881fe80f01d0..2d6a14f5f2f1 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -196,7 +196,6 @@ typedef unsigned char *sk_buff_data_t;
196 * @sk: Socket we are owned by 196 * @sk: Socket we are owned by
197 * @tstamp: Time we arrived 197 * @tstamp: Time we arrived
198 * @dev: Device we arrived on/are leaving by 198 * @dev: Device we arrived on/are leaving by
199 * @iif: ifindex of device we arrived on
200 * @transport_header: Transport layer header 199 * @transport_header: Transport layer header
201 * @network_header: Network layer header 200 * @network_header: Network layer header
202 * @mac_header: Link layer header 201 * @mac_header: Link layer header
@@ -231,6 +230,8 @@ typedef unsigned char *sk_buff_data_t;
231 * @nfctinfo: Relationship of this skb to the connection 230 * @nfctinfo: Relationship of this skb to the connection
232 * @nfct_reasm: netfilter conntrack re-assembly pointer 231 * @nfct_reasm: netfilter conntrack re-assembly pointer
233 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 232 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
233 * @iif: ifindex of device we arrived on
234 * @queue_mapping: Queue mapping for multiqueue devices
234 * @tc_index: Traffic control index 235 * @tc_index: Traffic control index
235 * @tc_verd: traffic control verdict 236 * @tc_verd: traffic control verdict
236 * @dma_cookie: a cookie to one of several possible DMA operations 237 * @dma_cookie: a cookie to one of several possible DMA operations
@@ -246,8 +247,6 @@ struct sk_buff {
246 struct sock *sk; 247 struct sock *sk;
247 ktime_t tstamp; 248 ktime_t tstamp;
248 struct net_device *dev; 249 struct net_device *dev;
249 int iif;
250 /* 4 byte hole on 64 bit*/
251 250
252 struct dst_entry *dst; 251 struct dst_entry *dst;
253 struct sec_path *sp; 252 struct sec_path *sp;
@@ -290,12 +289,18 @@ struct sk_buff {
290#ifdef CONFIG_BRIDGE_NETFILTER 289#ifdef CONFIG_BRIDGE_NETFILTER
291 struct nf_bridge_info *nf_bridge; 290 struct nf_bridge_info *nf_bridge;
292#endif 291#endif
292
293 int iif;
294 __u16 queue_mapping;
295
293#ifdef CONFIG_NET_SCHED 296#ifdef CONFIG_NET_SCHED
294 __u16 tc_index; /* traffic control index */ 297 __u16 tc_index; /* traffic control index */
295#ifdef CONFIG_NET_CLS_ACT 298#ifdef CONFIG_NET_CLS_ACT
296 __u16 tc_verd; /* traffic control verdict */ 299 __u16 tc_verd; /* traffic control verdict */
297#endif 300#endif
298#endif 301#endif
302 /* 2 byte hole */
303
299#ifdef CONFIG_NET_DMA 304#ifdef CONFIG_NET_DMA
300 dma_cookie_t dma_cookie; 305 dma_cookie_t dma_cookie;
301#endif 306#endif
@@ -1725,6 +1730,20 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1725{ } 1730{ }
1726#endif 1731#endif
1727 1732
1733static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
1734{
1735#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1736 skb->queue_mapping = queue_mapping;
1737#endif
1738}
1739
1740static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
1741{
1742#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1743 to->queue_mapping = from->queue_mapping;
1744#endif
1745}
1746
1728static inline int skb_is_gso(const struct sk_buff *skb) 1747static inline int skb_is_gso(const struct sk_buff *skb)
1729{ 1748{
1730 return skb_shinfo(skb)->gso_size; 1749 return skb_shinfo(skb)->gso_size;