Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 8, 2005
2 parents c0d6f96 + e104411 commit 27e2df2
Show file tree
Hide file tree
Showing 30 changed files with 615 additions and 179 deletions.
7 changes: 4 additions & 3 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.2.20"
#define DRV_MODULE_RELDATE "August 22, 2005"
#define DRV_MODULE_VERSION "1.2.21"
#define DRV_MODULE_RELDATE "September 7, 2005"

#define RUN_AT(x) (jiffies + (x))

Expand Down Expand Up @@ -1533,6 +1533,7 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs)
struct net_device *dev = dev_instance;
struct bnx2 *bp = dev->priv;

prefetch(bp->status_blk);
REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
Expand All @@ -1558,7 +1559,7 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
* When using MSI, the MSI message will always complete after
* the status block write.
*/
if ((bp->status_blk->status_idx == bp->last_status_idx) ||
if ((bp->status_blk->status_idx == bp->last_status_idx) &&
(REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &
BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
return IRQ_NONE;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#endif
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/prefetch.h>

/* Hardware data structures and register definitions automatically
* generated from RTL code. Do not modify.
Expand Down
36 changes: 30 additions & 6 deletions include/linux/in6.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ struct in6_flowlabel_req
*/

#define IPV6_ADDRFORM 1
#define IPV6_PKTINFO 2
#define IPV6_HOPOPTS 3
#define IPV6_DSTOPTS 4
#define IPV6_RTHDR 5
#define IPV6_PKTOPTIONS 6
#define IPV6_2292PKTINFO 2
#define IPV6_2292HOPOPTS 3
#define IPV6_2292DSTOPTS 4
#define IPV6_2292RTHDR 5
#define IPV6_2292PKTOPTIONS 6
#define IPV6_CHECKSUM 7
#define IPV6_HOPLIMIT 8
#define IPV6_2292HOPLIMIT 8
#define IPV6_NEXTHOP 9
#define IPV6_AUTHHDR 10 /* obsolete */
#define IPV6_FLOWINFO 11
Expand Down Expand Up @@ -198,4 +198,28 @@ struct in6_flowlabel_req
* MCAST_MSFILTER 48
*/

/* RFC3542 advanced socket options (50-67) */
#define IPV6_RECVPKTINFO 50
#define IPV6_PKTINFO 51
#if 0
#define IPV6_RECVPATHMTU 52
#define IPV6_PATHMTU 53
#define IPV6_DONTFRAG 54
#define IPV6_USE_MIN_MTU 55
#endif
#define IPV6_RECVHOPOPTS 56
#define IPV6_HOPOPTS 57
#if 0
#define IPV6_RECVRTHDRDSTOPTS 58 /* Unused, see net/ipv6/datagram.c */
#endif
#define IPV6_RTHDRDSTOPTS 59
#define IPV6_RECVRTHDR 60
#define IPV6_RTHDR 61
#define IPV6_RECVDSTOPTS 62
#define IPV6_DSTOPTS 63
#define IPV6_RECVHOPLIMIT 64
#define IPV6_HOPLIMIT 65
#define IPV6_RECVTCLASS 66
#define IPV6_TCLASS 67

#endif
15 changes: 12 additions & 3 deletions include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ struct inet6_skb_parm {
__u16 dst0;
__u16 srcrt;
__u16 dst1;
__u16 lastopt;
};

#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
Expand Down Expand Up @@ -234,14 +235,20 @@ struct ipv6_pinfo {
/* pktoption flags */
union {
struct {
__u8 srcrt:2,
__u16 srcrt:2,
osrcrt:2,
rxinfo:1,
rxoinfo:1,
rxhlim:1,
rxohlim:1,
hopopts:1,
ohopopts:1,
dstopts:1,
rxflow:1;
odstopts:1,
rxflow:1,
rxtclass:1;
} bits;
__u8 all;
__u16 all;
} rxopt;

/* sockopt flags */
Expand All @@ -250,6 +257,7 @@ struct ipv6_pinfo {
sndflow:1,
pmtudisc:2,
ipv6only:1;
__u8 tclass;

__u32 dst_cookie;

Expand All @@ -263,6 +271,7 @@ struct ipv6_pinfo {
struct ipv6_txoptions *opt;
struct rt6_info *rt;
int hop_limit;
int tclass;
} cork;
};

Expand Down
2 changes: 1 addition & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,

static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
{
if (len >= skb->len)
if (likely(len >= skb->len))
return 0;
if (skb->ip_summed == CHECKSUM_HW)
skb->ip_summed = CHECKSUM_NONE;
Expand Down
2 changes: 1 addition & 1 deletion include/net/ax25.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
/* ax25_addr.c */
extern ax25_address null_ax25_address;
extern char *ax2asc(char *buf, ax25_address *);
extern ax25_address *asc2ax(char *);
extern void asc2ax(ax25_address *addr, char *callsign);
extern int ax25cmp(ax25_address *, ax25_address *);
extern int ax25digicmp(ax25_digi *, ax25_digi *);
extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *);
Expand Down
5 changes: 3 additions & 2 deletions include/net/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi
extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *,
int);

struct sock;
extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int);

#endif /* NET_COMPAT_H */
5 changes: 5 additions & 0 deletions include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ extern int ip6_ra_control(struct sock *sk, int sel,
extern int ipv6_parse_hopopts(struct sk_buff *skb, int);

extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt);
extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
int newtype,
struct ipv6_opt_hdr __user *newopt,
int newoptlen);

extern int ip6_frag_nqueues;
extern atomic_t ip6_frag_mem;
Expand Down Expand Up @@ -373,6 +377,7 @@ extern int ip6_append_data(struct sock *sk,
int length,
int transhdrlen,
int hlimit,
int tclass,
struct ipv6_txoptions *opt,
struct flowi *fl,
struct rt6_info *rt,
Expand Down
2 changes: 1 addition & 1 deletion include/net/transp_v6.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern int datagram_recv_ctl(struct sock *sk,
extern int datagram_send_ctl(struct msghdr *msg,
struct flowi *fl,
struct ipv6_txoptions *opt,
int *hlimit);
int *hlimit, int *tclass);

#define LOOPBACK4_IPV6 __constant_htonl(0x7f000006)

Expand Down
27 changes: 12 additions & 15 deletions net/ax25/ax25_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,34 @@ char *ax2asc(char *buf, ax25_address *a)
/*
* ascii -> ax25 conversion
*/
ax25_address *asc2ax(char *callsign)
void asc2ax(ax25_address *addr, char *callsign)
{
static ax25_address addr;
char *s;
int n;

for (s = callsign, n = 0; n < 6; n++) {
if (*s != '\0' && *s != '-')
addr.ax25_call[n] = *s++;
addr->ax25_call[n] = *s++;
else
addr.ax25_call[n] = ' ';
addr.ax25_call[n] <<= 1;
addr.ax25_call[n] &= 0xFE;
addr->ax25_call[n] = ' ';
addr->ax25_call[n] <<= 1;
addr->ax25_call[n] &= 0xFE;
}

if (*s++ == '\0') {
addr.ax25_call[6] = 0x00;
return &addr;
addr->ax25_call[6] = 0x00;
return;
}

addr.ax25_call[6] = *s++ - '0';
addr->ax25_call[6] = *s++ - '0';

if (*s != '\0') {
addr.ax25_call[6] *= 10;
addr.ax25_call[6] += *s++ - '0';
addr->ax25_call[6] *= 10;
addr->ax25_call[6] += *s++ - '0';
}

addr.ax25_call[6] <<= 1;
addr.ax25_call[6] &= 0x1E;

return &addr;
addr->ax25_call[6] <<= 1;
addr->ax25_call[6] &= 0x1E;
}

/*
Expand Down
24 changes: 20 additions & 4 deletions net/ipv4/netfilter/ip_conntrack_netbios_ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,28 @@ static int help(struct sk_buff **pskb,
static struct ip_conntrack_helper helper = {
.name = "netbios-ns",
.tuple = {
.src.u.udp.port = __constant_htons(137),
.dst.protonum = IPPROTO_UDP,
.src = {
.u = {
.udp = {
.port = __constant_htons(137),
}
}
},
.dst = {
.protonum = IPPROTO_UDP,
},
},
.mask = {
.src.u.udp.port = 0xFFFF,
.dst.protonum = 0xFF,
.src = {
.u = {
.udp = {
.port = 0xFFFF,
}
}
},
.dst = {
.protonum = 0xFF,
},
},
.max_expected = 1,
.me = THIS_MODULE,
Expand Down
5 changes: 1 addition & 4 deletions net/ipv4/netfilter/ipt_REJECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ static inline struct rtable *route_reverse(struct sk_buff *skb,
fl.fl_ip_sport = tcph->dest;
fl.fl_ip_dport = tcph->source;

if (xfrm_lookup((struct dst_entry **)&rt, &fl, NULL, 0)) {
dst_release(&rt->u.dst);
rt = NULL;
}
xfrm_lookup((struct dst_entry **)&rt, &fl, NULL, 0);

return rt;
}
Expand Down
29 changes: 14 additions & 15 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,7 @@ static inline int __mkroute_input(struct sk_buff *skb,
goto cleanup;
}

atomic_set(&rth->u.dst.__refcnt, 1);
rth->u.dst.flags= DST_HOST;
#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
if (res->fi->fib_nhs > 1)
Expand Down Expand Up @@ -1820,7 +1821,6 @@ static inline int ip_mkroute_input_def(struct sk_buff *skb,
err = __mkroute_input(skb, res, in_dev, daddr, saddr, tos, &rth);
if (err)
return err;
atomic_set(&rth->u.dst.__refcnt, 1);

/* put it into the cache */
hash = rt_hash_code(daddr, saddr ^ (fl->iif << 5), tos);
Expand All @@ -1834,8 +1834,8 @@ static inline int ip_mkroute_input(struct sk_buff *skb,
u32 daddr, u32 saddr, u32 tos)
{
#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
struct rtable* rth = NULL;
unsigned char hop, hopcount, lasthop;
struct rtable* rth = NULL, *rtres;
unsigned char hop, hopcount;
int err = -EINVAL;
unsigned int hash;

Expand All @@ -1844,8 +1844,6 @@ static inline int ip_mkroute_input(struct sk_buff *skb,
else
hopcount = 1;

lasthop = hopcount - 1;

/* distinguish between multipath and singlepath */
if (hopcount < 2)
return ip_mkroute_input_def(skb, res, fl, in_dev, daddr,
Expand All @@ -1855,6 +1853,10 @@ static inline int ip_mkroute_input(struct sk_buff *skb,
for (hop = 0; hop < hopcount; hop++) {
res->nh_sel = hop;

/* put reference to previous result */
if (hop)
ip_rt_put(rtres);

/* create a routing cache entry */
err = __mkroute_input(skb, res, in_dev, daddr, saddr, tos,
&rth);
Expand All @@ -1863,7 +1865,7 @@ static inline int ip_mkroute_input(struct sk_buff *skb,

/* put it into the cache */
hash = rt_hash_code(daddr, saddr ^ (fl->iif << 5), tos);
err = rt_intern_hash(hash, rth, (struct rtable**)&skb->dst);
err = rt_intern_hash(hash, rth, &rtres);
if (err)
return err;

Expand All @@ -1873,13 +1875,8 @@ static inline int ip_mkroute_input(struct sk_buff *skb,
FIB_RES_NETMASK(*res),
res->prefixlen,
&FIB_RES_NH(*res));

/* only for the last hop the reference count is handled
* outside
*/
if (hop == lasthop)
atomic_set(&(skb->dst->__refcnt), 1);
}
skb->dst = &rtres->u.dst;
return err;
#else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
return ip_mkroute_input_def(skb, res, fl, in_dev, daddr, saddr, tos);
Expand Down Expand Up @@ -2208,6 +2205,7 @@ static inline int __mkroute_output(struct rtable **result,
goto cleanup;
}

atomic_set(&rth->u.dst.__refcnt, 1);
rth->u.dst.flags= DST_HOST;
#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
if (res->fi) {
Expand Down Expand Up @@ -2290,8 +2288,6 @@ static inline int ip_mkroute_output_def(struct rtable **rp,
if (err == 0) {
u32 tos = RT_FL_TOS(oldflp);

atomic_set(&rth->u.dst.__refcnt, 1);

hash = rt_hash_code(oldflp->fl4_dst,
oldflp->fl4_src ^ (oldflp->oif << 5), tos);
err = rt_intern_hash(hash, rth, rp);
Expand Down Expand Up @@ -2326,6 +2322,10 @@ static inline int ip_mkroute_output(struct rtable** rp,
dev2nexthop = FIB_RES_DEV(*res);
dev_hold(dev2nexthop);

/* put reference to previous result */
if (hop)
ip_rt_put(*rp);

err = __mkroute_output(&rth, res, fl, oldflp,
dev2nexthop, flags);

Expand All @@ -2350,7 +2350,6 @@ static inline int ip_mkroute_output(struct rtable** rp,
if (err != 0)
return err;
}
atomic_set(&(*rp)->u.dst.__refcnt, 1);
return err;
} else {
return ip_mkroute_output_def(rp, res, fl, oldflp, dev_out,
Expand Down
Loading

0 comments on commit 27e2df2

Please sign in to comment.