Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118557
b: refs/heads/master
c: ca409d6
h: refs/heads/master
i:
  118555: 18f032b
v: v3
  • Loading branch information
David S. Miller committed Nov 6, 2008
1 parent f382774 commit 0816349
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d54bc4e3fc5c56600a13c9ebc0a7e1077ac05d59
refs/heads/master: ca409d6e08c35b01965d9211c61dbd216286f8ff
7 changes: 7 additions & 0 deletions trunk/include/linux/if_vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);

extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
u16 vlan_tci, int polling);
extern int vlan_hwaccel_do_receive(struct sk_buff *skb);

#else
static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
{
Expand All @@ -133,6 +135,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
BUG();
return NET_XMIT_SUCCESS;
}

static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
{
return 0;
}
#endif

/**
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,8 @@ struct task_struct {
*/
unsigned long timer_slack_ns;
unsigned long default_timer_slack_ns;

struct list_head *scm_work_list;
};

/*
Expand Down
5 changes: 3 additions & 2 deletions trunk/include/net/scm.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

struct scm_fp_list
{
int count;
struct file *fp[SCM_MAX_FD];
struct list_head list;
int count;
struct file *fp[SCM_MAX_FD];
};

struct scm_cookie
Expand Down
46 changes: 33 additions & 13 deletions trunk/net/8021q/vlan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,56 @@
#include <linux/if_vlan.h>
#include "vlan.h"

struct vlan_hwaccel_cb {
struct net_device *dev;
};

static inline struct vlan_hwaccel_cb *vlan_hwaccel_cb(struct sk_buff *skb)
{
return (struct vlan_hwaccel_cb *)skb->cb;
}

/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
u16 vlan_tci, int polling)
{
struct net_device_stats *stats;
struct vlan_hwaccel_cb *cb = vlan_hwaccel_cb(skb);

if (skb_bond_should_drop(skb)) {
dev_kfree_skb_any(skb);
return NET_RX_DROP;
}

skb->vlan_tci = vlan_tci;
cb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);

return (polling ? netif_receive_skb(skb) : netif_rx(skb));
}
EXPORT_SYMBOL(__vlan_hwaccel_rx);

int vlan_hwaccel_do_receive(struct sk_buff *skb)
{
struct vlan_hwaccel_cb *cb = vlan_hwaccel_cb(skb);
struct net_device *dev = cb->dev;
struct net_device_stats *stats;

netif_nit_deliver(skb);

skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
if (skb->dev == NULL) {
dev_kfree_skb_any(skb);
/* Not NET_RX_DROP, this is not being dropped
* due to congestion. */
return NET_RX_SUCCESS;
if (dev == NULL) {
kfree_skb(skb);
return -1;
}
skb->dev->last_rx = jiffies;

skb->dev = dev;
skb->priority = vlan_get_ingress_priority(dev, skb->vlan_tci);
skb->vlan_tci = 0;

stats = &skb->dev->stats;
dev->last_rx = jiffies;

stats = &dev->stats;
stats->rx_packets++;
stats->rx_bytes += skb->len;

skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tci);
switch (skb->pkt_type) {
case PACKET_BROADCAST:
break;
Expand All @@ -43,13 +64,12 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
* This allows the VLAN to have a different MAC than the
* underlying device, and still route correctly. */
if (!compare_ether_addr(eth_hdr(skb)->h_dest,
skb->dev->dev_addr))
dev->dev_addr))
skb->pkt_type = PACKET_HOST;
break;
};
return (polling ? netif_receive_skb(skb) : netif_rx(skb));
return 0;
}
EXPORT_SYMBOL(__vlan_hwaccel_rx);

struct net_device *vlan_dev_real_dev(const struct net_device *dev)
{
Expand Down
31 changes: 20 additions & 11 deletions trunk/net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,9 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
}

P9_DPRINTK(P9_DEBUG_9P, "<<< RATTACH qid %x.%llx.%x\n",
qid.type, qid.path, qid.version);
qid.type,
(unsigned long long)qid.path,
qid.version);

memmove(&fid->qid, &qid, sizeof(struct p9_qid));

Expand Down Expand Up @@ -865,7 +867,9 @@ p9_client_auth(struct p9_client *clnt, char *uname, u32 n_uname, char *aname)
}

P9_DPRINTK(P9_DEBUG_9P, "<<< RAUTH qid %x.%llx.%x\n",
qid.type, qid.path, qid.version);
qid.type,
(unsigned long long)qid.path,
qid.version);

memmove(&afid->qid, &qid, sizeof(struct p9_qid));
p9_free_req(clnt, req);
Expand Down Expand Up @@ -930,7 +934,8 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,

for (count = 0; count < nwqids; count++)
P9_DPRINTK(P9_DEBUG_9P, "<<< [%d] %x.%llx.%x\n",
count, wqids[count].type, wqids[count].path,
count, wqids[count].type,
(unsigned long long)wqids[count].path,
wqids[count].version);

if (nwname)
Expand Down Expand Up @@ -980,7 +985,9 @@ int p9_client_open(struct p9_fid *fid, int mode)
}

P9_DPRINTK(P9_DEBUG_9P, "<<< ROPEN qid %x.%llx.%x iounit %x\n",
qid.type, qid.path, qid.version, iounit);
qid.type,
(unsigned long long)qid.path,
qid.version, iounit);

fid->mode = mode;
fid->iounit = iounit;
Expand Down Expand Up @@ -1023,7 +1030,9 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
}

P9_DPRINTK(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n",
qid.type, qid.path, qid.version, iounit);
qid.type,
(unsigned long long)qid.path,
qid.version, iounit);

fid->mode = mode;
fid->iounit = iounit;
Expand Down Expand Up @@ -1230,9 +1239,9 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
"<<< name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
"<<< uid=%d gid=%d n_muid=%d\n",
ret->size, ret->type, ret->dev, ret->qid.type,
ret->qid.path, ret->qid.version, ret->mode,
ret->atime, ret->mtime, ret->length, ret->name,
ret->uid, ret->gid, ret->muid, ret->extension,
(unsigned long long)ret->qid.path, ret->qid.version, ret->mode,
ret->atime, ret->mtime, (unsigned long long)ret->length,
ret->name, ret->uid, ret->gid, ret->muid, ret->extension,
ret->n_uid, ret->n_gid, ret->n_muid);

free_and_error:
Expand All @@ -1255,9 +1264,9 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst)
" name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
" uid=%d gid=%d n_muid=%d\n",
wst->size, wst->type, wst->dev, wst->qid.type,
wst->qid.path, wst->qid.version, wst->mode,
wst->atime, wst->mtime, wst->length, wst->name,
wst->uid, wst->gid, wst->muid, wst->extension,
(unsigned long long)wst->qid.path, wst->qid.version, wst->mode,
wst->atime, wst->mtime, (unsigned long long)wst->length,
wst->name, wst->uid, wst->gid, wst->muid, wst->extension,
wst->n_uid, wst->n_gid, wst->n_muid);
err = 0;
clnt = fid->clnt;
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,9 @@ int netif_receive_skb(struct sk_buff *skb)
int ret = NET_RX_DROP;
__be16 type;

if (skb->vlan_tci && vlan_hwaccel_do_receive(skb))
return NET_RX_SUCCESS;

/* if we've gotten here through NAPI, check netpoll */
if (netpoll_receive_skb(skb))
return NET_RX_DROP;
Expand Down
24 changes: 21 additions & 3 deletions trunk/net/core/scm.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
if (!fpl)
return -ENOMEM;
*fplp = fpl;
INIT_LIST_HEAD(&fpl->list);
fpl->count = 0;
}
fpp = &fpl->fp[fpl->count];
Expand Down Expand Up @@ -106,9 +107,25 @@ void __scm_destroy(struct scm_cookie *scm)

if (fpl) {
scm->fp = NULL;
for (i=fpl->count-1; i>=0; i--)
fput(fpl->fp[i]);
kfree(fpl);
if (current->scm_work_list) {
list_add_tail(&fpl->list, current->scm_work_list);
} else {
LIST_HEAD(work_list);

current->scm_work_list = &work_list;

list_add(&fpl->list, &work_list);
while (!list_empty(&work_list)) {
fpl = list_first_entry(&work_list, struct scm_fp_list, list);

list_del(&fpl->list);
for (i=fpl->count-1; i>=0; i--)
fput(fpl->fp[i]);
kfree(fpl);
}

current->scm_work_list = NULL;
}
}
}

Expand Down Expand Up @@ -284,6 +301,7 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)

new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL);
if (new_fpl) {
INIT_LIST_HEAD(&new_fpl->list);
for (i=fpl->count-1; i>=0; i--)
get_file(fpl->fp[i]);
memcpy(new_fpl, fpl, sizeof(*fpl));
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,8 +1374,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
sk->sk_state == TCP_CLOSE ||
(sk->sk_shutdown & RCV_SHUTDOWN) ||
!timeo ||
signal_pending(current) ||
(flags & MSG_PEEK))
signal_pending(current))
break;
} else {
if (sock_flag(sk, SOCK_DONE))
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/xfrm4_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
x->sel.dport_mask = htons(0xffff);
x->sel.sport = xfrm_flowi_sport(fl);
x->sel.sport_mask = htons(0xffff);
x->sel.family = AF_INET;
x->sel.prefixlen_d = 32;
x->sel.prefixlen_s = 32;
x->sel.proto = fl->proto;
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2483,8 +2483,10 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
if (!idev && dev->mtu >= IPV6_MIN_MTU)
idev = ipv6_add_dev(dev);

if (idev)
if (idev) {
idev->if_flags |= IF_READY;
run_pending = 1;
}
} else {
if (!addrconf_qdisc_ok(dev)) {
/* device is still not ready. */
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv6/xfrm6_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
x->sel.dport_mask = htons(0xffff);
x->sel.sport = xfrm_flowi_sport(fl);
x->sel.sport_mask = htons(0xffff);
x->sel.family = AF_INET6;
x->sel.prefixlen_d = 128;
x->sel.prefixlen_s = 128;
x->sel.proto = fl->proto;
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/netfilter/nf_conntrack_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/rculist.h>
#include <linux/rtnetlink.h>

#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_l3proto.h>
Expand Down Expand Up @@ -167,10 +168,12 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
*/
synchronize_rcu();

rtnl_lock();
spin_lock_bh(&nf_conntrack_lock);
for_each_net(net)
__nf_conntrack_helper_unregister(me, net);
spin_unlock_bh(&nf_conntrack_lock);
rtnl_unlock();
}
EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);

Expand Down
5 changes: 5 additions & 0 deletions trunk/net/netfilter/nf_conntrack_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/notifier.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>

#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_l3proto.h>
Expand Down Expand Up @@ -221,8 +222,10 @@ void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto)
synchronize_rcu();

/* Remove all contrack entries for this protocol */
rtnl_lock();
for_each_net(net)
nf_ct_iterate_cleanup(net, kill_l3proto, proto);
rtnl_unlock();
}
EXPORT_SYMBOL_GPL(nf_conntrack_l3proto_unregister);

Expand Down Expand Up @@ -333,8 +336,10 @@ void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *l4proto)
synchronize_rcu();

/* Remove all contrack entries for this protocol */
rtnl_lock();
for_each_net(net)
nf_ct_iterate_cleanup(net, kill_l4proto, l4proto);
rtnl_unlock();
}
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_unregister);

Expand Down

0 comments on commit 0816349

Please sign in to comment.