Commit ba6d973f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes and cleanups from David Miller:

 1) Use rb_entry() instead of hardcoded container_of(), from Geliang
    Tang.

 2) Use correct memory barriers in stammac driver, from Pavel Machek.

 3) Fix assoc bind address handling in SCTP, from Xin Long.

 4) Make the length check for UFO handling consistent between
    __ip_append_data() and ip_finish_output(), from Zheng Li.

 5) HSI driver compatible strings were busted fro hix5hd2, from Dongpo
    Li.

 6) Handle devm_ioremap() errors properly in cavium driver, from Arvind
    Yadav.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (22 commits)
  RDS: use rb_entry()
  net_sched: sch_netem: use rb_entry()
  net_sched: sch_fq: use rb_entry()
  net/mlx5: use rb_entry()
  ethernet: sfc: Add Kconfig entry for vendor Solarflare
  sctp: not copying duplicate addrs to the assoc's bind address list
  sctp: reduce indent level in sctp_copy_local_addr_list
  ARM: dts: hix5hd2: don't change the existing compatible string
  net: hix5hd2_gmac: fix compatible strings name
  openvswitch: Add a missing break statement.
  net: netcp: ethss: fix 10gbe host port tx pri map configuration
  net: netcp: ethss: fix errors in ethtool ops
  fsl/fman: enable compilation on ARM64
  fsl/fman: A007273 only applies to PPC SoCs
  powerpc: fsl/fman: remove fsl,fman from of_device_ids[]
  fsl/fman: fix 1G support for QSGMII interfaces
  dt: bindings: net: use boolean dt properties for eee broken modes
  net: phy: use boolean dt properties for eee broken modes
  net: phy: fix sign type error in genphy_config_eee_advert
  ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output
  ...
parents 3eb86259 a763f78c
...@@ -135,7 +135,7 @@ void rds_rdma_drop_keys(struct rds_sock *rs) ...@@ -135,7 +135,7 @@ void rds_rdma_drop_keys(struct rds_sock *rs)
/* Release any MRs associated with this socket */ /* Release any MRs associated with this socket */
spin_lock_irqsave(&rs->rs_rdma_lock, flags); spin_lock_irqsave(&rs->rs_rdma_lock, flags);
while ((node = rb_first(&rs->rs_rdma_keys))) { while ((node = rb_first(&rs->rs_rdma_keys))) {
mr = container_of(node, struct rds_mr, r_rb_node); mr = rb_entry(node, struct rds_mr, r_rb_node);
if (mr->r_trans == rs->rs_transport) if (mr->r_trans == rs->rs_transport)
mr->r_invalidate = 0; mr->r_invalidate = 0;
rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys); rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys);
......
...@@ -136,7 +136,7 @@ static void fq_flow_set_throttled(struct fq_sched_data *q, struct fq_flow *f) ...@@ -136,7 +136,7 @@ static void fq_flow_set_throttled(struct fq_sched_data *q, struct fq_flow *f)
struct fq_flow *aux; struct fq_flow *aux;
parent = *p; parent = *p;
aux = container_of(parent, struct fq_flow, rate_node); aux = rb_entry(parent, struct fq_flow, rate_node);
if (f->time_next_packet >= aux->time_next_packet) if (f->time_next_packet >= aux->time_next_packet)
p = &parent->rb_right; p = &parent->rb_right;
else else
...@@ -188,7 +188,7 @@ static void fq_gc(struct fq_sched_data *q, ...@@ -188,7 +188,7 @@ static void fq_gc(struct fq_sched_data *q,
while (*p) { while (*p) {
parent = *p; parent = *p;
f = container_of(parent, struct fq_flow, fq_node); f = rb_entry(parent, struct fq_flow, fq_node);
if (f->sk == sk) if (f->sk == sk)
break; break;
...@@ -256,7 +256,7 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q) ...@@ -256,7 +256,7 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
while (*p) { while (*p) {
parent = *p; parent = *p;
f = container_of(parent, struct fq_flow, fq_node); f = rb_entry(parent, struct fq_flow, fq_node);
if (f->sk == sk) { if (f->sk == sk) {
/* socket might have been reallocated, so check /* socket might have been reallocated, so check
* if its sk_hash is the same. * if its sk_hash is the same.
...@@ -424,7 +424,7 @@ static void fq_check_throttled(struct fq_sched_data *q, u64 now) ...@@ -424,7 +424,7 @@ static void fq_check_throttled(struct fq_sched_data *q, u64 now)
q->time_next_delayed_flow = ~0ULL; q->time_next_delayed_flow = ~0ULL;
while ((p = rb_first(&q->delayed)) != NULL) { while ((p = rb_first(&q->delayed)) != NULL) {
struct fq_flow *f = container_of(p, struct fq_flow, rate_node); struct fq_flow *f = rb_entry(p, struct fq_flow, rate_node);
if (f->time_next_packet > now) { if (f->time_next_packet > now) {
q->time_next_delayed_flow = f->time_next_packet; q->time_next_delayed_flow = f->time_next_packet;
...@@ -563,7 +563,7 @@ static void fq_reset(struct Qdisc *sch) ...@@ -563,7 +563,7 @@ static void fq_reset(struct Qdisc *sch)
for (idx = 0; idx < (1U << q->fq_trees_log); idx++) { for (idx = 0; idx < (1U << q->fq_trees_log); idx++) {
root = &q->fq_root[idx]; root = &q->fq_root[idx];
while ((p = rb_first(root)) != NULL) { while ((p = rb_first(root)) != NULL) {
f = container_of(p, struct fq_flow, fq_node); f = rb_entry(p, struct fq_flow, fq_node);
rb_erase(p, root); rb_erase(p, root);
fq_flow_purge(f); fq_flow_purge(f);
...@@ -593,7 +593,7 @@ static void fq_rehash(struct fq_sched_data *q, ...@@ -593,7 +593,7 @@ static void fq_rehash(struct fq_sched_data *q,
oroot = &old_array[idx]; oroot = &old_array[idx];
while ((op = rb_first(oroot)) != NULL) { while ((op = rb_first(oroot)) != NULL) {
rb_erase(op, oroot); rb_erase(op, oroot);
of = container_of(op, struct fq_flow, fq_node); of = rb_entry(op, struct fq_flow, fq_node);
if (fq_gc_candidate(of)) { if (fq_gc_candidate(of)) {
fcnt++; fcnt++;
kmem_cache_free(fq_flow_cachep, of); kmem_cache_free(fq_flow_cachep, of);
...@@ -606,7 +606,7 @@ static void fq_rehash(struct fq_sched_data *q, ...@@ -606,7 +606,7 @@ static void fq_rehash(struct fq_sched_data *q,
while (*np) { while (*np) {
parent = *np; parent = *np;
nf = container_of(parent, struct fq_flow, fq_node); nf = rb_entry(parent, struct fq_flow, fq_node);
BUG_ON(nf->sk == of->sk); BUG_ON(nf->sk == of->sk);
if (nf->sk > of->sk) if (nf->sk > of->sk)
......
...@@ -152,7 +152,7 @@ struct netem_skb_cb { ...@@ -152,7 +152,7 @@ struct netem_skb_cb {
static struct sk_buff *netem_rb_to_skb(struct rb_node *rb) static struct sk_buff *netem_rb_to_skb(struct rb_node *rb)
{ {
return container_of(rb, struct sk_buff, rbnode); return rb_entry(rb, struct sk_buff, rbnode);
} }
static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb) static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
......
...@@ -292,6 +292,8 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, ...@@ -292,6 +292,8 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
} }
af->from_addr_param(&addr, rawaddr, htons(port), 0); af->from_addr_param(&addr, rawaddr, htons(port), 0);
if (sctp_bind_addr_state(bp, &addr) != -1)
goto next;
retval = sctp_add_bind_addr(bp, &addr, sizeof(addr), retval = sctp_add_bind_addr(bp, &addr, sizeof(addr),
SCTP_ADDR_SRC, gfp); SCTP_ADDR_SRC, gfp);
if (retval) { if (retval) {
...@@ -300,6 +302,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, ...@@ -300,6 +302,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
break; break;
} }
next:
len = ntohs(param->length); len = ntohs(param->length);
addrs_len -= len; addrs_len -= len;
raw_addr_list += len; raw_addr_list += len;
......
...@@ -205,26 +205,30 @@ int sctp_copy_local_addr_list(struct net *net, struct sctp_bind_addr *bp, ...@@ -205,26 +205,30 @@ int sctp_copy_local_addr_list(struct net *net, struct sctp_bind_addr *bp,
list_for_each_entry_rcu(addr, &net->sctp.local_addr_list, list) { list_for_each_entry_rcu(addr, &net->sctp.local_addr_list, list) {
if (!addr->valid) if (!addr->valid)
continue; continue;
if (sctp_in_scope(net, &addr->a, scope)) { if (!sctp_in_scope(net, &addr->a, scope))
/* Now that the address is in scope, check to see if continue;
* the address type is really supported by the local
* sock as well as the remote peer. /* Now that the address is in scope, check to see if
*/ * the address type is really supported by the local
if ((((AF_INET == addr->a.sa.sa_family) && * sock as well as the remote peer.
(copy_flags & SCTP_ADDR4_PEERSUPP))) || */
(((AF_INET6 == addr->a.sa.sa_family) && if (addr->a.sa.sa_family == AF_INET &&
(copy_flags & SCTP_ADDR6_ALLOWED) && !(copy_flags & SCTP_ADDR4_PEERSUPP))
(copy_flags & SCTP_ADDR6_PEERSUPP)))) { continue;
error = sctp_add_bind_addr(bp, &addr->a, if (addr->a.sa.sa_family == AF_INET6 &&
sizeof(addr->a), (!(copy_flags & SCTP_ADDR6_ALLOWED) ||
SCTP_ADDR_SRC, GFP_ATOMIC); !(copy_flags & SCTP_ADDR6_PEERSUPP)))
if (error) continue;
goto end_copy;
} if (sctp_bind_addr_state(bp, &addr->a) != -1)
} continue;
error = sctp_add_bind_addr(bp, &addr->a, sizeof(addr->a),
SCTP_ADDR_SRC, GFP_ATOMIC);
if (error)
break;
} }
end_copy:
rcu_read_unlock(); rcu_read_unlock();
return error; return error;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment