Skip to content

Commit

Permalink
Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-…
Browse files Browse the repository at this point in the history
…2.6.git/
  • Loading branch information
Linus Torvalds committed May 19, 2005
2 parents 49a4387 + aa1c6a6 commit 804c64e
Show file tree
Hide file tree
Showing 12 changed files with 423 additions and 179 deletions.
480 changes: 364 additions & 116 deletions drivers/net/tg3.c

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -876,10 +876,12 @@
#define HOSTCC_STATUS_ERROR_ATTN 0x00000004
#define HOSTCC_RXCOL_TICKS 0x00003c08
#define LOW_RXCOL_TICKS 0x00000032
#define LOW_RXCOL_TICKS_CLRTCKS 0x00000014
#define DEFAULT_RXCOL_TICKS 0x00000048
#define HIGH_RXCOL_TICKS 0x00000096
#define HOSTCC_TXCOL_TICKS 0x00003c0c
#define LOW_TXCOL_TICKS 0x00000096
#define LOW_TXCOL_TICKS_CLRTCKS 0x00000048
#define DEFAULT_TXCOL_TICKS 0x0000012c
#define HIGH_TXCOL_TICKS 0x00000145
#define HOSTCC_RXMAX_FRAMES 0x00003c10
Expand All @@ -892,8 +894,10 @@
#define HIGH_TXMAX_FRAMES 0x00000052
#define HOSTCC_RXCOAL_TICK_INT 0x00003c18
#define DEFAULT_RXCOAL_TICK_INT 0x00000019
#define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_TXCOAL_TICK_INT 0x00003c1c
#define DEFAULT_TXCOAL_TICK_INT 0x00000019
#define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_RXCOAL_MAXF_INT 0x00003c20
#define DEFAULT_RXCOAL_MAXF_INT 0x00000005
#define HOSTCC_TXCOAL_MAXF_INT 0x00003c24
Expand Down Expand Up @@ -2023,6 +2027,7 @@ struct tg3 {

struct tg3_hw_status *hw_status;
dma_addr_t status_mapping;
u32 last_tag;

u32 msg_enable;

Expand Down Expand Up @@ -2068,6 +2073,7 @@ struct tg3 {

u32 rx_offset;
u32 tg3_flags;
#define TG3_FLAG_TAGGED_STATUS 0x00000001
#define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002
#define TG3_FLAG_RX_CHECKSUMS 0x00000004
#define TG3_FLAG_USE_LINKCHG_REG 0x00000008
Expand Down Expand Up @@ -2225,7 +2231,7 @@ struct tg3 {

#define SST_25VF0X0_PAGE_SIZE 4098


struct ethtool_coalesce coal;
};

#endif /* !(_T3_H) */
1 change: 1 addition & 0 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,7 @@ struct dentry *lookup_create(struct nameidata *nd, int is_dir)
fail:
return dentry;
}
EXPORT_SYMBOL_GPL(lookup_create);

int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
{
Expand Down
4 changes: 2 additions & 2 deletions include/net/act_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* include/net/act_generic.h
*
*/
#ifndef ACT_GENERIC_H
#define ACT_GENERIC_H
#ifndef _NET_ACT_GENERIC_H
#define _NET_ACT_GENERIC_H
static inline int tcf_defact_release(struct tcf_defact *p, int bind)
{
int ret = 0;
Expand Down
8 changes: 8 additions & 0 deletions net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
/* Partially cloned skb? */
if (skb_shared(frag))
goto slow_path;

BUG_ON(frag->sk);
if (skb->sk) {
sock_hold(skb->sk);
frag->sk = skb->sk;
frag->destructor = sock_wfree;
skb->truesize -= frag->truesize;
}
}

/* Everything is OK. Generate! */
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/ipvs/ip_vs_xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
rc = NF_ACCEPT;
/* do not touch skb anymore */
atomic_inc(&cp->in_pkts);
__ip_vs_conn_put(cp);
goto out;
}

Expand Down
28 changes: 8 additions & 20 deletions net/ipv4/netfilter/ip_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,37 +940,25 @@ void ip_ct_refresh_acct(struct ip_conntrack *ct,
struct sk_buff *
ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user)
{
struct sock *sk = skb->sk;
#ifdef CONFIG_NETFILTER_DEBUG
unsigned int olddebug = skb->nf_debug;
#endif

if (sk) {
sock_hold(sk);
skb_orphan(skb);
}
skb_orphan(skb);

local_bh_disable();
skb = ip_defrag(skb, user);
local_bh_enable();

if (!skb) {
if (sk)
sock_put(sk);
return skb;
}

if (sk) {
skb_set_owner_w(skb, sk);
sock_put(sk);
}

ip_send_check(skb->nh.iph);
skb->nfcache |= NFC_ALTERED;
if (skb) {
ip_send_check(skb->nh.iph);
skb->nfcache |= NFC_ALTERED;
#ifdef CONFIG_NETFILTER_DEBUG
/* Packet path as if nothing had happened. */
skb->nf_debug = olddebug;
/* Packet path as if nothing had happened. */
skb->nf_debug = olddebug;
#endif
}

return skb;
}

Expand Down
14 changes: 8 additions & 6 deletions net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,17 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
skb_headroom(frag) < hlen)
goto slow_path;

/* Correct socket ownership. */
if (frag->sk == NULL)
goto slow_path;

/* Partially cloned skb? */
if (skb_shared(frag))
goto slow_path;

BUG_ON(frag->sk);
if (skb->sk) {
sock_hold(skb->sk);
frag->sk = skb->sk;
frag->destructor = sock_wfree;
skb->truesize -= frag->truesize;
}
}

err = 0;
Expand Down Expand Up @@ -1116,12 +1120,10 @@ int ip6_push_pending_frames(struct sock *sk)
tail_skb = &(tmp_skb->next);
skb->len += tmp_skb->len;
skb->data_len += tmp_skb->len;
#if 0 /* Logically correct, but useless work, ip_fragment() will have to undo */
skb->truesize += tmp_skb->truesize;
__sock_put(tmp_skb->sk);
tmp_skb->destructor = NULL;
tmp_skb->sk = NULL;
#endif
}

ipv6_addr_copy(final_dst, &fl->fl6_dst);
Expand Down
13 changes: 9 additions & 4 deletions net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,15 @@ static inline int do_one_broadcast(struct sock *sk,

sock_hold(sk);
if (p->skb2 == NULL) {
if (atomic_read(&p->skb->users) != 1) {
if (skb_shared(p->skb)) {
p->skb2 = skb_clone(p->skb, p->allocation);
} else {
p->skb2 = p->skb;
atomic_inc(&p->skb->users);
p->skb2 = skb_get(p->skb);
/*
* skb ownership may have been set when
* delivered to a previous socket.
*/
skb_orphan(p->skb2);
}
}
if (p->skb2 == NULL) {
Expand Down Expand Up @@ -785,11 +789,12 @@ int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid,
sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
do_one_broadcast(sk, &info);

kfree_skb(skb);

netlink_unlock_table();

if (info.skb2)
kfree_skb(info.skb2);
kfree_skb(skb);

if (info.delivered) {
if (info.congested && (allocation & __GFP_WAIT))
Expand Down
28 changes: 3 additions & 25 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,33 +770,12 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
err = path_lookup(sunaddr->sun_path, LOOKUP_PARENT, &nd);
if (err)
goto out_mknod_parent;
/*
* Yucky last component or no last component at all?
* (foo/., foo/.., /////)
*/
err = -EEXIST;
if (nd.last_type != LAST_NORM)
goto out_mknod;
/*
* Lock the directory.
*/
down(&nd.dentry->d_inode->i_sem);
/*
* Do the final lookup.
*/
dentry = lookup_hash(&nd.last, nd.dentry);

dentry = lookup_create(&nd, 0);
err = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto out_mknod_unlock;
err = -ENOENT;
/*
* Special case - lookup gave negative, but... we had foo/bar/
* From the vfs_mknod() POV we just have a negative dentry -
* all is fine. Let's be bastards - you had / on the end, you've
* been asking for (non-existent) directory. -ENOENT for you.
*/
if (nd.last.name[nd.last.len] && !dentry->d_inode)
goto out_mknod_dput;

/*
* All right, let's create it.
*/
Expand Down Expand Up @@ -845,7 +824,6 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
dput(dentry);
out_mknod_unlock:
up(&nd.dentry->d_inode->i_sem);
out_mknod:
path_release(&nd);
out_mknod_parent:
if (err==-EEXIST)
Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
return -ENOMEM;

if (skb1->sk)
skb_set_owner_w(skb, skb1->sk);
skb_set_owner_w(skb2, skb1->sk);

/* Looking around. Are we still alive?
* OK, link new skb, drop old one */
Expand Down
15 changes: 12 additions & 3 deletions net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,21 @@ static int verify_one_alg(struct rtattr **xfrma, enum xfrm_attr_type_t type)
{
struct rtattr *rt = xfrma[type - 1];
struct xfrm_algo *algp;
int len;

if (!rt)
return 0;

if ((rt->rta_len - sizeof(*rt)) < sizeof(*algp))
len = (rt->rta_len - sizeof(*rt)) - sizeof(*algp);
if (len < 0)
return -EINVAL;

algp = RTA_DATA(rt);

len -= (algp->alg_key_len + 7U) / 8;
if (len < 0)
return -EINVAL;

switch (type) {
case XFRMA_ALG_AUTH:
if (!algp->alg_key_len &&
Expand Down Expand Up @@ -162,6 +169,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
struct rtattr *rta = u_arg;
struct xfrm_algo *p, *ualg;
struct xfrm_algo_desc *algo;
int len;

if (!rta)
return 0;
Expand All @@ -173,11 +181,12 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
return -ENOSYS;
*props = algo->desc.sadb_alg_id;

p = kmalloc(sizeof(*ualg) + ualg->alg_key_len, GFP_KERNEL);
len = sizeof(*ualg) + (ualg->alg_key_len + 7U) / 8;
p = kmalloc(len, GFP_KERNEL);
if (!p)
return -ENOMEM;

memcpy(p, ualg, sizeof(*ualg) + ualg->alg_key_len);
memcpy(p, ualg, len);
*algpp = p;
return 0;
}
Expand Down

0 comments on commit 804c64e

Please sign in to comment.