Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Nov 7, 2005
2 parents 8cde077 + 2d43f11 commit 8e33ba4
Show file tree
Hide file tree
Showing 24 changed files with 1,066 additions and 886 deletions.
50 changes: 24 additions & 26 deletions include/linux/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ struct tc_fifo_qopt
/* PRIO section */

#define TCQ_PRIO_BANDS 16
#define TCQ_MIN_PRIO_BANDS 2

struct tc_prio_qopt
{
Expand Down Expand Up @@ -169,6 +170,7 @@ struct tc_red_qopt
unsigned char Scell_log; /* cell size for idle damping */
unsigned char flags;
#define TC_RED_ECN 1
#define TC_RED_HARDDROP 2
};

struct tc_red_xstats
Expand All @@ -194,38 +196,34 @@ enum

#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)

#define TCA_SET_OFF TCA_GRED_PARMS
struct tc_gred_qopt
{
__u32 limit; /* HARD maximal queue length (bytes)
*/
__u32 qth_min; /* Min average length threshold (bytes)
*/
__u32 qth_max; /* Max average length threshold (bytes)
*/
__u32 DP; /* upto 2^32 DPs */
__u32 backlog;
__u32 qave;
__u32 forced;
__u32 early;
__u32 other;
__u32 pdrop;

unsigned char Wlog; /* log(W) */
unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
unsigned char Scell_log; /* cell size for idle damping */
__u8 prio; /* prio of this VQ */
__u32 packets;
__u32 bytesin;
__u32 limit; /* HARD maximal queue length (bytes) */
__u32 qth_min; /* Min average length threshold (bytes) */
__u32 qth_max; /* Max average length threshold (bytes) */
__u32 DP; /* upto 2^32 DPs */
__u32 backlog;
__u32 qave;
__u32 forced;
__u32 early;
__u32 other;
__u32 pdrop;
__u8 Wlog; /* log(W) */
__u8 Plog; /* log(P_max/(qth_max-qth_min)) */
__u8 Scell_log; /* cell size for idle damping */
__u8 prio; /* prio of this VQ */
__u32 packets;
__u32 bytesin;
};

/* gred setup */
struct tc_gred_sopt
{
__u32 DPs;
__u32 def_DP;
__u8 grio;
__u8 pad1;
__u16 pad2;
__u32 DPs;
__u32 def_DP;
__u8 grio;
__u8 flags;
__u16 pad1;
};

/* HTB section */
Expand Down
38 changes: 30 additions & 8 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,29 +603,46 @@ static inline void skb_queue_head_init(struct sk_buff_head *list)
*/

/**
* __skb_queue_head - queue a buffer at the list head
* __skb_queue_after - queue a buffer at the list head
* @list: list to use
* @prev: place after this buffer
* @newsk: buffer to queue
*
* Queue a buffer at the start of a list. This function takes no locks
* Queue a buffer int the middle of a list. This function takes no locks
* and you must therefore hold required locks before calling it.
*
* A buffer cannot be placed on two lists at the same time.
*/
extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
static inline void __skb_queue_head(struct sk_buff_head *list,
struct sk_buff *newsk)
static inline void __skb_queue_after(struct sk_buff_head *list,
struct sk_buff *prev,
struct sk_buff *newsk)
{
struct sk_buff *prev, *next;

struct sk_buff *next;
list->qlen++;
prev = (struct sk_buff *)list;

next = prev->next;
newsk->next = next;
newsk->prev = prev;
next->prev = prev->next = newsk;
}

/**
* __skb_queue_head - queue a buffer at the list head
* @list: list to use
* @newsk: buffer to queue
*
* Queue a buffer at the start of a list. This function takes no locks
* and you must therefore hold required locks before calling it.
*
* A buffer cannot be placed on two lists at the same time.
*/
extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
static inline void __skb_queue_head(struct sk_buff_head *list,
struct sk_buff *newsk)
{
__skb_queue_after(list, (struct sk_buff *)list, newsk);
}

/**
* __skb_queue_tail - queue a buffer at the list tail
* @list: list to use
Expand Down Expand Up @@ -1203,6 +1220,11 @@ static inline void kunmap_skb_frag(void *vaddr)
prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
skb = skb->next)

#define skb_queue_reverse_walk(queue, skb) \
for (skb = (queue)->prev; \
prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \
skb = skb->prev)


extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
int noblock, int *err);
Expand Down
28 changes: 24 additions & 4 deletions include/net/inet_ecn.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _INET_ECN_H_

#include <linux/ip.h>
#include <linux/skbuff.h>
#include <net/dsfield.h>

enum {
Expand Down Expand Up @@ -48,7 +49,7 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
(label) |= __constant_htons(INET_ECN_ECT_0 << 4); \
} while (0)

static inline void IP_ECN_set_ce(struct iphdr *iph)
static inline int IP_ECN_set_ce(struct iphdr *iph)
{
u32 check = iph->check;
u32 ecn = (iph->tos + 1) & INET_ECN_MASK;
Expand All @@ -61,7 +62,7 @@ static inline void IP_ECN_set_ce(struct iphdr *iph)
* INET_ECN_CE => 00
*/
if (!(ecn & 2))
return;
return !ecn;

/*
* The following gives us:
Expand All @@ -72,6 +73,7 @@ static inline void IP_ECN_set_ce(struct iphdr *iph)

iph->check = check + (check>=0xFFFF);
iph->tos |= INET_ECN_CE;
return 1;
}

static inline void IP_ECN_clear(struct iphdr *iph)
Expand All @@ -87,11 +89,12 @@ static inline void ipv4_copy_dscp(struct iphdr *outer, struct iphdr *inner)

struct ipv6hdr;

static inline void IP6_ECN_set_ce(struct ipv6hdr *iph)
static inline int IP6_ECN_set_ce(struct ipv6hdr *iph)
{
if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph)))
return;
return 0;
*(u32*)iph |= htonl(INET_ECN_CE << 20);
return 1;
}

static inline void IP6_ECN_clear(struct ipv6hdr *iph)
Expand All @@ -105,4 +108,21 @@ static inline void ipv6_copy_dscp(struct ipv6hdr *outer, struct ipv6hdr *inner)
ipv6_change_dsfield(inner, INET_ECN_MASK, dscp);
}

static inline int INET_ECN_set_ce(struct sk_buff *skb)
{
switch (skb->protocol) {
case __constant_htons(ETH_P_IP):
if (skb->nh.raw + sizeof(struct iphdr) <= skb->tail)
return IP_ECN_set_ce(skb->nh.iph);
break;

case __constant_htons(ETH_P_IPV6):
if (skb->nh.raw + sizeof(struct ipv6hdr) <= skb->tail)
return IP6_ECN_set_ce(skb->nh.ipv6h);
break;
}

return 0;
}

#endif
2 changes: 0 additions & 2 deletions include/net/inet_hashtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ struct inet_hashinfo {
rwlock_t lhash_lock ____cacheline_aligned;
atomic_t lhash_users;
wait_queue_head_t lhash_wait;
spinlock_t portalloc_lock;
kmem_cache_t *bind_bucket_cachep;
int port_rover;
};

static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport,
Expand Down
Loading

0 comments on commit 8e33ba4

Please sign in to comment.