diff options
author | David S. Miller <davem@davemloft.net> | 2010-06-06 20:42:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-06 20:42:02 -0400 |
commit | eedc765ca4b19a41cf0b921a492ac08d640060d1 (patch) | |
tree | 95c566c6238cc953e1e336115d2daafe8bcb388f | |
parent | e59d44df46edaafb6b637e98d046775524b31104 (diff) | |
parent | 024a07bacf8287a6ddfa83e9d5b951c5e8b4070e (diff) |
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
49 files changed, 323 insertions, 270 deletions
diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index bde3c88b8b27..b054494df846 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c | |||
@@ -1020,12 +1020,12 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data) | |||
1020 | if (cmd == AVMB1_ADDCARD) { | 1020 | if (cmd == AVMB1_ADDCARD) { |
1021 | if ((retval = copy_from_user(&cdef, data, | 1021 | if ((retval = copy_from_user(&cdef, data, |
1022 | sizeof(avmb1_carddef)))) | 1022 | sizeof(avmb1_carddef)))) |
1023 | return retval; | 1023 | return -EFAULT; |
1024 | cdef.cardtype = AVM_CARDTYPE_B1; | 1024 | cdef.cardtype = AVM_CARDTYPE_B1; |
1025 | } else { | 1025 | } else { |
1026 | if ((retval = copy_from_user(&cdef, data, | 1026 | if ((retval = copy_from_user(&cdef, data, |
1027 | sizeof(avmb1_extcarddef)))) | 1027 | sizeof(avmb1_extcarddef)))) |
1028 | return retval; | 1028 | return -EFAULT; |
1029 | } | 1029 | } |
1030 | cparams.port = cdef.port; | 1030 | cparams.port = cdef.port; |
1031 | cparams.irq = cdef.irq; | 1031 | cparams.irq = cdef.irq; |
@@ -1218,7 +1218,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data) | |||
1218 | kcapi_carddef cdef; | 1218 | kcapi_carddef cdef; |
1219 | 1219 | ||
1220 | if ((retval = copy_from_user(&cdef, data, sizeof(cdef)))) | 1220 | if ((retval = copy_from_user(&cdef, data, sizeof(cdef)))) |
1221 | return retval; | 1221 | return -EFAULT; |
1222 | 1222 | ||
1223 | cparams.port = cdef.port; | 1223 | cparams.port = cdef.port; |
1224 | cparams.irq = cdef.irq; | 1224 | cparams.irq = cdef.irq; |
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index 0a3553df065f..54ae71a907f9 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c | |||
@@ -320,12 +320,12 @@ inittiger(struct tiger_hw *card) | |||
320 | return -ENOMEM; | 320 | return -ENOMEM; |
321 | } | 321 | } |
322 | for (i = 0; i < 2; i++) { | 322 | for (i = 0; i < 2; i++) { |
323 | card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_KERNEL); | 323 | card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_ATOMIC); |
324 | if (!card->bc[i].hsbuf) { | 324 | if (!card->bc[i].hsbuf) { |
325 | pr_info("%s: no B%d send buffer\n", card->name, i + 1); | 325 | pr_info("%s: no B%d send buffer\n", card->name, i + 1); |
326 | return -ENOMEM; | 326 | return -ENOMEM; |
327 | } | 327 | } |
328 | card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_KERNEL); | 328 | card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_ATOMIC); |
329 | if (!card->bc[i].hrbuf) { | 329 | if (!card->bc[i].hrbuf) { |
330 | pr_info("%s: no B%d recv buffer\n", card->name, i + 1); | 330 | pr_info("%s: no B%d recv buffer\n", card->name, i + 1); |
331 | return -ENOMEM; | 331 | return -ENOMEM; |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index ce437b639cf8..ee1ad9693c8f 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -1592,7 +1592,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
1592 | 1592 | ||
1593 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, | 1593 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, |
1594 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req)); | 1594 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req)); |
1595 | req->hdr.timeout = 4; | 1595 | req->hdr.timeout = cpu_to_le32(4); |
1596 | 1596 | ||
1597 | req->pattern = cpu_to_le64(pattern); | 1597 | req->pattern = cpu_to_le64(pattern); |
1598 | req->src_port = cpu_to_le32(port_num); | 1598 | req->src_port = cpu_to_le32(port_num); |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 188e356c30a3..949d7a9dcf92 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -247,6 +247,7 @@ static const struct flash_spec flash_5709 = { | |||
247 | MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl); | 247 | MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl); |
248 | 248 | ||
249 | static void bnx2_init_napi(struct bnx2 *bp); | 249 | static void bnx2_init_napi(struct bnx2 *bp); |
250 | static void bnx2_del_napi(struct bnx2 *bp); | ||
250 | 251 | ||
251 | static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr) | 252 | static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr) |
252 | { | 253 | { |
@@ -6270,6 +6271,7 @@ open_err: | |||
6270 | bnx2_free_skbs(bp); | 6271 | bnx2_free_skbs(bp); |
6271 | bnx2_free_irq(bp); | 6272 | bnx2_free_irq(bp); |
6272 | bnx2_free_mem(bp); | 6273 | bnx2_free_mem(bp); |
6274 | bnx2_del_napi(bp); | ||
6273 | return rc; | 6275 | return rc; |
6274 | } | 6276 | } |
6275 | 6277 | ||
@@ -6537,6 +6539,7 @@ bnx2_close(struct net_device *dev) | |||
6537 | bnx2_free_irq(bp); | 6539 | bnx2_free_irq(bp); |
6538 | bnx2_free_skbs(bp); | 6540 | bnx2_free_skbs(bp); |
6539 | bnx2_free_mem(bp); | 6541 | bnx2_free_mem(bp); |
6542 | bnx2_del_napi(bp); | ||
6540 | bp->link_up = 0; | 6543 | bp->link_up = 0; |
6541 | netif_carrier_off(bp->dev); | 6544 | netif_carrier_off(bp->dev); |
6542 | bnx2_set_power_state(bp, PCI_D3hot); | 6545 | bnx2_set_power_state(bp, PCI_D3hot); |
@@ -8227,7 +8230,16 @@ bnx2_bus_string(struct bnx2 *bp, char *str) | |||
8227 | return str; | 8230 | return str; |
8228 | } | 8231 | } |
8229 | 8232 | ||
8230 | static void __devinit | 8233 | static void |
8234 | bnx2_del_napi(struct bnx2 *bp) | ||
8235 | { | ||
8236 | int i; | ||
8237 | |||
8238 | for (i = 0; i < bp->irq_nvecs; i++) | ||
8239 | netif_napi_del(&bp->bnx2_napi[i].napi); | ||
8240 | } | ||
8241 | |||
8242 | static void | ||
8231 | bnx2_init_napi(struct bnx2 *bp) | 8243 | bnx2_init_napi(struct bnx2 *bp) |
8232 | { | 8244 | { |
8233 | int i; | 8245 | int i; |
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index 8af8442c694a..af753936e835 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c | |||
@@ -73,7 +73,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev, | |||
73 | else | 73 | else |
74 | *mscan_clksrc = MSCAN_CLKSRC_XTAL; | 74 | *mscan_clksrc = MSCAN_CLKSRC_XTAL; |
75 | 75 | ||
76 | freq = mpc5xxx_get_bus_frequency(ofdev->node); | 76 | freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node); |
77 | if (!freq) | 77 | if (!freq) |
78 | return 0; | 78 | return 0; |
79 | 79 | ||
@@ -152,7 +152,7 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | |||
152 | } | 152 | } |
153 | 153 | ||
154 | /* Determine the MSCAN device index from the physical address */ | 154 | /* Determine the MSCAN device index from the physical address */ |
155 | pval = of_get_property(ofdev->node, "reg", &plen); | 155 | pval = of_get_property(ofdev->dev.of_node, "reg", &plen); |
156 | BUG_ON(!pval || plen < sizeof(*pval)); | 156 | BUG_ON(!pval || plen < sizeof(*pval)); |
157 | clockidx = (*pval & 0x80) ? 1 : 0; | 157 | clockidx = (*pval & 0x80) ? 1 : 0; |
158 | if (*pval & 0x2000) | 158 | if (*pval & 0x2000) |
@@ -168,11 +168,11 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | |||
168 | */ | 168 | */ |
169 | if (clock_name && !strcmp(clock_name, "ip")) { | 169 | if (clock_name && !strcmp(clock_name, "ip")) { |
170 | *mscan_clksrc = MSCAN_CLKSRC_IPS; | 170 | *mscan_clksrc = MSCAN_CLKSRC_IPS; |
171 | freq = mpc5xxx_get_bus_frequency(ofdev->node); | 171 | freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node); |
172 | } else { | 172 | } else { |
173 | *mscan_clksrc = MSCAN_CLKSRC_BUS; | 173 | *mscan_clksrc = MSCAN_CLKSRC_BUS; |
174 | 174 | ||
175 | pval = of_get_property(ofdev->node, | 175 | pval = of_get_property(ofdev->dev.of_node, |
176 | "fsl,mscan-clock-divider", &plen); | 176 | "fsl,mscan-clock-divider", &plen); |
177 | if (pval && plen == sizeof(*pval)) | 177 | if (pval && plen == sizeof(*pval)) |
178 | clockdiv = *pval; | 178 | clockdiv = *pval; |
@@ -251,7 +251,7 @@ static int __devinit mpc5xxx_can_probe(struct of_device *ofdev, | |||
251 | const struct of_device_id *id) | 251 | const struct of_device_id *id) |
252 | { | 252 | { |
253 | struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; | 253 | struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; |
254 | struct device_node *np = ofdev->node; | 254 | struct device_node *np = ofdev->dev.of_node; |
255 | struct net_device *dev; | 255 | struct net_device *dev; |
256 | struct mscan_priv *priv; | 256 | struct mscan_priv *priv; |
257 | void __iomem *base; | 257 | void __iomem *base; |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 24507f3b8b17..57a7e41da69e 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -2554,7 +2554,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter) | |||
2554 | mdef = er32(MDEF(i)); | 2554 | mdef = er32(MDEF(i)); |
2555 | 2555 | ||
2556 | /* Ignore filters with anything other than IPMI ports */ | 2556 | /* Ignore filters with anything other than IPMI ports */ |
2557 | if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664)) | 2557 | if (mdef & ~(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664)) |
2558 | continue; | 2558 | continue; |
2559 | 2559 | ||
2560 | /* Enable this decision filter in MANC2H */ | 2560 | /* Enable this decision filter in MANC2H */ |
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 85f2a2e7030a..45e86d1e5b1b 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -74,7 +74,14 @@ struct enic_msix_entry { | |||
74 | void *devid; | 74 | void *devid; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | #define ENIC_SET_APPLIED (1 << 0) | ||
78 | #define ENIC_SET_REQUEST (1 << 1) | ||
79 | #define ENIC_SET_NAME (1 << 2) | ||
80 | #define ENIC_SET_INSTANCE (1 << 3) | ||
81 | #define ENIC_SET_HOST (1 << 4) | ||
82 | |||
77 | struct enic_port_profile { | 83 | struct enic_port_profile { |
84 | u32 set; | ||
78 | u8 request; | 85 | u8 request; |
79 | char name[PORT_PROFILE_MAX]; | 86 | char name[PORT_PROFILE_MAX]; |
80 | u8 instance_uuid[PORT_UUID_MAX]; | 87 | u8 instance_uuid[PORT_UUID_MAX]; |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 6586b5c7e4b6..bc7d6b96de3d 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1029,8 +1029,7 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error) | |||
1029 | return err; | 1029 | return err; |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac, | 1032 | static int enic_set_port_profile(struct enic *enic, u8 *mac) |
1033 | char *name, u8 *instance_uuid, u8 *host_uuid) | ||
1034 | { | 1033 | { |
1035 | struct vic_provinfo *vp; | 1034 | struct vic_provinfo *vp; |
1036 | u8 oui[3] = VIC_PROVINFO_CISCO_OUI; | 1035 | u8 oui[3] = VIC_PROVINFO_CISCO_OUI; |
@@ -1040,97 +1039,112 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac, | |||
1040 | "%02X%02X-%02X%02X%02X%02X%0X%02X"; | 1039 | "%02X%02X-%02X%02X%02X%02X%0X%02X"; |
1041 | int err; | 1040 | int err; |
1042 | 1041 | ||
1043 | if (!name) | 1042 | err = enic_vnic_dev_deinit(enic); |
1044 | return -EINVAL; | 1043 | if (err) |
1044 | return err; | ||
1045 | 1045 | ||
1046 | if (!is_valid_ether_addr(mac)) | 1046 | switch (enic->pp.request) { |
1047 | return -EADDRNOTAVAIL; | ||
1048 | 1047 | ||
1049 | vp = vic_provinfo_alloc(GFP_KERNEL, oui, VIC_PROVINFO_LINUX_TYPE); | 1048 | case PORT_REQUEST_ASSOCIATE: |
1050 | if (!vp) | ||
1051 | return -ENOMEM; | ||
1052 | 1049 | ||
1053 | vic_provinfo_add_tlv(vp, | 1050 | if (!(enic->pp.set & ENIC_SET_NAME) || !strlen(enic->pp.name)) |
1054 | VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR, | 1051 | return -EINVAL; |
1055 | strlen(name) + 1, name); | ||
1056 | |||
1057 | vic_provinfo_add_tlv(vp, | ||
1058 | VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR, | ||
1059 | ETH_ALEN, mac); | ||
1060 | |||
1061 | if (instance_uuid) { | ||
1062 | uuid = instance_uuid; | ||
1063 | sprintf(uuid_str, uuid_fmt, | ||
1064 | uuid[0], uuid[1], uuid[2], uuid[3], | ||
1065 | uuid[4], uuid[5], uuid[6], uuid[7], | ||
1066 | uuid[8], uuid[9], uuid[10], uuid[11], | ||
1067 | uuid[12], uuid[13], uuid[14], uuid[15]); | ||
1068 | vic_provinfo_add_tlv(vp, | ||
1069 | VIC_LINUX_PROV_TLV_CLIENT_UUID_STR, | ||
1070 | sizeof(uuid_str), uuid_str); | ||
1071 | } | ||
1072 | 1052 | ||
1073 | if (host_uuid) { | 1053 | if (!is_valid_ether_addr(mac)) |
1074 | uuid = host_uuid; | 1054 | return -EADDRNOTAVAIL; |
1075 | sprintf(uuid_str, uuid_fmt, | ||
1076 | uuid[0], uuid[1], uuid[2], uuid[3], | ||
1077 | uuid[4], uuid[5], uuid[6], uuid[7], | ||
1078 | uuid[8], uuid[9], uuid[10], uuid[11], | ||
1079 | uuid[12], uuid[13], uuid[14], uuid[15]); | ||
1080 | vic_provinfo_add_tlv(vp, | ||
1081 | VIC_LINUX_PROV_TLV_HOST_UUID_STR, | ||
1082 | sizeof(uuid_str), uuid_str); | ||
1083 | } | ||
1084 | 1055 | ||
1085 | err = enic_vnic_dev_deinit(enic); | 1056 | vp = vic_provinfo_alloc(GFP_KERNEL, oui, |
1086 | if (err) | 1057 | VIC_PROVINFO_LINUX_TYPE); |
1087 | goto err_out; | 1058 | if (!vp) |
1059 | return -ENOMEM; | ||
1088 | 1060 | ||
1089 | memset(&enic->pp, 0, sizeof(enic->pp)); | 1061 | vic_provinfo_add_tlv(vp, |
1062 | VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR, | ||
1063 | strlen(enic->pp.name) + 1, enic->pp.name); | ||
1090 | 1064 | ||
1091 | err = enic_dev_init_prov(enic, vp); | 1065 | vic_provinfo_add_tlv(vp, |
1092 | if (err) | 1066 | VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR, |
1093 | goto err_out; | 1067 | ETH_ALEN, mac); |
1068 | |||
1069 | if (enic->pp.set & ENIC_SET_INSTANCE) { | ||
1070 | uuid = enic->pp.instance_uuid; | ||
1071 | sprintf(uuid_str, uuid_fmt, | ||
1072 | uuid[0], uuid[1], uuid[2], uuid[3], | ||
1073 | uuid[4], uuid[5], uuid[6], uuid[7], | ||
1074 | uuid[8], uuid[9], uuid[10], uuid[11], | ||
1075 | uuid[12], uuid[13], uuid[14], uuid[15]); | ||
1076 | vic_provinfo_add_tlv(vp, | ||
1077 | VIC_LINUX_PROV_TLV_CLIENT_UUID_STR, | ||
1078 | sizeof(uuid_str), uuid_str); | ||
1079 | } | ||
1094 | 1080 | ||
1095 | enic->pp.request = request; | 1081 | if (enic->pp.set & ENIC_SET_HOST) { |
1096 | memcpy(enic->pp.name, name, PORT_PROFILE_MAX); | 1082 | uuid = enic->pp.host_uuid; |
1097 | if (instance_uuid) | 1083 | sprintf(uuid_str, uuid_fmt, |
1098 | memcpy(enic->pp.instance_uuid, | 1084 | uuid[0], uuid[1], uuid[2], uuid[3], |
1099 | instance_uuid, PORT_UUID_MAX); | 1085 | uuid[4], uuid[5], uuid[6], uuid[7], |
1100 | if (host_uuid) | 1086 | uuid[8], uuid[9], uuid[10], uuid[11], |
1101 | memcpy(enic->pp.host_uuid, | 1087 | uuid[12], uuid[13], uuid[14], uuid[15]); |
1102 | host_uuid, PORT_UUID_MAX); | 1088 | vic_provinfo_add_tlv(vp, |
1089 | VIC_LINUX_PROV_TLV_HOST_UUID_STR, | ||
1090 | sizeof(uuid_str), uuid_str); | ||
1091 | } | ||
1103 | 1092 | ||
1104 | err_out: | 1093 | err = enic_dev_init_prov(enic, vp); |
1105 | vic_provinfo_free(vp); | 1094 | vic_provinfo_free(vp); |
1095 | if (err) | ||
1096 | return err; | ||
1097 | break; | ||
1106 | 1098 | ||
1107 | return err; | 1099 | case PORT_REQUEST_DISASSOCIATE: |
1108 | } | 1100 | break; |
1109 | 1101 | ||
1110 | static int enic_unset_port_profile(struct enic *enic) | 1102 | default: |
1111 | { | 1103 | return -EINVAL; |
1112 | memset(&enic->pp, 0, sizeof(enic->pp)); | 1104 | } |
1113 | return enic_vnic_dev_deinit(enic); | 1105 | |
1106 | enic->pp.set |= ENIC_SET_APPLIED; | ||
1107 | return 0; | ||
1114 | } | 1108 | } |
1115 | 1109 | ||
1116 | static int enic_set_vf_port(struct net_device *netdev, int vf, | 1110 | static int enic_set_vf_port(struct net_device *netdev, int vf, |
1117 | struct nlattr *port[]) | 1111 | struct nlattr *port[]) |
1118 | { | 1112 | { |
1119 | struct enic *enic = netdev_priv(netdev); | 1113 | struct enic *enic = netdev_priv(netdev); |
1120 | char *name = NULL; | 1114 | |
1121 | u8 *instance_uuid = NULL; | 1115 | memset(&enic->pp, 0, sizeof(enic->pp)); |
1122 | u8 *host_uuid = NULL; | 1116 | |
1123 | u8 request = PORT_REQUEST_DISASSOCIATE; | 1117 | if (port[IFLA_PORT_REQUEST]) { |
1118 | enic->pp.set |= ENIC_SET_REQUEST; | ||
1119 | enic->pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]); | ||
1120 | } | ||
1121 | |||
1122 | if (port[IFLA_PORT_PROFILE]) { | ||
1123 | enic->pp.set |= ENIC_SET_NAME; | ||
1124 | memcpy(enic->pp.name, nla_data(port[IFLA_PORT_PROFILE]), | ||
1125 | PORT_PROFILE_MAX); | ||
1126 | } | ||
1127 | |||
1128 | if (port[IFLA_PORT_INSTANCE_UUID]) { | ||
1129 | enic->pp.set |= ENIC_SET_INSTANCE; | ||
1130 | memcpy(enic->pp.instance_uuid, | ||
1131 | nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX); | ||
1132 | } | ||
1133 | |||
1134 | if (port[IFLA_PORT_HOST_UUID]) { | ||
1135 | enic->pp.set |= ENIC_SET_HOST; | ||
1136 | memcpy(enic->pp.host_uuid, | ||
1137 | nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX); | ||
1138 | } | ||
1124 | 1139 | ||
1125 | /* don't support VFs, yet */ | 1140 | /* don't support VFs, yet */ |
1126 | if (vf != PORT_SELF_VF) | 1141 | if (vf != PORT_SELF_VF) |
1127 | return -EOPNOTSUPP; | 1142 | return -EOPNOTSUPP; |
1128 | 1143 | ||
1129 | if (port[IFLA_PORT_REQUEST]) | 1144 | if (!(enic->pp.set & ENIC_SET_REQUEST)) |
1130 | request = nla_get_u8(port[IFLA_PORT_REQUEST]); | 1145 | return -EOPNOTSUPP; |
1131 | 1146 | ||
1132 | switch (request) { | 1147 | if (enic->pp.request == PORT_REQUEST_ASSOCIATE) { |
1133 | case PORT_REQUEST_ASSOCIATE: | ||
1134 | 1148 | ||
1135 | /* If the interface mac addr hasn't been assigned, | 1149 | /* If the interface mac addr hasn't been assigned, |
1136 | * assign a random mac addr before setting port- | 1150 | * assign a random mac addr before setting port- |
@@ -1139,30 +1153,9 @@ static int enic_set_vf_port(struct net_device *netdev, int vf, | |||
1139 | 1153 | ||
1140 | if (is_zero_ether_addr(netdev->dev_addr)) | 1154 | if (is_zero_ether_addr(netdev->dev_addr)) |
1141 | random_ether_addr(netdev->dev_addr); | 1155 | random_ether_addr(netdev->dev_addr); |
1142 | |||
1143 | if (port[IFLA_PORT_PROFILE]) | ||
1144 | name = nla_data(port[IFLA_PORT_PROFILE]); | ||
1145 | |||
1146 | if (port[IFLA_PORT_INSTANCE_UUID]) | ||
1147 | instance_uuid = | ||
1148 | nla_data(port[IFLA_PORT_INSTANCE_UUID]); | ||
1149 | |||
1150 | if (port[IFLA_PORT_HOST_UUID]) | ||
1151 | host_uuid = nla_data(port[IFLA_PORT_HOST_UUID]); | ||
1152 | |||
1153 | return enic_set_port_profile(enic, request, | ||
1154 | netdev->dev_addr, name, | ||
1155 | instance_uuid, host_uuid); | ||
1156 | |||
1157 | case PORT_REQUEST_DISASSOCIATE: | ||
1158 | |||
1159 | return enic_unset_port_profile(enic); | ||
1160 | |||
1161 | default: | ||
1162 | break; | ||
1163 | } | 1156 | } |
1164 | 1157 | ||
1165 | return -EOPNOTSUPP; | 1158 | return enic_set_port_profile(enic, netdev->dev_addr); |
1166 | } | 1159 | } |
1167 | 1160 | ||
1168 | static int enic_get_vf_port(struct net_device *netdev, int vf, | 1161 | 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, | |||
1172 | int err, error, done; | 1165 | int err, error, done; |
1173 | u16 response = PORT_PROFILE_RESPONSE_SUCCESS; | 1166 | u16 response = PORT_PROFILE_RESPONSE_SUCCESS; |
1174 | 1167 | ||
1175 | /* don't support VFs, yet */ | 1168 | if (!(enic->pp.set & ENIC_SET_APPLIED)) |
1176 | if (vf != PORT_SELF_VF) | 1169 | return -ENODATA; |
1177 | return -EOPNOTSUPP; | ||
1178 | 1170 | ||
1179 | err = enic_dev_init_done(enic, &done, &error); | 1171 | err = enic_dev_init_done(enic, &done, &error); |
1180 | |||
1181 | if (err) | 1172 | if (err) |
1182 | return err; | 1173 | error = err; |
1183 | 1174 | ||
1184 | switch (error) { | 1175 | switch (error) { |
1185 | case ERR_SUCCESS: | 1176 | case ERR_SUCCESS: |
@@ -1202,12 +1193,15 @@ static int enic_get_vf_port(struct net_device *netdev, int vf, | |||
1202 | 1193 | ||
1203 | NLA_PUT_U16(skb, IFLA_PORT_REQUEST, enic->pp.request); | 1194 | NLA_PUT_U16(skb, IFLA_PORT_REQUEST, enic->pp.request); |
1204 | NLA_PUT_U16(skb, IFLA_PORT_RESPONSE, response); | 1195 | NLA_PUT_U16(skb, IFLA_PORT_RESPONSE, response); |
1205 | NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX, | 1196 | if (enic->pp.set & ENIC_SET_NAME) |
1206 | enic->pp.name); | 1197 | NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX, |
1207 | NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX, | 1198 | enic->pp.name); |
1208 | enic->pp.instance_uuid); | 1199 | if (enic->pp.set & ENIC_SET_INSTANCE) |
1209 | NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX, | 1200 | NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX, |
1210 | enic->pp.host_uuid); | 1201 | enic->pp.instance_uuid); |
1202 | if (enic->pp.set & ENIC_SET_HOST) | ||
1203 | NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX, | ||
1204 | enic->pp.host_uuid); | ||
1211 | 1205 | ||
1212 | return 0; | 1206 | return 0; |
1213 | 1207 | ||
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 6838dfc9ef23..4c274657283c 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -87,6 +87,7 @@ static int rx_copybreak; | |||
87 | #include <linux/bitops.h> | 87 | #include <linux/bitops.h> |
88 | #include <asm/io.h> | 88 | #include <asm/io.h> |
89 | #include <asm/uaccess.h> | 89 | #include <asm/uaccess.h> |
90 | #include <asm/byteorder.h> | ||
90 | 91 | ||
91 | /* These identify the driver base version and may not be removed. */ | 92 | /* These identify the driver base version and may not be removed. */ |
92 | static char version[] __devinitdata = | 93 | static char version[] __devinitdata = |
@@ -230,7 +231,7 @@ static const u16 media2miictl[16] = { | |||
230 | * The EPIC100 Rx and Tx buffer descriptors. Note that these | 231 | * The EPIC100 Rx and Tx buffer descriptors. Note that these |
231 | * really ARE host-endian; it's not a misannotation. We tell | 232 | * really ARE host-endian; it's not a misannotation. We tell |
232 | * the card to byteswap them internally on big-endian hosts - | 233 | * the card to byteswap them internally on big-endian hosts - |
233 | * look for #ifdef CONFIG_BIG_ENDIAN in epic_open(). | 234 | * look for #ifdef __BIG_ENDIAN in epic_open(). |
234 | */ | 235 | */ |
235 | 236 | ||
236 | struct epic_tx_desc { | 237 | struct epic_tx_desc { |
@@ -690,7 +691,7 @@ static int epic_open(struct net_device *dev) | |||
690 | outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL); | 691 | outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL); |
691 | 692 | ||
692 | /* Tell the chip to byteswap descriptors on big-endian hosts */ | 693 | /* Tell the chip to byteswap descriptors on big-endian hosts */ |
693 | #ifdef CONFIG_BIG_ENDIAN | 694 | #ifdef __BIG_ENDIAN |
694 | outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); | 695 | outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); |
695 | inl(ioaddr + GENCTL); | 696 | inl(ioaddr + GENCTL); |
696 | outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); | 697 | outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); |
@@ -806,7 +807,7 @@ static void epic_restart(struct net_device *dev) | |||
806 | for (i = 16; i > 0; i--) | 807 | for (i = 16; i > 0; i--) |
807 | outl(0x0008, ioaddr + TEST1); | 808 | outl(0x0008, ioaddr + TEST1); |
808 | 809 | ||
809 | #ifdef CONFIG_BIG_ENDIAN | 810 | #ifdef __BIG_ENDIAN |
810 | outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); | 811 | outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); |
811 | #else | 812 | #else |
812 | outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); | 813 | outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index a3565adc034c..a3cae4ed6ac9 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1369,10 +1369,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state) | |||
1369 | 1369 | ||
1370 | if (ndev) { | 1370 | if (ndev) { |
1371 | fep = netdev_priv(ndev); | 1371 | fep = netdev_priv(ndev); |
1372 | if (netif_running(ndev)) { | 1372 | if (netif_running(ndev)) |
1373 | netif_device_detach(ndev); | 1373 | fec_enet_close(ndev); |
1374 | fec_stop(ndev); | 1374 | clk_disable(fep->clk); |
1375 | } | ||
1376 | } | 1375 | } |
1377 | return 0; | 1376 | return 0; |
1378 | } | 1377 | } |
@@ -1381,12 +1380,13 @@ static int | |||
1381 | fec_resume(struct platform_device *dev) | 1380 | fec_resume(struct platform_device *dev) |
1382 | { | 1381 | { |
1383 | struct net_device *ndev = platform_get_drvdata(dev); | 1382 | struct net_device *ndev = platform_get_drvdata(dev); |
1383 | struct fec_enet_private *fep; | ||
1384 | 1384 | ||
1385 | if (ndev) { | 1385 | if (ndev) { |
1386 | if (netif_running(ndev)) { | 1386 | fep = netdev_priv(ndev); |
1387 | fec_enet_init(ndev, 0); | 1387 | clk_enable(fep->clk); |
1388 | netif_device_attach(ndev); | 1388 | if (netif_running(ndev)) |
1389 | } | 1389 | fec_enet_open(ndev); |
1390 | } | 1390 | } |
1391 | return 0; | 1391 | return 0; |
1392 | } | 1392 | } |
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index f37a4c143ddd..3a029d02c2b4 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -1607,14 +1607,13 @@ static struct of_device_id greth_of_match[] = { | |||
1607 | MODULE_DEVICE_TABLE(of, greth_of_match); | 1607 | MODULE_DEVICE_TABLE(of, greth_of_match); |
1608 | 1608 | ||
1609 | static struct of_platform_driver greth_of_driver = { | 1609 | static struct of_platform_driver greth_of_driver = { |
1610 | .name = "grlib-greth", | 1610 | .driver = { |
1611 | .match_table = greth_of_match, | 1611 | .name = "grlib-greth", |
1612 | .owner = THIS_MODULE, | ||
1613 | .of_match_table = greth_of_match, | ||
1614 | }, | ||
1612 | .probe = greth_of_probe, | 1615 | .probe = greth_of_probe, |
1613 | .remove = __devexit_p(greth_of_remove), | 1616 | .remove = __devexit_p(greth_of_remove), |
1614 | .driver = { | ||
1615 | .owner = THIS_MODULE, | ||
1616 | .name = "grlib-greth", | ||
1617 | }, | ||
1618 | }; | 1617 | }; |
1619 | 1618 | ||
1620 | static int __init greth_init(void) | 1619 | static int __init greth_init(void) |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 1159d9138f05..9595b1bfb8dd 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/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, | |||
1188 | IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high); | 1188 | IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high); |
1189 | } else { | 1189 | } else { |
1190 | hw_dbg(hw, "RAR index %d is out of range.\n", index); | 1190 | hw_dbg(hw, "RAR index %d is out of range.\n", index); |
1191 | return IXGBE_ERR_RAR_INDEX; | ||
1191 | } | 1192 | } |
1192 | 1193 | ||
1193 | return 0; | 1194 | return 0; |
@@ -1219,6 +1220,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index) | |||
1219 | IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high); | 1220 | IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high); |
1220 | } else { | 1221 | } else { |
1221 | hw_dbg(hw, "RAR index %d is out of range.\n", index); | 1222 | hw_dbg(hw, "RAR index %d is out of range.\n", index); |
1223 | return IXGBE_ERR_RAR_INDEX; | ||
1222 | } | 1224 | } |
1223 | 1225 | ||
1224 | /* clear VMDq pool/queue selection for this RAR */ | 1226 | /* clear VMDq pool/queue selection for this RAR */ |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 04e64de4a600..6b483d352f23 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -642,7 +642,7 @@ static inline bool ixgbe_tx_xon_state(struct ixgbe_adapter *adapter, | |||
642 | u32 txoff = IXGBE_TFCS_TXOFF; | 642 | u32 txoff = IXGBE_TFCS_TXOFF; |
643 | 643 | ||
644 | #ifdef CONFIG_IXGBE_DCB | 644 | #ifdef CONFIG_IXGBE_DCB |
645 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 645 | if (adapter->dcb_cfg.pfc_mode_enable) { |
646 | int tc; | 646 | int tc; |
647 | int reg_idx = tx_ring->reg_idx; | 647 | int reg_idx = tx_ring->reg_idx; |
648 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; | 648 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 2eb6e151016c..cdd1998f18c7 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2609,6 +2609,7 @@ struct ixgbe_info { | |||
2609 | #define IXGBE_ERR_EEPROM_VERSION -24 | 2609 | #define IXGBE_ERR_EEPROM_VERSION -24 |
2610 | #define IXGBE_ERR_NO_SPACE -25 | 2610 | #define IXGBE_ERR_NO_SPACE -25 |
2611 | #define IXGBE_ERR_OVERTEMP -26 | 2611 | #define IXGBE_ERR_OVERTEMP -26 |
2612 | #define IXGBE_ERR_RAR_INDEX -27 | ||
2612 | #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF | 2613 | #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF |
2613 | 2614 | ||
2614 | #endif /* _IXGBE_TYPE_H_ */ | 2615 | #endif /* _IXGBE_TYPE_H_ */ |
diff --git a/drivers/net/korina.c b/drivers/net/korina.c index 26bf1b76b997..c7a9bef4dfb0 100644 --- a/drivers/net/korina.c +++ b/drivers/net/korina.c | |||
@@ -135,6 +135,7 @@ struct korina_private { | |||
135 | struct napi_struct napi; | 135 | struct napi_struct napi; |
136 | struct timer_list media_check_timer; | 136 | struct timer_list media_check_timer; |
137 | struct mii_if_info mii_if; | 137 | struct mii_if_info mii_if; |
138 | struct work_struct restart_task; | ||
138 | struct net_device *dev; | 139 | struct net_device *dev; |
139 | int phy_addr; | 140 | int phy_addr; |
140 | }; | 141 | }; |
@@ -375,7 +376,7 @@ static int korina_rx(struct net_device *dev, int limit) | |||
375 | if (devcs & ETH_RX_LE) | 376 | if (devcs & ETH_RX_LE) |
376 | dev->stats.rx_length_errors++; | 377 | dev->stats.rx_length_errors++; |
377 | if (devcs & ETH_RX_OVR) | 378 | if (devcs & ETH_RX_OVR) |
378 | dev->stats.rx_over_errors++; | 379 | dev->stats.rx_fifo_errors++; |
379 | if (devcs & ETH_RX_CV) | 380 | if (devcs & ETH_RX_CV) |
380 | dev->stats.rx_frame_errors++; | 381 | dev->stats.rx_frame_errors++; |
381 | if (devcs & ETH_RX_CES) | 382 | if (devcs & ETH_RX_CES) |
@@ -764,10 +765,9 @@ static int korina_alloc_ring(struct net_device *dev) | |||
764 | 765 | ||
765 | /* Initialize the receive descriptors */ | 766 | /* Initialize the receive descriptors */ |
766 | for (i = 0; i < KORINA_NUM_RDS; i++) { | 767 | for (i = 0; i < KORINA_NUM_RDS; i++) { |
767 | skb = dev_alloc_skb(KORINA_RBSIZE + 2); | 768 | skb = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE); |
768 | if (!skb) | 769 | if (!skb) |
769 | return -ENOMEM; | 770 | return -ENOMEM; |
770 | skb_reserve(skb, 2); | ||
771 | lp->rx_skb[i] = skb; | 771 | lp->rx_skb[i] = skb; |
772 | lp->rd_ring[i].control = DMA_DESC_IOD | | 772 | lp->rd_ring[i].control = DMA_DESC_IOD | |
773 | DMA_COUNT(KORINA_RBSIZE); | 773 | DMA_COUNT(KORINA_RBSIZE); |
@@ -890,12 +890,12 @@ static int korina_init(struct net_device *dev) | |||
890 | 890 | ||
891 | /* | 891 | /* |
892 | * Restart the RC32434 ethernet controller. | 892 | * Restart the RC32434 ethernet controller. |
893 | * FIXME: check the return status where we call it | ||
894 | */ | 893 | */ |
895 | static int korina_restart(struct net_device *dev) | 894 | static void korina_restart_task(struct work_struct *work) |
896 | { | 895 | { |
897 | struct korina_private *lp = netdev_priv(dev); | 896 | struct korina_private *lp = container_of(work, |
898 | int ret; | 897 | struct korina_private, restart_task); |
898 | struct net_device *dev = lp->dev; | ||
899 | 899 | ||
900 | /* | 900 | /* |
901 | * Disable interrupts | 901 | * Disable interrupts |
@@ -916,10 +916,9 @@ static int korina_restart(struct net_device *dev) | |||
916 | 916 | ||
917 | napi_disable(&lp->napi); | 917 | napi_disable(&lp->napi); |
918 | 918 | ||
919 | ret = korina_init(dev); | 919 | if (korina_init(dev) < 0) { |
920 | if (ret < 0) { | ||
921 | printk(KERN_ERR "%s: cannot restart device\n", dev->name); | 920 | printk(KERN_ERR "%s: cannot restart device\n", dev->name); |
922 | return ret; | 921 | return; |
923 | } | 922 | } |
924 | korina_multicast_list(dev); | 923 | korina_multicast_list(dev); |
925 | 924 | ||
@@ -927,8 +926,6 @@ static int korina_restart(struct net_device *dev) | |||
927 | enable_irq(lp->ovr_irq); | 926 | enable_irq(lp->ovr_irq); |
928 | enable_irq(lp->tx_irq); | 927 | enable_irq(lp->tx_irq); |
929 | enable_irq(lp->rx_irq); | 928 | enable_irq(lp->rx_irq); |
930 | |||
931 | return ret; | ||
932 | } | 929 | } |
933 | 930 | ||
934 | static void korina_clear_and_restart(struct net_device *dev, u32 value) | 931 | 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) | |||
937 | 934 | ||
938 | netif_stop_queue(dev); | 935 | netif_stop_queue(dev); |
939 | writel(value, &lp->eth_regs->ethintfc); | 936 | writel(value, &lp->eth_regs->ethintfc); |
940 | korina_restart(dev); | 937 | schedule_work(&lp->restart_task); |
941 | } | 938 | } |
942 | 939 | ||
943 | /* Ethernet Tx Underflow interrupt */ | 940 | /* Ethernet Tx Underflow interrupt */ |
@@ -962,11 +959,8 @@ static irqreturn_t korina_und_interrupt(int irq, void *dev_id) | |||
962 | static void korina_tx_timeout(struct net_device *dev) | 959 | static void korina_tx_timeout(struct net_device *dev) |
963 | { | 960 | { |
964 | struct korina_private *lp = netdev_priv(dev); | 961 | struct korina_private *lp = netdev_priv(dev); |
965 | unsigned long flags; | ||
966 | 962 | ||
967 | spin_lock_irqsave(&lp->lock, flags); | 963 | schedule_work(&lp->restart_task); |
968 | korina_restart(dev); | ||
969 | spin_unlock_irqrestore(&lp->lock, flags); | ||
970 | } | 964 | } |
971 | 965 | ||
972 | /* Ethernet Rx Overflow interrupt */ | 966 | /* Ethernet Rx Overflow interrupt */ |
@@ -1086,6 +1080,8 @@ static int korina_close(struct net_device *dev) | |||
1086 | 1080 | ||
1087 | napi_disable(&lp->napi); | 1081 | napi_disable(&lp->napi); |
1088 | 1082 | ||
1083 | cancel_work_sync(&lp->restart_task); | ||
1084 | |||
1089 | free_irq(lp->rx_irq, dev); | 1085 | free_irq(lp->rx_irq, dev); |
1090 | free_irq(lp->tx_irq, dev); | 1086 | free_irq(lp->tx_irq, dev); |
1091 | free_irq(lp->ovr_irq, dev); | 1087 | free_irq(lp->ovr_irq, dev); |
@@ -1198,6 +1194,8 @@ static int korina_probe(struct platform_device *pdev) | |||
1198 | } | 1194 | } |
1199 | setup_timer(&lp->media_check_timer, korina_poll_media, (unsigned long) dev); | 1195 | setup_timer(&lp->media_check_timer, korina_poll_media, (unsigned long) dev); |
1200 | 1196 | ||
1197 | INIT_WORK(&lp->restart_task, korina_restart_task); | ||
1198 | |||
1201 | printk(KERN_INFO "%s: " DRV_NAME "-" DRV_VERSION " " DRV_RELDATE "\n", | 1199 | printk(KERN_INFO "%s: " DRV_NAME "-" DRV_VERSION " " DRV_RELDATE "\n", |
1202 | dev->name); | 1200 | dev->name); |
1203 | out: | 1201 | out: |
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c index c80ca64277b2..7805bbf1d53a 100644 --- a/drivers/net/ksz884x.c +++ b/drivers/net/ksz884x.c | |||
@@ -4854,7 +4854,7 @@ static inline void copy_old_skb(struct sk_buff *old, struct sk_buff *skb) | |||
4854 | * | 4854 | * |
4855 | * Return 0 if successful; otherwise an error code indicating failure. | 4855 | * Return 0 if successful; otherwise an error code indicating failure. |
4856 | */ | 4856 | */ |
4857 | static int netdev_tx(struct sk_buff *skb, struct net_device *dev) | 4857 | static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev) |
4858 | { | 4858 | { |
4859 | struct dev_priv *priv = netdev_priv(dev); | 4859 | struct dev_priv *priv = netdev_priv(dev); |
4860 | struct dev_info *hw_priv = priv->adapter; | 4860 | struct dev_info *hw_priv = priv->adapter; |
@@ -6863,6 +6863,7 @@ static const struct net_device_ops netdev_ops = { | |||
6863 | .ndo_tx_timeout = netdev_tx_timeout, | 6863 | .ndo_tx_timeout = netdev_tx_timeout, |
6864 | .ndo_change_mtu = netdev_change_mtu, | 6864 | .ndo_change_mtu = netdev_change_mtu, |
6865 | .ndo_set_mac_address = netdev_set_mac_address, | 6865 | .ndo_set_mac_address = netdev_set_mac_address, |
6866 | .ndo_validate_addr = eth_validate_addr, | ||
6866 | .ndo_do_ioctl = netdev_ioctl, | 6867 | .ndo_do_ioctl = netdev_ioctl, |
6867 | .ndo_set_rx_mode = netdev_set_rx_mode, | 6868 | .ndo_set_rx_mode = netdev_set_rx_mode, |
6868 | #ifdef CONFIG_NET_POLL_CONTROLLER | 6869 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index e38f603a71f1..e7b4187da057 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -1416,7 +1416,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
1416 | flen = len; | 1416 | flen = len; |
1417 | if (nfree > 0) { | 1417 | if (nfree > 0) { |
1418 | if (pch->speed == 0) { | 1418 | if (pch->speed == 0) { |
1419 | flen = totlen/nfree; | 1419 | flen = len/nfree; |
1420 | if (nbigger > 0) { | 1420 | if (nbigger > 0) { |
1421 | flen++; | 1421 | flen++; |
1422 | nbigger--; | 1422 | nbigger--; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index ca93cdf002a7..6949504589db 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -559,6 +559,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) | |||
559 | break; | 559 | break; |
560 | udelay(25); | 560 | udelay(25); |
561 | } | 561 | } |
562 | /* | ||
563 | * Some configurations require a small delay even after the write | ||
564 | * completed indication or the next write might fail. | ||
565 | */ | ||
566 | udelay(25); | ||
562 | } | 567 | } |
563 | 568 | ||
564 | static int mdio_read(void __iomem *ioaddr, int reg_addr) | 569 | static int mdio_read(void __iomem *ioaddr, int reg_addr) |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 6b2e4402ec57..ba636e086fc3 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -836,7 +836,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx) | |||
836 | 836 | ||
837 | static inline unsigned int efx_port_num(struct efx_nic *efx) | 837 | static inline unsigned int efx_port_num(struct efx_nic *efx) |
838 | { | 838 | { |
839 | return efx->port_num; | 839 | return efx->net_dev->dev_id; |
840 | } | 840 | } |
841 | 841 | ||
842 | /** | 842 | /** |
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c index 7ecd255a7cc0..f2b1e6180753 100644 --- a/drivers/net/sfc/siena.c +++ b/drivers/net/sfc/siena.c | |||
@@ -222,7 +222,7 @@ static int siena_probe_nic(struct efx_nic *efx) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | efx_reado(efx, ®, FR_AZ_CS_DEBUG); | 224 | efx_reado(efx, ®, FR_AZ_CS_DEBUG); |
225 | efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1; | 225 | efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1; |
226 | 226 | ||
227 | efx_mcdi_init(efx); | 227 | efx_mcdi_init(efx); |
228 | 228 | ||
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c index 20ab16192325..737df6032bbc 100644 --- a/drivers/net/tehuti.c +++ b/drivers/net/tehuti.c | |||
@@ -646,7 +646,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) | |||
646 | error = copy_from_user(data, ifr->ifr_data, sizeof(data)); | 646 | error = copy_from_user(data, ifr->ifr_data, sizeof(data)); |
647 | if (error) { | 647 | if (error) { |
648 | pr_err("cant copy from user\n"); | 648 | pr_err("cant copy from user\n"); |
649 | RET(error); | 649 | RET(-EFAULT); |
650 | } | 650 | } |
651 | DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); | 651 | DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); |
652 | } | 652 | } |
@@ -665,7 +665,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) | |||
665 | data[2]); | 665 | data[2]); |
666 | error = copy_to_user(ifr->ifr_data, data, sizeof(data)); | 666 | error = copy_to_user(ifr->ifr_data, data, sizeof(data)); |
667 | if (error) | 667 | if (error) |
668 | RET(error); | 668 | RET(-EFAULT); |
669 | break; | 669 | break; |
670 | 670 | ||
671 | case BDX_OP_WRITE: | 671 | case BDX_OP_WRITE: |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 78eb3190b9b1..1edb7a61983c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -340,7 +340,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp) | |||
340 | 340 | ||
341 | skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); | 341 | skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); |
342 | 342 | ||
343 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb); | 343 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp); |
344 | if (err < 0) | 344 | if (err < 0) |
345 | dev_kfree_skb(skb); | 345 | dev_kfree_skb(skb); |
346 | 346 | ||
@@ -385,8 +385,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp) | |||
385 | 385 | ||
386 | /* chain first in list head */ | 386 | /* chain first in list head */ |
387 | first->private = (unsigned long)list; | 387 | first->private = (unsigned long)list; |
388 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, | 388 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, |
389 | first); | 389 | first, gfp); |
390 | if (err < 0) | 390 | if (err < 0) |
391 | give_pages(vi, first); | 391 | give_pages(vi, first); |
392 | 392 | ||
@@ -404,7 +404,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp) | |||
404 | 404 | ||
405 | sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); | 405 | sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); |
406 | 406 | ||
407 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page); | 407 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp); |
408 | if (err < 0) | 408 | if (err < 0) |
409 | give_pages(vi, page); | 409 | give_pages(vi, page); |
410 | 410 | ||
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 166e77dfffda..e47f5a986b1c 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -37,8 +37,6 @@ | |||
37 | #include <net/x25device.h> | 37 | #include <net/x25device.h> |
38 | #include "x25_asy.h" | 38 | #include "x25_asy.h" |
39 | 39 | ||
40 | #include <net/x25device.h> | ||
41 | |||
42 | static struct net_device **x25_asy_devs; | 40 | static struct net_device **x25_asy_devs; |
43 | static int x25_asy_maxdev = SL_NRUNIT; | 41 | static int x25_asy_maxdev = SL_NRUNIT; |
44 | 42 | ||
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index cc6d41dec332..2978359c4366 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -222,7 +222,6 @@ static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
222 | static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, | 222 | static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, |
223 | struct ath5k_txq *txq); | 223 | struct ath5k_txq *txq); |
224 | static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan); | 224 | static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan); |
225 | static int ath5k_reset_wake(struct ath5k_softc *sc); | ||
226 | static int ath5k_start(struct ieee80211_hw *hw); | 225 | static int ath5k_start(struct ieee80211_hw *hw); |
227 | static void ath5k_stop(struct ieee80211_hw *hw); | 226 | static void ath5k_stop(struct ieee80211_hw *hw); |
228 | static int ath5k_add_interface(struct ieee80211_hw *hw, | 227 | static int ath5k_add_interface(struct ieee80211_hw *hw, |
@@ -2770,7 +2769,7 @@ ath5k_tasklet_reset(unsigned long data) | |||
2770 | { | 2769 | { |
2771 | struct ath5k_softc *sc = (void *)data; | 2770 | struct ath5k_softc *sc = (void *)data; |
2772 | 2771 | ||
2773 | ath5k_reset_wake(sc); | 2772 | ath5k_reset(sc, sc->curchan); |
2774 | } | 2773 | } |
2775 | 2774 | ||
2776 | /* | 2775 | /* |
@@ -2941,23 +2940,13 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan) | |||
2941 | ath5k_beacon_config(sc); | 2940 | ath5k_beacon_config(sc); |
2942 | /* intrs are enabled by ath5k_beacon_config */ | 2941 | /* intrs are enabled by ath5k_beacon_config */ |
2943 | 2942 | ||
2943 | ieee80211_wake_queues(sc->hw); | ||
2944 | |||
2944 | return 0; | 2945 | return 0; |
2945 | err: | 2946 | err: |
2946 | return ret; | 2947 | return ret; |
2947 | } | 2948 | } |
2948 | 2949 | ||
2949 | static int | ||
2950 | ath5k_reset_wake(struct ath5k_softc *sc) | ||
2951 | { | ||
2952 | int ret; | ||
2953 | |||
2954 | ret = ath5k_reset(sc, sc->curchan); | ||
2955 | if (!ret) | ||
2956 | ieee80211_wake_queues(sc->hw); | ||
2957 | |||
2958 | return ret; | ||
2959 | } | ||
2960 | |||
2961 | static int ath5k_start(struct ieee80211_hw *hw) | 2950 | static int ath5k_start(struct ieee80211_hw *hw) |
2962 | { | 2951 | { |
2963 | return ath5k_init(hw->priv); | 2952 | return ath5k_init(hw->priv); |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index c00cc0c4d0b7..24e5d01d27d0 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -397,7 +397,7 @@ struct xt_table_info { | |||
397 | * @stacksize jumps (number of user chains) can possibly be made. | 397 | * @stacksize jumps (number of user chains) can possibly be made. |
398 | */ | 398 | */ |
399 | unsigned int stacksize; | 399 | unsigned int stacksize; |
400 | unsigned int *stackptr; | 400 | unsigned int __percpu *stackptr; |
401 | void ***jumpstack; | 401 | void ***jumpstack; |
402 | /* ipt_entry tables: one per CPU */ | 402 | /* ipt_entry tables: one per CPU */ |
403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ | 403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ |
diff --git a/include/net/dst.h b/include/net/dst.h index 612069beda73..81d1413a8701 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -250,11 +250,11 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | |||
250 | * Linux networking. Thus, destinations are stackable. | 250 | * Linux networking. Thus, destinations are stackable. |
251 | */ | 251 | */ |
252 | 252 | ||
253 | static inline struct dst_entry *dst_pop(struct dst_entry *dst) | 253 | static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb) |
254 | { | 254 | { |
255 | struct dst_entry *child = dst_clone(dst->child); | 255 | struct dst_entry *child = skb_dst(skb)->child; |
256 | 256 | ||
257 | dst_release(dst); | 257 | skb_dst_drop(skb); |
258 | return child; | 258 | return child; |
259 | } | 259 | } |
260 | 260 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index 3461e5d1e9ad..f8acf38f092f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1524,20 +1524,7 @@ extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); | |||
1524 | 1524 | ||
1525 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 1525 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
1526 | 1526 | ||
1527 | static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | 1527 | extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb); |
1528 | { | ||
1529 | /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces | ||
1530 | number of warnings when compiling with -W --ANK | ||
1531 | */ | ||
1532 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
1533 | (unsigned)sk->sk_rcvbuf) | ||
1534 | return -ENOMEM; | ||
1535 | skb_set_owner_r(skb, sk); | ||
1536 | skb_queue_tail(&sk->sk_error_queue, skb); | ||
1537 | if (!sock_flag(sk, SOCK_DEAD)) | ||
1538 | sk->sk_data_ready(sk, skb->len); | ||
1539 | return 0; | ||
1540 | } | ||
1541 | 1528 | ||
1542 | /* | 1529 | /* |
1543 | * Recover an error report and clear atomically | 1530 | * Recover an error report and clear atomically |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 55be90826f5f..529842677817 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -708,7 +708,8 @@ static int vlan_dev_init(struct net_device *dev) | |||
708 | netif_carrier_off(dev); | 708 | netif_carrier_off(dev); |
709 | 709 | ||
710 | /* IFF_BROADCAST|IFF_MULTICAST; ??? */ | 710 | /* IFF_BROADCAST|IFF_MULTICAST; ??? */ |
711 | dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI); | 711 | dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI | |
712 | IFF_MASTER | IFF_SLAVE); | ||
712 | dev->iflink = real_dev->ifindex; | 713 | dev->iflink = real_dev->ifindex; |
713 | dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) | | 714 | dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) | |
714 | (1<<__LINK_STATE_DORMANT))) | | 715 | (1<<__LINK_STATE_DORMANT))) | |
diff --git a/net/core/dev.c b/net/core/dev.c index 3abb3a6058be..b65347c2cf2a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2805,7 +2805,7 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
2805 | struct net_device *orig_dev; | 2805 | struct net_device *orig_dev; |
2806 | struct net_device *master; | 2806 | struct net_device *master; |
2807 | struct net_device *null_or_orig; | 2807 | struct net_device *null_or_orig; |
2808 | struct net_device *null_or_bond; | 2808 | struct net_device *orig_or_bond; |
2809 | int ret = NET_RX_DROP; | 2809 | int ret = NET_RX_DROP; |
2810 | __be16 type; | 2810 | __be16 type; |
2811 | 2811 | ||
@@ -2882,10 +2882,10 @@ ncls: | |||
2882 | * device that may have registered for a specific ptype. The | 2882 | * device that may have registered for a specific ptype. The |
2883 | * handler may have to adjust skb->dev and orig_dev. | 2883 | * handler may have to adjust skb->dev and orig_dev. |
2884 | */ | 2884 | */ |
2885 | null_or_bond = NULL; | 2885 | orig_or_bond = orig_dev; |
2886 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && | 2886 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && |
2887 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { | 2887 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { |
2888 | null_or_bond = vlan_dev_real_dev(skb->dev); | 2888 | orig_or_bond = vlan_dev_real_dev(skb->dev); |
2889 | } | 2889 | } |
2890 | 2890 | ||
2891 | type = skb->protocol; | 2891 | type = skb->protocol; |
@@ -2893,7 +2893,7 @@ ncls: | |||
2893 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { | 2893 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { |
2894 | if (ptype->type == type && (ptype->dev == null_or_orig || | 2894 | if (ptype->type == type && (ptype->dev == null_or_orig || |
2895 | ptype->dev == skb->dev || ptype->dev == orig_dev || | 2895 | ptype->dev == skb->dev || ptype->dev == orig_dev || |
2896 | ptype->dev == null_or_bond)) { | 2896 | ptype->dev == orig_or_bond)) { |
2897 | if (pt_prev) | 2897 | if (pt_prev) |
2898 | ret = deliver_skb(skb, pt_prev, orig_dev); | 2898 | ret = deliver_skb(skb, pt_prev, orig_dev); |
2899 | pt_prev = ptype; | 2899 | pt_prev = ptype; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 4e7ac09c281a..9f07e749d7b1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2965,6 +2965,34 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer) | |||
2965 | } | 2965 | } |
2966 | EXPORT_SYMBOL_GPL(skb_cow_data); | 2966 | EXPORT_SYMBOL_GPL(skb_cow_data); |
2967 | 2967 | ||
2968 | static void sock_rmem_free(struct sk_buff *skb) | ||
2969 | { | ||
2970 | struct sock *sk = skb->sk; | ||
2971 | |||
2972 | atomic_sub(skb->truesize, &sk->sk_rmem_alloc); | ||
2973 | } | ||
2974 | |||
2975 | /* | ||
2976 | * Note: We dont mem charge error packets (no sk_forward_alloc changes) | ||
2977 | */ | ||
2978 | int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | ||
2979 | { | ||
2980 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
2981 | (unsigned)sk->sk_rcvbuf) | ||
2982 | return -ENOMEM; | ||
2983 | |||
2984 | skb_orphan(skb); | ||
2985 | skb->sk = sk; | ||
2986 | skb->destructor = sock_rmem_free; | ||
2987 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); | ||
2988 | |||
2989 | skb_queue_tail(&sk->sk_error_queue, skb); | ||
2990 | if (!sock_flag(sk, SOCK_DEAD)) | ||
2991 | sk->sk_data_ready(sk, skb->len); | ||
2992 | return 0; | ||
2993 | } | ||
2994 | EXPORT_SYMBOL(sock_queue_err_skb); | ||
2995 | |||
2968 | void skb_tstamp_tx(struct sk_buff *orig_skb, | 2996 | void skb_tstamp_tx(struct sk_buff *orig_skb, |
2969 | struct skb_shared_hwtstamps *hwtstamps) | 2997 | struct skb_shared_hwtstamps *hwtstamps) |
2970 | { | 2998 | { |
@@ -2997,9 +3025,7 @@ void skb_tstamp_tx(struct sk_buff *orig_skb, | |||
2997 | serr->ee.ee_errno = ENOMSG; | 3025 | serr->ee.ee_errno = ENOMSG; |
2998 | serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING; | 3026 | serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING; |
2999 | 3027 | ||
3000 | bh_lock_sock(sk); | ||
3001 | err = sock_queue_err_skb(sk, skb); | 3028 | err = sock_queue_err_skb(sk, skb); |
3002 | bh_unlock_sock(sk); | ||
3003 | 3029 | ||
3004 | if (err) | 3030 | if (err) |
3005 | kfree_skb(skb); | 3031 | kfree_skb(skb); |
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 8e3a1fd938ab..7c3a7d191249 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
@@ -303,7 +303,7 @@ config ARPD | |||
303 | If unsure, say N. | 303 | If unsure, say N. |
304 | 304 | ||
305 | config SYN_COOKIES | 305 | config SYN_COOKIES |
306 | bool "IP: TCP syncookie support (disabled per default)" | 306 | bool "IP: TCP syncookie support" |
307 | ---help--- | 307 | ---help--- |
308 | Normal TCP/IP networking is open to an attack known as "SYN | 308 | Normal TCP/IP networking is open to an attack known as "SYN |
309 | flooding". This denial-of-service attack prevents legitimate remote | 309 | flooding". This denial-of-service attack prevents legitimate remote |
@@ -328,13 +328,13 @@ config SYN_COOKIES | |||
328 | server is really overloaded. If this happens frequently better turn | 328 | server is really overloaded. If this happens frequently better turn |
329 | them off. | 329 | them off. |
330 | 330 | ||
331 | If you say Y here, note that SYN cookies aren't enabled by default; | 331 | If you say Y here, you can disable SYN cookies at run time by |
332 | you can enable them by saying Y to "/proc file system support" and | 332 | saying Y to "/proc file system support" and |
333 | "Sysctl support" below and executing the command | 333 | "Sysctl support" below and executing the command |
334 | 334 | ||
335 | echo 1 >/proc/sys/net/ipv4/tcp_syncookies | 335 | echo 0 > /proc/sys/net/ipv4/tcp_syncookies |
336 | 336 | ||
337 | at boot time after the /proc file system has been mounted. | 337 | after the /proc file system has been mounted. |
338 | 338 | ||
339 | If unsure, say N. | 339 | If unsure, say N. |
340 | 340 | ||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 63958f3394a5..4b6c5ca610fc 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -336,7 +336,7 @@ ipt_do_table(struct sk_buff *skb, | |||
336 | cpu = smp_processor_id(); | 336 | cpu = smp_processor_id(); |
337 | table_base = private->entries[cpu]; | 337 | table_base = private->entries[cpu]; |
338 | jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; | 338 | jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; |
339 | stackptr = &private->stackptr[cpu]; | 339 | stackptr = per_cpu_ptr(private->stackptr, cpu); |
340 | origptr = *stackptr; | 340 | origptr = *stackptr; |
341 | 341 | ||
342 | e = get_entry(table_base, private->hook_entry[hook]); | 342 | e = get_entry(table_base, private->hook_entry[hook]); |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index a7cbcc4b726b..5c48124332de 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
@@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
347 | { .sport = th->dest, | 347 | { .sport = th->dest, |
348 | .dport = th->source } } }; | 348 | .dport = th->source } } }; |
349 | security_req_classify_flow(req, &fl); | 349 | security_req_classify_flow(req, &fl); |
350 | if (ip_route_output_key(&init_net, &rt, &fl)) { | 350 | if (ip_route_output_key(sock_net(sk), &rt, &fl)) { |
351 | reqsk_free(req); | 351 | reqsk_free(req); |
352 | goto out; | 352 | goto out; |
353 | } | 353 | } |
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c index c209e054a634..377bc9349371 100644 --- a/net/ipv4/tcp_hybla.c +++ b/net/ipv4/tcp_hybla.c | |||
@@ -126,8 +126,8 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) | |||
126 | * calculate 2^fract in a <<7 value. | 126 | * calculate 2^fract in a <<7 value. |
127 | */ | 127 | */ |
128 | is_slowstart = 1; | 128 | is_slowstart = 1; |
129 | increment = ((1 << ca->rho) * hybla_fraction(rho_fractions)) | 129 | increment = ((1 << min(ca->rho, 16U)) * |
130 | - 128; | 130 | hybla_fraction(rho_fractions)) - 128; |
131 | } else { | 131 | } else { |
132 | /* | 132 | /* |
133 | * congestion avoidance | 133 | * congestion avoidance |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3e6dafcb1071..548d575e6cc6 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2639,7 +2639,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2639 | if (sk->sk_family == AF_INET) { | 2639 | if (sk->sk_family == AF_INET) { |
2640 | printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", | 2640 | printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", |
2641 | msg, | 2641 | msg, |
2642 | &inet->daddr, ntohs(inet->dport), | 2642 | &inet->inet_daddr, ntohs(inet->inet_dport), |
2643 | tp->snd_cwnd, tcp_left_out(tp), | 2643 | tp->snd_cwnd, tcp_left_out(tp), |
2644 | tp->snd_ssthresh, tp->prior_ssthresh, | 2644 | tp->snd_ssthresh, tp->prior_ssthresh, |
2645 | tp->packets_out); | 2645 | tp->packets_out); |
@@ -2649,7 +2649,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2649 | struct ipv6_pinfo *np = inet6_sk(sk); | 2649 | struct ipv6_pinfo *np = inet6_sk(sk); |
2650 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", | 2650 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", |
2651 | msg, | 2651 | msg, |
2652 | &np->daddr, ntohs(inet->dport), | 2652 | &np->daddr, ntohs(inet->inet_dport), |
2653 | tp->snd_cwnd, tcp_left_out(tp), | 2653 | tp->snd_cwnd, tcp_left_out(tp), |
2654 | tp->snd_ssthresh, tp->prior_ssthresh, | 2654 | tp->snd_ssthresh, tp->prior_ssthresh, |
2655 | tp->packets_out); | 2655 | tp->packets_out); |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 6558dfd899da..acdc4c989853 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1557,6 +1557,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1557 | #endif | 1557 | #endif |
1558 | 1558 | ||
1559 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ | 1559 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ |
1560 | sock_rps_save_rxhash(sk, skb->rxhash); | ||
1560 | TCP_CHECK_TIMER(sk); | 1561 | TCP_CHECK_TIMER(sk); |
1561 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) { | 1562 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) { |
1562 | rsk = sk; | 1563 | rsk = sk; |
@@ -1581,7 +1582,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1581 | } | 1582 | } |
1582 | return 0; | 1583 | return 0; |
1583 | } | 1584 | } |
1584 | } | 1585 | } else |
1586 | sock_rps_save_rxhash(sk, skb->rxhash); | ||
1587 | |||
1585 | 1588 | ||
1586 | TCP_CHECK_TIMER(sk); | 1589 | TCP_CHECK_TIMER(sk); |
1587 | if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) { | 1590 | if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) { |
@@ -1674,8 +1677,6 @@ process: | |||
1674 | 1677 | ||
1675 | skb->dev = NULL; | 1678 | skb->dev = NULL; |
1676 | 1679 | ||
1677 | sock_rps_save_rxhash(sk, skb->rxhash); | ||
1678 | |||
1679 | bh_lock_sock_nested(sk); | 1680 | bh_lock_sock_nested(sk); |
1680 | ret = 0; | 1681 | ret = 0; |
1681 | if (!sock_owned_by_user(sk)) { | 1682 | if (!sock_owned_by_user(sk)) { |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 50678f9a2763..eec4ff456e33 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -633,11 +633,9 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable) | |||
633 | if (!inet->recverr) { | 633 | if (!inet->recverr) { |
634 | if (!harderr || sk->sk_state != TCP_ESTABLISHED) | 634 | if (!harderr || sk->sk_state != TCP_ESTABLISHED) |
635 | goto out; | 635 | goto out; |
636 | } else { | 636 | } else |
637 | bh_lock_sock(sk); | ||
638 | ip_icmp_error(sk, skb, err, uh->dest, info, (u8 *)(uh+1)); | 637 | ip_icmp_error(sk, skb, err, uh->dest, info, (u8 *)(uh+1)); |
639 | bh_unlock_sock(sk); | 638 | |
640 | } | ||
641 | sk->sk_err = err; | 639 | sk->sk_err = err; |
642 | sk->sk_error_report(sk); | 640 | sk->sk_error_report(sk); |
643 | out: | 641 | out: |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 073071f2b75b..89c0b077c7aa 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -120,7 +120,7 @@ static void mroute_clean_tables(struct mr6_table *mrt); | |||
120 | static void ipmr_expire_process(unsigned long arg); | 120 | static void ipmr_expire_process(unsigned long arg); |
121 | 121 | ||
122 | #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES | 122 | #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES |
123 | #define ip6mr_for_each_table(mrt, met) \ | 123 | #define ip6mr_for_each_table(mrt, net) \ |
124 | list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list) | 124 | list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list) |
125 | 125 | ||
126 | static struct mr6_table *ip6mr_get_table(struct net *net, u32 id) | 126 | static struct mr6_table *ip6mr_get_table(struct net *net, u32 id) |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 7b5fb43c227c..8752e8084806 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1356,7 +1356,10 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size) | |||
1356 | IPV6_TLV_PADN, 0 }; | 1356 | IPV6_TLV_PADN, 0 }; |
1357 | 1357 | ||
1358 | /* we assume size > sizeof(ra) here */ | 1358 | /* we assume size > sizeof(ra) here */ |
1359 | skb = sock_alloc_send_skb(sk, size + LL_ALLOCATED_SPACE(dev), 1, &err); | 1359 | size += LL_ALLOCATED_SPACE(dev); |
1360 | /* limit our allocations to order-0 page */ | ||
1361 | size = min_t(int, size, SKB_MAX_ORDER(0, 0)); | ||
1362 | skb = sock_alloc_send_skb(sk, size, 1, &err); | ||
1360 | 1363 | ||
1361 | if (!skb) | 1364 | if (!skb) |
1362 | return NULL; | 1365 | return NULL; |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 6f517bd83692..9d2d68f0e605 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -363,7 +363,7 @@ ip6t_do_table(struct sk_buff *skb, | |||
363 | cpu = smp_processor_id(); | 363 | cpu = smp_processor_id(); |
364 | table_base = private->entries[cpu]; | 364 | table_base = private->entries[cpu]; |
365 | jumpstack = (struct ip6t_entry **)private->jumpstack[cpu]; | 365 | jumpstack = (struct ip6t_entry **)private->jumpstack[cpu]; |
366 | stackptr = &private->stackptr[cpu]; | 366 | stackptr = per_cpu_ptr(private->stackptr, cpu); |
367 | origptr = *stackptr; | 367 | origptr = *stackptr; |
368 | 368 | ||
369 | e = get_entry(table_base, private->hook_entry[hook]); | 369 | e = get_entry(table_base, private->hook_entry[hook]); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 4aea57dec75f..1dd1affdead2 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -466,11 +466,9 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
466 | if (sk->sk_state != TCP_ESTABLISHED && !np->recverr) | 466 | if (sk->sk_state != TCP_ESTABLISHED && !np->recverr) |
467 | goto out; | 467 | goto out; |
468 | 468 | ||
469 | if (np->recverr) { | 469 | if (np->recverr) |
470 | bh_lock_sock(sk); | ||
471 | ipv6_icmp_error(sk, skb, err, uh->dest, ntohl(info), (u8 *)(uh+1)); | 470 | ipv6_icmp_error(sk, skb, err, uh->dest, ntohl(info), (u8 *)(uh+1)); |
472 | bh_unlock_sock(sk); | 471 | |
473 | } | ||
474 | sk->sk_err = err; | 472 | sk->sk_err = err; |
475 | sk->sk_error_report(sk); | 473 | sk->sk_error_report(sk); |
476 | out: | 474 | out: |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index c163d0a149f4..98258b7341e3 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -332,14 +332,16 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) | |||
332 | IEEE80211_QUEUE_STOP_REASON_AGGREGATION); | 332 | IEEE80211_QUEUE_STOP_REASON_AGGREGATION); |
333 | 333 | ||
334 | spin_unlock(&local->ampdu_lock); | 334 | spin_unlock(&local->ampdu_lock); |
335 | spin_unlock_bh(&sta->lock); | ||
336 | 335 | ||
337 | /* send an addBA request */ | 336 | /* prepare tid data */ |
338 | sta->ampdu_mlme.dialog_token_allocator++; | 337 | sta->ampdu_mlme.dialog_token_allocator++; |
339 | sta->ampdu_mlme.tid_tx[tid]->dialog_token = | 338 | sta->ampdu_mlme.tid_tx[tid]->dialog_token = |
340 | sta->ampdu_mlme.dialog_token_allocator; | 339 | sta->ampdu_mlme.dialog_token_allocator; |
341 | sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num; | 340 | sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num; |
342 | 341 | ||
342 | spin_unlock_bh(&sta->lock); | ||
343 | |||
344 | /* send AddBA request */ | ||
343 | ieee80211_send_addba_request(sdata, pubsta->addr, tid, | 345 | ieee80211_send_addba_request(sdata, pubsta->addr, tid, |
344 | sta->ampdu_mlme.tid_tx[tid]->dialog_token, | 346 | sta->ampdu_mlme.tid_tx[tid]->dialog_token, |
345 | sta->ampdu_mlme.tid_tx[tid]->ssn, | 347 | sta->ampdu_mlme.tid_tx[tid]->ssn, |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 2d9a2ee94e17..dd232061e4c4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1818,17 +1818,26 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) | |||
1818 | return RX_CONTINUE; | 1818 | return RX_CONTINUE; |
1819 | 1819 | ||
1820 | if (ieee80211_is_back_req(bar->frame_control)) { | 1820 | if (ieee80211_is_back_req(bar->frame_control)) { |
1821 | struct { | ||
1822 | __le16 control, start_seq_num; | ||
1823 | } __packed bar_data; | ||
1824 | |||
1821 | if (!rx->sta) | 1825 | if (!rx->sta) |
1822 | return RX_DROP_MONITOR; | 1826 | return RX_DROP_MONITOR; |
1827 | |||
1828 | if (skb_copy_bits(skb, offsetof(struct ieee80211_bar, control), | ||
1829 | &bar_data, sizeof(bar_data))) | ||
1830 | return RX_DROP_MONITOR; | ||
1831 | |||
1823 | spin_lock(&rx->sta->lock); | 1832 | spin_lock(&rx->sta->lock); |
1824 | tid = le16_to_cpu(bar->control) >> 12; | 1833 | tid = le16_to_cpu(bar_data.control) >> 12; |
1825 | if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) { | 1834 | if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) { |
1826 | spin_unlock(&rx->sta->lock); | 1835 | spin_unlock(&rx->sta->lock); |
1827 | return RX_DROP_MONITOR; | 1836 | return RX_DROP_MONITOR; |
1828 | } | 1837 | } |
1829 | tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid]; | 1838 | tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid]; |
1830 | 1839 | ||
1831 | start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4; | 1840 | start_seq_num = le16_to_cpu(bar_data.start_seq_num) >> 4; |
1832 | 1841 | ||
1833 | /* reset session timer */ | 1842 | /* reset session timer */ |
1834 | if (tid_agg_rx->timeout) | 1843 | if (tid_agg_rx->timeout) |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 445de702b8b7..e34622fa0003 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -699,10 +699,8 @@ void xt_free_table_info(struct xt_table_info *info) | |||
699 | vfree(info->jumpstack); | 699 | vfree(info->jumpstack); |
700 | else | 700 | else |
701 | kfree(info->jumpstack); | 701 | kfree(info->jumpstack); |
702 | if (sizeof(unsigned int) * nr_cpu_ids > PAGE_SIZE) | 702 | |
703 | vfree(info->stackptr); | 703 | free_percpu(info->stackptr); |
704 | else | ||
705 | kfree(info->stackptr); | ||
706 | 704 | ||
707 | kfree(info); | 705 | kfree(info); |
708 | } | 706 | } |
@@ -753,14 +751,9 @@ static int xt_jumpstack_alloc(struct xt_table_info *i) | |||
753 | unsigned int size; | 751 | unsigned int size; |
754 | int cpu; | 752 | int cpu; |
755 | 753 | ||
756 | size = sizeof(unsigned int) * nr_cpu_ids; | 754 | i->stackptr = alloc_percpu(unsigned int); |
757 | if (size > PAGE_SIZE) | ||
758 | i->stackptr = vmalloc(size); | ||
759 | else | ||
760 | i->stackptr = kmalloc(size, GFP_KERNEL); | ||
761 | if (i->stackptr == NULL) | 755 | if (i->stackptr == NULL) |
762 | return -ENOMEM; | 756 | return -ENOMEM; |
763 | memset(i->stackptr, 0, size); | ||
764 | 757 | ||
765 | size = sizeof(void **) * nr_cpu_ids; | 758 | size = sizeof(void **) * nr_cpu_ids; |
766 | if (size > PAGE_SIZE) | 759 | if (size > PAGE_SIZE) |
@@ -844,10 +837,6 @@ struct xt_table *xt_register_table(struct net *net, | |||
844 | struct xt_table_info *private; | 837 | struct xt_table_info *private; |
845 | struct xt_table *t, *table; | 838 | struct xt_table *t, *table; |
846 | 839 | ||
847 | ret = xt_jumpstack_alloc(newinfo); | ||
848 | if (ret < 0) | ||
849 | return ERR_PTR(ret); | ||
850 | |||
851 | /* Don't add one object to multiple lists. */ | 840 | /* Don't add one object to multiple lists. */ |
852 | table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL); | 841 | table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL); |
853 | if (!table) { | 842 | if (!table) { |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index d885ba311564..570949417f38 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -159,6 +159,9 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
159 | iph->daddr = new_addr; | 159 | iph->daddr = new_addr; |
160 | 160 | ||
161 | csum_replace4(&iph->check, addr, new_addr); | 161 | csum_replace4(&iph->check, addr, new_addr); |
162 | } else if ((iph->frag_off & htons(IP_OFFSET)) || | ||
163 | iph->protocol != IPPROTO_ICMP) { | ||
164 | goto out; | ||
162 | } | 165 | } |
163 | 166 | ||
164 | ihl = iph->ihl * 4; | 167 | ihl = iph->ihl * 4; |
@@ -247,6 +250,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
247 | break; | 250 | break; |
248 | } | 251 | } |
249 | 252 | ||
253 | out: | ||
250 | return action; | 254 | return action; |
251 | 255 | ||
252 | drop: | 256 | drop: |
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index fdbd0b7bd840..50e3d945e1f4 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
@@ -125,7 +125,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
125 | { | 125 | { |
126 | struct tcf_pedit *p = a->priv; | 126 | struct tcf_pedit *p = a->priv; |
127 | int i, munged = 0; | 127 | int i, munged = 0; |
128 | u8 *pptr; | 128 | unsigned int off; |
129 | 129 | ||
130 | if (!(skb->tc_verd & TC_OK2MUNGE)) { | 130 | if (!(skb->tc_verd & TC_OK2MUNGE)) { |
131 | /* should we set skb->cloned? */ | 131 | /* should we set skb->cloned? */ |
@@ -134,7 +134,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | pptr = skb_network_header(skb); | 137 | off = skb_network_offset(skb); |
138 | 138 | ||
139 | spin_lock(&p->tcf_lock); | 139 | spin_lock(&p->tcf_lock); |
140 | 140 | ||
@@ -144,17 +144,17 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
144 | struct tc_pedit_key *tkey = p->tcfp_keys; | 144 | struct tc_pedit_key *tkey = p->tcfp_keys; |
145 | 145 | ||
146 | for (i = p->tcfp_nkeys; i > 0; i--, tkey++) { | 146 | for (i = p->tcfp_nkeys; i > 0; i--, tkey++) { |
147 | u32 *ptr; | 147 | u32 *ptr, _data; |
148 | int offset = tkey->off; | 148 | int offset = tkey->off; |
149 | 149 | ||
150 | if (tkey->offmask) { | 150 | if (tkey->offmask) { |
151 | if (skb->len > tkey->at) { | 151 | char *d, _d; |
152 | char *j = pptr + tkey->at; | 152 | |
153 | offset += ((*j & tkey->offmask) >> | 153 | d = skb_header_pointer(skb, off + tkey->at, 1, |
154 | tkey->shift); | 154 | &_d); |
155 | } else { | 155 | if (!d) |
156 | goto bad; | 156 | goto bad; |
157 | } | 157 | offset += (*d & tkey->offmask) >> tkey->shift; |
158 | } | 158 | } |
159 | 159 | ||
160 | if (offset % 4) { | 160 | if (offset % 4) { |
@@ -169,9 +169,13 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
169 | goto bad; | 169 | goto bad; |
170 | } | 170 | } |
171 | 171 | ||
172 | ptr = (u32 *)(pptr+offset); | 172 | ptr = skb_header_pointer(skb, off + offset, 4, &_data); |
173 | if (!ptr) | ||
174 | goto bad; | ||
173 | /* just do it, baby */ | 175 | /* just do it, baby */ |
174 | *ptr = ((*ptr & tkey->mask) ^ tkey->val); | 176 | *ptr = ((*ptr & tkey->mask) ^ tkey->val); |
177 | if (ptr == &_data) | ||
178 | skb_store_bits(skb, off + offset, ptr, 4); | ||
175 | munged++; | 179 | munged++; |
176 | } | 180 | } |
177 | 181 | ||
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 96275422c619..4f522143811e 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -98,11 +98,11 @@ static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_re | |||
98 | { | 98 | { |
99 | struct { | 99 | struct { |
100 | struct tc_u_knode *knode; | 100 | struct tc_u_knode *knode; |
101 | u8 *ptr; | 101 | unsigned int off; |
102 | } stack[TC_U32_MAXDEPTH]; | 102 | } stack[TC_U32_MAXDEPTH]; |
103 | 103 | ||
104 | struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root; | 104 | struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root; |
105 | u8 *ptr = skb_network_header(skb); | 105 | unsigned int off = skb_network_offset(skb); |
106 | struct tc_u_knode *n; | 106 | struct tc_u_knode *n; |
107 | int sdepth = 0; | 107 | int sdepth = 0; |
108 | int off2 = 0; | 108 | int off2 = 0; |
@@ -134,8 +134,14 @@ next_knode: | |||
134 | #endif | 134 | #endif |
135 | 135 | ||
136 | for (i = n->sel.nkeys; i>0; i--, key++) { | 136 | for (i = n->sel.nkeys; i>0; i--, key++) { |
137 | 137 | unsigned int toff; | |
138 | if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) { | 138 | __be32 *data, _data; |
139 | |||
140 | toff = off + key->off + (off2 & key->offmask); | ||
141 | data = skb_header_pointer(skb, toff, 4, &_data); | ||
142 | if (!data) | ||
143 | goto out; | ||
144 | if ((*data ^ key->val) & key->mask) { | ||
139 | n = n->next; | 145 | n = n->next; |
140 | goto next_knode; | 146 | goto next_knode; |
141 | } | 147 | } |
@@ -174,29 +180,45 @@ check_terminal: | |||
174 | if (sdepth >= TC_U32_MAXDEPTH) | 180 | if (sdepth >= TC_U32_MAXDEPTH) |
175 | goto deadloop; | 181 | goto deadloop; |
176 | stack[sdepth].knode = n; | 182 | stack[sdepth].knode = n; |
177 | stack[sdepth].ptr = ptr; | 183 | stack[sdepth].off = off; |
178 | sdepth++; | 184 | sdepth++; |
179 | 185 | ||
180 | ht = n->ht_down; | 186 | ht = n->ht_down; |
181 | sel = 0; | 187 | sel = 0; |
182 | if (ht->divisor) | 188 | if (ht->divisor) { |
183 | sel = ht->divisor&u32_hash_fold(*(__be32*)(ptr+n->sel.hoff), &n->sel,n->fshift); | 189 | __be32 *data, _data; |
184 | 190 | ||
191 | data = skb_header_pointer(skb, off + n->sel.hoff, 4, | ||
192 | &_data); | ||
193 | if (!data) | ||
194 | goto out; | ||
195 | sel = ht->divisor & u32_hash_fold(*data, &n->sel, | ||
196 | n->fshift); | ||
197 | } | ||
185 | if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) | 198 | if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) |
186 | goto next_ht; | 199 | goto next_ht; |
187 | 200 | ||
188 | if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) { | 201 | if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) { |
189 | off2 = n->sel.off + 3; | 202 | off2 = n->sel.off + 3; |
190 | if (n->sel.flags&TC_U32_VAROFFSET) | 203 | if (n->sel.flags & TC_U32_VAROFFSET) { |
191 | off2 += ntohs(n->sel.offmask & *(__be16*)(ptr+n->sel.offoff)) >>n->sel.offshift; | 204 | __be16 *data, _data; |
205 | |||
206 | data = skb_header_pointer(skb, | ||
207 | off + n->sel.offoff, | ||
208 | 2, &_data); | ||
209 | if (!data) | ||
210 | goto out; | ||
211 | off2 += ntohs(n->sel.offmask & *data) >> | ||
212 | n->sel.offshift; | ||
213 | } | ||
192 | off2 &= ~3; | 214 | off2 &= ~3; |
193 | } | 215 | } |
194 | if (n->sel.flags&TC_U32_EAT) { | 216 | if (n->sel.flags&TC_U32_EAT) { |
195 | ptr += off2; | 217 | off += off2; |
196 | off2 = 0; | 218 | off2 = 0; |
197 | } | 219 | } |
198 | 220 | ||
199 | if (ptr < skb_tail_pointer(skb)) | 221 | if (off < skb->len) |
200 | goto next_ht; | 222 | goto next_ht; |
201 | } | 223 | } |
202 | 224 | ||
@@ -204,9 +226,10 @@ check_terminal: | |||
204 | if (sdepth--) { | 226 | if (sdepth--) { |
205 | n = stack[sdepth].knode; | 227 | n = stack[sdepth].knode; |
206 | ht = n->ht_up; | 228 | ht = n->ht_up; |
207 | ptr = stack[sdepth].ptr; | 229 | off = stack[sdepth].off; |
208 | goto check_terminal; | 230 | goto check_terminal; |
209 | } | 231 | } |
232 | out: | ||
210 | return -1; | 233 | return -1; |
211 | 234 | ||
212 | deadloop: | 235 | deadloop: |
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 6a329158bdfa..a3cca0a94346 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
@@ -95,13 +95,13 @@ resume: | |||
95 | goto error_nolock; | 95 | goto error_nolock; |
96 | } | 96 | } |
97 | 97 | ||
98 | dst = dst_pop(dst); | 98 | dst = skb_dst_pop(skb); |
99 | if (!dst) { | 99 | if (!dst) { |
100 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); | 100 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); |
101 | err = -EHOSTUNREACH; | 101 | err = -EHOSTUNREACH; |
102 | goto error_nolock; | 102 | goto error_nolock; |
103 | } | 103 | } |
104 | skb_dst_set(skb, dst); | 104 | skb_dst_set_noref(skb, dst); |
105 | x = dst->xfrm; | 105 | x = dst->xfrm; |
106 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); | 106 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); |
107 | 107 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index d965a2bad8d3..4bf27d901333 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2153,6 +2153,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2153 | return 0; | 2153 | return 0; |
2154 | } | 2154 | } |
2155 | 2155 | ||
2156 | skb_dst_force(skb); | ||
2156 | dst = skb_dst(skb); | 2157 | dst = skb_dst(skb); |
2157 | 2158 | ||
2158 | res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0; | 2159 | res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0; |