Browse Source

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
	drivers/net/sfc/net_driver.h
	drivers/net/sfc/siena.c
David S. Miller 15 năm trước cách đây
mục cha
commit
eedc765ca4
49 tập tin đã thay đổi với 323 bổ sung270 xóa
  1. 3 3
      drivers/isdn/capi/kcapi.c
  2. 2 2
      drivers/isdn/hardware/mISDN/netjet.c
  3. 1 1
      drivers/net/benet/be_cmds.c
  4. 13 1
      drivers/net/bnx2.c
  5. 5 5
      drivers/net/can/mscan/mpc5xxx_can.c
  6. 1 1
      drivers/net/e1000e/netdev.c
  7. 7 0
      drivers/net/enic/enic.h
  8. 97 103
      drivers/net/enic/enic_main.c
  9. 4 3
      drivers/net/epic100.c
  10. 8 8
      drivers/net/fec.c
  11. 5 6
      drivers/net/greth.c
  12. 2 0
      drivers/net/ixgbe/ixgbe_common.c
  13. 1 1
      drivers/net/ixgbe/ixgbe_main.c
  14. 1 0
      drivers/net/ixgbe/ixgbe_type.h
  15. 15 17
      drivers/net/korina.c
  16. 2 1
      drivers/net/ksz884x.c
  17. 1 1
      drivers/net/ppp_generic.c
  18. 5 0
      drivers/net/r8169.c
  19. 1 1
      drivers/net/sfc/net_driver.h
  20. 1 1
      drivers/net/sfc/siena.c
  21. 2 2
      drivers/net/tehuti.c
  22. 4 4
      drivers/net/virtio_net.c
  23. 0 2
      drivers/net/wan/x25_asy.c
  24. 3 14
      drivers/net/wireless/ath/ath5k/base.c
  25. 1 1
      include/linux/netfilter/x_tables.h
  26. 3 3
      include/net/dst.h
  27. 1 14
      include/net/sock.h
  28. 2 1
      net/8021q/vlan_dev.c
  29. 4 4
      net/core/dev.c
  30. 28 2
      net/core/skbuff.c
  31. 5 5
      net/ipv4/Kconfig
  32. 1 1
      net/ipv4/netfilter/ip_tables.c
  33. 1 1
      net/ipv4/syncookies.c
  34. 2 2
      net/ipv4/tcp_hybla.c
  35. 2 2
      net/ipv4/tcp_input.c
  36. 4 3
      net/ipv4/tcp_ipv4.c
  37. 2 4
      net/ipv4/udp.c
  38. 1 1
      net/ipv6/ip6mr.c
  39. 4 1
      net/ipv6/mcast.c
  40. 1 1
      net/ipv6/netfilter/ip6_tables.c
  41. 2 4
      net/ipv6/udp.c
  42. 4 2
      net/mac80211/agg-tx.c
  43. 11 2
      net/mac80211/rx.c
  44. 3 14
      net/netfilter/x_tables.c
  45. 4 0
      net/sched/act_nat.c
  46. 14 10
      net/sched/act_pedit.c
  47. 36 13
      net/sched/cls_u32.c
  48. 2 2
      net/xfrm/xfrm_output.c
  49. 1 0
      net/xfrm/xfrm_policy.c

+ 3 - 3
drivers/isdn/capi/kcapi.c

@@ -1020,12 +1020,12 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
 		if (cmd == AVMB1_ADDCARD) {
 		if (cmd == AVMB1_ADDCARD) {
 		   if ((retval = copy_from_user(&cdef, data,
 		   if ((retval = copy_from_user(&cdef, data,
 					    sizeof(avmb1_carddef))))
 					    sizeof(avmb1_carddef))))
-			   return retval;
+			   return -EFAULT;
 		   cdef.cardtype = AVM_CARDTYPE_B1;
 		   cdef.cardtype = AVM_CARDTYPE_B1;
 		} else {
 		} else {
 		   if ((retval = copy_from_user(&cdef, data,
 		   if ((retval = copy_from_user(&cdef, data,
 					    sizeof(avmb1_extcarddef))))
 					    sizeof(avmb1_extcarddef))))
-			   return retval;
+			   return -EFAULT;
 		}
 		}
 		cparams.port = cdef.port;
 		cparams.port = cdef.port;
 		cparams.irq = cdef.irq;
 		cparams.irq = cdef.irq;
@@ -1218,7 +1218,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
 		kcapi_carddef cdef;
 		kcapi_carddef cdef;
 
 
 		if ((retval = copy_from_user(&cdef, data, sizeof(cdef))))
 		if ((retval = copy_from_user(&cdef, data, sizeof(cdef))))
-			return retval;
+			return -EFAULT;
 
 
 		cparams.port = cdef.port;
 		cparams.port = cdef.port;
 		cparams.irq = cdef.irq;
 		cparams.irq = cdef.irq;

+ 2 - 2
drivers/isdn/hardware/mISDN/netjet.c

@@ -320,12 +320,12 @@ inittiger(struct tiger_hw *card)
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 	for (i = 0; i < 2; i++) {
 	for (i = 0; i < 2; i++) {
-		card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_KERNEL);
+		card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_ATOMIC);
 		if (!card->bc[i].hsbuf) {
 		if (!card->bc[i].hsbuf) {
 			pr_info("%s: no B%d send buffer\n", card->name, i + 1);
 			pr_info("%s: no B%d send buffer\n", card->name, i + 1);
 			return -ENOMEM;
 			return -ENOMEM;
 		}
 		}
-		card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_KERNEL);
+		card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_ATOMIC);
 		if (!card->bc[i].hrbuf) {
 		if (!card->bc[i].hrbuf) {
 			pr_info("%s: no B%d recv buffer\n", card->name, i + 1);
 			pr_info("%s: no B%d recv buffer\n", card->name, i + 1);
 			return -ENOMEM;
 			return -ENOMEM;

+ 1 - 1
drivers/net/benet/be_cmds.c

@@ -1592,7 +1592,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
 
 
 	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL,
 	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL,
 			OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req));
 			OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req));
-	req->hdr.timeout = 4;
+	req->hdr.timeout = cpu_to_le32(4);
 
 
 	req->pattern = cpu_to_le64(pattern);
 	req->pattern = cpu_to_le64(pattern);
 	req->src_port = cpu_to_le32(port_num);
 	req->src_port = cpu_to_le32(port_num);

+ 13 - 1
drivers/net/bnx2.c

@@ -247,6 +247,7 @@ static const struct flash_spec flash_5709 = {
 MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);
 MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);
 
 
 static void bnx2_init_napi(struct bnx2 *bp);
 static void bnx2_init_napi(struct bnx2 *bp);
+static void bnx2_del_napi(struct bnx2 *bp);
 
 
 static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)
 static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)
 {
 {
@@ -6270,6 +6271,7 @@ open_err:
 	bnx2_free_skbs(bp);
 	bnx2_free_skbs(bp);
 	bnx2_free_irq(bp);
 	bnx2_free_irq(bp);
 	bnx2_free_mem(bp);
 	bnx2_free_mem(bp);
+	bnx2_del_napi(bp);
 	return rc;
 	return rc;
 }
 }
 
 
@@ -6537,6 +6539,7 @@ bnx2_close(struct net_device *dev)
 	bnx2_free_irq(bp);
 	bnx2_free_irq(bp);
 	bnx2_free_skbs(bp);
 	bnx2_free_skbs(bp);
 	bnx2_free_mem(bp);
 	bnx2_free_mem(bp);
+	bnx2_del_napi(bp);
 	bp->link_up = 0;
 	bp->link_up = 0;
 	netif_carrier_off(bp->dev);
 	netif_carrier_off(bp->dev);
 	bnx2_set_power_state(bp, PCI_D3hot);
 	bnx2_set_power_state(bp, PCI_D3hot);
@@ -8227,7 +8230,16 @@ bnx2_bus_string(struct bnx2 *bp, char *str)
 	return str;
 	return str;
 }
 }
 
 
-static void __devinit
+static void
+bnx2_del_napi(struct bnx2 *bp)
+{
+	int i;
+
+	for (i = 0; i < bp->irq_nvecs; i++)
+		netif_napi_del(&bp->bnx2_napi[i].napi);
+}
+
+static void
 bnx2_init_napi(struct bnx2 *bp)
 bnx2_init_napi(struct bnx2 *bp)
 {
 {
 	int i;
 	int i;

+ 5 - 5
drivers/net/can/mscan/mpc5xxx_can.c

@@ -73,7 +73,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev,
 	else
 	else
 		*mscan_clksrc = MSCAN_CLKSRC_XTAL;
 		*mscan_clksrc = MSCAN_CLKSRC_XTAL;
 
 
-	freq = mpc5xxx_get_bus_frequency(ofdev->node);
+	freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
 	if (!freq)
 	if (!freq)
 		return 0;
 		return 0;
 
 
@@ -152,7 +152,7 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev,
 	}
 	}
 
 
 	/* Determine the MSCAN device index from the physical address */
 	/* Determine the MSCAN device index from the physical address */
-	pval = of_get_property(ofdev->node, "reg", &plen);
+	pval = of_get_property(ofdev->dev.of_node, "reg", &plen);
 	BUG_ON(!pval || plen < sizeof(*pval));
 	BUG_ON(!pval || plen < sizeof(*pval));
 	clockidx = (*pval & 0x80) ? 1 : 0;
 	clockidx = (*pval & 0x80) ? 1 : 0;
 	if (*pval & 0x2000)
 	if (*pval & 0x2000)
@@ -168,11 +168,11 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev,
 	 */
 	 */
 	if (clock_name && !strcmp(clock_name, "ip")) {
 	if (clock_name && !strcmp(clock_name, "ip")) {
 		*mscan_clksrc = MSCAN_CLKSRC_IPS;
 		*mscan_clksrc = MSCAN_CLKSRC_IPS;
-		freq = mpc5xxx_get_bus_frequency(ofdev->node);
+		freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
 	} else {
 	} else {
 		*mscan_clksrc = MSCAN_CLKSRC_BUS;
 		*mscan_clksrc = MSCAN_CLKSRC_BUS;
 
 
-		pval = of_get_property(ofdev->node,
+		pval = of_get_property(ofdev->dev.of_node,
 				       "fsl,mscan-clock-divider", &plen);
 				       "fsl,mscan-clock-divider", &plen);
 		if (pval && plen == sizeof(*pval))
 		if (pval && plen == sizeof(*pval))
 			clockdiv = *pval;
 			clockdiv = *pval;
@@ -251,7 +251,7 @@ static int __devinit mpc5xxx_can_probe(struct of_device *ofdev,
 				       const struct of_device_id *id)
 				       const struct of_device_id *id)
 {
 {
 	struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
 	struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
-	struct device_node *np = ofdev->node;
+	struct device_node *np = ofdev->dev.of_node;
 	struct net_device *dev;
 	struct net_device *dev;
 	struct mscan_priv *priv;
 	struct mscan_priv *priv;
 	void __iomem *base;
 	void __iomem *base;

+ 1 - 1
drivers/net/e1000e/netdev.c

@@ -2554,7 +2554,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
 			mdef = er32(MDEF(i));
 			mdef = er32(MDEF(i));
 
 
 			/* Ignore filters with anything other than IPMI ports */
 			/* Ignore filters with anything other than IPMI ports */
-			if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
+			if (mdef & ~(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
 				continue;
 				continue;
 
 
 			/* Enable this decision filter in MANC2H */
 			/* Enable this decision filter in MANC2H */

+ 7 - 0
drivers/net/enic/enic.h

@@ -74,7 +74,14 @@ struct enic_msix_entry {
 	void *devid;
 	void *devid;
 };
 };
 
 
+#define ENIC_SET_APPLIED		(1 << 0)
+#define ENIC_SET_REQUEST		(1 << 1)
+#define ENIC_SET_NAME			(1 << 2)
+#define ENIC_SET_INSTANCE		(1 << 3)
+#define ENIC_SET_HOST			(1 << 4)
+
 struct enic_port_profile {
 struct enic_port_profile {
+	u32 set;
 	u8 request;
 	u8 request;
 	char name[PORT_PROFILE_MAX];
 	char name[PORT_PROFILE_MAX];
 	u8 instance_uuid[PORT_UUID_MAX];
 	u8 instance_uuid[PORT_UUID_MAX];

+ 97 - 103
drivers/net/enic/enic_main.c

@@ -1029,8 +1029,7 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error)
 	return err;
 	return err;
 }
 }
 
 
-static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
-	char *name, u8 *instance_uuid, u8 *host_uuid)
+static int enic_set_port_profile(struct enic *enic, u8 *mac)
 {
 {
 	struct vic_provinfo *vp;
 	struct vic_provinfo *vp;
 	u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
 	u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
@@ -1040,97 +1039,112 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
 		"%02X%02X-%02X%02X%02X%02X%0X%02X";
 		"%02X%02X-%02X%02X%02X%02X%0X%02X";
 	int err;
 	int err;
 
 
-	if (!name)
-		return -EINVAL;
+	err = enic_vnic_dev_deinit(enic);
+	if (err)
+		return err;
 
 
-	if (!is_valid_ether_addr(mac))
-		return -EADDRNOTAVAIL;
+	switch (enic->pp.request) {
 
 
-	vp = vic_provinfo_alloc(GFP_KERNEL, oui, VIC_PROVINFO_LINUX_TYPE);
-	if (!vp)
-		return -ENOMEM;
+	case PORT_REQUEST_ASSOCIATE:
 
 
-	vic_provinfo_add_tlv(vp,
-		VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
-		strlen(name) + 1, name);
-
-	vic_provinfo_add_tlv(vp,
-		VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
-		ETH_ALEN, mac);
-
-	if (instance_uuid) {
-		uuid = instance_uuid;
-		sprintf(uuid_str, uuid_fmt,
-			uuid[0],  uuid[1],  uuid[2],  uuid[3],
-			uuid[4],  uuid[5],  uuid[6],  uuid[7],
-			uuid[8],  uuid[9],  uuid[10], uuid[11],
-			uuid[12], uuid[13], uuid[14], uuid[15]);
-		vic_provinfo_add_tlv(vp,
-			VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
-			sizeof(uuid_str), uuid_str);
-	}
+		if (!(enic->pp.set & ENIC_SET_NAME) || !strlen(enic->pp.name))
+			return -EINVAL;
 
 
-	if (host_uuid) {
-		uuid = host_uuid;
-		sprintf(uuid_str, uuid_fmt,
-			uuid[0],  uuid[1],  uuid[2],  uuid[3],
-			uuid[4],  uuid[5],  uuid[6],  uuid[7],
-			uuid[8],  uuid[9],  uuid[10], uuid[11],
-			uuid[12], uuid[13], uuid[14], uuid[15]);
-		vic_provinfo_add_tlv(vp,
-			VIC_LINUX_PROV_TLV_HOST_UUID_STR,
-			sizeof(uuid_str), uuid_str);
-	}
+		if (!is_valid_ether_addr(mac))
+			return -EADDRNOTAVAIL;
 
 
-	err = enic_vnic_dev_deinit(enic);
-	if (err)
-		goto err_out;
+		vp = vic_provinfo_alloc(GFP_KERNEL, oui,
+			VIC_PROVINFO_LINUX_TYPE);
+		if (!vp)
+			return -ENOMEM;
 
 
-	memset(&enic->pp, 0, sizeof(enic->pp));
+		vic_provinfo_add_tlv(vp,
+			VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
+			strlen(enic->pp.name) + 1, enic->pp.name);
 
 
-	err = enic_dev_init_prov(enic, vp);
-	if (err)
-		goto err_out;
+		vic_provinfo_add_tlv(vp,
+			VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
+			ETH_ALEN, mac);
+
+		if (enic->pp.set & ENIC_SET_INSTANCE) {
+			uuid = enic->pp.instance_uuid;
+			sprintf(uuid_str, uuid_fmt,
+				uuid[0],  uuid[1],  uuid[2],  uuid[3],
+				uuid[4],  uuid[5],  uuid[6],  uuid[7],
+				uuid[8],  uuid[9],  uuid[10], uuid[11],
+				uuid[12], uuid[13], uuid[14], uuid[15]);
+			vic_provinfo_add_tlv(vp,
+				VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
+				sizeof(uuid_str), uuid_str);
+		}
 
 
-	enic->pp.request = request;
-	memcpy(enic->pp.name, name, PORT_PROFILE_MAX);
-	if (instance_uuid)
-		memcpy(enic->pp.instance_uuid,
-			instance_uuid, PORT_UUID_MAX);
-	if (host_uuid)
-		memcpy(enic->pp.host_uuid,
-			host_uuid, PORT_UUID_MAX);
+		if (enic->pp.set & ENIC_SET_HOST) {
+			uuid = enic->pp.host_uuid;
+			sprintf(uuid_str, uuid_fmt,
+				uuid[0],  uuid[1],  uuid[2],  uuid[3],
+				uuid[4],  uuid[5],  uuid[6],  uuid[7],
+				uuid[8],  uuid[9],  uuid[10], uuid[11],
+				uuid[12], uuid[13], uuid[14], uuid[15]);
+			vic_provinfo_add_tlv(vp,
+				VIC_LINUX_PROV_TLV_HOST_UUID_STR,
+				sizeof(uuid_str), uuid_str);
+		}
 
 
-err_out:
-	vic_provinfo_free(vp);
+		err = enic_dev_init_prov(enic, vp);
+		vic_provinfo_free(vp);
+		if (err)
+			return err;
+		break;
 
 
-	return err;
-}
+	case PORT_REQUEST_DISASSOCIATE:
+		break;
 
 
-static int enic_unset_port_profile(struct enic *enic)
-{
-	memset(&enic->pp, 0, sizeof(enic->pp));
-	return enic_vnic_dev_deinit(enic);
+	default:
+		return -EINVAL;
+	}
+
+	enic->pp.set |= ENIC_SET_APPLIED;
+	return 0;
 }
 }
 
 
 static int enic_set_vf_port(struct net_device *netdev, int vf,
 static int enic_set_vf_port(struct net_device *netdev, int vf,
 	struct nlattr *port[])
 	struct nlattr *port[])
 {
 {
 	struct enic *enic = netdev_priv(netdev);
 	struct enic *enic = netdev_priv(netdev);
-	char *name = NULL;
-	u8 *instance_uuid = NULL;
-	u8 *host_uuid = NULL;
-	u8 request = PORT_REQUEST_DISASSOCIATE;
+
+	memset(&enic->pp, 0, sizeof(enic->pp));
+
+	if (port[IFLA_PORT_REQUEST]) {
+		enic->pp.set |= ENIC_SET_REQUEST;
+		enic->pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
+	}
+
+	if (port[IFLA_PORT_PROFILE]) {
+		enic->pp.set |= ENIC_SET_NAME;
+		memcpy(enic->pp.name, nla_data(port[IFLA_PORT_PROFILE]),
+			PORT_PROFILE_MAX);
+	}
+
+	if (port[IFLA_PORT_INSTANCE_UUID]) {
+		enic->pp.set |= ENIC_SET_INSTANCE;
+		memcpy(enic->pp.instance_uuid,
+			nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX);
+	}
+
+	if (port[IFLA_PORT_HOST_UUID]) {
+		enic->pp.set |= ENIC_SET_HOST;
+		memcpy(enic->pp.host_uuid,
+			nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);
+	}
 
 
 	/* don't support VFs, yet */
 	/* don't support VFs, yet */
 	if (vf != PORT_SELF_VF)
 	if (vf != PORT_SELF_VF)
 		return -EOPNOTSUPP;
 		return -EOPNOTSUPP;
 
 
-	if (port[IFLA_PORT_REQUEST])
-		request = nla_get_u8(port[IFLA_PORT_REQUEST]);
+	if (!(enic->pp.set & ENIC_SET_REQUEST))
+		return -EOPNOTSUPP;
 
 
-	switch (request) {
-	case PORT_REQUEST_ASSOCIATE:
+	if (enic->pp.request == PORT_REQUEST_ASSOCIATE) {
 
 
 		/* If the interface mac addr hasn't been assigned,
 		/* If the interface mac addr hasn't been assigned,
 		 * assign a random mac addr before setting port-
 		 * assign a random mac addr before setting port-
@@ -1139,30 +1153,9 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
 
 
 		if (is_zero_ether_addr(netdev->dev_addr))
 		if (is_zero_ether_addr(netdev->dev_addr))
 			random_ether_addr(netdev->dev_addr);
 			random_ether_addr(netdev->dev_addr);
-
-		if (port[IFLA_PORT_PROFILE])
-			name = nla_data(port[IFLA_PORT_PROFILE]);
-
-		if (port[IFLA_PORT_INSTANCE_UUID])
-			instance_uuid =
-				nla_data(port[IFLA_PORT_INSTANCE_UUID]);
-
-		if (port[IFLA_PORT_HOST_UUID])
-			host_uuid = nla_data(port[IFLA_PORT_HOST_UUID]);
-
-		return enic_set_port_profile(enic, request,
-			netdev->dev_addr, name,
-			instance_uuid, host_uuid);
-
-	case PORT_REQUEST_DISASSOCIATE:
-
-		return enic_unset_port_profile(enic);
-
-	default:
-		break;
 	}
 	}
 
 
-	return -EOPNOTSUPP;
+	return enic_set_port_profile(enic, netdev->dev_addr);
 }
 }
 
 
 static int enic_get_vf_port(struct net_device *netdev, int vf,
 static int enic_get_vf_port(struct net_device *netdev, int vf,
@@ -1172,14 +1165,12 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
 	int err, error, done;
 	int err, error, done;
 	u16 response = PORT_PROFILE_RESPONSE_SUCCESS;
 	u16 response = PORT_PROFILE_RESPONSE_SUCCESS;
 
 
-	/* don't support VFs, yet */
-	if (vf != PORT_SELF_VF)
-		return -EOPNOTSUPP;
+	if (!(enic->pp.set & ENIC_SET_APPLIED))
+		return -ENODATA;
 
 
 	err = enic_dev_init_done(enic, &done, &error);
 	err = enic_dev_init_done(enic, &done, &error);
-
 	if (err)
 	if (err)
-		return err;
+		error = err;
 
 
 	switch (error) {
 	switch (error) {
 	case ERR_SUCCESS:
 	case ERR_SUCCESS:
@@ -1202,12 +1193,15 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
 
 
 	NLA_PUT_U16(skb, IFLA_PORT_REQUEST, enic->pp.request);
 	NLA_PUT_U16(skb, IFLA_PORT_REQUEST, enic->pp.request);
 	NLA_PUT_U16(skb, IFLA_PORT_RESPONSE, response);
 	NLA_PUT_U16(skb, IFLA_PORT_RESPONSE, response);
-	NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX,
-		enic->pp.name);
-	NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX,
-		enic->pp.instance_uuid);
-	NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX,
-		enic->pp.host_uuid);
+	if (enic->pp.set & ENIC_SET_NAME)
+		NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX,
+			enic->pp.name);
+	if (enic->pp.set & ENIC_SET_INSTANCE)
+		NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX,
+			enic->pp.instance_uuid);
+	if (enic->pp.set & ENIC_SET_HOST)
+		NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX,
+			enic->pp.host_uuid);
 
 
 	return 0;
 	return 0;
 
 

+ 4 - 3
drivers/net/epic100.c

@@ -87,6 +87,7 @@ static int rx_copybreak;
 #include <linux/bitops.h>
 #include <linux/bitops.h>
 #include <asm/io.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
+#include <asm/byteorder.h>
 
 
 /* These identify the driver base version and may not be removed. */
 /* These identify the driver base version and may not be removed. */
 static char version[] __devinitdata =
 static char version[] __devinitdata =
@@ -230,7 +231,7 @@ static const u16 media2miictl[16] = {
  * The EPIC100 Rx and Tx buffer descriptors.  Note that these
  * The EPIC100 Rx and Tx buffer descriptors.  Note that these
  * really ARE host-endian; it's not a misannotation.  We tell
  * really ARE host-endian; it's not a misannotation.  We tell
  * the card to byteswap them internally on big-endian hosts -
  * the card to byteswap them internally on big-endian hosts -
- * look for #ifdef CONFIG_BIG_ENDIAN in epic_open().
+ * look for #ifdef __BIG_ENDIAN in epic_open().
  */
  */
 
 
 struct epic_tx_desc {
 struct epic_tx_desc {
@@ -690,7 +691,7 @@ static int epic_open(struct net_device *dev)
 		outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
 		outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
 
 
 	/* Tell the chip to byteswap descriptors on big-endian hosts */
 	/* Tell the chip to byteswap descriptors on big-endian hosts */
-#ifdef CONFIG_BIG_ENDIAN
+#ifdef __BIG_ENDIAN
 	outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
 	outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
 	inl(ioaddr + GENCTL);
 	inl(ioaddr + GENCTL);
 	outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
 	outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
@@ -806,7 +807,7 @@ static void epic_restart(struct net_device *dev)
 	for (i = 16; i > 0; i--)
 	for (i = 16; i > 0; i--)
 		outl(0x0008, ioaddr + TEST1);
 		outl(0x0008, ioaddr + TEST1);
 
 
-#ifdef CONFIG_BIG_ENDIAN
+#ifdef __BIG_ENDIAN
 	outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
 	outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
 #else
 #else
 	outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
 	outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);

+ 8 - 8
drivers/net/fec.c

@@ -1369,10 +1369,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
 
 
 	if (ndev) {
 	if (ndev) {
 		fep = netdev_priv(ndev);
 		fep = netdev_priv(ndev);
-		if (netif_running(ndev)) {
-			netif_device_detach(ndev);
-			fec_stop(ndev);
-		}
+		if (netif_running(ndev))
+			fec_enet_close(ndev);
+		clk_disable(fep->clk);
 	}
 	}
 	return 0;
 	return 0;
 }
 }
@@ -1381,12 +1380,13 @@ static int
 fec_resume(struct platform_device *dev)
 fec_resume(struct platform_device *dev)
 {
 {
 	struct net_device *ndev = platform_get_drvdata(dev);
 	struct net_device *ndev = platform_get_drvdata(dev);
+	struct fec_enet_private *fep;
 
 
 	if (ndev) {
 	if (ndev) {
-		if (netif_running(ndev)) {
-			fec_enet_init(ndev, 0);
-			netif_device_attach(ndev);
-		}
+		fep = netdev_priv(ndev);
+		clk_enable(fep->clk);
+		if (netif_running(ndev))
+			fec_enet_open(ndev);
 	}
 	}
 	return 0;
 	return 0;
 }
 }

+ 5 - 6
drivers/net/greth.c

@@ -1607,14 +1607,13 @@ static struct of_device_id greth_of_match[] = {
 MODULE_DEVICE_TABLE(of, greth_of_match);
 MODULE_DEVICE_TABLE(of, greth_of_match);
 
 
 static struct of_platform_driver greth_of_driver = {
 static struct of_platform_driver greth_of_driver = {
-	.name = "grlib-greth",
-	.match_table = greth_of_match,
+	.driver = {
+		.name = "grlib-greth",
+		.owner = THIS_MODULE,
+		.of_match_table = greth_of_match,
+	},
 	.probe = greth_of_probe,
 	.probe = greth_of_probe,
 	.remove = __devexit_p(greth_of_remove),
 	.remove = __devexit_p(greth_of_remove),
-	.driver = {
-		   .owner = THIS_MODULE,
-		   .name = "grlib-greth",
-		   },
 };
 };
 
 
 static int __init greth_init(void)
 static int __init greth_init(void)

+ 2 - 0
drivers/net/ixgbe/ixgbe_common.c

@@ -1188,6 +1188,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
 		IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
 		IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
 	} else {
 	} else {
 		hw_dbg(hw, "RAR index %d is out of range.\n", index);
 		hw_dbg(hw, "RAR index %d is out of range.\n", index);
+		return IXGBE_ERR_RAR_INDEX;
 	}
 	}
 
 
 	return 0;
 	return 0;
@@ -1219,6 +1220,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
 		IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
 		IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
 	} else {
 	} else {
 		hw_dbg(hw, "RAR index %d is out of range.\n", index);
 		hw_dbg(hw, "RAR index %d is out of range.\n", index);
+		return IXGBE_ERR_RAR_INDEX;
 	}
 	}
 
 
 	/* clear VMDq pool/queue selection for this RAR */
 	/* clear VMDq pool/queue selection for this RAR */

+ 1 - 1
drivers/net/ixgbe/ixgbe_main.c

@@ -642,7 +642,7 @@ static inline bool ixgbe_tx_xon_state(struct ixgbe_adapter *adapter,
 	u32 txoff = IXGBE_TFCS_TXOFF;
 	u32 txoff = IXGBE_TFCS_TXOFF;
 
 
 #ifdef CONFIG_IXGBE_DCB
 #ifdef CONFIG_IXGBE_DCB
-	if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
+	if (adapter->dcb_cfg.pfc_mode_enable) {
 		int tc;
 		int tc;
 		int reg_idx = tx_ring->reg_idx;
 		int reg_idx = tx_ring->reg_idx;
 		int dcb_i = adapter->ring_feature[RING_F_DCB].indices;
 		int dcb_i = adapter->ring_feature[RING_F_DCB].indices;

+ 1 - 0
drivers/net/ixgbe/ixgbe_type.h

@@ -2609,6 +2609,7 @@ struct ixgbe_info {
 #define IXGBE_ERR_EEPROM_VERSION                -24
 #define IXGBE_ERR_EEPROM_VERSION                -24
 #define IXGBE_ERR_NO_SPACE                      -25
 #define IXGBE_ERR_NO_SPACE                      -25
 #define IXGBE_ERR_OVERTEMP                      -26
 #define IXGBE_ERR_OVERTEMP                      -26
+#define IXGBE_ERR_RAR_INDEX                     -27
 #define IXGBE_NOT_IMPLEMENTED                   0x7FFFFFFF
 #define IXGBE_NOT_IMPLEMENTED                   0x7FFFFFFF
 
 
 #endif /* _IXGBE_TYPE_H_ */
 #endif /* _IXGBE_TYPE_H_ */

+ 15 - 17
drivers/net/korina.c

@@ -135,6 +135,7 @@ struct korina_private {
 	struct napi_struct napi;
 	struct napi_struct napi;
 	struct timer_list media_check_timer;
 	struct timer_list media_check_timer;
 	struct mii_if_info mii_if;
 	struct mii_if_info mii_if;
+	struct work_struct restart_task;
 	struct net_device *dev;
 	struct net_device *dev;
 	int phy_addr;
 	int phy_addr;
 };
 };
@@ -375,7 +376,7 @@ static int korina_rx(struct net_device *dev, int limit)
 		if (devcs & ETH_RX_LE)
 		if (devcs & ETH_RX_LE)
 			dev->stats.rx_length_errors++;
 			dev->stats.rx_length_errors++;
 		if (devcs & ETH_RX_OVR)
 		if (devcs & ETH_RX_OVR)
-			dev->stats.rx_over_errors++;
+			dev->stats.rx_fifo_errors++;
 		if (devcs & ETH_RX_CV)
 		if (devcs & ETH_RX_CV)
 			dev->stats.rx_frame_errors++;
 			dev->stats.rx_frame_errors++;
 		if (devcs & ETH_RX_CES)
 		if (devcs & ETH_RX_CES)
@@ -764,10 +765,9 @@ static int korina_alloc_ring(struct net_device *dev)
 
 
 	/* Initialize the receive descriptors */
 	/* Initialize the receive descriptors */
 	for (i = 0; i < KORINA_NUM_RDS; i++) {
 	for (i = 0; i < KORINA_NUM_RDS; i++) {
-		skb = dev_alloc_skb(KORINA_RBSIZE + 2);
+		skb = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE);
 		if (!skb)
 		if (!skb)
 			return -ENOMEM;
 			return -ENOMEM;
-		skb_reserve(skb, 2);
 		lp->rx_skb[i] = skb;
 		lp->rx_skb[i] = skb;
 		lp->rd_ring[i].control = DMA_DESC_IOD |
 		lp->rd_ring[i].control = DMA_DESC_IOD |
 				DMA_COUNT(KORINA_RBSIZE);
 				DMA_COUNT(KORINA_RBSIZE);
@@ -890,12 +890,12 @@ static int korina_init(struct net_device *dev)
 
 
 /*
 /*
  * Restart the RC32434 ethernet controller.
  * Restart the RC32434 ethernet controller.
- * FIXME: check the return status where we call it
  */
  */
-static int korina_restart(struct net_device *dev)
+static void korina_restart_task(struct work_struct *work)
 {
 {
-	struct korina_private *lp = netdev_priv(dev);
-	int ret;
+	struct korina_private *lp = container_of(work,
+			struct korina_private, restart_task);
+	struct net_device *dev = lp->dev;
 
 
 	/*
 	/*
 	 * Disable interrupts
 	 * Disable interrupts
@@ -916,10 +916,9 @@ static int korina_restart(struct net_device *dev)
 
 
 	napi_disable(&lp->napi);
 	napi_disable(&lp->napi);
 
 
-	ret = korina_init(dev);
-	if (ret < 0) {
+	if (korina_init(dev) < 0) {
 		printk(KERN_ERR "%s: cannot restart device\n", dev->name);
 		printk(KERN_ERR "%s: cannot restart device\n", dev->name);
-		return ret;
+		return;
 	}
 	}
 	korina_multicast_list(dev);
 	korina_multicast_list(dev);
 
 
@@ -927,8 +926,6 @@ static int korina_restart(struct net_device *dev)
 	enable_irq(lp->ovr_irq);
 	enable_irq(lp->ovr_irq);
 	enable_irq(lp->tx_irq);
 	enable_irq(lp->tx_irq);
 	enable_irq(lp->rx_irq);
 	enable_irq(lp->rx_irq);
-
-	return ret;
 }
 }
 
 
 static void korina_clear_and_restart(struct net_device *dev, u32 value)
 static void korina_clear_and_restart(struct net_device *dev, u32 value)
@@ -937,7 +934,7 @@ static void korina_clear_and_restart(struct net_device *dev, u32 value)
 
 
 	netif_stop_queue(dev);
 	netif_stop_queue(dev);
 	writel(value, &lp->eth_regs->ethintfc);
 	writel(value, &lp->eth_regs->ethintfc);
-	korina_restart(dev);
+	schedule_work(&lp->restart_task);
 }
 }
 
 
 /* Ethernet Tx Underflow interrupt */
 /* Ethernet Tx Underflow interrupt */
@@ -962,11 +959,8 @@ static irqreturn_t korina_und_interrupt(int irq, void *dev_id)
 static void korina_tx_timeout(struct net_device *dev)
 static void korina_tx_timeout(struct net_device *dev)
 {
 {
 	struct korina_private *lp = netdev_priv(dev);
 	struct korina_private *lp = netdev_priv(dev);
-	unsigned long flags;
 
 
-	spin_lock_irqsave(&lp->lock, flags);
-	korina_restart(dev);
-	spin_unlock_irqrestore(&lp->lock, flags);
+	schedule_work(&lp->restart_task);
 }
 }
 
 
 /* Ethernet Rx Overflow interrupt */
 /* Ethernet Rx Overflow interrupt */
@@ -1086,6 +1080,8 @@ static int korina_close(struct net_device *dev)
 
 
 	napi_disable(&lp->napi);
 	napi_disable(&lp->napi);
 
 
+	cancel_work_sync(&lp->restart_task);
+
 	free_irq(lp->rx_irq, dev);
 	free_irq(lp->rx_irq, dev);
 	free_irq(lp->tx_irq, dev);
 	free_irq(lp->tx_irq, dev);
 	free_irq(lp->ovr_irq, dev);
 	free_irq(lp->ovr_irq, dev);
@@ -1198,6 +1194,8 @@ static int korina_probe(struct platform_device *pdev)
 	}
 	}
 	setup_timer(&lp->media_check_timer, korina_poll_media, (unsigned long) dev);
 	setup_timer(&lp->media_check_timer, korina_poll_media, (unsigned long) dev);
 
 
+	INIT_WORK(&lp->restart_task, korina_restart_task);
+
 	printk(KERN_INFO "%s: " DRV_NAME "-" DRV_VERSION " " DRV_RELDATE "\n",
 	printk(KERN_INFO "%s: " DRV_NAME "-" DRV_VERSION " " DRV_RELDATE "\n",
 			dev->name);
 			dev->name);
 out:
 out:

+ 2 - 1
drivers/net/ksz884x.c

@@ -4854,7 +4854,7 @@ static inline void copy_old_skb(struct sk_buff *old, struct sk_buff *skb)
  *
  *
  * Return 0 if successful; otherwise an error code indicating failure.
  * Return 0 if successful; otherwise an error code indicating failure.
  */
  */
-static int netdev_tx(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
 {
 {
 	struct dev_priv *priv = netdev_priv(dev);
 	struct dev_priv *priv = netdev_priv(dev);
 	struct dev_info *hw_priv = priv->adapter;
 	struct dev_info *hw_priv = priv->adapter;
@@ -6863,6 +6863,7 @@ static const struct net_device_ops netdev_ops = {
 	.ndo_tx_timeout		= netdev_tx_timeout,
 	.ndo_tx_timeout		= netdev_tx_timeout,
 	.ndo_change_mtu		= netdev_change_mtu,
 	.ndo_change_mtu		= netdev_change_mtu,
 	.ndo_set_mac_address	= netdev_set_mac_address,
 	.ndo_set_mac_address	= netdev_set_mac_address,
+	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_do_ioctl		= netdev_ioctl,
 	.ndo_do_ioctl		= netdev_ioctl,
 	.ndo_set_rx_mode	= netdev_set_rx_mode,
 	.ndo_set_rx_mode	= netdev_set_rx_mode,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 #ifdef CONFIG_NET_POLL_CONTROLLER

+ 1 - 1
drivers/net/ppp_generic.c

@@ -1416,7 +1416,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
 		flen = len;
 		flen = len;
 		if (nfree > 0) {
 		if (nfree > 0) {
 			if (pch->speed == 0) {
 			if (pch->speed == 0) {
-				flen = totlen/nfree;
+				flen = len/nfree;
 				if (nbigger > 0) {
 				if (nbigger > 0) {
 					flen++;
 					flen++;
 					nbigger--;
 					nbigger--;

+ 5 - 0
drivers/net/r8169.c

@@ -559,6 +559,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
 			break;
 			break;
 		udelay(25);
 		udelay(25);
 	}
 	}
+	/*
+	 * Some configurations require a small delay even after the write
+	 * completed indication or the next write might fail.
+	 */
+	udelay(25);
 }
 }
 
 
 static int mdio_read(void __iomem *ioaddr, int reg_addr)
 static int mdio_read(void __iomem *ioaddr, int reg_addr)

+ 1 - 1
drivers/net/sfc/net_driver.h

@@ -836,7 +836,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx)
 
 
 static inline unsigned int efx_port_num(struct efx_nic *efx)
 static inline unsigned int efx_port_num(struct efx_nic *efx)
 {
 {
-	return efx->port_num;
+	return efx->net_dev->dev_id;
 }
 }
 
 
 /**
 /**

+ 1 - 1
drivers/net/sfc/siena.c

@@ -222,7 +222,7 @@ static int siena_probe_nic(struct efx_nic *efx)
 	}
 	}
 
 
 	efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
 	efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
-	efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
+	efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
 
 
 	efx_mcdi_init(efx);
 	efx_mcdi_init(efx);
 
 

+ 2 - 2
drivers/net/tehuti.c

@@ -646,7 +646,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
 		error = copy_from_user(data, ifr->ifr_data, sizeof(data));
 		error = copy_from_user(data, ifr->ifr_data, sizeof(data));
 		if (error) {
 		if (error) {
 			pr_err("cant copy from user\n");
 			pr_err("cant copy from user\n");
-			RET(error);
+			RET(-EFAULT);
 		}
 		}
 		DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
 		DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
 	}
 	}
@@ -665,7 +665,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
 		    data[2]);
 		    data[2]);
 		error = copy_to_user(ifr->ifr_data, data, sizeof(data));
 		error = copy_to_user(ifr->ifr_data, data, sizeof(data));
 		if (error)
 		if (error)
-			RET(error);
+			RET(-EFAULT);
 		break;
 		break;
 
 
 	case BDX_OP_WRITE:
 	case BDX_OP_WRITE:

+ 4 - 4
drivers/net/virtio_net.c

@@ -340,7 +340,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)
 
 
 	skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len);
 	skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len);
 
 
-	err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb);
+	err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp);
 	if (err < 0)
 	if (err < 0)
 		dev_kfree_skb(skb);
 		dev_kfree_skb(skb);
 
 
@@ -385,8 +385,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
 
 
 	/* chain first in list head */
 	/* chain first in list head */
 	first->private = (unsigned long)list;
 	first->private = (unsigned long)list;
-	err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
-				       first);
+	err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
+				    first, gfp);
 	if (err < 0)
 	if (err < 0)
 		give_pages(vi, first);
 		give_pages(vi, first);
 
 
@@ -404,7 +404,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp)
 
 
 	sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE);
 	sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE);
 
 
-	err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page);
+	err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp);
 	if (err < 0)
 	if (err < 0)
 		give_pages(vi, page);
 		give_pages(vi, page);
 
 

+ 0 - 2
drivers/net/wan/x25_asy.c

@@ -37,8 +37,6 @@
 #include <net/x25device.h>
 #include <net/x25device.h>
 #include "x25_asy.h"
 #include "x25_asy.h"
 
 
-#include <net/x25device.h>
-
 static struct net_device **x25_asy_devs;
 static struct net_device **x25_asy_devs;
 static int x25_asy_maxdev = SL_NRUNIT;
 static int x25_asy_maxdev = SL_NRUNIT;
 
 

+ 3 - 14
drivers/net/wireless/ath/ath5k/base.c

@@ -222,7 +222,6 @@ static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
 static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
 static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
 		struct ath5k_txq *txq);
 		struct ath5k_txq *txq);
 static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan);
 static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan);
-static int ath5k_reset_wake(struct ath5k_softc *sc);
 static int ath5k_start(struct ieee80211_hw *hw);
 static int ath5k_start(struct ieee80211_hw *hw);
 static void ath5k_stop(struct ieee80211_hw *hw);
 static void ath5k_stop(struct ieee80211_hw *hw);
 static int ath5k_add_interface(struct ieee80211_hw *hw,
 static int ath5k_add_interface(struct ieee80211_hw *hw,
@@ -2770,7 +2769,7 @@ ath5k_tasklet_reset(unsigned long data)
 {
 {
 	struct ath5k_softc *sc = (void *)data;
 	struct ath5k_softc *sc = (void *)data;
 
 
-	ath5k_reset_wake(sc);
+	ath5k_reset(sc, sc->curchan);
 }
 }
 
 
 /*
 /*
@@ -2941,23 +2940,13 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
 	ath5k_beacon_config(sc);
 	ath5k_beacon_config(sc);
 	/* intrs are enabled by ath5k_beacon_config */
 	/* intrs are enabled by ath5k_beacon_config */
 
 
+	ieee80211_wake_queues(sc->hw);
+
 	return 0;
 	return 0;
 err:
 err:
 	return ret;
 	return ret;
 }
 }
 
 
-static int
-ath5k_reset_wake(struct ath5k_softc *sc)
-{
-	int ret;
-
-	ret = ath5k_reset(sc, sc->curchan);
-	if (!ret)
-		ieee80211_wake_queues(sc->hw);
-
-	return ret;
-}
-
 static int ath5k_start(struct ieee80211_hw *hw)
 static int ath5k_start(struct ieee80211_hw *hw)
 {
 {
 	return ath5k_init(hw->priv);
 	return ath5k_init(hw->priv);

+ 1 - 1
include/linux/netfilter/x_tables.h

@@ -397,7 +397,7 @@ struct xt_table_info {
 	 * @stacksize jumps (number of user chains) can possibly be made.
 	 * @stacksize jumps (number of user chains) can possibly be made.
 	 */
 	 */
 	unsigned int stacksize;
 	unsigned int stacksize;
-	unsigned int *stackptr;
+	unsigned int __percpu *stackptr;
 	void ***jumpstack;
 	void ***jumpstack;
 	/* ipt_entry tables: one per CPU */
 	/* ipt_entry tables: one per CPU */
 	/* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */
 	/* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */

+ 3 - 3
include/net/dst.h

@@ -250,11 +250,11 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
  * Linux networking.  Thus, destinations are stackable.
  * Linux networking.  Thus, destinations are stackable.
  */
  */
 
 
-static inline struct dst_entry *dst_pop(struct dst_entry *dst)
+static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb)
 {
 {
-	struct dst_entry *child = dst_clone(dst->child);
+	struct dst_entry *child = skb_dst(skb)->child;
 
 
-	dst_release(dst);
+	skb_dst_drop(skb);
 	return child;
 	return child;
 }
 }
 
 

+ 1 - 14
include/net/sock.h

@@ -1524,20 +1524,7 @@ extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);
 
 
 extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
 extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
 
 
-static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
-{
-	/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
-	   number of warnings when compiling with -W --ANK
-	 */
-	if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
-	    (unsigned)sk->sk_rcvbuf)
-		return -ENOMEM;
-	skb_set_owner_r(skb, sk);
-	skb_queue_tail(&sk->sk_error_queue, skb);
-	if (!sock_flag(sk, SOCK_DEAD))
-		sk->sk_data_ready(sk, skb->len);
-	return 0;
-}
+extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);
 
 
 /*
 /*
  *	Recover an error report and clear atomically
  *	Recover an error report and clear atomically

+ 2 - 1
net/8021q/vlan_dev.c

@@ -708,7 +708,8 @@ static int vlan_dev_init(struct net_device *dev)
 	netif_carrier_off(dev);
 	netif_carrier_off(dev);
 
 
 	/* IFF_BROADCAST|IFF_MULTICAST; ??? */
 	/* IFF_BROADCAST|IFF_MULTICAST; ??? */
-	dev->flags  = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI);
+	dev->flags  = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI |
+					  IFF_MASTER | IFF_SLAVE);
 	dev->iflink = real_dev->ifindex;
 	dev->iflink = real_dev->ifindex;
 	dev->state  = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
 	dev->state  = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
 					  (1<<__LINK_STATE_DORMANT))) |
 					  (1<<__LINK_STATE_DORMANT))) |

+ 4 - 4
net/core/dev.c

@@ -2805,7 +2805,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
 	struct net_device *orig_dev;
 	struct net_device *orig_dev;
 	struct net_device *master;
 	struct net_device *master;
 	struct net_device *null_or_orig;
 	struct net_device *null_or_orig;
-	struct net_device *null_or_bond;
+	struct net_device *orig_or_bond;
 	int ret = NET_RX_DROP;
 	int ret = NET_RX_DROP;
 	__be16 type;
 	__be16 type;
 
 
@@ -2882,10 +2882,10 @@ ncls:
 	 * device that may have registered for a specific ptype.  The
 	 * device that may have registered for a specific ptype.  The
 	 * handler may have to adjust skb->dev and orig_dev.
 	 * handler may have to adjust skb->dev and orig_dev.
 	 */
 	 */
-	null_or_bond = NULL;
+	orig_or_bond = orig_dev;
 	if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
 	if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
 	    (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
 	    (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
-		null_or_bond = vlan_dev_real_dev(skb->dev);
+		orig_or_bond = vlan_dev_real_dev(skb->dev);
 	}
 	}
 
 
 	type = skb->protocol;
 	type = skb->protocol;
@@ -2893,7 +2893,7 @@ ncls:
 			&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
 			&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
 		if (ptype->type == type && (ptype->dev == null_or_orig ||
 		if (ptype->type == type && (ptype->dev == null_or_orig ||
 		     ptype->dev == skb->dev || ptype->dev == orig_dev ||
 		     ptype->dev == skb->dev || ptype->dev == orig_dev ||
-		     ptype->dev == null_or_bond)) {
+		     ptype->dev == orig_or_bond)) {
 			if (pt_prev)
 			if (pt_prev)
 				ret = deliver_skb(skb, pt_prev, orig_dev);
 				ret = deliver_skb(skb, pt_prev, orig_dev);
 			pt_prev = ptype;
 			pt_prev = ptype;

+ 28 - 2
net/core/skbuff.c

@@ -2965,6 +2965,34 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
 }
 }
 EXPORT_SYMBOL_GPL(skb_cow_data);
 EXPORT_SYMBOL_GPL(skb_cow_data);
 
 
+static void sock_rmem_free(struct sk_buff *skb)
+{
+	struct sock *sk = skb->sk;
+
+	atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
+}
+
+/*
+ * Note: We dont mem charge error packets (no sk_forward_alloc changes)
+ */
+int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
+{
+	if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
+	    (unsigned)sk->sk_rcvbuf)
+		return -ENOMEM;
+
+	skb_orphan(skb);
+	skb->sk = sk;
+	skb->destructor = sock_rmem_free;
+	atomic_add(skb->truesize, &sk->sk_rmem_alloc);
+
+	skb_queue_tail(&sk->sk_error_queue, skb);
+	if (!sock_flag(sk, SOCK_DEAD))
+		sk->sk_data_ready(sk, skb->len);
+	return 0;
+}
+EXPORT_SYMBOL(sock_queue_err_skb);
+
 void skb_tstamp_tx(struct sk_buff *orig_skb,
 void skb_tstamp_tx(struct sk_buff *orig_skb,
 		struct skb_shared_hwtstamps *hwtstamps)
 		struct skb_shared_hwtstamps *hwtstamps)
 {
 {
@@ -2997,9 +3025,7 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
 	serr->ee.ee_errno = ENOMSG;
 	serr->ee.ee_errno = ENOMSG;
 	serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;
 	serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;
 
 
-	bh_lock_sock(sk);
 	err = sock_queue_err_skb(sk, skb);
 	err = sock_queue_err_skb(sk, skb);
-	bh_unlock_sock(sk);
 
 
 	if (err)
 	if (err)
 		kfree_skb(skb);
 		kfree_skb(skb);

+ 5 - 5
net/ipv4/Kconfig

@@ -303,7 +303,7 @@ config ARPD
 	  If unsure, say N.
 	  If unsure, say N.
 
 
 config SYN_COOKIES
 config SYN_COOKIES
-	bool "IP: TCP syncookie support (disabled per default)"
+	bool "IP: TCP syncookie support"
 	---help---
 	---help---
 	  Normal TCP/IP networking is open to an attack known as "SYN
 	  Normal TCP/IP networking is open to an attack known as "SYN
 	  flooding". This denial-of-service attack prevents legitimate remote
 	  flooding". This denial-of-service attack prevents legitimate remote
@@ -328,13 +328,13 @@ config SYN_COOKIES
 	  server is really overloaded. If this happens frequently better turn
 	  server is really overloaded. If this happens frequently better turn
 	  them off.
 	  them off.
 
 
-	  If you say Y here, note that SYN cookies aren't enabled by default;
-	  you can enable them by saying Y to "/proc file system support" and
+	  If you say Y here, you can disable SYN cookies at run time by
+	  saying Y to "/proc file system support" and
 	  "Sysctl support" below and executing the command
 	  "Sysctl support" below and executing the command
 
 
-	  echo 1 >/proc/sys/net/ipv4/tcp_syncookies
+	  echo 0 > /proc/sys/net/ipv4/tcp_syncookies
 
 
-	  at boot time after the /proc file system has been mounted.
+	  after the /proc file system has been mounted.
 
 
 	  If unsure, say N.
 	  If unsure, say N.
 
 

+ 1 - 1
net/ipv4/netfilter/ip_tables.c

@@ -336,7 +336,7 @@ ipt_do_table(struct sk_buff *skb,
 	cpu        = smp_processor_id();
 	cpu        = smp_processor_id();
 	table_base = private->entries[cpu];
 	table_base = private->entries[cpu];
 	jumpstack  = (struct ipt_entry **)private->jumpstack[cpu];
 	jumpstack  = (struct ipt_entry **)private->jumpstack[cpu];
-	stackptr   = &private->stackptr[cpu];
+	stackptr   = per_cpu_ptr(private->stackptr, cpu);
 	origptr    = *stackptr;
 	origptr    = *stackptr;
 
 
 	e = get_entry(table_base, private->hook_entry[hook]);
 	e = get_entry(table_base, private->hook_entry[hook]);

+ 1 - 1
net/ipv4/syncookies.c

@@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
 					       { .sport = th->dest,
 					       { .sport = th->dest,
 						 .dport = th->source } } };
 						 .dport = th->source } } };
 		security_req_classify_flow(req, &fl);
 		security_req_classify_flow(req, &fl);
-		if (ip_route_output_key(&init_net, &rt, &fl)) {
+		if (ip_route_output_key(sock_net(sk), &rt, &fl)) {
 			reqsk_free(req);
 			reqsk_free(req);
 			goto out;
 			goto out;
 		}
 		}

+ 2 - 2
net/ipv4/tcp_hybla.c

@@ -126,8 +126,8 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
 		 * calculate 2^fract in a <<7 value.
 		 * calculate 2^fract in a <<7 value.
 		 */
 		 */
 		is_slowstart = 1;
 		is_slowstart = 1;
-		increment = ((1 << ca->rho) * hybla_fraction(rho_fractions))
-			- 128;
+		increment = ((1 << min(ca->rho, 16U)) *
+			hybla_fraction(rho_fractions)) - 128;
 	} else {
 	} else {
 		/*
 		/*
 		 * congestion avoidance
 		 * congestion avoidance

+ 2 - 2
net/ipv4/tcp_input.c

@@ -2639,7 +2639,7 @@ static void DBGUNDO(struct sock *sk, const char *msg)
 	if (sk->sk_family == AF_INET) {
 	if (sk->sk_family == AF_INET) {
 		printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n",
 		printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n",
 		       msg,
 		       msg,
-		       &inet->daddr, ntohs(inet->dport),
+		       &inet->inet_daddr, ntohs(inet->inet_dport),
 		       tp->snd_cwnd, tcp_left_out(tp),
 		       tp->snd_cwnd, tcp_left_out(tp),
 		       tp->snd_ssthresh, tp->prior_ssthresh,
 		       tp->snd_ssthresh, tp->prior_ssthresh,
 		       tp->packets_out);
 		       tp->packets_out);
@@ -2649,7 +2649,7 @@ static void DBGUNDO(struct sock *sk, const char *msg)
 		struct ipv6_pinfo *np = inet6_sk(sk);
 		struct ipv6_pinfo *np = inet6_sk(sk);
 		printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n",
 		printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n",
 		       msg,
 		       msg,
-		       &np->daddr, ntohs(inet->dport),
+		       &np->daddr, ntohs(inet->inet_dport),
 		       tp->snd_cwnd, tcp_left_out(tp),
 		       tp->snd_cwnd, tcp_left_out(tp),
 		       tp->snd_ssthresh, tp->prior_ssthresh,
 		       tp->snd_ssthresh, tp->prior_ssthresh,
 		       tp->packets_out);
 		       tp->packets_out);

+ 4 - 3
net/ipv4/tcp_ipv4.c

@@ -1557,6 +1557,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
 #endif
 #endif
 
 
 	if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */
 	if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */
+		sock_rps_save_rxhash(sk, skb->rxhash);
 		TCP_CHECK_TIMER(sk);
 		TCP_CHECK_TIMER(sk);
 		if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) {
 		if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) {
 			rsk = sk;
 			rsk = sk;
@@ -1581,7 +1582,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
 			}
 			}
 			return 0;
 			return 0;
 		}
 		}
-	}
+	} else
+		sock_rps_save_rxhash(sk, skb->rxhash);
+
 
 
 	TCP_CHECK_TIMER(sk);
 	TCP_CHECK_TIMER(sk);
 	if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) {
 	if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) {
@@ -1674,8 +1677,6 @@ process:
 
 
 	skb->dev = NULL;
 	skb->dev = NULL;
 
 
-	sock_rps_save_rxhash(sk, skb->rxhash);
-
 	bh_lock_sock_nested(sk);
 	bh_lock_sock_nested(sk);
 	ret = 0;
 	ret = 0;
 	if (!sock_owned_by_user(sk)) {
 	if (!sock_owned_by_user(sk)) {

+ 2 - 4
net/ipv4/udp.c

@@ -633,11 +633,9 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
 	if (!inet->recverr) {
 	if (!inet->recverr) {
 		if (!harderr || sk->sk_state != TCP_ESTABLISHED)
 		if (!harderr || sk->sk_state != TCP_ESTABLISHED)
 			goto out;
 			goto out;
-	} else {
-		bh_lock_sock(sk);
+	} else
 		ip_icmp_error(sk, skb, err, uh->dest, info, (u8 *)(uh+1));
 		ip_icmp_error(sk, skb, err, uh->dest, info, (u8 *)(uh+1));
-		bh_unlock_sock(sk);
-	}
+
 	sk->sk_err = err;
 	sk->sk_err = err;
 	sk->sk_error_report(sk);
 	sk->sk_error_report(sk);
 out:
 out:

+ 1 - 1
net/ipv6/ip6mr.c

@@ -120,7 +120,7 @@ static void mroute_clean_tables(struct mr6_table *mrt);
 static void ipmr_expire_process(unsigned long arg);
 static void ipmr_expire_process(unsigned long arg);
 
 
 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
-#define ip6mr_for_each_table(mrt, met) \
+#define ip6mr_for_each_table(mrt, net) \
 	list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list)
 	list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list)
 
 
 static struct mr6_table *ip6mr_get_table(struct net *net, u32 id)
 static struct mr6_table *ip6mr_get_table(struct net *net, u32 id)

+ 4 - 1
net/ipv6/mcast.c

@@ -1356,7 +1356,10 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
 		     IPV6_TLV_PADN, 0 };
 		     IPV6_TLV_PADN, 0 };
 
 
 	/* we assume size > sizeof(ra) here */
 	/* we assume size > sizeof(ra) here */
-	skb = sock_alloc_send_skb(sk, size + LL_ALLOCATED_SPACE(dev), 1, &err);
+	size += LL_ALLOCATED_SPACE(dev);
+	/* limit our allocations to order-0 page */
+	size = min_t(int, size, SKB_MAX_ORDER(0, 0));
+	skb = sock_alloc_send_skb(sk, size, 1, &err);
 
 
 	if (!skb)
 	if (!skb)
 		return NULL;
 		return NULL;

+ 1 - 1
net/ipv6/netfilter/ip6_tables.c

@@ -363,7 +363,7 @@ ip6t_do_table(struct sk_buff *skb,
 	cpu        = smp_processor_id();
 	cpu        = smp_processor_id();
 	table_base = private->entries[cpu];
 	table_base = private->entries[cpu];
 	jumpstack  = (struct ip6t_entry **)private->jumpstack[cpu];
 	jumpstack  = (struct ip6t_entry **)private->jumpstack[cpu];
-	stackptr   = &private->stackptr[cpu];
+	stackptr   = per_cpu_ptr(private->stackptr, cpu);
 	origptr    = *stackptr;
 	origptr    = *stackptr;
 
 
 	e = get_entry(table_base, private->hook_entry[hook]);
 	e = get_entry(table_base, private->hook_entry[hook]);

+ 2 - 4
net/ipv6/udp.c

@@ -466,11 +466,9 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	if (sk->sk_state != TCP_ESTABLISHED && !np->recverr)
 	if (sk->sk_state != TCP_ESTABLISHED && !np->recverr)
 		goto out;
 		goto out;
 
 
-	if (np->recverr) {
-		bh_lock_sock(sk);
+	if (np->recverr)
 		ipv6_icmp_error(sk, skb, err, uh->dest, ntohl(info), (u8 *)(uh+1));
 		ipv6_icmp_error(sk, skb, err, uh->dest, ntohl(info), (u8 *)(uh+1));
-		bh_unlock_sock(sk);
-	}
+
 	sk->sk_err = err;
 	sk->sk_err = err;
 	sk->sk_error_report(sk);
 	sk->sk_error_report(sk);
 out:
 out:

+ 4 - 2
net/mac80211/agg-tx.c

@@ -332,14 +332,16 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
 		IEEE80211_QUEUE_STOP_REASON_AGGREGATION);
 		IEEE80211_QUEUE_STOP_REASON_AGGREGATION);
 
 
 	spin_unlock(&local->ampdu_lock);
 	spin_unlock(&local->ampdu_lock);
-	spin_unlock_bh(&sta->lock);
 
 
-	/* send an addBA request */
+	/* prepare tid data */
 	sta->ampdu_mlme.dialog_token_allocator++;
 	sta->ampdu_mlme.dialog_token_allocator++;
 	sta->ampdu_mlme.tid_tx[tid]->dialog_token =
 	sta->ampdu_mlme.tid_tx[tid]->dialog_token =
 			sta->ampdu_mlme.dialog_token_allocator;
 			sta->ampdu_mlme.dialog_token_allocator;
 	sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num;
 	sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num;
 
 
+	spin_unlock_bh(&sta->lock);
+
+	/* send AddBA request */
 	ieee80211_send_addba_request(sdata, pubsta->addr, tid,
 	ieee80211_send_addba_request(sdata, pubsta->addr, tid,
 			 sta->ampdu_mlme.tid_tx[tid]->dialog_token,
 			 sta->ampdu_mlme.tid_tx[tid]->dialog_token,
 			 sta->ampdu_mlme.tid_tx[tid]->ssn,
 			 sta->ampdu_mlme.tid_tx[tid]->ssn,

+ 11 - 2
net/mac80211/rx.c

@@ -1818,17 +1818,26 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames)
 		return RX_CONTINUE;
 		return RX_CONTINUE;
 
 
 	if (ieee80211_is_back_req(bar->frame_control)) {
 	if (ieee80211_is_back_req(bar->frame_control)) {
+		struct {
+			__le16 control, start_seq_num;
+		} __packed bar_data;
+
 		if (!rx->sta)
 		if (!rx->sta)
 			return RX_DROP_MONITOR;
 			return RX_DROP_MONITOR;
+
+		if (skb_copy_bits(skb, offsetof(struct ieee80211_bar, control),
+				  &bar_data, sizeof(bar_data)))
+			return RX_DROP_MONITOR;
+
 		spin_lock(&rx->sta->lock);
 		spin_lock(&rx->sta->lock);
-		tid = le16_to_cpu(bar->control) >> 12;
+		tid = le16_to_cpu(bar_data.control) >> 12;
 		if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) {
 		if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) {
 			spin_unlock(&rx->sta->lock);
 			spin_unlock(&rx->sta->lock);
 			return RX_DROP_MONITOR;
 			return RX_DROP_MONITOR;
 		}
 		}
 		tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid];
 		tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid];
 
 
-		start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4;
+		start_seq_num = le16_to_cpu(bar_data.start_seq_num) >> 4;
 
 
 		/* reset session timer */
 		/* reset session timer */
 		if (tid_agg_rx->timeout)
 		if (tid_agg_rx->timeout)

+ 3 - 14
net/netfilter/x_tables.c

@@ -699,10 +699,8 @@ void xt_free_table_info(struct xt_table_info *info)
 		vfree(info->jumpstack);
 		vfree(info->jumpstack);
 	else
 	else
 		kfree(info->jumpstack);
 		kfree(info->jumpstack);
-	if (sizeof(unsigned int) * nr_cpu_ids > PAGE_SIZE)
-		vfree(info->stackptr);
-	else
-		kfree(info->stackptr);
+
+	free_percpu(info->stackptr);
 
 
 	kfree(info);
 	kfree(info);
 }
 }
@@ -753,14 +751,9 @@ static int xt_jumpstack_alloc(struct xt_table_info *i)
 	unsigned int size;
 	unsigned int size;
 	int cpu;
 	int cpu;
 
 
-	size = sizeof(unsigned int) * nr_cpu_ids;
-	if (size > PAGE_SIZE)
-		i->stackptr = vmalloc(size);
-	else
-		i->stackptr = kmalloc(size, GFP_KERNEL);
+	i->stackptr = alloc_percpu(unsigned int);
 	if (i->stackptr == NULL)
 	if (i->stackptr == NULL)
 		return -ENOMEM;
 		return -ENOMEM;
-	memset(i->stackptr, 0, size);
 
 
 	size = sizeof(void **) * nr_cpu_ids;
 	size = sizeof(void **) * nr_cpu_ids;
 	if (size > PAGE_SIZE)
 	if (size > PAGE_SIZE)
@@ -844,10 +837,6 @@ struct xt_table *xt_register_table(struct net *net,
 	struct xt_table_info *private;
 	struct xt_table_info *private;
 	struct xt_table *t, *table;
 	struct xt_table *t, *table;
 
 
-	ret = xt_jumpstack_alloc(newinfo);
-	if (ret < 0)
-		return ERR_PTR(ret);
-
 	/* Don't add one object to multiple lists. */
 	/* Don't add one object to multiple lists. */
 	table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL);
 	table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL);
 	if (!table) {
 	if (!table) {

+ 4 - 0
net/sched/act_nat.c

@@ -159,6 +159,9 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
 			iph->daddr = new_addr;
 			iph->daddr = new_addr;
 
 
 		csum_replace4(&iph->check, addr, new_addr);
 		csum_replace4(&iph->check, addr, new_addr);
+	} else if ((iph->frag_off & htons(IP_OFFSET)) ||
+		   iph->protocol != IPPROTO_ICMP) {
+		goto out;
 	}
 	}
 
 
 	ihl = iph->ihl * 4;
 	ihl = iph->ihl * 4;
@@ -247,6 +250,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
 		break;
 		break;
 	}
 	}
 
 
+out:
 	return action;
 	return action;
 
 
 drop:
 drop:

+ 14 - 10
net/sched/act_pedit.c

@@ -125,7 +125,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
 {
 {
 	struct tcf_pedit *p = a->priv;
 	struct tcf_pedit *p = a->priv;
 	int i, munged = 0;
 	int i, munged = 0;
-	u8 *pptr;
+	unsigned int off;
 
 
 	if (!(skb->tc_verd & TC_OK2MUNGE)) {
 	if (!(skb->tc_verd & TC_OK2MUNGE)) {
 		/* should we set skb->cloned? */
 		/* should we set skb->cloned? */
@@ -134,7 +134,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
 		}
 		}
 	}
 	}
 
 
-	pptr = skb_network_header(skb);
+	off = skb_network_offset(skb);
 
 
 	spin_lock(&p->tcf_lock);
 	spin_lock(&p->tcf_lock);
 
 
@@ -144,17 +144,17 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
 		struct tc_pedit_key *tkey = p->tcfp_keys;
 		struct tc_pedit_key *tkey = p->tcfp_keys;
 
 
 		for (i = p->tcfp_nkeys; i > 0; i--, tkey++) {
 		for (i = p->tcfp_nkeys; i > 0; i--, tkey++) {
-			u32 *ptr;
+			u32 *ptr, _data;
 			int offset = tkey->off;
 			int offset = tkey->off;
 
 
 			if (tkey->offmask) {
 			if (tkey->offmask) {
-				if (skb->len > tkey->at) {
-					 char *j = pptr + tkey->at;
-					 offset += ((*j & tkey->offmask) >>
-						   tkey->shift);
-				} else {
+				char *d, _d;
+
+				d = skb_header_pointer(skb, off + tkey->at, 1,
+						       &_d);
+				if (!d)
 					goto bad;
 					goto bad;
-				}
+				offset += (*d & tkey->offmask) >> tkey->shift;
 			}
 			}
 
 
 			if (offset % 4) {
 			if (offset % 4) {
@@ -169,9 +169,13 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
 				goto bad;
 				goto bad;
 			}
 			}
 
 
-			ptr = (u32 *)(pptr+offset);
+			ptr = skb_header_pointer(skb, off + offset, 4, &_data);
+			if (!ptr)
+				goto bad;
 			/* just do it, baby */
 			/* just do it, baby */
 			*ptr = ((*ptr & tkey->mask) ^ tkey->val);
 			*ptr = ((*ptr & tkey->mask) ^ tkey->val);
+			if (ptr == &_data)
+				skb_store_bits(skb, off + offset, ptr, 4);
 			munged++;
 			munged++;
 		}
 		}
 
 

+ 36 - 13
net/sched/cls_u32.c

@@ -98,11 +98,11 @@ static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_re
 {
 {
 	struct {
 	struct {
 		struct tc_u_knode *knode;
 		struct tc_u_knode *knode;
-		u8		  *ptr;
+		unsigned int	  off;
 	} stack[TC_U32_MAXDEPTH];
 	} stack[TC_U32_MAXDEPTH];
 
 
 	struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root;
 	struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root;
-	u8 *ptr = skb_network_header(skb);
+	unsigned int off = skb_network_offset(skb);
 	struct tc_u_knode *n;
 	struct tc_u_knode *n;
 	int sdepth = 0;
 	int sdepth = 0;
 	int off2 = 0;
 	int off2 = 0;
@@ -134,8 +134,14 @@ next_knode:
 #endif
 #endif
 
 
 		for (i = n->sel.nkeys; i>0; i--, key++) {
 		for (i = n->sel.nkeys; i>0; i--, key++) {
-
-			if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) {
+			unsigned int toff;
+			__be32 *data, _data;
+
+			toff = off + key->off + (off2 & key->offmask);
+			data = skb_header_pointer(skb, toff, 4, &_data);
+			if (!data)
+				goto out;
+			if ((*data ^ key->val) & key->mask) {
 				n = n->next;
 				n = n->next;
 				goto next_knode;
 				goto next_knode;
 			}
 			}
@@ -174,29 +180,45 @@ check_terminal:
 		if (sdepth >= TC_U32_MAXDEPTH)
 		if (sdepth >= TC_U32_MAXDEPTH)
 			goto deadloop;
 			goto deadloop;
 		stack[sdepth].knode = n;
 		stack[sdepth].knode = n;
-		stack[sdepth].ptr = ptr;
+		stack[sdepth].off = off;
 		sdepth++;
 		sdepth++;
 
 
 		ht = n->ht_down;
 		ht = n->ht_down;
 		sel = 0;
 		sel = 0;
-		if (ht->divisor)
-			sel = ht->divisor&u32_hash_fold(*(__be32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
-
+		if (ht->divisor) {
+			__be32 *data, _data;
+
+			data = skb_header_pointer(skb, off + n->sel.hoff, 4,
+						  &_data);
+			if (!data)
+				goto out;
+			sel = ht->divisor & u32_hash_fold(*data, &n->sel,
+							  n->fshift);
+		}
 		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
 		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
 			goto next_ht;
 			goto next_ht;
 
 
 		if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
 		if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
 			off2 = n->sel.off + 3;
 			off2 = n->sel.off + 3;
-			if (n->sel.flags&TC_U32_VAROFFSET)
-				off2 += ntohs(n->sel.offmask & *(__be16*)(ptr+n->sel.offoff)) >>n->sel.offshift;
+			if (n->sel.flags & TC_U32_VAROFFSET) {
+				__be16 *data, _data;
+
+				data = skb_header_pointer(skb,
+							  off + n->sel.offoff,
+							  2, &_data);
+				if (!data)
+					goto out;
+				off2 += ntohs(n->sel.offmask & *data) >>
+					n->sel.offshift;
+			}
 			off2 &= ~3;
 			off2 &= ~3;
 		}
 		}
 		if (n->sel.flags&TC_U32_EAT) {
 		if (n->sel.flags&TC_U32_EAT) {
-			ptr += off2;
+			off += off2;
 			off2 = 0;
 			off2 = 0;
 		}
 		}
 
 
-		if (ptr < skb_tail_pointer(skb))
+		if (off < skb->len)
 			goto next_ht;
 			goto next_ht;
 	}
 	}
 
 
@@ -204,9 +226,10 @@ check_terminal:
 	if (sdepth--) {
 	if (sdepth--) {
 		n = stack[sdepth].knode;
 		n = stack[sdepth].knode;
 		ht = n->ht_up;
 		ht = n->ht_up;
-		ptr = stack[sdepth].ptr;
+		off = stack[sdepth].off;
 		goto check_terminal;
 		goto check_terminal;
 	}
 	}
+out:
 	return -1;
 	return -1;
 
 
 deadloop:
 deadloop:

+ 2 - 2
net/xfrm/xfrm_output.c

@@ -95,13 +95,13 @@ resume:
 			goto error_nolock;
 			goto error_nolock;
 		}
 		}
 
 
-		dst = dst_pop(dst);
+		dst = skb_dst_pop(skb);
 		if (!dst) {
 		if (!dst) {
 			XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR);
 			XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR);
 			err = -EHOSTUNREACH;
 			err = -EHOSTUNREACH;
 			goto error_nolock;
 			goto error_nolock;
 		}
 		}
-		skb_dst_set(skb, dst);
+		skb_dst_set_noref(skb, dst);
 		x = dst->xfrm;
 		x = dst->xfrm;
 	} while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL));
 	} while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL));
 
 

+ 1 - 0
net/xfrm/xfrm_policy.c

@@ -2153,6 +2153,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
 		return 0;
 		return 0;
 	}
 	}
 
 
+	skb_dst_force(skb);
 	dst = skb_dst(skb);
 	dst = skb_dst(skb);
 
 
 	res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0;
 	res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0;