Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275706
b: refs/heads/master
c: f8b8a80
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Nov 14, 2011
1 parent 7f50eb8 commit d381181
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 41 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: fb14ca438c0a54306419ee648d9d146c5e7be679
refs/heads/master: f8b8a80f2d5f2960482292d961df18a776e3e524
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/lantiq_etop.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>

#include <asm/checksum.h>

Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/net/ethernet/mellanox/mlx4/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
* Packet is OK - process it.
*/
length = be32_to_cpu(cqe->byte_cnt);
length -= ring->fcs_del;
ring->bytes += length;
ring->packets++;

Expand Down Expand Up @@ -813,8 +814,11 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn,
context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma);

/* Cancel FCS removal if FW allows */
if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP)
if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP) {
context->param3 |= cpu_to_be32(1 << 29);
ring->fcs_del = ETH_FCS_LEN;
} else
ring->fcs_del = 0;

err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, context, qp, state);
if (err) {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ struct mlx4_en_rx_ring {
u32 prod;
u32 cons;
u32 buf_size;
u8 fcs_del;
void *buf;
void *rx_info;
unsigned long bytes;
Expand Down
36 changes: 27 additions & 9 deletions trunk/drivers/net/ethernet/nvidia/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ struct nv_ethtool_str {
};

static const struct nv_ethtool_str nv_estats_str[] = {
{ "tx_bytes" },
{ "tx_bytes" }, /* includes Ethernet FCS CRC */
{ "tx_zero_rexmt" },
{ "tx_one_rexmt" },
{ "tx_many_rexmt" },
Expand Down Expand Up @@ -637,7 +637,7 @@ static const struct nv_ethtool_str nv_estats_str[] = {
/* version 2 stats */
{ "tx_deferral" },
{ "tx_packets" },
{ "rx_bytes" },
{ "rx_bytes" }, /* includes Ethernet FCS CRC */
{ "tx_pause" },
{ "rx_pause" },
{ "rx_drop_frame" },
Expand All @@ -649,7 +649,7 @@ static const struct nv_ethtool_str nv_estats_str[] = {
};

struct nv_ethtool_stats {
u64 tx_bytes;
u64 tx_bytes; /* should be ifconfig->tx_bytes + 4*tx_packets */
u64 tx_zero_rexmt;
u64 tx_one_rexmt;
u64 tx_many_rexmt;
Expand All @@ -670,14 +670,14 @@ struct nv_ethtool_stats {
u64 rx_unicast;
u64 rx_multicast;
u64 rx_broadcast;
u64 rx_packets;
u64 rx_packets; /* should be ifconfig->rx_packets */
u64 rx_errors_total;
u64 tx_errors_total;

/* version 2 stats */
u64 tx_deferral;
u64 tx_packets;
u64 rx_bytes;
u64 tx_packets; /* should be ifconfig->tx_packets */
u64 rx_bytes; /* should be ifconfig->rx_bytes + 4*rx_packets */
u64 tx_pause;
u64 rx_pause;
u64 rx_drop_frame;
Expand Down Expand Up @@ -1706,10 +1706,17 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_STATISTICS_V3)) {
nv_get_hw_stats(dev);

/*
* Note: because HW stats are not always available and
* for consistency reasons, the following ifconfig
* stats are managed by software: rx_bytes, tx_bytes,
* rx_packets and tx_packets. The related hardware
* stats reported by ethtool should be equivalent to
* these ifconfig stats, with 4 additional bytes per
* packet (Ethernet FCS CRC).
*/

/* copy to net_device stats */
dev->stats.tx_packets = np->estats.tx_packets;
dev->stats.rx_bytes = np->estats.rx_bytes;
dev->stats.tx_bytes = np->estats.tx_bytes;
dev->stats.tx_fifo_errors = np->estats.tx_fifo_errors;
dev->stats.tx_carrier_errors = np->estats.tx_carrier_errors;
dev->stats.rx_crc_errors = np->estats.rx_crc_errors;
Expand Down Expand Up @@ -2380,6 +2387,9 @@ static int nv_tx_done(struct net_device *dev, int limit)
if (flags & NV_TX_ERROR) {
if ((flags & NV_TX_RETRYERROR) && !(flags & NV_TX_RETRYCOUNT_MASK))
nv_legacybackoff_reseed(dev);
} else {
dev->stats.tx_packets++;
dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
}
dev_kfree_skb_any(np->get_tx_ctx->skb);
np->get_tx_ctx->skb = NULL;
Expand All @@ -2390,6 +2400,9 @@ static int nv_tx_done(struct net_device *dev, int limit)
if (flags & NV_TX2_ERROR) {
if ((flags & NV_TX2_RETRYERROR) && !(flags & NV_TX2_RETRYCOUNT_MASK))
nv_legacybackoff_reseed(dev);
} else {
dev->stats.tx_packets++;
dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
}
dev_kfree_skb_any(np->get_tx_ctx->skb);
np->get_tx_ctx->skb = NULL;
Expand Down Expand Up @@ -2429,6 +2442,9 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
else
nv_legacybackoff_reseed(dev);
}
} else {
dev->stats.tx_packets++;
dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
}

dev_kfree_skb_any(np->get_tx_ctx->skb);
Expand Down Expand Up @@ -2678,6 +2694,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
skb->protocol = eth_type_trans(skb, dev);
napi_gro_receive(&np->napi, skb);
dev->stats.rx_packets++;
dev->stats.rx_bytes += len;
next_pkt:
if (unlikely(np->get_rx.orig++ == np->last_rx.orig))
np->get_rx.orig = np->first_rx.orig;
Expand Down Expand Up @@ -2761,6 +2778,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
}
napi_gro_receive(&np->napi, skb);
dev->stats.rx_packets++;
dev->stats.rx_bytes += len;
} else {
dev_kfree_skb(skb);
}
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/net/ethernet/smsc/smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,7 @@ static int __devinit smsc911x_init(struct net_device *dev)
{
struct smsc911x_data *pdata = netdev_priv(dev);
unsigned int byte_test;
unsigned int to = 100;

SMSC_TRACE(pdata, probe, "Driver Parameters:");
SMSC_TRACE(pdata, probe, "LAN base: 0x%08lX",
Expand All @@ -1952,6 +1953,17 @@ static int __devinit smsc911x_init(struct net_device *dev)
return -ENODEV;
}

/*
* poll the READY bit in PMT_CTRL. Any other access to the device is
* forbidden while this bit isn't set. Try for 100ms
*/
while (!(smsc911x_reg_read(pdata, PMT_CTRL) & PMT_CTRL_READY_) && --to)
udelay(1000);
if (to == 0) {
pr_err("Device not READY in 100ms aborting\n");
return -ENODEV;
}

/* Check byte ordering */
byte_test = smsc911x_reg_read(pdata, BYTE_TEST);
SMSC_TRACE(pdata, probe, "BYTE_TEST: 0x%08X", byte_test);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/usb/cdc_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static const struct usb_device_id products [] = {
{
USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&wwan_info,
.driver_info = 0,
},

/*
Expand Down
25 changes: 11 additions & 14 deletions trunk/drivers/net/usb/lg-vl600.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
}

frame = (struct vl600_frame_hdr *) buf->data;
/* NOTE: Should check that frame->magic == 0x53544448?
* Otherwise if we receive garbage at the beginning of the frame
* we may end up allocating a huge buffer and saving all the
* future incoming data into it. */
/* Yes, check that frame->magic == 0x53544448 (or 0x44544d48),
* otherwise we may run out of memory w/a bad packet */
if (ntohl(frame->magic) != 0x53544448 &&
ntohl(frame->magic) != 0x44544d48)
goto error;

if (buf->len < sizeof(*frame) ||
buf->len != le32_to_cpup(&frame->len)) {
Expand Down Expand Up @@ -296,6 +297,11 @@ static struct sk_buff *vl600_tx_fixup(struct usbnet *dev,
* overwrite the remaining fields.
*/
packet = (struct vl600_pkt_hdr *) skb->data;
/* The VL600 wants IPv6 packets to have an IPv4 ethertype
* Since this modem only supports IPv4 and IPv6, just set all
* frames to 0x0800 (ETH_P_IP)
*/
packet->h_proto = htons(ETH_P_IP);
memset(&packet->dummy, 0, sizeof(packet->dummy));
packet->len = cpu_to_le32(orig_len);

Expand All @@ -308,21 +314,12 @@ static struct sk_buff *vl600_tx_fixup(struct usbnet *dev,
if (skb->len < full_len) /* Pad */
skb_put(skb, full_len - skb->len);

/* The VL600 wants IPv6 packets to have an IPv4 ethertype
* Check if this is an IPv6 packet, and set the ethertype
* to 0x800
*/
if ((skb->data[sizeof(struct vl600_pkt_hdr *) + 0x22] & 0xf0) == 0x60) {
skb->data[sizeof(struct vl600_pkt_hdr *) + 0x20] = 0x08;
skb->data[sizeof(struct vl600_pkt_hdr *) + 0x21] = 0;
}

return skb;
}

static const struct driver_info vl600_info = {
.description = "LG VL600 modem",
.flags = FLAG_ETHER | FLAG_RX_ASSEMBLE,
.flags = FLAG_RX_ASSEMBLE | FLAG_WWAN,
.bind = vl600_bind,
.unbind = vl600_unbind,
.status = usbnet_cdc_status,
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/inet_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ enum {
INET_DIAG_VEGASINFO,
INET_DIAG_CONG,
INET_DIAG_TOS,
INET_DIAG_TCLASS,
};

#define INET_DIAG_MAX INET_DIAG_TOS
#define INET_DIAG_MAX INET_DIAG_TCLASS


/* INET_DIAG_MEM */
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
int err = 0;
struct net_bridge_mdb_htable *mdb;

spin_lock(&br->multicast_lock);
spin_lock_bh(&br->multicast_lock);
if (br->multicast_disabled == !val)
goto unlock;

Expand Down Expand Up @@ -1806,7 +1806,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
}

unlock:
spin_unlock(&br->multicast_lock);
spin_unlock_bh(&br->multicast_lock);

return err;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/ipv4/ah4.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
if (err == -EINPROGRESS)
goto out;

if (err == -EBUSY)
err = NET_XMIT_DROP;
goto out_free;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ static int inet_csk_diag_fill(struct sock *sk,
&np->rcv_saddr);
ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
&np->daddr);
if (ext & (1 << (INET_DIAG_TOS - 1)))
RTA_PUT_U8(skb, INET_DIAG_TOS, np->tclass);
if (ext & (1 << (INET_DIAG_TCLASS - 1)))
RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass);
}
#endif

Expand Down
2 changes: 0 additions & 2 deletions trunk/net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,6 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
if (err == -EINPROGRESS)
goto out;

if (err == -EBUSY)
err = NET_XMIT_DROP;
goto out_free;
}

Expand Down
8 changes: 7 additions & 1 deletion trunk/net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
if ((err = register_netdevice(dev)) < 0)
goto failed_free;

strcpy(t->parms.name, dev->name);

dev_hold(dev);
ip6_tnl_link(ip6n, t);
return t;
Expand Down Expand Up @@ -1407,7 +1409,6 @@ ip6_tnl_dev_init_gen(struct net_device *dev)
struct ip6_tnl *t = netdev_priv(dev);

t->dev = dev;
strcpy(t->parms.name, dev->name);
dev->tstats = alloc_percpu(struct pcpu_tstats);
if (!dev->tstats)
return -ENOMEM;
Expand Down Expand Up @@ -1487,6 +1488,7 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n)
static int __net_init ip6_tnl_init_net(struct net *net)
{
struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
struct ip6_tnl *t = NULL;
int err;

ip6n->tnls[0] = ip6n->tnls_wc;
Expand All @@ -1507,6 +1509,10 @@ static int __net_init ip6_tnl_init_net(struct net *net)
err = register_netdev(ip6n->fb_tnl_dev);
if (err < 0)
goto err_register;

t = netdev_priv(ip6n->fb_tnl_dev);

strcpy(t->parms.name, ip6n->fb_tnl_dev->name);
return 0;

err_register:
Expand Down
6 changes: 2 additions & 4 deletions trunk/net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,11 @@ static void prb_init_blk_timer(struct packet_sock *po,

static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring)
{
struct tpacket_kbdq_core *pkc;

if (tx_ring)
BUG();

pkc = tx_ring ? &po->tx_ring.prb_bdqc : &po->rx_ring.prb_bdqc;
prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired);
prb_init_blk_timer(po, &po->rx_ring.prb_bdqc,
prb_retire_rx_blk_timer_expired);
}

static int prb_calc_retire_blk_tmo(struct packet_sock *po,
Expand Down
1 change: 0 additions & 1 deletion trunk/net/rds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ config RDS

config RDS_RDMA
tristate "RDS over Infiniband and iWARP"
select LLIST
depends on RDS && INFINIBAND && INFINIBAND_ADDR_TRANS
---help---
Allow RDS to use Infiniband and iWARP as a transport.
Expand Down

0 comments on commit d381181

Please sign in to comment.