[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>
This commit is contained in:
committed by
David S. Miller
parent
a093bf006e
commit
f25f4e4480
@ -196,7 +196,6 @@ typedef unsigned char *sk_buff_data_t;
|
||||
* @sk: Socket we are owned by
|
||||
* @tstamp: Time we arrived
|
||||
* @dev: Device we arrived on/are leaving by
|
||||
* @iif: ifindex of device we arrived on
|
||||
* @transport_header: Transport layer header
|
||||
* @network_header: Network layer header
|
||||
* @mac_header: Link layer header
|
||||
@ -231,6 +230,8 @@ typedef unsigned char *sk_buff_data_t;
|
||||
* @nfctinfo: Relationship of this skb to the connection
|
||||
* @nfct_reasm: netfilter conntrack re-assembly pointer
|
||||
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
|
||||
* @iif: ifindex of device we arrived on
|
||||
* @queue_mapping: Queue mapping for multiqueue devices
|
||||
* @tc_index: Traffic control index
|
||||
* @tc_verd: traffic control verdict
|
||||
* @dma_cookie: a cookie to one of several possible DMA operations
|
||||
@ -246,8 +247,6 @@ struct sk_buff {
|
||||
struct sock *sk;
|
||||
ktime_t tstamp;
|
||||
struct net_device *dev;
|
||||
int iif;
|
||||
/* 4 byte hole on 64 bit*/
|
||||
|
||||
struct dst_entry *dst;
|
||||
struct sec_path *sp;
|
||||
@ -290,12 +289,18 @@ struct sk_buff {
|
||||
#ifdef CONFIG_BRIDGE_NETFILTER
|
||||
struct nf_bridge_info *nf_bridge;
|
||||
#endif
|
||||
|
||||
int iif;
|
||||
__u16 queue_mapping;
|
||||
|
||||
#ifdef CONFIG_NET_SCHED
|
||||
__u16 tc_index; /* traffic control index */
|
||||
#ifdef CONFIG_NET_CLS_ACT
|
||||
__u16 tc_verd; /* traffic control verdict */
|
||||
#endif
|
||||
#endif
|
||||
/* 2 byte hole */
|
||||
|
||||
#ifdef CONFIG_NET_DMA
|
||||
dma_cookie_t dma_cookie;
|
||||
#endif
|
||||
@ -1725,6 +1730,20 @@ static inline void skb_init_secmark(struct sk_buff *skb)
|
||||
{ }
|
||||
#endif
|
||||
|
||||
static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
|
||||
{
|
||||
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
|
||||
skb->queue_mapping = queue_mapping;
|
||||
#endif
|
||||
}
|
||||
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int skb_is_gso(const struct sk_buff *skb)
|
||||
{
|
||||
return skb_shinfo(skb)->gso_size;
|
||||
|
Reference in New Issue
Block a user