Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314269
b: refs/heads/master
c: 185095f
h: refs/heads/master
i:
  314267: 2d7d066
v: v3
  • Loading branch information
Bruce Allan authored and Jeff Kirsher committed Jun 14, 2012
1 parent ba4f92a commit f26d9ae
Show file tree
Hide file tree
Showing 25 changed files with 175 additions and 149 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: 81aded24675ebda5de8a68843250ad15584ac38a
refs/heads/master: 185095fb80ce57c0f3db8738e36ad7c02dc34d33
11 changes: 7 additions & 4 deletions trunk/drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6238,7 +6238,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
}

if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw))
e_info("PHY reset is blocked due to SOL/IDER session.\n");
dev_info(&pdev->dev,
"PHY reset is blocked due to SOL/IDER session.\n");

/* Set initial default active device features */
netdev->features = (NETIF_F_SG |
Expand Down Expand Up @@ -6288,7 +6289,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
if (e1000_validate_nvm_checksum(&adapter->hw) >= 0)
break;
if (i == 2) {
e_err("The NVM Checksum Is Not Valid\n");
dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n");
err = -EIO;
goto err_eeprom;
}
Expand All @@ -6298,13 +6299,15 @@ static int __devinit e1000_probe(struct pci_dev *pdev,

/* copy the MAC address */
if (e1000e_read_mac_addr(&adapter->hw))
e_err("NVM Read Error while reading MAC address\n");
dev_err(&pdev->dev,
"NVM Read Error while reading MAC address\n");

memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);

if (!is_valid_ether_addr(netdev->perm_addr)) {
e_err("Invalid MAC Address: %pM\n", netdev->perm_addr);
dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
netdev->perm_addr);
err = -EIO;
goto err_eeprom;
}
Expand Down
43 changes: 27 additions & 16 deletions trunk/drivers/net/ethernet/intel/e1000e/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,19 @@ static int __devinit e1000_validate_option(unsigned int *value,
case enable_option:
switch (*value) {
case OPTION_ENABLED:
e_info("%s Enabled\n", opt->name);
dev_info(&adapter->pdev->dev, "%s Enabled\n",
opt->name);
return 0;
case OPTION_DISABLED:
e_info("%s Disabled\n", opt->name);
dev_info(&adapter->pdev->dev, "%s Disabled\n",
opt->name);
return 0;
}
break;
case range_option:
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
e_info("%s set to %i\n", opt->name, *value);
dev_info(&adapter->pdev->dev, "%s set to %i\n",
opt->name, *value);
return 0;
}
break;
Expand All @@ -220,7 +223,8 @@ static int __devinit e1000_validate_option(unsigned int *value,
ent = &opt->arg.l.p[i];
if (*value == ent->i) {
if (ent->str[0] != '\0')
e_info("%s\n", ent->str);
dev_info(&adapter->pdev->dev, "%s\n",
ent->str);
return 0;
}
}
Expand All @@ -230,8 +234,8 @@ static int __devinit e1000_validate_option(unsigned int *value,
BUG();
}

e_info("Invalid %s value specified (%i) %s\n", opt->name, *value,
opt->err);
dev_info(&adapter->pdev->dev, "Invalid %s value specified (%i) %s\n",
opt->name, *value, opt->err);
*value = opt->def;
return -1;
}
Expand All @@ -251,8 +255,10 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
int bd = adapter->bd_number;

if (bd >= E1000_MAX_NIC) {
e_notice("Warning: no configuration for board #%i\n", bd);
e_notice("Using defaults for all values\n");
dev_notice(&adapter->pdev->dev,
"Warning: no configuration for board #%i\n", bd);
dev_notice(&adapter->pdev->dev,
"Using defaults for all values\n");
}

{ /* Transmit Interrupt Delay */
Expand Down Expand Up @@ -366,27 +372,32 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
* default values
*/
if (adapter->itr > 4)
e_info("%s set to default %d\n", opt.name,
adapter->itr);
dev_info(&adapter->pdev->dev,
"%s set to default %d\n", opt.name,
adapter->itr);
}

adapter->itr_setting = adapter->itr;
switch (adapter->itr) {
case 0:
e_info("%s turned off\n", opt.name);
dev_info(&adapter->pdev->dev, "%s turned off\n",
opt.name);
break;
case 1:
e_info("%s set to dynamic mode\n", opt.name);
dev_info(&adapter->pdev->dev,
"%s set to dynamic mode\n", opt.name);
adapter->itr = 20000;
break;
case 3:
e_info("%s set to dynamic conservative mode\n",
opt.name);
dev_info(&adapter->pdev->dev,
"%s set to dynamic conservative mode\n",
opt.name);
adapter->itr = 20000;
break;
case 4:
e_info("%s set to simplified (2000-8000 ints) mode\n",
opt.name);
dev_info(&adapter->pdev->dev,
"%s set to simplified (2000-8000 ints) mode\n",
opt.name);
break;
default:
/*
Expand Down
8 changes: 4 additions & 4 deletions trunk/include/net/ip6_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ extern void rt6_redirect(const struct in6_addr *dest,
u8 *lladdr,
int on_link);

extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
int oif, u32 mark);
extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk,
__be32 mtu);
extern void rt6_pmtu_discovery(const struct in6_addr *daddr,
const struct in6_addr *saddr,
struct net_device *dev,
u32 pmtu);

struct netlink_callback;

Expand Down
5 changes: 1 addition & 4 deletions trunk/include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@ static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 s
return ip_route_input_common(skb, dst, src, tos, devin, true);
}

extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,
int oif, u32 mark, u8 protocol, int flow_flags);
extern void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu);
extern void ip_rt_send_redirect(struct sk_buff *skb);
extern void ip_rt_send_redirect(struct sk_buff *skb);

extern unsigned int inet_addr_type(struct net *net, __be32 addr);
extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr);
Expand Down
7 changes: 5 additions & 2 deletions trunk/net/dcb/dcbnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ static struct sk_buff *dcbnl_newmsg(int type, u8 cmd, u32 port, u32 seq,
return NULL;

nlh = nlmsg_put(skb, port, seq, type, sizeof(*dcb), flags);
BUG_ON(!nlh);
if (!nlh) {
/* header should always fit, allocation must be buggy */
BUG();
}

dcb = nlmsg_data(nlh);
dcb->dcb_family = AF_UNSPEC;
Expand Down Expand Up @@ -1661,7 +1664,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
u32 pid = skb ? NETLINK_CB(skb).pid : 0;
int ret = -EINVAL;
struct sk_buff *reply_skb;
struct nlmsghdr *reply_nlh = NULL;
struct nlmsghdr *reply_nlh;
const struct reply_func *fn;

if (!net_eq(net, &init_net))
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
} else
dst_hold(dst);

dst->ops->update_pmtu(dst, ntohl(info));

if (inet_csk(sk)->icsk_pmtu_cookie > dst_mtu(dst)) {
dccp_sync_mss(sk, dst_mtu(dst));
} /* else let the usual retransmit timer handle it */
Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv4/ah4.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ static void ah4_err(struct sk_buff *skb, u32 info)
return;
pr_debug("pmtu discovery on SA AH/%08x/%08x\n",
ntohl(ah->spi), ntohl(iph->daddr));
ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0);
xfrm_state_put(x);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ static void esp4_err(struct sk_buff *skb, u32 info)
return;
NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
ntohl(esph->spi), ntohl(iph->daddr));
ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0);
xfrm_state_put(x);
}

Expand Down
14 changes: 4 additions & 10 deletions trunk/net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
case ICMP_PORT_UNREACH:
/* Impossible event. */
return;
case ICMP_FRAG_NEEDED:
/* Soft state for pmtu is maintained by IP core. */
return;
default:
/* All others are translated to HOST_UNREACH.
rfc2003 contains "deep thoughts" about NET_UNREACH,
Expand All @@ -535,16 +538,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
flags & GRE_KEY ?
*(((__be32 *)p) + (grehlen / 4) - 1) : 0,
p[1]);
if (t == NULL)
goto out;

if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
ipv4_update_pmtu(skb, dev_net(skb->dev), info,
t->parms.link, 0, IPPROTO_GRE, 0);
goto out;
}

if (t->parms.iph.daddr == 0 ||
if (t == NULL || t->parms.iph.daddr == 0 ||
ipv4_is_multicast(t->parms.iph.daddr))
goto out;

Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv4/ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
return;
NETDEBUG(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI4\n",
spi, &iph->daddr);
ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0);
xfrm_state_put(x);
}

Expand Down
15 changes: 4 additions & 11 deletions trunk/net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ static int ipip_err(struct sk_buff *skb, u32 info)
case ICMP_PORT_UNREACH:
/* Impossible event. */
return 0;
case ICMP_FRAG_NEEDED:
/* Soft state for pmtu is maintained by IP core. */
return 0;
default:
/* All others are translated to HOST_UNREACH.
rfc2003 contains "deep thoughts" about NET_UNREACH,
Expand All @@ -366,17 +369,7 @@ static int ipip_err(struct sk_buff *skb, u32 info)

rcu_read_lock();
t = ipip_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr);
if (t == NULL)
goto out;

if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
ipv4_update_pmtu(skb, dev_net(skb->dev), info,
t->dev->ifindex, 0, IPPROTO_IPIP, 0);
err = 0;
goto out;
}

if (t->parms.iph.daddr == 0)
if (t == NULL || t->parms.iph.daddr == 0)
goto out;

err = 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv4/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ void ping_err(struct sk_buff *skb, u32 info)
break;
case ICMP_DEST_UNREACH:
if (code == ICMP_FRAG_NEEDED) { /* Path MTU discovery */
ipv4_sk_update_pmtu(skb, sk, info);
if (inet_sock->pmtudisc != IP_PMTUDISC_DONT) {
err = EMSGSIZE;
harderr = 1;
Expand Down
3 changes: 0 additions & 3 deletions trunk/net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
int err = 0;
int harderr = 0;

if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)
ipv4_sk_update_pmtu(skb, sk, info);

/* Report error on raw socket, if:
1. User requested ip_recverr.
2. Socket is connected (otherwise the error indication
Expand Down
28 changes: 0 additions & 28 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,34 +1711,6 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
}
}

void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,
int oif, u32 mark, u8 protocol, int flow_flags)
{
const struct iphdr *iph = (const struct iphdr *)skb->data;
struct flowi4 fl4;
struct rtable *rt;

flowi4_init_output(&fl4, oif, mark, RT_TOS(iph->tos), RT_SCOPE_UNIVERSE,
protocol, flow_flags | FLOWI_FLAG_PRECOW_METRICS,
iph->daddr, iph->saddr, 0, 0);
rt = __ip_route_output_key(net, &fl4);
if (!IS_ERR(rt)) {
ip_rt_update_pmtu(&rt->dst, mtu);
ip_rt_put(rt);
}
}
EXPORT_SYMBOL_GPL(ipv4_update_pmtu);

void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
{
const struct inet_sock *inet = inet_sk(sk);

return ipv4_update_pmtu(skb, sock_net(sk), mtu,
sk->sk_bound_dev_if, sk->sk_mark,
inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol,
inet_sk_flowi_flags(sk));
}
EXPORT_SYMBOL_GPL(ipv4_sk_update_pmtu);

static void ipv4_validate_peer(struct rtable *rt)
{
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 @@ -615,7 +615,6 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
break;
case ICMP_DEST_UNREACH:
if (code == ICMP_FRAG_NEEDED) { /* Path MTU discovery */
ipv4_sk_update_pmtu(skb, sk, info);
if (inet->pmtudisc != IP_PMTUDISC_DONT) {
err = EMSGSIZE;
harderr = 1;
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <linux/pfkeyv2.h>
#include <linux/string.h>
#include <linux/scatterlist.h>
#include <net/ip6_route.h>
#include <net/icmp.h>
#include <net/ipv6.h>
#include <net/protocol.h>
Expand Down Expand Up @@ -622,7 +621,7 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,

NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/%pI6\n",
ntohl(ah->spi), &iph->daddr);
ip6_update_pmtu(skb, net, info, 0, 0);

xfrm_state_put(x);
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <net/ip6_route.h>
#include <net/icmp.h>
#include <net/ipv6.h>
#include <net/protocol.h>
Expand Down Expand Up @@ -443,7 +442,6 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
return;
pr_debug("pmtu discovery on SA ESP/%08x/%pI6\n",
ntohl(esph->spi), &iph->daddr);
ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}

Expand Down
6 changes: 5 additions & 1 deletion trunk/net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
struct net_device *dev = skb->dev;
struct inet6_dev *idev = __in6_dev_get(dev);
const struct in6_addr *saddr, *daddr;
const struct ipv6hdr *orig_hdr;
struct icmp6hdr *hdr;
u8 type;

Expand All @@ -660,7 +661,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
XFRM_STATE_ICMP))
goto drop_no_count;

if (!pskb_may_pull(skb, sizeof(*hdr) + sizeof(struct ipv6hdr)))
if (!pskb_may_pull(skb, sizeof(*hdr) + sizeof(*orig_hdr)))
goto drop_no_count;

nh = skb_network_offset(skb);
Expand Down Expand Up @@ -721,6 +722,9 @@ static int icmpv6_rcv(struct sk_buff *skb)
if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
goto discard_it;
hdr = icmp6_hdr(skb);
orig_hdr = (struct ipv6hdr *) (hdr + 1);
rt6_pmtu_discovery(&orig_hdr->daddr, &orig_hdr->saddr, dev,
ntohl(hdr->icmp6_mtu));

/*
* Drop through to notify
Expand Down
Loading

0 comments on commit f26d9ae

Please sign in to comment.