Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: Require CAP_NET_ADMIN to create tuntap devices.
  [NET]: fix net-core kernel-doc
  [TCP]: Move inclusion of <linux/dmaengine.h> to correct place in <linux/tcp.h>
  [IPSEC]: Handle GSO packets
  [NET]: Added GSO toggle
  [NET]: Add software TSOv4
  [NET]: Add generic segmentation offload
  [NET]: Merge TSO/UFO fields in sk_buff
  [NET]: Prevent transmission after dev_deactivate
  [IPV6] ADDRCONF: Fix default source address selection without CONFIG_IPV6_PRIVACY
  [IPV6]: Fix source address selection.
  [NET]: Avoid allocating skb in skb_pad
  • Loading branch information
Linus Torvalds committed Jun 23, 2006
2 parents 3722447 + ca6bb5d commit 199f4c9
Show file tree
Hide file tree
Showing 73 changed files with 746 additions and 232 deletions.
11 changes: 7 additions & 4 deletions Documentation/networking/tuntap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ Copyright (C) 1999-2000 Maxim Krasnyansky <[email protected]>
mknod /dev/net/tun c 10 200

Set permissions:
e.g. chmod 0700 /dev/net/tun
if you want the device only accessible by root. Giving regular users the
right to assign network devices is NOT a good idea. Users could assign
bogus network interfaces to trick firewalls or administrators.
e.g. chmod 0666 /dev/net/tun
There's no harm in allowing the device to be accessible by non-root users,
since CAP_NET_ADMIN is required for creating network devices or for
connecting to network devices which aren't owned by the user in question.
If you want to create persistent devices and give ownership of them to
unprivileged users, then you need the /dev/net/tun device to be usable by
those users.

Driver module autoloading

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/3c527.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
return 1;
}

skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL) {
if (skb_padto(skb, ETH_ZLEN)) {
netif_wake_queue(dev);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
entry = cp->tx_head;
eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0;
if (dev->features & NETIF_F_TSO)
mss = skb_shinfo(skb)->tso_size;
mss = skb_shinfo(skb)->gso_size;

if (skb_shinfo(skb)->nr_frags == 0) {
struct cp_desc *txd = &cp->tx_ring[entry];
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/82596.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb->len, (unsigned int)skb->data));

if (skb->len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/a2065.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)

if (len < ETH_ZLEN) {
len = ETH_ZLEN;
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ariadne.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* FIXME: is the 79C960 new enough to do its own padding right ? */
if (skb->len < ETH_ZLEN)
{
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
len = ETH_ZLEN;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/arm/ether1.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,7 @@ ether1_sendpacket (struct sk_buff *skb, struct net_device *dev)
}

if (skb->len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
goto out;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/arm/ether3.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,7 @@ ether3_sendpacket(struct sk_buff *skb, struct net_device *dev)

length = (length + 1) & ~1;
if (length != skb->len) {
skb = skb_padto(skb, length);
if (skb == NULL)
if (skb_padto(skb, length))
goto out;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/atarilance.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
++len;

if (len > skb->len) {
skb = skb_padto(skb, len);
if (skb == NULL)
if (skb_padto(skb, len))
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ bnx2_tx_int(struct bnx2 *bp)
skb = tx_buf->skb;
#ifdef BCM_TSO
/* partial BD completions possible with TSO packets */
if (skb_shinfo(skb)->tso_size) {
if (skb_shinfo(skb)->gso_size) {
u16 last_idx, last_ring_idx;

last_idx = sw_cons +
Expand Down Expand Up @@ -4428,7 +4428,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
(TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16));
}
#ifdef BCM_TSO
if ((mss = skb_shinfo(skb)->tso_size) &&
if ((mss = skb_shinfo(skb)->gso_size) &&
(skb->len > (bp->dev->mtu + ETH_HLEN))) {
u32 tcp_opt_len, ip_tcp_len;

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -2915,8 +2915,7 @@ static int cas_start_xmit(struct sk_buff *skb, struct net_device *dev)
*/
static int ring;

skb = skb_padto(skb, cp->min_frame_size);
if (!skb)
if (skb_padto(skb, cp->min_frame_size))
return 0;

/* XXX: we need some higher-level QoS hooks to steer packets to
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/chelsio/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct cpl_tx_pkt *cpl;

#ifdef NETIF_F_TSO
if (skb_shinfo(skb)->tso_size) {
if (skb_shinfo(skb)->gso_size) {
int eth_type;
struct cpl_tx_pkt_lso *hdr;

Expand All @@ -1433,7 +1433,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
hdr->ip_hdr_words = skb->nh.iph->ihl;
hdr->tcp_hdr_words = skb->h.th->doff;
hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type,
skb_shinfo(skb)->tso_size));
skb_shinfo(skb)->gso_size));
hdr->len = htonl(skb->len - sizeof(*hdr));
cpl = (struct cpl_tx_pkt *)hdr;
sge->stats.tx_lso_pkts++;
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/declance.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
len = skblen;

if (len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
len = ETH_ZLEN;
}
Expand Down
7 changes: 2 additions & 5 deletions drivers/net/depca.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,8 @@ static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->len < 1)
goto out;

if (skb->len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
goto out;
}
if (skb_padto(skb, ETH_ZLEN))
goto out;

netif_stop_queue(dev);

Expand Down
10 changes: 5 additions & 5 deletions drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2394,15 +2394,15 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
int err;

if (skb_shinfo(skb)->tso_size) {
if (skb_shinfo(skb)->gso_size) {
if (skb_header_cloned(skb)) {
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (err)
return err;
}

hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
mss = skb_shinfo(skb)->tso_size;
mss = skb_shinfo(skb)->gso_size;
if (skb->protocol == htons(ETH_P_IP)) {
skb->nh.iph->tot_len = 0;
skb->nh.iph->check = 0;
Expand Down Expand Up @@ -2519,7 +2519,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
* tso gets written back prematurely before the data is fully
* DMA'd to the controller */
if (!skb->data_len && tx_ring->last_tx_tso &&
!skb_shinfo(skb)->tso_size) {
!skb_shinfo(skb)->gso_size) {
tx_ring->last_tx_tso = 0;
size -= 4;
}
Expand Down Expand Up @@ -2757,7 +2757,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}

#ifdef NETIF_F_TSO
mss = skb_shinfo(skb)->tso_size;
mss = skb_shinfo(skb)->gso_size;
/* The controller does a simple calculation to
* make sure there is enough room in the FIFO before
* initiating the DMA for each buffer. The calc is:
Expand Down Expand Up @@ -2807,7 +2807,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
#ifdef NETIF_F_TSO
/* Controller Erratum workaround */
if (!skb->data_len && tx_ring->last_tx_tso &&
!skb_shinfo(skb)->tso_size)
!skb_shinfo(skb)->gso_size)
count++;
#endif

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/eepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,7 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
printk(KERN_DEBUG "%s: entering eepro_send_packet routine.\n", dev->name);

if (length < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/eexpress.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,7 @@ static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
#endif

if (buf->len < ETH_ZLEN) {
buf = skb_padto(buf, ETH_ZLEN);
if (buf == NULL)
if (skb_padto(buf, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
7 changes: 2 additions & 5 deletions drivers/net/epic100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,11 +1027,8 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
u32 ctrl_word;
unsigned long flags;

if (skb->len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
return 0;
}
if (skb_padto(skb, ETH_ZLEN))
return 0;

/* Caution: the write order is important here, set the field with the
"ownership" bit last. */
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/eth16i.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,7 @@ static int eth16i_tx(struct sk_buff *skb, struct net_device *dev)
unsigned long flags;

if (length < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1495,8 +1495,8 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
np->tx_skbuff[nr] = skb;

#ifdef NETIF_F_TSO
if (skb_shinfo(skb)->tso_size)
tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->tso_size << NV_TX2_TSO_SHIFT);
if (skb_shinfo(skb)->gso_size)
tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT);
else
#endif
tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0);
Expand Down
7 changes: 2 additions & 5 deletions drivers/net/hp100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,11 +1487,8 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
if (skb->len <= 0)
return 0;

if (skb->len < ETH_ZLEN && lp->chip == HP100_CHIPID_SHASTA) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
return 0;
}
if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN))
return 0;

/* Get Tx ring tail pointer */
if (lp->txrtail->next == lp->txrhead) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ixgb/ixgb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,15 +1173,15 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
uint16_t ipcse, tucse, mss;
int err;

if(likely(skb_shinfo(skb)->tso_size)) {
if(likely(skb_shinfo(skb)->gso_size)) {
if (skb_header_cloned(skb)) {
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (err)
return err;
}

hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
mss = skb_shinfo(skb)->tso_size;
mss = skb_shinfo(skb)->gso_size;
skb->nh.iph->tot_len = 0;
skb->nh.iph->check = 0;
skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr,
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/lance.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* The old LANCE chips doesn't automatically pad buffers to min. size. */
if (chip_table[lp->chip_version].flags & LANCE_MUST_PAD) {
if (skb->len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
goto out;
lp->tx_ring[entry].length = -ETH_ZLEN;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/lasi_82596.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb->len, skb->data));

if (length < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
struct iphdr *iph = skb->nh.iph;
struct tcphdr *th = (struct tcphdr*)(skb->nh.raw + (iph->ihl * 4));
unsigned int doffset = (iph->ihl + th->doff) * 4;
unsigned int mtu = skb_shinfo(skb)->tso_size + doffset;
unsigned int mtu = skb_shinfo(skb)->gso_size + doffset;
unsigned int offset = 0;
u32 seq = ntohl(th->seq);
u16 id = ntohs(iph->id);
Expand Down Expand Up @@ -139,7 +139,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
#endif

#ifdef LOOPBACK_TSO
if (skb_shinfo(skb)->tso_size) {
if (skb_shinfo(skb)->gso_size) {
BUG_ON(skb->protocol != htons(ETH_P_IP));
BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP);

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/lp486e.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,7 @@ static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) {
length = skb->len;

if (length < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev)

#ifdef NETIF_F_TSO
if (skb->len > (dev->mtu + ETH_HLEN)) {
mss = skb_shinfo(skb)->tso_size;
mss = skb_shinfo(skb)->gso_size;
if (mss != 0)
max_segments = MYRI10GE_MAX_SEND_DESC_TSO;
}
Expand Down Expand Up @@ -1939,8 +1939,7 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev)

/* pad frames to at least ETH_ZLEN bytes */
if (unlikely(skb->len < ETH_ZLEN)) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL) {
if (skb_padto(skb, ETH_ZLEN)) {
/* The packet is gone, so we must
* return 0 */
mgp->stats.tx_dropped += 1;
Expand Down Expand Up @@ -2113,7 +2112,7 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev)
}
idx = (idx + 1) & tx->mask;
} while (idx != last_idx);
if (skb_shinfo(skb)->tso_size) {
if (skb_shinfo(skb)->gso_size) {
printk(KERN_ERR
"myri10ge: %s: TSO but wanted to linearize?!?!?\n",
mgp->dev->name);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/pcmcia/fmvj18x_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,7 @@ static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev)

if (length < ETH_ZLEN)
{
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/pcmcia/xirc2ps_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,8 +1374,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
*/
if (pktlen < ETH_ZLEN)
{
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
if (skb_padto(skb, ETH_ZLEN))
return 0;
pktlen = ETH_ZLEN;
}
Expand Down
Loading

0 comments on commit 199f4c9

Please sign in to comment.