Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237551
b: refs/heads/master
c: 9b082d7
h: refs/heads/master
i:
  237549: dd88dbc
  237547: 6ce4660
  237543: cdd0b8c
  237535: 85ce1ff
v: v3
  • Loading branch information
Stefan Assmann authored and Jeff Kirsher committed Mar 3, 2011
1 parent e8e06a3 commit 5e211e5
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 86 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: e066008b38ca9ace1b6de8dbbac8ed460640791d
refs/heads/master: 9b082d734a938b951ed4b9b5a850ae3513d4a7e3
21 changes: 18 additions & 3 deletions trunk/drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2595,9 +2595,14 @@ config CHELSIO_T1_1G
Enables support for Chelsio's gigabit Ethernet PCI cards. If you
are using only 10G cards say 'N' here.

config CHELSIO_T3_DEPENDS
tristate
depends on PCI && INET
default y

config CHELSIO_T3
tristate "Chelsio Communications T3 10Gb Ethernet support"
depends on PCI && INET
depends on CHELSIO_T3_DEPENDS
select FW_LOADER
select MDIO
help
Expand All @@ -2615,9 +2620,14 @@ config CHELSIO_T3
To compile this driver as a module, choose M here: the module
will be called cxgb3.

config CHELSIO_T4_DEPENDS
tristate
depends on PCI && INET
default y

config CHELSIO_T4
tristate "Chelsio Communications T4 Ethernet support"
depends on PCI
depends on CHELSIO_T4_DEPENDS
select FW_LOADER
select MDIO
help
Expand All @@ -2635,9 +2645,14 @@ config CHELSIO_T4
To compile this driver as a module choose M here; the module
will be called cxgb4.

config CHELSIO_T4VF_DEPENDS
tristate
depends on PCI && INET
default y

config CHELSIO_T4VF
tristate "Chelsio Communications T4 Virtual Function Ethernet support"
depends on PCI
depends on CHELSIO_T4VF_DEPENDS
help
This driver supports Chelsio T4-based gigabit and 10Gb Ethernet
adapters with PCI-E SR-IOV Virtual Functions.
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,12 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
switch (hw->mac.type) {
case e1000_82576:
case e1000_i350:
adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
if (max_vfs > 7) {
dev_warn(&pdev->dev,
"Maximum of 7 VFs per PF, using max\n");
adapter->vfs_allocated_count = 7;
} else
adapter->vfs_allocated_count = max_vfs;
break;
default:
break;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/scsi/cxgbi/cxgb3i/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
config SCSI_CXGB3_ISCSI
tristate "Chelsio T3 iSCSI support"
depends on PCI && INET
select NETDEVICES
select NETDEV_10000
depends on CHELSIO_T3_DEPENDS
select CHELSIO_T3
select SCSI_ISCSI_ATTRS
---help---
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/scsi/cxgbi/cxgb4i/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
config SCSI_CXGB4_ISCSI
tristate "Chelsio T4 iSCSI support"
depends on PCI && INET
select NETDEVICES
select NETDEV_10000
depends on CHELSIO_T4_DEPENDS
select CHELSIO_T4
select SCSI_ISCSI_ATTRS
---help---
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ struct netlink_skb_parms {
__u32 pid;
__u32 dst_group;
kernel_cap_t eff_cap;
__u32 loginuid; /* Login (audit) uid */
__u32 sessionid; /* Session id (audit) */
__u32 sid; /* SELinux security id */
};

#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
Expand Down
1 change: 0 additions & 1 deletion trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ struct Qdisc {
struct gnet_stats_queue qstats;
struct rcu_head rcu_head;
spinlock_t busylock;
u32 limit;
};

static inline bool qdisc_is_running(const struct Qdisc *qdisc)
Expand Down
6 changes: 3 additions & 3 deletions trunk/kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,9 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)

pid = NETLINK_CREDS(skb)->pid;
uid = NETLINK_CREDS(skb)->uid;
loginuid = audit_get_loginuid(current);
sessionid = audit_get_sessionid(current);
security_task_getsecid(current, &sid);
loginuid = NETLINK_CB(skb).loginuid;
sessionid = NETLINK_CB(skb).sessionid;
sid = NETLINK_CB(skb).sid;
seq = nlh->nlmsg_seq;
data = NLMSG_DATA(nlh);

Expand Down
10 changes: 3 additions & 7 deletions trunk/kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,6 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb,
for (i = 0; i < rule->field_count; i++) {
struct audit_field *f = &rule->fields[i];
int result = 0;
u32 sid;

switch (f->type) {
case AUDIT_PID:
Expand All @@ -1251,22 +1250,19 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb,
result = audit_comparator(cb->creds.gid, f->op, f->val);
break;
case AUDIT_LOGINUID:
result = audit_comparator(audit_get_loginuid(current),
f->op, f->val);
result = audit_comparator(cb->loginuid, f->op, f->val);
break;
case AUDIT_SUBJ_USER:
case AUDIT_SUBJ_ROLE:
case AUDIT_SUBJ_TYPE:
case AUDIT_SUBJ_SEN:
case AUDIT_SUBJ_CLR:
if (f->lsm_rule) {
security_task_getsecid(current, &sid);
result = security_audit_rule_match(sid,
if (f->lsm_rule)
result = security_audit_rule_match(cb->sid,
f->type,
f->op,
f->lsm_rule,
NULL);
}
break;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static inline unsigned int inet_addr_hash(struct net *net, __be32 addr)

static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa)
{
unsigned int hash = inet_addr_hash(net, ifa->ifa_local);
unsigned int hash = inet_addr_hash(net, ifa->ifa_address);

spin_lock(&inet_addr_hash_lock);
hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]);
Expand Down Expand Up @@ -146,7 +146,7 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)

if (!net_eq(dev_net(dev), net))
continue;
if (ifa->ifa_local == addr) {
if (ifa->ifa_address == addr) {
result = dev;
break;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
rt = ip_route_output_flow(net, &fl, sk);
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
rt = NULL;
if (err == -ENETUNREACH)
IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
goto out;
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/netlabel/netlabel_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
static inline void netlbl_netlink_auditinfo(struct sk_buff *skb,
struct netlbl_audit *audit_info)
{
security_task_getsecid(current, &audit_info->secid);
audit_info->loginuid = audit_get_loginuid(current);
audit_info->sessionid = audit_get_sessionid(current);
audit_info->secid = NETLINK_CB(skb).sid;
audit_info->loginuid = NETLINK_CB(skb).loginuid;
audit_info->sessionid = NETLINK_CB(skb).sessionid;
}

/* NetLabel NETLINK I/O functions */
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,9 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,

NETLINK_CB(skb).pid = nlk->pid;
NETLINK_CB(skb).dst_group = dst_group;
NETLINK_CB(skb).loginuid = audit_get_loginuid(current);
NETLINK_CB(skb).sessionid = audit_get_sessionid(current);
security_task_getsecid(current, &(NETLINK_CB(skb).sid));
memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));

/* What can I do? Netlink is asynchronous, so that
Expand Down
34 changes: 23 additions & 11 deletions trunk/net/sched/sch_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,35 @@

/* 1 band FIFO pseudo-"scheduler" */

struct fifo_sched_data {
u32 limit;
};

static int bfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= sch->limit))
struct fifo_sched_data *q = qdisc_priv(sch);

if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= q->limit))
return qdisc_enqueue_tail(skb, sch);

return qdisc_reshape_fail(skb, sch);
}

static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
if (likely(skb_queue_len(&sch->q) < sch->limit))
struct fifo_sched_data *q = qdisc_priv(sch);

if (likely(skb_queue_len(&sch->q) < q->limit))
return qdisc_enqueue_tail(skb, sch);

return qdisc_reshape_fail(skb, sch);
}

static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
if (likely(skb_queue_len(&sch->q) < sch->limit))
struct fifo_sched_data *q = qdisc_priv(sch);

if (likely(skb_queue_len(&sch->q) < q->limit))
return qdisc_enqueue_tail(skb, sch);

/* queue full, remove one skb to fulfill the limit */
Expand All @@ -50,6 +60,7 @@ static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch)

static int fifo_init(struct Qdisc *sch, struct nlattr *opt)
{
struct fifo_sched_data *q = qdisc_priv(sch);
bool bypass;
bool is_bfifo = sch->ops == &bfifo_qdisc_ops;

Expand All @@ -59,20 +70,20 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt)
if (is_bfifo)
limit *= psched_mtu(qdisc_dev(sch));

sch->limit = limit;
q->limit = limit;
} else {
struct tc_fifo_qopt *ctl = nla_data(opt);

if (nla_len(opt) < sizeof(*ctl))
return -EINVAL;

sch->limit = ctl->limit;
q->limit = ctl->limit;
}

if (is_bfifo)
bypass = sch->limit >= psched_mtu(qdisc_dev(sch));
bypass = q->limit >= psched_mtu(qdisc_dev(sch));
else
bypass = sch->limit >= 1;
bypass = q->limit >= 1;

if (bypass)
sch->flags |= TCQ_F_CAN_BYPASS;
Expand All @@ -83,7 +94,8 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt)

static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb)
{
struct tc_fifo_qopt opt = { .limit = sch->limit };
struct fifo_sched_data *q = qdisc_priv(sch);
struct tc_fifo_qopt opt = { .limit = q->limit };

NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
return skb->len;
Expand All @@ -94,7 +106,7 @@ static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb)

struct Qdisc_ops pfifo_qdisc_ops __read_mostly = {
.id = "pfifo",
.priv_size = 0,
.priv_size = sizeof(struct fifo_sched_data),
.enqueue = pfifo_enqueue,
.dequeue = qdisc_dequeue_head,
.peek = qdisc_peek_head,
Expand All @@ -109,7 +121,7 @@ EXPORT_SYMBOL(pfifo_qdisc_ops);

struct Qdisc_ops bfifo_qdisc_ops __read_mostly = {
.id = "bfifo",
.priv_size = 0,
.priv_size = sizeof(struct fifo_sched_data),
.enqueue = bfifo_enqueue,
.dequeue = qdisc_dequeue_head,
.peek = qdisc_peek_head,
Expand All @@ -124,7 +136,7 @@ EXPORT_SYMBOL(bfifo_qdisc_ops);

struct Qdisc_ops pfifo_head_drop_qdisc_ops __read_mostly = {
.id = "pfifo_head_drop",
.priv_size = 0,
.priv_size = sizeof(struct fifo_sched_data),
.enqueue = pfifo_tail_enqueue,
.dequeue = qdisc_dequeue_head,
.peek = qdisc_peek_head,
Expand Down
18 changes: 7 additions & 11 deletions trunk/net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,25 +550,21 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
{
void *p;
struct Qdisc *sch;
unsigned int size = QDISC_ALIGN(sizeof(*sch)) + ops->priv_size;
unsigned int size;
int err = -ENOBUFS;

/* ensure that the Qdisc and the private data are 64-byte aligned */
size = QDISC_ALIGN(sizeof(*sch));
size += ops->priv_size + (QDISC_ALIGNTO - 1);

p = kzalloc_node(size, GFP_KERNEL,
netdev_queue_numa_node_read(dev_queue));

if (!p)
goto errout;
sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);
/* if we got non aligned memory, ask more and do alignment ourself */
if (sch != p) {
kfree(p);
p = kzalloc_node(size + QDISC_ALIGNTO - 1, GFP_KERNEL,
netdev_queue_numa_node_read(dev_queue));
if (!p)
goto errout;
sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);
sch->padded = (char *) sch - (char *) p;
}
sch->padded = (char *) sch - (char *) p;

INIT_LIST_HEAD(&sch->list);
skb_queue_head_init(&sch->q);
spin_lock_init(&sch->busylock);
Expand Down
Loading

0 comments on commit 5e211e5

Please sign in to comment.