Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9247744e authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

skb: expose and constify hash primitives



Some minor changes to queue hashing:
 1. Use const on accessor functions
 2. Export skb_tx_hash for use in drivers (see ixgbe)

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1f1900f9
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -1969,7 +1969,7 @@ static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
	skb->queue_mapping = queue_mapping;
	skb->queue_mapping = queue_mapping;
}
}


static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
static inline u16 skb_get_queue_mapping(const struct sk_buff *skb)
{
{
	return skb->queue_mapping;
	return skb->queue_mapping;
}
}
@@ -1984,16 +1984,19 @@ static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue)
	skb->queue_mapping = rx_queue + 1;
	skb->queue_mapping = rx_queue + 1;
}
}


static inline u16 skb_get_rx_queue(struct sk_buff *skb)
static inline u16 skb_get_rx_queue(const struct sk_buff *skb)
{
{
	return skb->queue_mapping - 1;
	return skb->queue_mapping - 1;
}
}


static inline bool skb_rx_queue_recorded(struct sk_buff *skb)
static inline bool skb_rx_queue_recorded(const struct sk_buff *skb)
{
{
	return (skb->queue_mapping != 0);
	return (skb->queue_mapping != 0);
}
}


extern u16 skb_tx_hash(const struct net_device *dev,
		       const struct sk_buff *skb);

#ifdef CONFIG_XFRM
#ifdef CONFIG_XFRM
static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
{
{
+2 −1
Original line number Original line Diff line number Diff line
@@ -1725,7 +1725,7 @@ out_kfree_skb:


static u32 skb_tx_hashrnd;
static u32 skb_tx_hashrnd;


static u16 skb_tx_hash(struct net_device *dev, struct sk_buff *skb)
u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
{
{
	u32 hash;
	u32 hash;


@@ -1740,6 +1740,7 @@ static u16 skb_tx_hash(struct net_device *dev, struct sk_buff *skb)


	return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
	return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
}
}
EXPORT_SYMBOL(skb_tx_hash);


static struct netdev_queue *dev_pick_tx(struct net_device *dev,
static struct netdev_queue *dev_pick_tx(struct net_device *dev,
					struct sk_buff *skb)
					struct sk_buff *skb)