diff options
106 files changed, 714 insertions, 291 deletions
diff --git a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt index 93c3a6ae32f9..ac71daa46195 100644 --- a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt +++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt | |||
@@ -5,7 +5,9 @@ Required properties: | |||
5 | - compatible: Must contain one or more of the following: | 5 | - compatible: Must contain one or more of the following: |
6 | - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller. | 6 | - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller. |
7 | - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller. | 7 | - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller. |
8 | - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3) compatible controller. | 8 | - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller. |
9 | - "renesas,r8a77970-canfd" for R8A77970 (R-Car V3M) compatible controller. | ||
10 | - "renesas,r8a77980-canfd" for R8A77980 (R-Car V3H) compatible controller. | ||
9 | 11 | ||
10 | When compatible with the generic version, nodes must list the | 12 | When compatible with the generic version, nodes must list the |
11 | SoC-specific version corresponding to the platform first, followed by the | 13 | SoC-specific version corresponding to the platform first, followed by the |
diff --git a/MAINTAINERS b/MAINTAINERS index 358e200c04ba..f913c80c8c38 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -137,9 +137,9 @@ Maintainers List (try to look for most precise areas first) | |||
137 | ----------------------------------- | 137 | ----------------------------------- |
138 | 138 | ||
139 | 3C59X NETWORK DRIVER | 139 | 3C59X NETWORK DRIVER |
140 | M: Steffen Klassert <klassert@mathematik.tu-chemnitz.de> | 140 | M: Steffen Klassert <klassert@kernel.org> |
141 | L: netdev@vger.kernel.org | 141 | L: netdev@vger.kernel.org |
142 | S: Maintained | 142 | S: Odd Fixes |
143 | F: Documentation/networking/vortex.txt | 143 | F: Documentation/networking/vortex.txt |
144 | F: drivers/net/ethernet/3com/3c59x.c | 144 | F: drivers/net/ethernet/3com/3c59x.c |
145 | 145 | ||
diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi index bf343195697e..54111ed218b1 100644 --- a/arch/arm/boot/dts/imx35.dtsi +++ b/arch/arm/boot/dts/imx35.dtsi | |||
@@ -303,7 +303,7 @@ | |||
303 | }; | 303 | }; |
304 | 304 | ||
305 | can1: can@53fe4000 { | 305 | can1: can@53fe4000 { |
306 | compatible = "fsl,imx35-flexcan"; | 306 | compatible = "fsl,imx35-flexcan", "fsl,imx25-flexcan"; |
307 | reg = <0x53fe4000 0x1000>; | 307 | reg = <0x53fe4000 0x1000>; |
308 | clocks = <&clks 33>, <&clks 33>; | 308 | clocks = <&clks 33>, <&clks 33>; |
309 | clock-names = "ipg", "per"; | 309 | clock-names = "ipg", "per"; |
@@ -312,7 +312,7 @@ | |||
312 | }; | 312 | }; |
313 | 313 | ||
314 | can2: can@53fe8000 { | 314 | can2: can@53fe8000 { |
315 | compatible = "fsl,imx35-flexcan"; | 315 | compatible = "fsl,imx35-flexcan", "fsl,imx25-flexcan"; |
316 | reg = <0x53fe8000 0x1000>; | 316 | reg = <0x53fe8000 0x1000>; |
317 | clocks = <&clks 34>, <&clks 34>; | 317 | clocks = <&clks 34>, <&clks 34>; |
318 | clock-names = "ipg", "per"; | 318 | clock-names = "ipg", "per"; |
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index 7d647d043f52..3d65c0192f69 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi | |||
@@ -551,7 +551,7 @@ | |||
551 | }; | 551 | }; |
552 | 552 | ||
553 | can1: can@53fc8000 { | 553 | can1: can@53fc8000 { |
554 | compatible = "fsl,imx53-flexcan"; | 554 | compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan"; |
555 | reg = <0x53fc8000 0x4000>; | 555 | reg = <0x53fc8000 0x4000>; |
556 | interrupts = <82>; | 556 | interrupts = <82>; |
557 | clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>, | 557 | clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>, |
@@ -561,7 +561,7 @@ | |||
561 | }; | 561 | }; |
562 | 562 | ||
563 | can2: can@53fcc000 { | 563 | can2: can@53fcc000 { |
564 | compatible = "fsl,imx53-flexcan"; | 564 | compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan"; |
565 | reg = <0x53fcc000 0x4000>; | 565 | reg = <0x53fcc000 0x4000>; |
566 | interrupts = <83>; | 566 | interrupts = <83>; |
567 | clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>, | 567 | clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>, |
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index d97c05690faa..4e46dc9e41ad 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
@@ -191,7 +191,7 @@ static char *res_strings[] = { | |||
191 | "reserved 37", | 191 | "reserved 37", |
192 | "reserved 38", | 192 | "reserved 38", |
193 | "reserved 39", | 193 | "reserved 39", |
194 | "reseverd 40", | 194 | "reserved 40", |
195 | "reserved 41", | 195 | "reserved 41", |
196 | "reserved 42", | 196 | "reserved 42", |
197 | "reserved 43", | 197 | "reserved 43", |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 1ef67db03c8e..9c9a22958717 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
29 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
31 | #include <linux/nospec.h> | ||
31 | 32 | ||
32 | #include "uPD98401.h" | 33 | #include "uPD98401.h" |
33 | #include "uPD98402.h" | 34 | #include "uPD98402.h" |
@@ -1458,6 +1459,8 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) | |||
1458 | return -EFAULT; | 1459 | return -EFAULT; |
1459 | if (pool < 0 || pool > ZATM_LAST_POOL) | 1460 | if (pool < 0 || pool > ZATM_LAST_POOL) |
1460 | return -EINVAL; | 1461 | return -EINVAL; |
1462 | pool = array_index_nospec(pool, | ||
1463 | ZATM_LAST_POOL + 1); | ||
1461 | spin_lock_irqsave(&zatm_dev->lock, flags); | 1464 | spin_lock_irqsave(&zatm_dev->lock, flags); |
1462 | info = zatm_dev->pool_info[pool]; | 1465 | info = zatm_dev->pool_info[pool]; |
1463 | if (cmd == ZATM_GETPOOLZ) { | 1466 | if (cmd == ZATM_GETPOOLZ) { |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index c8c8b0b8d333..b937cc1e2c07 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -231,6 +231,7 @@ static const struct usb_device_id blacklist_table[] = { | |||
231 | { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 }, | 231 | { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 }, |
232 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, | 232 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, |
233 | { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, | 233 | { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, |
234 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, | ||
234 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, | 235 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, |
235 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, | 236 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, |
236 | { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, | 237 | { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, |
@@ -263,7 +264,6 @@ static const struct usb_device_id blacklist_table[] = { | |||
263 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, | 264 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, |
264 | 265 | ||
265 | /* QCA ROME chipset */ | 266 | /* QCA ROME chipset */ |
266 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_QCA_ROME }, | ||
267 | { USB_DEVICE(0x0cf3, 0xe007), .driver_info = BTUSB_QCA_ROME }, | 267 | { USB_DEVICE(0x0cf3, 0xe007), .driver_info = BTUSB_QCA_ROME }, |
268 | { USB_DEVICE(0x0cf3, 0xe009), .driver_info = BTUSB_QCA_ROME }, | 268 | { USB_DEVICE(0x0cf3, 0xe009), .driver_info = BTUSB_QCA_ROME }, |
269 | { USB_DEVICE(0x0cf3, 0xe010), .driver_info = BTUSB_QCA_ROME }, | 269 | { USB_DEVICE(0x0cf3, 0xe010), .driver_info = BTUSB_QCA_ROME }, |
@@ -399,6 +399,13 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = { | |||
399 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 3060"), | 399 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 3060"), |
400 | }, | 400 | }, |
401 | }, | 401 | }, |
402 | { | ||
403 | /* Dell XPS 9360 (QCA ROME device 0cf3:e300) */ | ||
404 | .matches = { | ||
405 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
406 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"), | ||
407 | }, | ||
408 | }, | ||
402 | {} | 409 | {} |
403 | }; | 410 | }; |
404 | 411 | ||
@@ -2852,6 +2859,12 @@ static int btusb_config_oob_wake(struct hci_dev *hdev) | |||
2852 | } | 2859 | } |
2853 | #endif | 2860 | #endif |
2854 | 2861 | ||
2862 | static void btusb_check_needs_reset_resume(struct usb_interface *intf) | ||
2863 | { | ||
2864 | if (dmi_check_system(btusb_needs_reset_resume_table)) | ||
2865 | interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; | ||
2866 | } | ||
2867 | |||
2855 | static int btusb_probe(struct usb_interface *intf, | 2868 | static int btusb_probe(struct usb_interface *intf, |
2856 | const struct usb_device_id *id) | 2869 | const struct usb_device_id *id) |
2857 | { | 2870 | { |
@@ -2974,9 +2987,6 @@ static int btusb_probe(struct usb_interface *intf, | |||
2974 | hdev->send = btusb_send_frame; | 2987 | hdev->send = btusb_send_frame; |
2975 | hdev->notify = btusb_notify; | 2988 | hdev->notify = btusb_notify; |
2976 | 2989 | ||
2977 | if (dmi_check_system(btusb_needs_reset_resume_table)) | ||
2978 | interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; | ||
2979 | |||
2980 | #ifdef CONFIG_PM | 2990 | #ifdef CONFIG_PM |
2981 | err = btusb_config_oob_wake(hdev); | 2991 | err = btusb_config_oob_wake(hdev); |
2982 | if (err) | 2992 | if (err) |
@@ -3064,6 +3074,7 @@ static int btusb_probe(struct usb_interface *intf, | |||
3064 | data->setup_on_usb = btusb_setup_qca; | 3074 | data->setup_on_usb = btusb_setup_qca; |
3065 | hdev->set_bdaddr = btusb_set_bdaddr_ath3012; | 3075 | hdev->set_bdaddr = btusb_set_bdaddr_ath3012; |
3066 | set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); | 3076 | set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); |
3077 | btusb_check_needs_reset_resume(intf); | ||
3067 | } | 3078 | } |
3068 | 3079 | ||
3069 | #ifdef CONFIG_BT_HCIBTUSB_RTL | 3080 | #ifdef CONFIG_BT_HCIBTUSB_RTL |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 1ed9529e7bd1..5eb0df2e5464 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -450,7 +450,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
450 | { | 450 | { |
451 | int i; | 451 | int i; |
452 | 452 | ||
453 | if (!client_info->slave) | 453 | if (!client_info->slave || !is_valid_ether_addr(client_info->mac_dst)) |
454 | return; | 454 | return; |
455 | 455 | ||
456 | for (i = 0; i < RLB_ARP_BURST_SIZE; i++) { | 456 | for (i = 0; i < RLB_ARP_BURST_SIZE; i++) { |
@@ -943,6 +943,10 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], | |||
943 | skb->priority = TC_PRIO_CONTROL; | 943 | skb->priority = TC_PRIO_CONTROL; |
944 | skb->dev = slave->dev; | 944 | skb->dev = slave->dev; |
945 | 945 | ||
946 | netdev_dbg(slave->bond->dev, | ||
947 | "Send learning packet: dev %s mac %pM vlan %d\n", | ||
948 | slave->dev->name, mac_addr, vid); | ||
949 | |||
946 | if (vid) | 950 | if (vid) |
947 | __vlan_hwaccel_put_tag(skb, vlan_proto, vid); | 951 | __vlan_hwaccel_put_tag(skb, vlan_proto, vid); |
948 | 952 | ||
@@ -965,14 +969,13 @@ static int alb_upper_dev_walk(struct net_device *upper, void *_data) | |||
965 | u8 *mac_addr = data->mac_addr; | 969 | u8 *mac_addr = data->mac_addr; |
966 | struct bond_vlan_tag *tags; | 970 | struct bond_vlan_tag *tags; |
967 | 971 | ||
968 | if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) { | 972 | if (is_vlan_dev(upper) && |
969 | if (strict_match && | 973 | bond->nest_level == vlan_get_encap_level(upper) - 1) { |
970 | ether_addr_equal_64bits(mac_addr, | 974 | if (upper->addr_assign_type == NET_ADDR_STOLEN) { |
971 | upper->dev_addr)) { | ||
972 | alb_send_lp_vid(slave, mac_addr, | 975 | alb_send_lp_vid(slave, mac_addr, |
973 | vlan_dev_vlan_proto(upper), | 976 | vlan_dev_vlan_proto(upper), |
974 | vlan_dev_vlan_id(upper)); | 977 | vlan_dev_vlan_id(upper)); |
975 | } else if (!strict_match) { | 978 | } else { |
976 | alb_send_lp_vid(slave, upper->dev_addr, | 979 | alb_send_lp_vid(slave, upper->dev_addr, |
977 | vlan_dev_vlan_proto(upper), | 980 | vlan_dev_vlan_proto(upper), |
978 | vlan_dev_vlan_id(upper)); | 981 | vlan_dev_vlan_id(upper)); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 718e4914e3a0..1f1e97b26f95 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1738,6 +1738,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, | |||
1738 | if (bond_mode_uses_xmit_hash(bond)) | 1738 | if (bond_mode_uses_xmit_hash(bond)) |
1739 | bond_update_slave_arr(bond, NULL); | 1739 | bond_update_slave_arr(bond, NULL); |
1740 | 1740 | ||
1741 | bond->nest_level = dev_get_nest_level(bond_dev); | ||
1742 | |||
1741 | netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n", | 1743 | netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n", |
1742 | slave_dev->name, | 1744 | slave_dev->name, |
1743 | bond_is_active_slave(new_slave) ? "an active" : "a backup", | 1745 | bond_is_active_slave(new_slave) ? "an active" : "a backup", |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index b1779566c5bb..3c71f1cb205f 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -605,7 +605,7 @@ void can_bus_off(struct net_device *dev) | |||
605 | { | 605 | { |
606 | struct can_priv *priv = netdev_priv(dev); | 606 | struct can_priv *priv = netdev_priv(dev); |
607 | 607 | ||
608 | netdev_dbg(dev, "bus-off\n"); | 608 | netdev_info(dev, "bus-off\n"); |
609 | 609 | ||
610 | netif_carrier_off(dev); | 610 | netif_carrier_off(dev); |
611 | 611 | ||
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 634c51e6b8ae..d53a45bf2a72 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -200,6 +200,7 @@ | |||
200 | #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ | 200 | #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ |
201 | #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ | 201 | #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ |
202 | #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* No interrupt for error passive */ | 202 | #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* No interrupt for error passive */ |
203 | #define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7) /* default to BE register access */ | ||
203 | 204 | ||
204 | /* Structure of the message buffer */ | 205 | /* Structure of the message buffer */ |
205 | struct flexcan_mb { | 206 | struct flexcan_mb { |
@@ -288,6 +289,12 @@ struct flexcan_priv { | |||
288 | 289 | ||
289 | static const struct flexcan_devtype_data fsl_p1010_devtype_data = { | 290 | static const struct flexcan_devtype_data fsl_p1010_devtype_data = { |
290 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | | 291 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | |
292 | FLEXCAN_QUIRK_BROKEN_PERR_STATE | | ||
293 | FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN, | ||
294 | }; | ||
295 | |||
296 | static const struct flexcan_devtype_data fsl_imx25_devtype_data = { | ||
297 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | | ||
291 | FLEXCAN_QUIRK_BROKEN_PERR_STATE, | 298 | FLEXCAN_QUIRK_BROKEN_PERR_STATE, |
292 | }; | 299 | }; |
293 | 300 | ||
@@ -1251,9 +1258,9 @@ static void unregister_flexcandev(struct net_device *dev) | |||
1251 | static const struct of_device_id flexcan_of_match[] = { | 1258 | static const struct of_device_id flexcan_of_match[] = { |
1252 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | 1259 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, |
1253 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | 1260 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, |
1254 | { .compatible = "fsl,imx53-flexcan", .data = &fsl_p1010_devtype_data, }, | 1261 | { .compatible = "fsl,imx53-flexcan", .data = &fsl_imx25_devtype_data, }, |
1255 | { .compatible = "fsl,imx35-flexcan", .data = &fsl_p1010_devtype_data, }, | 1262 | { .compatible = "fsl,imx35-flexcan", .data = &fsl_imx25_devtype_data, }, |
1256 | { .compatible = "fsl,imx25-flexcan", .data = &fsl_p1010_devtype_data, }, | 1263 | { .compatible = "fsl,imx25-flexcan", .data = &fsl_imx25_devtype_data, }, |
1257 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | 1264 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, |
1258 | { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, | 1265 | { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, |
1259 | { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, | 1266 | { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, |
@@ -1337,18 +1344,13 @@ static int flexcan_probe(struct platform_device *pdev) | |||
1337 | 1344 | ||
1338 | priv = netdev_priv(dev); | 1345 | priv = netdev_priv(dev); |
1339 | 1346 | ||
1340 | if (of_property_read_bool(pdev->dev.of_node, "big-endian")) { | 1347 | if (of_property_read_bool(pdev->dev.of_node, "big-endian") || |
1348 | devtype_data->quirks & FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN) { | ||
1341 | priv->read = flexcan_read_be; | 1349 | priv->read = flexcan_read_be; |
1342 | priv->write = flexcan_write_be; | 1350 | priv->write = flexcan_write_be; |
1343 | } else { | 1351 | } else { |
1344 | if (of_device_is_compatible(pdev->dev.of_node, | 1352 | priv->read = flexcan_read_le; |
1345 | "fsl,p1010-flexcan")) { | 1353 | priv->write = flexcan_write_le; |
1346 | priv->read = flexcan_read_be; | ||
1347 | priv->write = flexcan_write_be; | ||
1348 | } else { | ||
1349 | priv->read = flexcan_read_le; | ||
1350 | priv->write = flexcan_write_le; | ||
1351 | } | ||
1352 | } | 1354 | } |
1353 | 1355 | ||
1354 | priv->can.clock.freq = clock_freq; | 1356 | priv->can.clock.freq = clock_freq; |
diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index 5590c559a8ca..53e320c92a8b 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c | |||
@@ -91,6 +91,7 @@ | |||
91 | #define HI3110_STAT_BUSOFF BIT(2) | 91 | #define HI3110_STAT_BUSOFF BIT(2) |
92 | #define HI3110_STAT_ERRP BIT(3) | 92 | #define HI3110_STAT_ERRP BIT(3) |
93 | #define HI3110_STAT_ERRW BIT(4) | 93 | #define HI3110_STAT_ERRW BIT(4) |
94 | #define HI3110_STAT_TXMTY BIT(7) | ||
94 | 95 | ||
95 | #define HI3110_BTR0_SJW_SHIFT 6 | 96 | #define HI3110_BTR0_SJW_SHIFT 6 |
96 | #define HI3110_BTR0_BRP_SHIFT 0 | 97 | #define HI3110_BTR0_BRP_SHIFT 0 |
@@ -427,8 +428,10 @@ static int hi3110_get_berr_counter(const struct net_device *net, | |||
427 | struct hi3110_priv *priv = netdev_priv(net); | 428 | struct hi3110_priv *priv = netdev_priv(net); |
428 | struct spi_device *spi = priv->spi; | 429 | struct spi_device *spi = priv->spi; |
429 | 430 | ||
431 | mutex_lock(&priv->hi3110_lock); | ||
430 | bec->txerr = hi3110_read(spi, HI3110_READ_TEC); | 432 | bec->txerr = hi3110_read(spi, HI3110_READ_TEC); |
431 | bec->rxerr = hi3110_read(spi, HI3110_READ_REC); | 433 | bec->rxerr = hi3110_read(spi, HI3110_READ_REC); |
434 | mutex_unlock(&priv->hi3110_lock); | ||
432 | 435 | ||
433 | return 0; | 436 | return 0; |
434 | } | 437 | } |
@@ -735,10 +738,7 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) | |||
735 | } | 738 | } |
736 | } | 739 | } |
737 | 740 | ||
738 | if (intf == 0) | 741 | if (priv->tx_len && statf & HI3110_STAT_TXMTY) { |
739 | break; | ||
740 | |||
741 | if (intf & HI3110_INT_TXCPLT) { | ||
742 | net->stats.tx_packets++; | 742 | net->stats.tx_packets++; |
743 | net->stats.tx_bytes += priv->tx_len - 1; | 743 | net->stats.tx_bytes += priv->tx_len - 1; |
744 | can_led_event(net, CAN_LED_EVENT_TX); | 744 | can_led_event(net, CAN_LED_EVENT_TX); |
@@ -748,6 +748,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) | |||
748 | } | 748 | } |
749 | netif_wake_queue(net); | 749 | netif_wake_queue(net); |
750 | } | 750 | } |
751 | |||
752 | if (intf == 0) | ||
753 | break; | ||
751 | } | 754 | } |
752 | mutex_unlock(&priv->hi3110_lock); | 755 | mutex_unlock(&priv->hi3110_lock); |
753 | return IRQ_HANDLED; | 756 | return IRQ_HANDLED; |
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 63587b8e6825..daed57d3d209 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
@@ -1179,7 +1179,7 @@ static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, | |||
1179 | 1179 | ||
1180 | skb = alloc_can_skb(priv->netdev, &cf); | 1180 | skb = alloc_can_skb(priv->netdev, &cf); |
1181 | if (!skb) { | 1181 | if (!skb) { |
1182 | stats->tx_dropped++; | 1182 | stats->rx_dropped++; |
1183 | return; | 1183 | return; |
1184 | } | 1184 | } |
1185 | 1185 | ||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 3d2091099f7f..5b4374f21d76 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c | |||
@@ -3370,6 +3370,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3370 | .num_internal_phys = 5, | 3370 | .num_internal_phys = 5, |
3371 | .max_vid = 4095, | 3371 | .max_vid = 4095, |
3372 | .port_base_addr = 0x10, | 3372 | .port_base_addr = 0x10, |
3373 | .phy_base_addr = 0x0, | ||
3373 | .global1_addr = 0x1b, | 3374 | .global1_addr = 0x1b, |
3374 | .global2_addr = 0x1c, | 3375 | .global2_addr = 0x1c, |
3375 | .age_time_coeff = 15000, | 3376 | .age_time_coeff = 15000, |
@@ -3391,6 +3392,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3391 | .num_internal_phys = 0, | 3392 | .num_internal_phys = 0, |
3392 | .max_vid = 4095, | 3393 | .max_vid = 4095, |
3393 | .port_base_addr = 0x10, | 3394 | .port_base_addr = 0x10, |
3395 | .phy_base_addr = 0x0, | ||
3394 | .global1_addr = 0x1b, | 3396 | .global1_addr = 0x1b, |
3395 | .global2_addr = 0x1c, | 3397 | .global2_addr = 0x1c, |
3396 | .age_time_coeff = 15000, | 3398 | .age_time_coeff = 15000, |
@@ -3410,6 +3412,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3410 | .num_internal_phys = 8, | 3412 | .num_internal_phys = 8, |
3411 | .max_vid = 4095, | 3413 | .max_vid = 4095, |
3412 | .port_base_addr = 0x10, | 3414 | .port_base_addr = 0x10, |
3415 | .phy_base_addr = 0x0, | ||
3413 | .global1_addr = 0x1b, | 3416 | .global1_addr = 0x1b, |
3414 | .global2_addr = 0x1c, | 3417 | .global2_addr = 0x1c, |
3415 | .age_time_coeff = 15000, | 3418 | .age_time_coeff = 15000, |
@@ -3431,6 +3434,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3431 | .num_internal_phys = 5, | 3434 | .num_internal_phys = 5, |
3432 | .max_vid = 4095, | 3435 | .max_vid = 4095, |
3433 | .port_base_addr = 0x10, | 3436 | .port_base_addr = 0x10, |
3437 | .phy_base_addr = 0x0, | ||
3434 | .global1_addr = 0x1b, | 3438 | .global1_addr = 0x1b, |
3435 | .global2_addr = 0x1c, | 3439 | .global2_addr = 0x1c, |
3436 | .age_time_coeff = 15000, | 3440 | .age_time_coeff = 15000, |
@@ -3452,6 +3456,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3452 | .num_internal_phys = 0, | 3456 | .num_internal_phys = 0, |
3453 | .max_vid = 4095, | 3457 | .max_vid = 4095, |
3454 | .port_base_addr = 0x10, | 3458 | .port_base_addr = 0x10, |
3459 | .phy_base_addr = 0x0, | ||
3455 | .global1_addr = 0x1b, | 3460 | .global1_addr = 0x1b, |
3456 | .global2_addr = 0x1c, | 3461 | .global2_addr = 0x1c, |
3457 | .age_time_coeff = 15000, | 3462 | .age_time_coeff = 15000, |
@@ -3472,6 +3477,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3472 | .num_gpio = 11, | 3477 | .num_gpio = 11, |
3473 | .max_vid = 4095, | 3478 | .max_vid = 4095, |
3474 | .port_base_addr = 0x10, | 3479 | .port_base_addr = 0x10, |
3480 | .phy_base_addr = 0x10, | ||
3475 | .global1_addr = 0x1b, | 3481 | .global1_addr = 0x1b, |
3476 | .global2_addr = 0x1c, | 3482 | .global2_addr = 0x1c, |
3477 | .age_time_coeff = 3750, | 3483 | .age_time_coeff = 3750, |
@@ -3493,6 +3499,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3493 | .num_internal_phys = 5, | 3499 | .num_internal_phys = 5, |
3494 | .max_vid = 4095, | 3500 | .max_vid = 4095, |
3495 | .port_base_addr = 0x10, | 3501 | .port_base_addr = 0x10, |
3502 | .phy_base_addr = 0x0, | ||
3496 | .global1_addr = 0x1b, | 3503 | .global1_addr = 0x1b, |
3497 | .global2_addr = 0x1c, | 3504 | .global2_addr = 0x1c, |
3498 | .age_time_coeff = 15000, | 3505 | .age_time_coeff = 15000, |
@@ -3514,6 +3521,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3514 | .num_internal_phys = 0, | 3521 | .num_internal_phys = 0, |
3515 | .max_vid = 4095, | 3522 | .max_vid = 4095, |
3516 | .port_base_addr = 0x10, | 3523 | .port_base_addr = 0x10, |
3524 | .phy_base_addr = 0x0, | ||
3517 | .global1_addr = 0x1b, | 3525 | .global1_addr = 0x1b, |
3518 | .global2_addr = 0x1c, | 3526 | .global2_addr = 0x1c, |
3519 | .age_time_coeff = 15000, | 3527 | .age_time_coeff = 15000, |
@@ -3535,6 +3543,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3535 | .num_internal_phys = 5, | 3543 | .num_internal_phys = 5, |
3536 | .max_vid = 4095, | 3544 | .max_vid = 4095, |
3537 | .port_base_addr = 0x10, | 3545 | .port_base_addr = 0x10, |
3546 | .phy_base_addr = 0x0, | ||
3538 | .global1_addr = 0x1b, | 3547 | .global1_addr = 0x1b, |
3539 | .global2_addr = 0x1c, | 3548 | .global2_addr = 0x1c, |
3540 | .age_time_coeff = 15000, | 3549 | .age_time_coeff = 15000, |
@@ -3557,6 +3566,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3557 | .num_gpio = 15, | 3566 | .num_gpio = 15, |
3558 | .max_vid = 4095, | 3567 | .max_vid = 4095, |
3559 | .port_base_addr = 0x10, | 3568 | .port_base_addr = 0x10, |
3569 | .phy_base_addr = 0x0, | ||
3560 | .global1_addr = 0x1b, | 3570 | .global1_addr = 0x1b, |
3561 | .global2_addr = 0x1c, | 3571 | .global2_addr = 0x1c, |
3562 | .age_time_coeff = 15000, | 3572 | .age_time_coeff = 15000, |
@@ -3578,6 +3588,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3578 | .num_internal_phys = 5, | 3588 | .num_internal_phys = 5, |
3579 | .max_vid = 4095, | 3589 | .max_vid = 4095, |
3580 | .port_base_addr = 0x10, | 3590 | .port_base_addr = 0x10, |
3591 | .phy_base_addr = 0x0, | ||
3581 | .global1_addr = 0x1b, | 3592 | .global1_addr = 0x1b, |
3582 | .global2_addr = 0x1c, | 3593 | .global2_addr = 0x1c, |
3583 | .age_time_coeff = 15000, | 3594 | .age_time_coeff = 15000, |
@@ -3600,6 +3611,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3600 | .num_gpio = 15, | 3611 | .num_gpio = 15, |
3601 | .max_vid = 4095, | 3612 | .max_vid = 4095, |
3602 | .port_base_addr = 0x10, | 3613 | .port_base_addr = 0x10, |
3614 | .phy_base_addr = 0x0, | ||
3603 | .global1_addr = 0x1b, | 3615 | .global1_addr = 0x1b, |
3604 | .global2_addr = 0x1c, | 3616 | .global2_addr = 0x1c, |
3605 | .age_time_coeff = 15000, | 3617 | .age_time_coeff = 15000, |
@@ -3621,6 +3633,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3621 | .num_internal_phys = 0, | 3633 | .num_internal_phys = 0, |
3622 | .max_vid = 4095, | 3634 | .max_vid = 4095, |
3623 | .port_base_addr = 0x10, | 3635 | .port_base_addr = 0x10, |
3636 | .phy_base_addr = 0x0, | ||
3624 | .global1_addr = 0x1b, | 3637 | .global1_addr = 0x1b, |
3625 | .global2_addr = 0x1c, | 3638 | .global2_addr = 0x1c, |
3626 | .age_time_coeff = 15000, | 3639 | .age_time_coeff = 15000, |
@@ -3641,6 +3654,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3641 | .num_gpio = 16, | 3654 | .num_gpio = 16, |
3642 | .max_vid = 8191, | 3655 | .max_vid = 8191, |
3643 | .port_base_addr = 0x0, | 3656 | .port_base_addr = 0x0, |
3657 | .phy_base_addr = 0x0, | ||
3644 | .global1_addr = 0x1b, | 3658 | .global1_addr = 0x1b, |
3645 | .global2_addr = 0x1c, | 3659 | .global2_addr = 0x1c, |
3646 | .tag_protocol = DSA_TAG_PROTO_DSA, | 3660 | .tag_protocol = DSA_TAG_PROTO_DSA, |
@@ -3663,6 +3677,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3663 | .num_gpio = 16, | 3677 | .num_gpio = 16, |
3664 | .max_vid = 8191, | 3678 | .max_vid = 8191, |
3665 | .port_base_addr = 0x0, | 3679 | .port_base_addr = 0x0, |
3680 | .phy_base_addr = 0x0, | ||
3666 | .global1_addr = 0x1b, | 3681 | .global1_addr = 0x1b, |
3667 | .global2_addr = 0x1c, | 3682 | .global2_addr = 0x1c, |
3668 | .age_time_coeff = 3750, | 3683 | .age_time_coeff = 3750, |
@@ -3684,6 +3699,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3684 | .num_internal_phys = 11, | 3699 | .num_internal_phys = 11, |
3685 | .max_vid = 8191, | 3700 | .max_vid = 8191, |
3686 | .port_base_addr = 0x0, | 3701 | .port_base_addr = 0x0, |
3702 | .phy_base_addr = 0x0, | ||
3687 | .global1_addr = 0x1b, | 3703 | .global1_addr = 0x1b, |
3688 | .global2_addr = 0x1c, | 3704 | .global2_addr = 0x1c, |
3689 | .age_time_coeff = 3750, | 3705 | .age_time_coeff = 3750, |
@@ -3707,6 +3723,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3707 | .num_gpio = 15, | 3723 | .num_gpio = 15, |
3708 | .max_vid = 4095, | 3724 | .max_vid = 4095, |
3709 | .port_base_addr = 0x10, | 3725 | .port_base_addr = 0x10, |
3726 | .phy_base_addr = 0x0, | ||
3710 | .global1_addr = 0x1b, | 3727 | .global1_addr = 0x1b, |
3711 | .global2_addr = 0x1c, | 3728 | .global2_addr = 0x1c, |
3712 | .age_time_coeff = 15000, | 3729 | .age_time_coeff = 15000, |
@@ -3730,6 +3747,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3730 | .num_gpio = 16, | 3747 | .num_gpio = 16, |
3731 | .max_vid = 8191, | 3748 | .max_vid = 8191, |
3732 | .port_base_addr = 0x0, | 3749 | .port_base_addr = 0x0, |
3750 | .phy_base_addr = 0x0, | ||
3733 | .global1_addr = 0x1b, | 3751 | .global1_addr = 0x1b, |
3734 | .global2_addr = 0x1c, | 3752 | .global2_addr = 0x1c, |
3735 | .age_time_coeff = 3750, | 3753 | .age_time_coeff = 3750, |
@@ -3753,6 +3771,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3753 | .num_gpio = 15, | 3771 | .num_gpio = 15, |
3754 | .max_vid = 4095, | 3772 | .max_vid = 4095, |
3755 | .port_base_addr = 0x10, | 3773 | .port_base_addr = 0x10, |
3774 | .phy_base_addr = 0x0, | ||
3756 | .global1_addr = 0x1b, | 3775 | .global1_addr = 0x1b, |
3757 | .global2_addr = 0x1c, | 3776 | .global2_addr = 0x1c, |
3758 | .age_time_coeff = 15000, | 3777 | .age_time_coeff = 15000, |
@@ -3776,6 +3795,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3776 | .num_gpio = 15, | 3795 | .num_gpio = 15, |
3777 | .max_vid = 4095, | 3796 | .max_vid = 4095, |
3778 | .port_base_addr = 0x10, | 3797 | .port_base_addr = 0x10, |
3798 | .phy_base_addr = 0x0, | ||
3779 | .global1_addr = 0x1b, | 3799 | .global1_addr = 0x1b, |
3780 | .global2_addr = 0x1c, | 3800 | .global2_addr = 0x1c, |
3781 | .age_time_coeff = 15000, | 3801 | .age_time_coeff = 15000, |
@@ -3798,6 +3818,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3798 | .num_gpio = 11, | 3818 | .num_gpio = 11, |
3799 | .max_vid = 4095, | 3819 | .max_vid = 4095, |
3800 | .port_base_addr = 0x10, | 3820 | .port_base_addr = 0x10, |
3821 | .phy_base_addr = 0x10, | ||
3801 | .global1_addr = 0x1b, | 3822 | .global1_addr = 0x1b, |
3802 | .global2_addr = 0x1c, | 3823 | .global2_addr = 0x1c, |
3803 | .age_time_coeff = 3750, | 3824 | .age_time_coeff = 3750, |
@@ -3820,6 +3841,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3820 | .num_internal_phys = 5, | 3841 | .num_internal_phys = 5, |
3821 | .max_vid = 4095, | 3842 | .max_vid = 4095, |
3822 | .port_base_addr = 0x10, | 3843 | .port_base_addr = 0x10, |
3844 | .phy_base_addr = 0x0, | ||
3823 | .global1_addr = 0x1b, | 3845 | .global1_addr = 0x1b, |
3824 | .global2_addr = 0x1c, | 3846 | .global2_addr = 0x1c, |
3825 | .age_time_coeff = 15000, | 3847 | .age_time_coeff = 15000, |
@@ -3841,6 +3863,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3841 | .num_internal_phys = 5, | 3863 | .num_internal_phys = 5, |
3842 | .max_vid = 4095, | 3864 | .max_vid = 4095, |
3843 | .port_base_addr = 0x10, | 3865 | .port_base_addr = 0x10, |
3866 | .phy_base_addr = 0x0, | ||
3844 | .global1_addr = 0x1b, | 3867 | .global1_addr = 0x1b, |
3845 | .global2_addr = 0x1c, | 3868 | .global2_addr = 0x1c, |
3846 | .age_time_coeff = 15000, | 3869 | .age_time_coeff = 15000, |
@@ -3863,6 +3886,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3863 | .num_gpio = 15, | 3886 | .num_gpio = 15, |
3864 | .max_vid = 4095, | 3887 | .max_vid = 4095, |
3865 | .port_base_addr = 0x10, | 3888 | .port_base_addr = 0x10, |
3889 | .phy_base_addr = 0x0, | ||
3866 | .global1_addr = 0x1b, | 3890 | .global1_addr = 0x1b, |
3867 | .global2_addr = 0x1c, | 3891 | .global2_addr = 0x1c, |
3868 | .age_time_coeff = 15000, | 3892 | .age_time_coeff = 15000, |
@@ -3885,6 +3909,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3885 | .num_gpio = 16, | 3909 | .num_gpio = 16, |
3886 | .max_vid = 8191, | 3910 | .max_vid = 8191, |
3887 | .port_base_addr = 0x0, | 3911 | .port_base_addr = 0x0, |
3912 | .phy_base_addr = 0x0, | ||
3888 | .global1_addr = 0x1b, | 3913 | .global1_addr = 0x1b, |
3889 | .global2_addr = 0x1c, | 3914 | .global2_addr = 0x1c, |
3890 | .age_time_coeff = 3750, | 3915 | .age_time_coeff = 3750, |
@@ -3907,6 +3932,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
3907 | .num_gpio = 16, | 3932 | .num_gpio = 16, |
3908 | .max_vid = 8191, | 3933 | .max_vid = 8191, |
3909 | .port_base_addr = 0x0, | 3934 | .port_base_addr = 0x0, |
3935 | .phy_base_addr = 0x0, | ||
3910 | .global1_addr = 0x1b, | 3936 | .global1_addr = 0x1b, |
3911 | .global2_addr = 0x1c, | 3937 | .global2_addr = 0x1c, |
3912 | .age_time_coeff = 3750, | 3938 | .age_time_coeff = 3750, |
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 80490f66bc06..12b7f4649b25 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h | |||
@@ -114,6 +114,7 @@ struct mv88e6xxx_info { | |||
114 | unsigned int num_gpio; | 114 | unsigned int num_gpio; |
115 | unsigned int max_vid; | 115 | unsigned int max_vid; |
116 | unsigned int port_base_addr; | 116 | unsigned int port_base_addr; |
117 | unsigned int phy_base_addr; | ||
117 | unsigned int global1_addr; | 118 | unsigned int global1_addr; |
118 | unsigned int global2_addr; | 119 | unsigned int global2_addr; |
119 | unsigned int age_time_coeff; | 120 | unsigned int age_time_coeff; |
diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c index 0ce627fded48..8d22d66d84b7 100644 --- a/drivers/net/dsa/mv88e6xxx/global2.c +++ b/drivers/net/dsa/mv88e6xxx/global2.c | |||
@@ -1118,7 +1118,7 @@ int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip, | |||
1118 | err = irq; | 1118 | err = irq; |
1119 | goto out; | 1119 | goto out; |
1120 | } | 1120 | } |
1121 | bus->irq[chip->info->port_base_addr + phy] = irq; | 1121 | bus->irq[chip->info->phy_base_addr + phy] = irq; |
1122 | } | 1122 | } |
1123 | return 0; | 1123 | return 0; |
1124 | out: | 1124 | out: |
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index 32f6d2e24d66..1a1a6380c128 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c | |||
@@ -95,6 +95,7 @@ void aq_nic_cfg_start(struct aq_nic_s *self) | |||
95 | /*rss rings */ | 95 | /*rss rings */ |
96 | cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); | 96 | cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); |
97 | cfg->vecs = min(cfg->vecs, num_online_cpus()); | 97 | cfg->vecs = min(cfg->vecs, num_online_cpus()); |
98 | cfg->vecs = min(cfg->vecs, self->irqvecs); | ||
98 | /* cfg->vecs should be power of 2 for RSS */ | 99 | /* cfg->vecs should be power of 2 for RSS */ |
99 | if (cfg->vecs >= 8U) | 100 | if (cfg->vecs >= 8U) |
100 | cfg->vecs = 8U; | 101 | cfg->vecs = 8U; |
@@ -246,6 +247,8 @@ void aq_nic_ndev_init(struct aq_nic_s *self) | |||
246 | 247 | ||
247 | self->ndev->hw_features |= aq_hw_caps->hw_features; | 248 | self->ndev->hw_features |= aq_hw_caps->hw_features; |
248 | self->ndev->features = aq_hw_caps->hw_features; | 249 | self->ndev->features = aq_hw_caps->hw_features; |
250 | self->ndev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM | | ||
251 | NETIF_F_RXHASH | NETIF_F_SG | NETIF_F_LRO; | ||
249 | self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; | 252 | self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; |
250 | self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; | 253 | self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; |
251 | 254 | ||
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h index 219b550d1665..faa533a0ec47 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h | |||
@@ -80,6 +80,7 @@ struct aq_nic_s { | |||
80 | 80 | ||
81 | struct pci_dev *pdev; | 81 | struct pci_dev *pdev; |
82 | unsigned int msix_entry_mask; | 82 | unsigned int msix_entry_mask; |
83 | u32 irqvecs; | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | static inline struct device *aq_nic_get_dev(struct aq_nic_s *self) | 86 | static inline struct device *aq_nic_get_dev(struct aq_nic_s *self) |
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index ecc6306f940f..a50e08bb4748 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | |||
@@ -267,16 +267,16 @@ static int aq_pci_probe(struct pci_dev *pdev, | |||
267 | numvecs = min(numvecs, num_online_cpus()); | 267 | numvecs = min(numvecs, num_online_cpus()); |
268 | /*enable interrupts */ | 268 | /*enable interrupts */ |
269 | #if !AQ_CFG_FORCE_LEGACY_INT | 269 | #if !AQ_CFG_FORCE_LEGACY_INT |
270 | err = pci_alloc_irq_vectors(self->pdev, numvecs, numvecs, | 270 | numvecs = pci_alloc_irq_vectors(self->pdev, 1, numvecs, |
271 | PCI_IRQ_MSIX); | 271 | PCI_IRQ_MSIX | PCI_IRQ_MSI | |
272 | 272 | PCI_IRQ_LEGACY); | |
273 | if (err < 0) { | 273 | |
274 | err = pci_alloc_irq_vectors(self->pdev, 1, 1, | 274 | if (numvecs < 0) { |
275 | PCI_IRQ_MSI | PCI_IRQ_LEGACY); | 275 | err = numvecs; |
276 | if (err < 0) | 276 | goto err_hwinit; |
277 | goto err_hwinit; | ||
278 | } | 277 | } |
279 | #endif | 278 | #endif |
279 | self->irqvecs = numvecs; | ||
280 | 280 | ||
281 | /* net device init */ | 281 | /* net device init */ |
282 | aq_nic_cfg_start(self); | 282 | aq_nic_cfg_start(self); |
@@ -298,9 +298,9 @@ err_free_aq_hw: | |||
298 | kfree(self->aq_hw); | 298 | kfree(self->aq_hw); |
299 | err_ioremap: | 299 | err_ioremap: |
300 | free_netdev(ndev); | 300 | free_netdev(ndev); |
301 | err_pci_func: | ||
302 | pci_release_regions(pdev); | ||
303 | err_ndev: | 301 | err_ndev: |
302 | pci_release_regions(pdev); | ||
303 | err_pci_func: | ||
304 | pci_disable_device(pdev); | 304 | pci_disable_device(pdev); |
305 | return err; | 305 | return err; |
306 | } | 306 | } |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 08bbb639be1a..9f59b1270a7c 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -8733,14 +8733,15 @@ static void tg3_free_consistent(struct tg3 *tp) | |||
8733 | tg3_mem_rx_release(tp); | 8733 | tg3_mem_rx_release(tp); |
8734 | tg3_mem_tx_release(tp); | 8734 | tg3_mem_tx_release(tp); |
8735 | 8735 | ||
8736 | /* Protect tg3_get_stats64() from reading freed tp->hw_stats. */ | 8736 | /* tp->hw_stats can be referenced safely: |
8737 | tg3_full_lock(tp, 0); | 8737 | * 1. under rtnl_lock |
8738 | * 2. or under tp->lock if TG3_FLAG_INIT_COMPLETE is set. | ||
8739 | */ | ||
8738 | if (tp->hw_stats) { | 8740 | if (tp->hw_stats) { |
8739 | dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats), | 8741 | dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats), |
8740 | tp->hw_stats, tp->stats_mapping); | 8742 | tp->hw_stats, tp->stats_mapping); |
8741 | tp->hw_stats = NULL; | 8743 | tp->hw_stats = NULL; |
8742 | } | 8744 | } |
8743 | tg3_full_unlock(tp); | ||
8744 | } | 8745 | } |
8745 | 8746 | ||
8746 | /* | 8747 | /* |
@@ -14178,7 +14179,7 @@ static void tg3_get_stats64(struct net_device *dev, | |||
14178 | struct tg3 *tp = netdev_priv(dev); | 14179 | struct tg3 *tp = netdev_priv(dev); |
14179 | 14180 | ||
14180 | spin_lock_bh(&tp->lock); | 14181 | spin_lock_bh(&tp->lock); |
14181 | if (!tp->hw_stats) { | 14182 | if (!tp->hw_stats || !tg3_flag(tp, INIT_COMPLETE)) { |
14182 | *stats = tp->net_stats_prev; | 14183 | *stats = tp->net_stats_prev; |
14183 | spin_unlock_bh(&tp->lock); | 14184 | spin_unlock_bh(&tp->lock); |
14184 | return; | 14185 | return; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 24d2865b8806..005283c7cdfe 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -3433,8 +3433,8 @@ static int adap_config_hma(struct adapter *adapter) | |||
3433 | sgl = adapter->hma.sgt->sgl; | 3433 | sgl = adapter->hma.sgt->sgl; |
3434 | node = dev_to_node(adapter->pdev_dev); | 3434 | node = dev_to_node(adapter->pdev_dev); |
3435 | for_each_sg(sgl, iter, sgt->orig_nents, i) { | 3435 | for_each_sg(sgl, iter, sgt->orig_nents, i) { |
3436 | newpage = alloc_pages_node(node, __GFP_NOWARN | GFP_KERNEL, | 3436 | newpage = alloc_pages_node(node, __GFP_NOWARN | GFP_KERNEL | |
3437 | page_order); | 3437 | __GFP_ZERO, page_order); |
3438 | if (!newpage) { | 3438 | if (!newpage) { |
3439 | dev_err(adapter->pdev_dev, | 3439 | dev_err(adapter->pdev_dev, |
3440 | "Not enough memory for HMA page allocation\n"); | 3440 | "Not enough memory for HMA page allocation\n"); |
@@ -5474,6 +5474,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
5474 | } | 5474 | } |
5475 | spin_lock_init(&adapter->mbox_lock); | 5475 | spin_lock_init(&adapter->mbox_lock); |
5476 | INIT_LIST_HEAD(&adapter->mlist.list); | 5476 | INIT_LIST_HEAD(&adapter->mlist.list); |
5477 | adapter->mbox_log->size = T4_OS_LOG_MBOX_CMDS; | ||
5477 | pci_set_drvdata(pdev, adapter); | 5478 | pci_set_drvdata(pdev, adapter); |
5478 | 5479 | ||
5479 | if (func != ent->driver_data) { | 5480 | if (func != ent->driver_data) { |
@@ -5508,8 +5509,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
5508 | goto out_free_adapter; | 5509 | goto out_free_adapter; |
5509 | } | 5510 | } |
5510 | 5511 | ||
5511 | adapter->mbox_log->size = T4_OS_LOG_MBOX_CMDS; | ||
5512 | |||
5513 | /* PCI device has been enabled */ | 5512 | /* PCI device has been enabled */ |
5514 | adapter->flags |= DEV_ENABLED; | 5513 | adapter->flags |= DEV_ENABLED; |
5515 | memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map)); | 5514 | memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map)); |
diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c index 5909a4407e38..7c511f144ed6 100644 --- a/drivers/net/ethernet/intel/ice/ice_controlq.c +++ b/drivers/net/ethernet/intel/ice/ice_controlq.c | |||
@@ -1014,10 +1014,10 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, | |||
1014 | desc = ICE_CTL_Q_DESC(cq->rq, ntc); | 1014 | desc = ICE_CTL_Q_DESC(cq->rq, ntc); |
1015 | desc_idx = ntc; | 1015 | desc_idx = ntc; |
1016 | 1016 | ||
1017 | cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval); | ||
1017 | flags = le16_to_cpu(desc->flags); | 1018 | flags = le16_to_cpu(desc->flags); |
1018 | if (flags & ICE_AQ_FLAG_ERR) { | 1019 | if (flags & ICE_AQ_FLAG_ERR) { |
1019 | ret_code = ICE_ERR_AQ_ERROR; | 1020 | ret_code = ICE_ERR_AQ_ERROR; |
1020 | cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval); | ||
1021 | ice_debug(hw, ICE_DBG_AQ_MSG, | 1021 | ice_debug(hw, ICE_DBG_AQ_MSG, |
1022 | "Control Receive Queue Event received with error 0x%x\n", | 1022 | "Control Receive Queue Event received with error 0x%x\n", |
1023 | cq->rq_last_status); | 1023 | cq->rq_last_status); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c index 68af127987bc..cead23e3db0c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | |||
@@ -943,8 +943,8 @@ err2: | |||
943 | kfree(ipsec->ip_tbl); | 943 | kfree(ipsec->ip_tbl); |
944 | kfree(ipsec->rx_tbl); | 944 | kfree(ipsec->rx_tbl); |
945 | kfree(ipsec->tx_tbl); | 945 | kfree(ipsec->tx_tbl); |
946 | kfree(ipsec); | ||
946 | err1: | 947 | err1: |
947 | kfree(adapter->ipsec); | ||
948 | netdev_err(adapter->netdev, "Unable to allocate memory for SA tables"); | 948 | netdev_err(adapter->netdev, "Unable to allocate memory for SA tables"); |
949 | } | 949 | } |
950 | 950 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c index 3123267dfba9..9592f3e3e42e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | |||
@@ -3427,6 +3427,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) | |||
3427 | hw->phy.sfp_setup_needed = false; | 3427 | hw->phy.sfp_setup_needed = false; |
3428 | } | 3428 | } |
3429 | 3429 | ||
3430 | if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) | ||
3431 | return status; | ||
3432 | |||
3430 | /* Reset PHY */ | 3433 | /* Reset PHY */ |
3431 | if (!hw->phy.reset_disable && hw->phy.ops.reset) | 3434 | if (!hw->phy.reset_disable && hw->phy.ops.reset) |
3432 | hw->phy.ops.reset(hw); | 3435 | hw->phy.ops.reset(hw); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index e3d04f226d57..850f8af95e49 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -4137,7 +4137,7 @@ out_drop: | |||
4137 | return NETDEV_TX_OK; | 4137 | return NETDEV_TX_OK; |
4138 | } | 4138 | } |
4139 | 4139 | ||
4140 | static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 4140 | static netdev_tx_t ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
4141 | { | 4141 | { |
4142 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 4142 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
4143 | struct ixgbevf_ring *tx_ring; | 4143 | struct ixgbevf_ring *tx_ring; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index a30a2e95d13f..f11b45001cad 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | |||
@@ -1027,6 +1027,22 @@ static int mlx4_en_set_coalesce(struct net_device *dev, | |||
1027 | if (!coal->tx_max_coalesced_frames_irq) | 1027 | if (!coal->tx_max_coalesced_frames_irq) |
1028 | return -EINVAL; | 1028 | return -EINVAL; |
1029 | 1029 | ||
1030 | if (coal->tx_coalesce_usecs > MLX4_EN_MAX_COAL_TIME || | ||
1031 | coal->rx_coalesce_usecs > MLX4_EN_MAX_COAL_TIME || | ||
1032 | coal->rx_coalesce_usecs_low > MLX4_EN_MAX_COAL_TIME || | ||
1033 | coal->rx_coalesce_usecs_high > MLX4_EN_MAX_COAL_TIME) { | ||
1034 | netdev_info(dev, "%s: maximum coalesce time supported is %d usecs\n", | ||
1035 | __func__, MLX4_EN_MAX_COAL_TIME); | ||
1036 | return -ERANGE; | ||
1037 | } | ||
1038 | |||
1039 | if (coal->tx_max_coalesced_frames > MLX4_EN_MAX_COAL_PKTS || | ||
1040 | coal->rx_max_coalesced_frames > MLX4_EN_MAX_COAL_PKTS) { | ||
1041 | netdev_info(dev, "%s: maximum coalesced frames supported is %d\n", | ||
1042 | __func__, MLX4_EN_MAX_COAL_PKTS); | ||
1043 | return -ERANGE; | ||
1044 | } | ||
1045 | |||
1030 | priv->rx_frames = (coal->rx_max_coalesced_frames == | 1046 | priv->rx_frames = (coal->rx_max_coalesced_frames == |
1031 | MLX4_EN_AUTO_CONF) ? | 1047 | MLX4_EN_AUTO_CONF) ? |
1032 | MLX4_EN_RX_COAL_TARGET : | 1048 | MLX4_EN_RX_COAL_TARGET : |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index e0adac4a9a19..9670b33fc9b1 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -3324,12 +3324,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
3324 | MAX_TX_RINGS, GFP_KERNEL); | 3324 | MAX_TX_RINGS, GFP_KERNEL); |
3325 | if (!priv->tx_ring[t]) { | 3325 | if (!priv->tx_ring[t]) { |
3326 | err = -ENOMEM; | 3326 | err = -ENOMEM; |
3327 | goto err_free_tx; | 3327 | goto out; |
3328 | } | 3328 | } |
3329 | priv->tx_cq[t] = kzalloc(sizeof(struct mlx4_en_cq *) * | 3329 | priv->tx_cq[t] = kzalloc(sizeof(struct mlx4_en_cq *) * |
3330 | MAX_TX_RINGS, GFP_KERNEL); | 3330 | MAX_TX_RINGS, GFP_KERNEL); |
3331 | if (!priv->tx_cq[t]) { | 3331 | if (!priv->tx_cq[t]) { |
3332 | kfree(priv->tx_ring[t]); | ||
3333 | err = -ENOMEM; | 3332 | err = -ENOMEM; |
3334 | goto out; | 3333 | goto out; |
3335 | } | 3334 | } |
@@ -3582,11 +3581,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
3582 | 3581 | ||
3583 | return 0; | 3582 | return 0; |
3584 | 3583 | ||
3585 | err_free_tx: | ||
3586 | while (t--) { | ||
3587 | kfree(priv->tx_ring[t]); | ||
3588 | kfree(priv->tx_cq[t]); | ||
3589 | } | ||
3590 | out: | 3584 | out: |
3591 | mlx4_en_destroy_netdev(dev); | 3585 | mlx4_en_destroy_netdev(dev); |
3592 | return err; | 3586 | return err; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index f7c81133594f..ace6545f82e6 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -132,6 +132,9 @@ | |||
132 | #define MLX4_EN_TX_COAL_PKTS 16 | 132 | #define MLX4_EN_TX_COAL_PKTS 16 |
133 | #define MLX4_EN_TX_COAL_TIME 0x10 | 133 | #define MLX4_EN_TX_COAL_TIME 0x10 |
134 | 134 | ||
135 | #define MLX4_EN_MAX_COAL_PKTS U16_MAX | ||
136 | #define MLX4_EN_MAX_COAL_TIME U16_MAX | ||
137 | |||
135 | #define MLX4_EN_RX_RATE_LOW 400000 | 138 | #define MLX4_EN_RX_RATE_LOW 400000 |
136 | #define MLX4_EN_RX_COAL_TIME_LOW 0 | 139 | #define MLX4_EN_RX_COAL_TIME_LOW 0 |
137 | #define MLX4_EN_RX_RATE_HIGH 450000 | 140 | #define MLX4_EN_RX_RATE_HIGH 450000 |
@@ -552,8 +555,8 @@ struct mlx4_en_priv { | |||
552 | u16 rx_usecs_low; | 555 | u16 rx_usecs_low; |
553 | u32 pkt_rate_high; | 556 | u32 pkt_rate_high; |
554 | u16 rx_usecs_high; | 557 | u16 rx_usecs_high; |
555 | u16 sample_interval; | 558 | u32 sample_interval; |
556 | u16 adaptive_rx_coal; | 559 | u32 adaptive_rx_coal; |
557 | u32 msg_enable; | 560 | u32 msg_enable; |
558 | u32 loopback_ok; | 561 | u32 loopback_ok; |
559 | u32 validate_loopback; | 562 | u32 validate_loopback; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 3c534fc43400..b94276db3ce9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |||
@@ -1261,6 +1261,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, | |||
1261 | f->mask); | 1261 | f->mask); |
1262 | addr_type = key->addr_type; | 1262 | addr_type = key->addr_type; |
1263 | 1263 | ||
1264 | /* the HW doesn't support frag first/later */ | ||
1265 | if (mask->flags & FLOW_DIS_FIRST_FRAG) | ||
1266 | return -EOPNOTSUPP; | ||
1267 | |||
1264 | if (mask->flags & FLOW_DIS_IS_FRAGMENT) { | 1268 | if (mask->flags & FLOW_DIS_IS_FRAGMENT) { |
1265 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1); | 1269 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1); |
1266 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, | 1270 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index c1c94974e16b..1814f803bd2c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c | |||
@@ -34,6 +34,9 @@ | |||
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/mlx5/driver.h> | 35 | #include <linux/mlx5/driver.h> |
36 | #include <linux/mlx5/cmd.h> | 36 | #include <linux/mlx5/cmd.h> |
37 | #ifdef CONFIG_RFS_ACCEL | ||
38 | #include <linux/cpu_rmap.h> | ||
39 | #endif | ||
37 | #include "mlx5_core.h" | 40 | #include "mlx5_core.h" |
38 | #include "fpga/core.h" | 41 | #include "fpga/core.h" |
39 | #include "eswitch.h" | 42 | #include "eswitch.h" |
@@ -923,3 +926,28 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, | |||
923 | MLX5_SET(query_eq_in, in, eq_number, eq->eqn); | 926 | MLX5_SET(query_eq_in, in, eq_number, eq->eqn); |
924 | return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen); | 927 | return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen); |
925 | } | 928 | } |
929 | |||
930 | /* This function should only be called after mlx5_cmd_force_teardown_hca */ | ||
931 | void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev) | ||
932 | { | ||
933 | struct mlx5_eq_table *table = &dev->priv.eq_table; | ||
934 | struct mlx5_eq *eq; | ||
935 | |||
936 | #ifdef CONFIG_RFS_ACCEL | ||
937 | if (dev->rmap) { | ||
938 | free_irq_cpu_rmap(dev->rmap); | ||
939 | dev->rmap = NULL; | ||
940 | } | ||
941 | #endif | ||
942 | list_for_each_entry(eq, &table->comp_eqs_list, list) | ||
943 | free_irq(eq->irqn, eq); | ||
944 | |||
945 | free_irq(table->pages_eq.irqn, &table->pages_eq); | ||
946 | free_irq(table->async_eq.irqn, &table->async_eq); | ||
947 | free_irq(table->cmd_eq.irqn, &table->cmd_eq); | ||
948 | #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING | ||
949 | if (MLX5_CAP_GEN(dev, pg)) | ||
950 | free_irq(table->pfault_eq.irqn, &table->pfault_eq); | ||
951 | #endif | ||
952 | pci_free_irq_vectors(dev->pdev); | ||
953 | } | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 332bc56306bf..1352d13eedb3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | |||
@@ -2175,26 +2175,35 @@ int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw, | |||
2175 | memset(vf_stats, 0, sizeof(*vf_stats)); | 2175 | memset(vf_stats, 0, sizeof(*vf_stats)); |
2176 | vf_stats->rx_packets = | 2176 | vf_stats->rx_packets = |
2177 | MLX5_GET_CTR(out, received_eth_unicast.packets) + | 2177 | MLX5_GET_CTR(out, received_eth_unicast.packets) + |
2178 | MLX5_GET_CTR(out, received_ib_unicast.packets) + | ||
2178 | MLX5_GET_CTR(out, received_eth_multicast.packets) + | 2179 | MLX5_GET_CTR(out, received_eth_multicast.packets) + |
2180 | MLX5_GET_CTR(out, received_ib_multicast.packets) + | ||
2179 | MLX5_GET_CTR(out, received_eth_broadcast.packets); | 2181 | MLX5_GET_CTR(out, received_eth_broadcast.packets); |
2180 | 2182 | ||
2181 | vf_stats->rx_bytes = | 2183 | vf_stats->rx_bytes = |
2182 | MLX5_GET_CTR(out, received_eth_unicast.octets) + | 2184 | MLX5_GET_CTR(out, received_eth_unicast.octets) + |
2185 | MLX5_GET_CTR(out, received_ib_unicast.octets) + | ||
2183 | MLX5_GET_CTR(out, received_eth_multicast.octets) + | 2186 | MLX5_GET_CTR(out, received_eth_multicast.octets) + |
2187 | MLX5_GET_CTR(out, received_ib_multicast.octets) + | ||
2184 | MLX5_GET_CTR(out, received_eth_broadcast.octets); | 2188 | MLX5_GET_CTR(out, received_eth_broadcast.octets); |
2185 | 2189 | ||
2186 | vf_stats->tx_packets = | 2190 | vf_stats->tx_packets = |
2187 | MLX5_GET_CTR(out, transmitted_eth_unicast.packets) + | 2191 | MLX5_GET_CTR(out, transmitted_eth_unicast.packets) + |
2192 | MLX5_GET_CTR(out, transmitted_ib_unicast.packets) + | ||
2188 | MLX5_GET_CTR(out, transmitted_eth_multicast.packets) + | 2193 | MLX5_GET_CTR(out, transmitted_eth_multicast.packets) + |
2194 | MLX5_GET_CTR(out, transmitted_ib_multicast.packets) + | ||
2189 | MLX5_GET_CTR(out, transmitted_eth_broadcast.packets); | 2195 | MLX5_GET_CTR(out, transmitted_eth_broadcast.packets); |
2190 | 2196 | ||
2191 | vf_stats->tx_bytes = | 2197 | vf_stats->tx_bytes = |
2192 | MLX5_GET_CTR(out, transmitted_eth_unicast.octets) + | 2198 | MLX5_GET_CTR(out, transmitted_eth_unicast.octets) + |
2199 | MLX5_GET_CTR(out, transmitted_ib_unicast.octets) + | ||
2193 | MLX5_GET_CTR(out, transmitted_eth_multicast.octets) + | 2200 | MLX5_GET_CTR(out, transmitted_eth_multicast.octets) + |
2201 | MLX5_GET_CTR(out, transmitted_ib_multicast.octets) + | ||
2194 | MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); | 2202 | MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); |
2195 | 2203 | ||
2196 | vf_stats->multicast = | 2204 | vf_stats->multicast = |
2197 | MLX5_GET_CTR(out, received_eth_multicast.packets); | 2205 | MLX5_GET_CTR(out, received_eth_multicast.packets) + |
2206 | MLX5_GET_CTR(out, received_ib_multicast.packets); | ||
2198 | 2207 | ||
2199 | vf_stats->broadcast = | 2208 | vf_stats->broadcast = |
2200 | MLX5_GET_CTR(out, received_eth_broadcast.packets); | 2209 | MLX5_GET_CTR(out, received_eth_broadcast.packets); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 63a8ea31601c..e2c465b0b3f8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -1587,6 +1587,14 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev) | |||
1587 | 1587 | ||
1588 | mlx5_enter_error_state(dev, true); | 1588 | mlx5_enter_error_state(dev, true); |
1589 | 1589 | ||
1590 | /* Some platforms requiring freeing the IRQ's in the shutdown | ||
1591 | * flow. If they aren't freed they can't be allocated after | ||
1592 | * kexec. There is no need to cleanup the mlx5_core software | ||
1593 | * contexts. | ||
1594 | */ | ||
1595 | mlx5_irq_clear_affinity_hints(dev); | ||
1596 | mlx5_core_eq_free_irqs(dev); | ||
1597 | |||
1590 | return 0; | 1598 | return 0; |
1591 | } | 1599 | } |
1592 | 1600 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h index 7d001fe6e631..023882d9a22e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | |||
@@ -128,6 +128,8 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, | |||
128 | u32 *out, int outlen); | 128 | u32 *out, int outlen); |
129 | int mlx5_start_eqs(struct mlx5_core_dev *dev); | 129 | int mlx5_start_eqs(struct mlx5_core_dev *dev); |
130 | void mlx5_stop_eqs(struct mlx5_core_dev *dev); | 130 | void mlx5_stop_eqs(struct mlx5_core_dev *dev); |
131 | /* This function should only be called after mlx5_cmd_force_teardown_hca */ | ||
132 | void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev); | ||
131 | struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn); | 133 | struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn); |
132 | u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq *eq); | 134 | u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq *eq); |
133 | void mlx5_cq_tasklet_cb(unsigned long data); | 135 | void mlx5_cq_tasklet_cb(unsigned long data); |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 93ea56620a24..e13ac3b8dff7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c | |||
@@ -1100,11 +1100,11 @@ err_emad_init: | |||
1100 | err_alloc_lag_mapping: | 1100 | err_alloc_lag_mapping: |
1101 | mlxsw_ports_fini(mlxsw_core); | 1101 | mlxsw_ports_fini(mlxsw_core); |
1102 | err_ports_init: | 1102 | err_ports_init: |
1103 | mlxsw_bus->fini(bus_priv); | ||
1104 | err_bus_init: | ||
1105 | if (!reload) | 1103 | if (!reload) |
1106 | devlink_resources_unregister(devlink, NULL); | 1104 | devlink_resources_unregister(devlink, NULL); |
1107 | err_register_resources: | 1105 | err_register_resources: |
1106 | mlxsw_bus->fini(bus_priv); | ||
1107 | err_bus_init: | ||
1108 | if (!reload) | 1108 | if (!reload) |
1109 | devlink_free(devlink); | 1109 | devlink_free(devlink); |
1110 | err_devlink_alloc: | 1110 | err_devlink_alloc: |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c index a997e34bcec2..84e3b9f5abb1 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.c +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c | |||
@@ -52,8 +52,6 @@ | |||
52 | 52 | ||
53 | #define NFP_FLOWER_ALLOWED_VER 0x0001000000010000UL | 53 | #define NFP_FLOWER_ALLOWED_VER 0x0001000000010000UL |
54 | 54 | ||
55 | #define NFP_FLOWER_FRAME_HEADROOM 158 | ||
56 | |||
57 | static const char *nfp_flower_extra_cap(struct nfp_app *app, struct nfp_net *nn) | 55 | static const char *nfp_flower_extra_cap(struct nfp_app *app, struct nfp_net *nn) |
58 | { | 56 | { |
59 | return "FLOWER"; | 57 | return "FLOWER"; |
@@ -559,22 +557,6 @@ static void nfp_flower_clean(struct nfp_app *app) | |||
559 | app->priv = NULL; | 557 | app->priv = NULL; |
560 | } | 558 | } |
561 | 559 | ||
562 | static int | ||
563 | nfp_flower_check_mtu(struct nfp_app *app, struct net_device *netdev, | ||
564 | int new_mtu) | ||
565 | { | ||
566 | /* The flower fw reserves NFP_FLOWER_FRAME_HEADROOM bytes of the | ||
567 | * supported max MTU to allow for appending tunnel headers. To prevent | ||
568 | * unexpected behaviour this needs to be accounted for. | ||
569 | */ | ||
570 | if (new_mtu > netdev->max_mtu - NFP_FLOWER_FRAME_HEADROOM) { | ||
571 | nfp_err(app->cpp, "New MTU (%d) is not valid\n", new_mtu); | ||
572 | return -EINVAL; | ||
573 | } | ||
574 | |||
575 | return 0; | ||
576 | } | ||
577 | |||
578 | static bool nfp_flower_check_ack(struct nfp_flower_priv *app_priv) | 560 | static bool nfp_flower_check_ack(struct nfp_flower_priv *app_priv) |
579 | { | 561 | { |
580 | bool ret; | 562 | bool ret; |
@@ -656,7 +638,6 @@ const struct nfp_app_type app_flower = { | |||
656 | .init = nfp_flower_init, | 638 | .init = nfp_flower_init, |
657 | .clean = nfp_flower_clean, | 639 | .clean = nfp_flower_clean, |
658 | 640 | ||
659 | .check_mtu = nfp_flower_check_mtu, | ||
660 | .repr_change_mtu = nfp_flower_repr_change_mtu, | 641 | .repr_change_mtu = nfp_flower_repr_change_mtu, |
661 | 642 | ||
662 | .vnic_alloc = nfp_flower_vnic_alloc, | 643 | .vnic_alloc = nfp_flower_vnic_alloc, |
diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 27364b7572fc..b092894dd128 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c | |||
@@ -1170,7 +1170,7 @@ static void *nixge_get_nvmem_address(struct device *dev) | |||
1170 | 1170 | ||
1171 | cell = nvmem_cell_get(dev, "address"); | 1171 | cell = nvmem_cell_get(dev, "address"); |
1172 | if (IS_ERR(cell)) | 1172 | if (IS_ERR(cell)) |
1173 | return cell; | 1173 | return NULL; |
1174 | 1174 | ||
1175 | mac = nvmem_cell_read(cell, &cell_size); | 1175 | mac = nvmem_cell_read(cell, &cell_size); |
1176 | nvmem_cell_put(cell); | 1176 | nvmem_cell_put(cell); |
@@ -1183,7 +1183,7 @@ static int nixge_probe(struct platform_device *pdev) | |||
1183 | struct nixge_priv *priv; | 1183 | struct nixge_priv *priv; |
1184 | struct net_device *ndev; | 1184 | struct net_device *ndev; |
1185 | struct resource *dmares; | 1185 | struct resource *dmares; |
1186 | const char *mac_addr; | 1186 | const u8 *mac_addr; |
1187 | int err; | 1187 | int err; |
1188 | 1188 | ||
1189 | ndev = alloc_etherdev(sizeof(*priv)); | 1189 | ndev = alloc_etherdev(sizeof(*priv)); |
@@ -1202,10 +1202,12 @@ static int nixge_probe(struct platform_device *pdev) | |||
1202 | ndev->max_mtu = NIXGE_JUMBO_MTU; | 1202 | ndev->max_mtu = NIXGE_JUMBO_MTU; |
1203 | 1203 | ||
1204 | mac_addr = nixge_get_nvmem_address(&pdev->dev); | 1204 | mac_addr = nixge_get_nvmem_address(&pdev->dev); |
1205 | if (mac_addr && is_valid_ether_addr(mac_addr)) | 1205 | if (mac_addr && is_valid_ether_addr(mac_addr)) { |
1206 | ether_addr_copy(ndev->dev_addr, mac_addr); | 1206 | ether_addr_copy(ndev->dev_addr, mac_addr); |
1207 | else | 1207 | kfree(mac_addr); |
1208 | } else { | ||
1208 | eth_hw_addr_random(ndev); | 1209 | eth_hw_addr_random(ndev); |
1210 | } | ||
1209 | 1211 | ||
1210 | priv = netdev_priv(ndev); | 1212 | priv = netdev_priv(ndev); |
1211 | priv->ndev = ndev; | 1213 | priv->ndev = ndev; |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index e874504e8b28..8667799d0069 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c | |||
@@ -115,8 +115,7 @@ int qed_l2_alloc(struct qed_hwfn *p_hwfn) | |||
115 | 115 | ||
116 | void qed_l2_setup(struct qed_hwfn *p_hwfn) | 116 | void qed_l2_setup(struct qed_hwfn *p_hwfn) |
117 | { | 117 | { |
118 | if (p_hwfn->hw_info.personality != QED_PCI_ETH && | 118 | if (!QED_IS_L2_PERSONALITY(p_hwfn)) |
119 | p_hwfn->hw_info.personality != QED_PCI_ETH_ROCE) | ||
120 | return; | 119 | return; |
121 | 120 | ||
122 | mutex_init(&p_hwfn->p_l2_info->lock); | 121 | mutex_init(&p_hwfn->p_l2_info->lock); |
@@ -126,8 +125,7 @@ void qed_l2_free(struct qed_hwfn *p_hwfn) | |||
126 | { | 125 | { |
127 | u32 i; | 126 | u32 i; |
128 | 127 | ||
129 | if (p_hwfn->hw_info.personality != QED_PCI_ETH && | 128 | if (!QED_IS_L2_PERSONALITY(p_hwfn)) |
130 | p_hwfn->hw_info.personality != QED_PCI_ETH_ROCE) | ||
131 | return; | 129 | return; |
132 | 130 | ||
133 | if (!p_hwfn->p_l2_info) | 131 | if (!p_hwfn->p_l2_info) |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 9854aa9139af..7870ae2a6f7e 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c | |||
@@ -680,7 +680,7 @@ static int qed_nic_stop(struct qed_dev *cdev) | |||
680 | tasklet_disable(p_hwfn->sp_dpc); | 680 | tasklet_disable(p_hwfn->sp_dpc); |
681 | p_hwfn->b_sp_dpc_enabled = false; | 681 | p_hwfn->b_sp_dpc_enabled = false; |
682 | DP_VERBOSE(cdev, NETIF_MSG_IFDOWN, | 682 | DP_VERBOSE(cdev, NETIF_MSG_IFDOWN, |
683 | "Disabled sp taskelt [hwfn %d] at %p\n", | 683 | "Disabled sp tasklet [hwfn %d] at %p\n", |
684 | i, p_hwfn->sp_dpc); | 684 | i, p_hwfn->sp_dpc); |
685 | } | 685 | } |
686 | } | 686 | } |
diff --git a/drivers/net/ethernet/qlogic/qede/qede_rdma.c b/drivers/net/ethernet/qlogic/qede/qede_rdma.c index 50b142fad6b8..1900bf7e67d1 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_rdma.c +++ b/drivers/net/ethernet/qlogic/qede/qede_rdma.c | |||
@@ -238,7 +238,7 @@ qede_rdma_get_free_event_node(struct qede_dev *edev) | |||
238 | } | 238 | } |
239 | 239 | ||
240 | if (!found) { | 240 | if (!found) { |
241 | event_node = kzalloc(sizeof(*event_node), GFP_KERNEL); | 241 | event_node = kzalloc(sizeof(*event_node), GFP_ATOMIC); |
242 | if (!event_node) { | 242 | if (!event_node) { |
243 | DP_NOTICE(edev, | 243 | DP_NOTICE(edev, |
244 | "qedr: Could not allocate memory for rdma work\n"); | 244 | "qedr: Could not allocate memory for rdma work\n"); |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 604ae78381ae..c7aac1fc99e8 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -4981,6 +4981,9 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) | |||
4981 | static void rtl_pll_power_up(struct rtl8169_private *tp) | 4981 | static void rtl_pll_power_up(struct rtl8169_private *tp) |
4982 | { | 4982 | { |
4983 | rtl_generic_op(tp, tp->pll_power_ops.up); | 4983 | rtl_generic_op(tp, tp->pll_power_ops.up); |
4984 | |||
4985 | /* give MAC/PHY some time to resume */ | ||
4986 | msleep(20); | ||
4984 | } | 4987 | } |
4985 | 4988 | ||
4986 | static void rtl_init_pll_power_ops(struct rtl8169_private *tp) | 4989 | static void rtl_init_pll_power_ops(struct rtl8169_private *tp) |
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index f081de4f38d7..88c12474a0c3 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
@@ -3443,7 +3443,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
3443 | 3443 | ||
3444 | len = (val & RCR_ENTRY_L2_LEN) >> | 3444 | len = (val & RCR_ENTRY_L2_LEN) >> |
3445 | RCR_ENTRY_L2_LEN_SHIFT; | 3445 | RCR_ENTRY_L2_LEN_SHIFT; |
3446 | len -= ETH_FCS_LEN; | 3446 | append_size = len + ETH_HLEN + ETH_FCS_LEN; |
3447 | 3447 | ||
3448 | addr = (val & RCR_ENTRY_PKT_BUF_ADDR) << | 3448 | addr = (val & RCR_ENTRY_PKT_BUF_ADDR) << |
3449 | RCR_ENTRY_PKT_BUF_ADDR_SHIFT; | 3449 | RCR_ENTRY_PKT_BUF_ADDR_SHIFT; |
@@ -3453,7 +3453,6 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
3453 | RCR_ENTRY_PKTBUFSZ_SHIFT]; | 3453 | RCR_ENTRY_PKTBUFSZ_SHIFT]; |
3454 | 3454 | ||
3455 | off = addr & ~PAGE_MASK; | 3455 | off = addr & ~PAGE_MASK; |
3456 | append_size = rcr_size; | ||
3457 | if (num_rcr == 1) { | 3456 | if (num_rcr == 1) { |
3458 | int ptype; | 3457 | int ptype; |
3459 | 3458 | ||
@@ -3466,7 +3465,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
3466 | else | 3465 | else |
3467 | skb_checksum_none_assert(skb); | 3466 | skb_checksum_none_assert(skb); |
3468 | } else if (!(val & RCR_ENTRY_MULTI)) | 3467 | } else if (!(val & RCR_ENTRY_MULTI)) |
3469 | append_size = len - skb->len; | 3468 | append_size = append_size - skb->len; |
3470 | 3469 | ||
3471 | niu_rx_skb_append(skb, page, off, append_size, rcr_size); | 3470 | niu_rx_skb_append(skb, page, off, append_size, rcr_size); |
3472 | if ((page->index + rp->rbr_block_size) - rcr_size == addr) { | 3471 | if ((page->index + rp->rbr_block_size) - rcr_size == addr) { |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index ecc84954c511..da07ccdf84bf 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -1840,7 +1840,8 @@ static int netvsc_vf_join(struct net_device *vf_netdev, | |||
1840 | goto rx_handler_failed; | 1840 | goto rx_handler_failed; |
1841 | } | 1841 | } |
1842 | 1842 | ||
1843 | ret = netdev_upper_dev_link(vf_netdev, ndev, NULL); | 1843 | ret = netdev_master_upper_dev_link(vf_netdev, ndev, |
1844 | NULL, NULL, NULL); | ||
1844 | if (ret != 0) { | 1845 | if (ret != 0) { |
1845 | netdev_err(vf_netdev, | 1846 | netdev_err(vf_netdev, |
1846 | "can not set master device %s (err = %d)\n", | 1847 | "can not set master device %s (err = %d)\n", |
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 6b127be781d9..e7ca5b5f39ed 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
@@ -1288,7 +1288,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, | |||
1288 | rndis_device->link_state ? "down" : "up"); | 1288 | rndis_device->link_state ? "down" : "up"); |
1289 | 1289 | ||
1290 | if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) | 1290 | if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) |
1291 | return net_device; | 1291 | goto out; |
1292 | 1292 | ||
1293 | rndis_filter_query_link_speed(rndis_device, net_device); | 1293 | rndis_filter_query_link_speed(rndis_device, net_device); |
1294 | 1294 | ||
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c index 9fb9b565a002..4f684cbcdc57 100644 --- a/drivers/net/ieee802154/atusb.c +++ b/drivers/net/ieee802154/atusb.c | |||
@@ -1045,7 +1045,7 @@ static int atusb_probe(struct usb_interface *interface, | |||
1045 | atusb->tx_dr.bRequest = ATUSB_TX; | 1045 | atusb->tx_dr.bRequest = ATUSB_TX; |
1046 | atusb->tx_dr.wValue = cpu_to_le16(0); | 1046 | atusb->tx_dr.wValue = cpu_to_le16(0); |
1047 | 1047 | ||
1048 | atusb->tx_urb = usb_alloc_urb(0, GFP_ATOMIC); | 1048 | atusb->tx_urb = usb_alloc_urb(0, GFP_KERNEL); |
1049 | if (!atusb->tx_urb) | 1049 | if (!atusb->tx_urb) |
1050 | goto fail; | 1050 | goto fail; |
1051 | 1051 | ||
diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c index 55a22c761808..de0d7f28a181 100644 --- a/drivers/net/ieee802154/mcr20a.c +++ b/drivers/net/ieee802154/mcr20a.c | |||
@@ -1267,7 +1267,7 @@ mcr20a_probe(struct spi_device *spi) | |||
1267 | ret = mcr20a_get_platform_data(spi, pdata); | 1267 | ret = mcr20a_get_platform_data(spi, pdata); |
1268 | if (ret < 0) { | 1268 | if (ret < 0) { |
1269 | dev_crit(&spi->dev, "mcr20a_get_platform_data failed.\n"); | 1269 | dev_crit(&spi->dev, "mcr20a_get_platform_data failed.\n"); |
1270 | return ret; | 1270 | goto free_pdata; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | /* init reset gpio */ | 1273 | /* init reset gpio */ |
@@ -1275,7 +1275,7 @@ mcr20a_probe(struct spi_device *spi) | |||
1275 | ret = devm_gpio_request_one(&spi->dev, pdata->rst_gpio, | 1275 | ret = devm_gpio_request_one(&spi->dev, pdata->rst_gpio, |
1276 | GPIOF_OUT_INIT_HIGH, "reset"); | 1276 | GPIOF_OUT_INIT_HIGH, "reset"); |
1277 | if (ret) | 1277 | if (ret) |
1278 | return ret; | 1278 | goto free_pdata; |
1279 | } | 1279 | } |
1280 | 1280 | ||
1281 | /* reset mcr20a */ | 1281 | /* reset mcr20a */ |
@@ -1291,7 +1291,8 @@ mcr20a_probe(struct spi_device *spi) | |||
1291 | hw = ieee802154_alloc_hw(sizeof(*lp), &mcr20a_hw_ops); | 1291 | hw = ieee802154_alloc_hw(sizeof(*lp), &mcr20a_hw_ops); |
1292 | if (!hw) { | 1292 | if (!hw) { |
1293 | dev_crit(&spi->dev, "ieee802154_alloc_hw failed\n"); | 1293 | dev_crit(&spi->dev, "ieee802154_alloc_hw failed\n"); |
1294 | return -ENOMEM; | 1294 | ret = -ENOMEM; |
1295 | goto free_pdata; | ||
1295 | } | 1296 | } |
1296 | 1297 | ||
1297 | /* init mcr20a local data */ | 1298 | /* init mcr20a local data */ |
@@ -1308,8 +1309,10 @@ mcr20a_probe(struct spi_device *spi) | |||
1308 | /* init buf */ | 1309 | /* init buf */ |
1309 | lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL); | 1310 | lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL); |
1310 | 1311 | ||
1311 | if (!lp->buf) | 1312 | if (!lp->buf) { |
1312 | return -ENOMEM; | 1313 | ret = -ENOMEM; |
1314 | goto free_dev; | ||
1315 | } | ||
1313 | 1316 | ||
1314 | mcr20a_setup_tx_spi_messages(lp); | 1317 | mcr20a_setup_tx_spi_messages(lp); |
1315 | mcr20a_setup_rx_spi_messages(lp); | 1318 | mcr20a_setup_rx_spi_messages(lp); |
@@ -1366,6 +1369,8 @@ mcr20a_probe(struct spi_device *spi) | |||
1366 | 1369 | ||
1367 | free_dev: | 1370 | free_dev: |
1368 | ieee802154_free_hw(lp->hw); | 1371 | ieee802154_free_hw(lp->hw); |
1372 | free_pdata: | ||
1373 | kfree(pdata); | ||
1369 | 1374 | ||
1370 | return ret; | 1375 | return ret; |
1371 | } | 1376 | } |
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 3bb6b66dc7bf..f9c25912eb98 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c | |||
@@ -720,6 +720,15 @@ static struct phy_driver broadcom_drivers[] = { | |||
720 | .get_strings = bcm_phy_get_strings, | 720 | .get_strings = bcm_phy_get_strings, |
721 | .get_stats = bcm53xx_phy_get_stats, | 721 | .get_stats = bcm53xx_phy_get_stats, |
722 | .probe = bcm53xx_phy_probe, | 722 | .probe = bcm53xx_phy_probe, |
723 | }, { | ||
724 | .phy_id = PHY_ID_BCM89610, | ||
725 | .phy_id_mask = 0xfffffff0, | ||
726 | .name = "Broadcom BCM89610", | ||
727 | .features = PHY_GBIT_FEATURES, | ||
728 | .flags = PHY_HAS_INTERRUPT, | ||
729 | .config_init = bcm54xx_config_init, | ||
730 | .ack_interrupt = bcm_phy_ack_intr, | ||
731 | .config_intr = bcm_phy_config_intr, | ||
723 | } }; | 732 | } }; |
724 | 733 | ||
725 | module_phy_driver(broadcom_drivers); | 734 | module_phy_driver(broadcom_drivers); |
@@ -741,6 +750,7 @@ static struct mdio_device_id __maybe_unused broadcom_tbl[] = { | |||
741 | { PHY_ID_BCMAC131, 0xfffffff0 }, | 750 | { PHY_ID_BCMAC131, 0xfffffff0 }, |
742 | { PHY_ID_BCM5241, 0xfffffff0 }, | 751 | { PHY_ID_BCM5241, 0xfffffff0 }, |
743 | { PHY_ID_BCM5395, 0xfffffff0 }, | 752 | { PHY_ID_BCM5395, 0xfffffff0 }, |
753 | { PHY_ID_BCM89610, 0xfffffff0 }, | ||
744 | { } | 754 | { } |
745 | }; | 755 | }; |
746 | 756 | ||
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index 0381da78d228..fd6c23f69c2f 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c | |||
@@ -125,7 +125,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, | |||
125 | if (id->base.br_nominal) { | 125 | if (id->base.br_nominal) { |
126 | if (id->base.br_nominal != 255) { | 126 | if (id->base.br_nominal != 255) { |
127 | br_nom = id->base.br_nominal * 100; | 127 | br_nom = id->base.br_nominal * 100; |
128 | br_min = br_nom + id->base.br_nominal * id->ext.br_min; | 128 | br_min = br_nom - id->base.br_nominal * id->ext.br_min; |
129 | br_max = br_nom + id->base.br_nominal * id->ext.br_max; | 129 | br_max = br_nom + id->base.br_nominal * id->ext.br_max; |
130 | } else if (id->ext.br_max) { | 130 | } else if (id->ext.br_max) { |
131 | br_nom = 250 * id->ext.br_max; | 131 | br_nom = 250 * id->ext.br_max; |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 96d26cfae90b..4a017a0d71ea 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) | |||
3236 | GENL_SET_ERR_MSG(info,"MAC is no valid source addr"); | 3236 | GENL_SET_ERR_MSG(info,"MAC is no valid source addr"); |
3237 | NL_SET_BAD_ATTR(info->extack, | 3237 | NL_SET_BAD_ATTR(info->extack, |
3238 | info->attrs[HWSIM_ATTR_PERM_ADDR]); | 3238 | info->attrs[HWSIM_ATTR_PERM_ADDR]); |
3239 | kfree(hwname); | ||
3239 | return -EINVAL; | 3240 | return -EINVAL; |
3240 | } | 3241 | } |
3241 | 3242 | ||
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index d3339dd48b1a..b324e01ccf2d 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define PHY_ID_BCM54612E 0x03625e60 | 25 | #define PHY_ID_BCM54612E 0x03625e60 |
26 | #define PHY_ID_BCM54616S 0x03625d10 | 26 | #define PHY_ID_BCM54616S 0x03625d10 |
27 | #define PHY_ID_BCM57780 0x03625d90 | 27 | #define PHY_ID_BCM57780 0x03625d90 |
28 | #define PHY_ID_BCM89610 0x03625cd0 | ||
28 | 29 | ||
29 | #define PHY_ID_BCM7250 0xae025280 | 30 | #define PHY_ID_BCM7250 0xae025280 |
30 | #define PHY_ID_BCM7260 0xae025190 | 31 | #define PHY_ID_BCM7260 0xae025190 |
diff --git a/include/net/bonding.h b/include/net/bonding.h index f801fc940b29..b52235158836 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h | |||
@@ -198,6 +198,7 @@ struct bonding { | |||
198 | struct slave __rcu *primary_slave; | 198 | struct slave __rcu *primary_slave; |
199 | struct bond_up_slave __rcu *slave_arr; /* Array of usable slaves */ | 199 | struct bond_up_slave __rcu *slave_arr; /* Array of usable slaves */ |
200 | bool force_primary; | 200 | bool force_primary; |
201 | u32 nest_level; | ||
201 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ | 202 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ |
202 | int (*recv_probe)(const struct sk_buff *, struct bonding *, | 203 | int (*recv_probe)(const struct sk_buff *, struct bonding *, |
203 | struct slave *); | 204 | struct slave *); |
diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h index 9a074776f70b..d1fcf2442a42 100644 --- a/include/net/flow_dissector.h +++ b/include/net/flow_dissector.h | |||
@@ -251,7 +251,7 @@ extern struct flow_dissector flow_keys_buf_dissector; | |||
251 | * This structure is used to hold a digest of the full flow keys. This is a | 251 | * This structure is used to hold a digest of the full flow keys. This is a |
252 | * larger "hash" of a flow to allow definitively matching specific flows where | 252 | * larger "hash" of a flow to allow definitively matching specific flows where |
253 | * the 32 bit skb->hash is not large enough. The size is limited to 16 bytes so | 253 | * the 32 bit skb->hash is not large enough. The size is limited to 16 bytes so |
254 | * that it can by used in CB of skb (see sch_choke for an example). | 254 | * that it can be used in CB of skb (see sch_choke for an example). |
255 | */ | 255 | */ |
256 | #define FLOW_KEYS_DIGEST_LEN 16 | 256 | #define FLOW_KEYS_DIGEST_LEN 16 |
257 | struct flow_keys_digest { | 257 | struct flow_keys_digest { |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index d2279b2d61aa..b2f3a0c018e7 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -2080,7 +2080,7 @@ struct ieee80211_txq { | |||
2080 | * virtual interface might not be given air time for the transmission of | 2080 | * virtual interface might not be given air time for the transmission of |
2081 | * the frame, as it is not synced with the AP/P2P GO yet, and thus the | 2081 | * the frame, as it is not synced with the AP/P2P GO yet, and thus the |
2082 | * deauthentication frame might not be transmitted. | 2082 | * deauthentication frame might not be transmitted. |
2083 | > | 2083 | * |
2084 | * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't | 2084 | * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't |
2085 | * support QoS NDP for AP probing - that's most likely a driver bug. | 2085 | * support QoS NDP for AP probing - that's most likely a driver bug. |
2086 | * | 2086 | * |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index a872379b69da..45e75c36b738 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -375,6 +375,7 @@ struct xfrm_input_afinfo { | |||
375 | int xfrm_input_register_afinfo(const struct xfrm_input_afinfo *afinfo); | 375 | int xfrm_input_register_afinfo(const struct xfrm_input_afinfo *afinfo); |
376 | int xfrm_input_unregister_afinfo(const struct xfrm_input_afinfo *afinfo); | 376 | int xfrm_input_unregister_afinfo(const struct xfrm_input_afinfo *afinfo); |
377 | 377 | ||
378 | void xfrm_flush_gc(void); | ||
378 | void xfrm_state_delete_tunnel(struct xfrm_state *x); | 379 | void xfrm_state_delete_tunnel(struct xfrm_state *x); |
379 | 380 | ||
380 | struct xfrm_type { | 381 | struct xfrm_type { |
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h index 9e96c2fe2793..077e664ac9a2 100644 --- a/include/trace/events/rxrpc.h +++ b/include/trace/events/rxrpc.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _TRACE_RXRPC_H | 15 | #define _TRACE_RXRPC_H |
16 | 16 | ||
17 | #include <linux/tracepoint.h> | 17 | #include <linux/tracepoint.h> |
18 | #include <linux/errqueue.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * Define enums for tracing information. | 21 | * Define enums for tracing information. |
@@ -210,6 +211,20 @@ enum rxrpc_congest_change { | |||
210 | rxrpc_cong_saw_nack, | 211 | rxrpc_cong_saw_nack, |
211 | }; | 212 | }; |
212 | 213 | ||
214 | enum rxrpc_tx_fail_trace { | ||
215 | rxrpc_tx_fail_call_abort, | ||
216 | rxrpc_tx_fail_call_ack, | ||
217 | rxrpc_tx_fail_call_data_frag, | ||
218 | rxrpc_tx_fail_call_data_nofrag, | ||
219 | rxrpc_tx_fail_call_final_resend, | ||
220 | rxrpc_tx_fail_conn_abort, | ||
221 | rxrpc_tx_fail_conn_challenge, | ||
222 | rxrpc_tx_fail_conn_response, | ||
223 | rxrpc_tx_fail_reject, | ||
224 | rxrpc_tx_fail_version_keepalive, | ||
225 | rxrpc_tx_fail_version_reply, | ||
226 | }; | ||
227 | |||
213 | #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */ | 228 | #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */ |
214 | 229 | ||
215 | /* | 230 | /* |
@@ -437,6 +452,19 @@ enum rxrpc_congest_change { | |||
437 | EM(RXRPC_CALL_LOCAL_ERROR, "LocalError") \ | 452 | EM(RXRPC_CALL_LOCAL_ERROR, "LocalError") \ |
438 | E_(RXRPC_CALL_NETWORK_ERROR, "NetError") | 453 | E_(RXRPC_CALL_NETWORK_ERROR, "NetError") |
439 | 454 | ||
455 | #define rxrpc_tx_fail_traces \ | ||
456 | EM(rxrpc_tx_fail_call_abort, "CallAbort") \ | ||
457 | EM(rxrpc_tx_fail_call_ack, "CallAck") \ | ||
458 | EM(rxrpc_tx_fail_call_data_frag, "CallDataFrag") \ | ||
459 | EM(rxrpc_tx_fail_call_data_nofrag, "CallDataNofrag") \ | ||
460 | EM(rxrpc_tx_fail_call_final_resend, "CallFinalResend") \ | ||
461 | EM(rxrpc_tx_fail_conn_abort, "ConnAbort") \ | ||
462 | EM(rxrpc_tx_fail_conn_challenge, "ConnChall") \ | ||
463 | EM(rxrpc_tx_fail_conn_response, "ConnResp") \ | ||
464 | EM(rxrpc_tx_fail_reject, "Reject") \ | ||
465 | EM(rxrpc_tx_fail_version_keepalive, "VerKeepalive") \ | ||
466 | E_(rxrpc_tx_fail_version_reply, "VerReply") | ||
467 | |||
440 | /* | 468 | /* |
441 | * Export enum symbols via userspace. | 469 | * Export enum symbols via userspace. |
442 | */ | 470 | */ |
@@ -460,6 +488,7 @@ rxrpc_propose_ack_traces; | |||
460 | rxrpc_propose_ack_outcomes; | 488 | rxrpc_propose_ack_outcomes; |
461 | rxrpc_congest_modes; | 489 | rxrpc_congest_modes; |
462 | rxrpc_congest_changes; | 490 | rxrpc_congest_changes; |
491 | rxrpc_tx_fail_traces; | ||
463 | 492 | ||
464 | /* | 493 | /* |
465 | * Now redefine the EM() and E_() macros to map the enums to the strings that | 494 | * Now redefine the EM() and E_() macros to map the enums to the strings that |
@@ -1374,6 +1403,62 @@ TRACE_EVENT(rxrpc_resend, | |||
1374 | __entry->anno) | 1403 | __entry->anno) |
1375 | ); | 1404 | ); |
1376 | 1405 | ||
1406 | TRACE_EVENT(rxrpc_rx_icmp, | ||
1407 | TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee, | ||
1408 | struct sockaddr_rxrpc *srx), | ||
1409 | |||
1410 | TP_ARGS(peer, ee, srx), | ||
1411 | |||
1412 | TP_STRUCT__entry( | ||
1413 | __field(unsigned int, peer ) | ||
1414 | __field_struct(struct sock_extended_err, ee ) | ||
1415 | __field_struct(struct sockaddr_rxrpc, srx ) | ||
1416 | ), | ||
1417 | |||
1418 | TP_fast_assign( | ||
1419 | __entry->peer = peer->debug_id; | ||
1420 | memcpy(&__entry->ee, ee, sizeof(__entry->ee)); | ||
1421 | memcpy(&__entry->srx, srx, sizeof(__entry->srx)); | ||
1422 | ), | ||
1423 | |||
1424 | TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp", | ||
1425 | __entry->peer, | ||
1426 | __entry->ee.ee_origin, | ||
1427 | __entry->ee.ee_type, | ||
1428 | __entry->ee.ee_code, | ||
1429 | __entry->ee.ee_info, | ||
1430 | __entry->ee.ee_data, | ||
1431 | __entry->ee.ee_errno, | ||
1432 | &__entry->srx.transport) | ||
1433 | ); | ||
1434 | |||
1435 | TRACE_EVENT(rxrpc_tx_fail, | ||
1436 | TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret, | ||
1437 | enum rxrpc_tx_fail_trace what), | ||
1438 | |||
1439 | TP_ARGS(debug_id, serial, ret, what), | ||
1440 | |||
1441 | TP_STRUCT__entry( | ||
1442 | __field(unsigned int, debug_id ) | ||
1443 | __field(rxrpc_serial_t, serial ) | ||
1444 | __field(int, ret ) | ||
1445 | __field(enum rxrpc_tx_fail_trace, what ) | ||
1446 | ), | ||
1447 | |||
1448 | TP_fast_assign( | ||
1449 | __entry->debug_id = debug_id; | ||
1450 | __entry->serial = serial; | ||
1451 | __entry->ret = ret; | ||
1452 | __entry->what = what; | ||
1453 | ), | ||
1454 | |||
1455 | TP_printk("c=%08x r=%x ret=%d %s", | ||
1456 | __entry->debug_id, | ||
1457 | __entry->serial, | ||
1458 | __entry->ret, | ||
1459 | __print_symbolic(__entry->what, rxrpc_tx_fail_traces)) | ||
1460 | ); | ||
1461 | |||
1377 | #endif /* _TRACE_RXRPC_H */ | 1462 | #endif /* _TRACE_RXRPC_H */ |
1378 | 1463 | ||
1379 | /* This part must be outside protection */ | 1464 | /* This part must be outside protection */ |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 15daf5e2638d..9c3630146cec 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -2698,6 +2698,8 @@ enum nl80211_attrs { | |||
2698 | #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS | 2698 | #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS |
2699 | #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS | 2699 | #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS |
2700 | 2700 | ||
2701 | #define NL80211_WIPHY_NAME_MAXLEN 128 | ||
2702 | |||
2701 | #define NL80211_MAX_SUPP_RATES 32 | 2703 | #define NL80211_MAX_SUPP_RATES 32 |
2702 | #define NL80211_MAX_SUPP_HT_RATES 77 | 2704 | #define NL80211_MAX_SUPP_HT_RATES 77 |
2703 | #define NL80211_MAX_SUPP_REG_RULES 64 | 2705 | #define NL80211_MAX_SUPP_REG_RULES 64 |
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index ebfe9f29dae8..016ef9025827 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/cred.h> | 26 | #include <linux/cred.h> |
27 | #include <linux/timekeeping.h> | 27 | #include <linux/timekeeping.h> |
28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
29 | #include <linux/nospec.h> | ||
29 | 30 | ||
30 | #define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PROG_ARRAY || \ | 31 | #define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PROG_ARRAY || \ |
31 | (map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \ | 32 | (map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \ |
@@ -102,12 +103,14 @@ const struct bpf_map_ops bpf_map_offload_ops = { | |||
102 | static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) | 103 | static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) |
103 | { | 104 | { |
104 | const struct bpf_map_ops *ops; | 105 | const struct bpf_map_ops *ops; |
106 | u32 type = attr->map_type; | ||
105 | struct bpf_map *map; | 107 | struct bpf_map *map; |
106 | int err; | 108 | int err; |
107 | 109 | ||
108 | if (attr->map_type >= ARRAY_SIZE(bpf_map_types)) | 110 | if (type >= ARRAY_SIZE(bpf_map_types)) |
109 | return ERR_PTR(-EINVAL); | 111 | return ERR_PTR(-EINVAL); |
110 | ops = bpf_map_types[attr->map_type]; | 112 | type = array_index_nospec(type, ARRAY_SIZE(bpf_map_types)); |
113 | ops = bpf_map_types[type]; | ||
111 | if (!ops) | 114 | if (!ops) |
112 | return ERR_PTR(-EINVAL); | 115 | return ERR_PTR(-EINVAL); |
113 | 116 | ||
@@ -122,7 +125,7 @@ static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) | |||
122 | if (IS_ERR(map)) | 125 | if (IS_ERR(map)) |
123 | return map; | 126 | return map; |
124 | map->ops = ops; | 127 | map->ops = ops; |
125 | map->map_type = attr->map_type; | 128 | map->map_type = type; |
126 | return map; | 129 | return map; |
127 | } | 130 | } |
128 | 131 | ||
@@ -871,11 +874,17 @@ static const struct bpf_prog_ops * const bpf_prog_types[] = { | |||
871 | 874 | ||
872 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) | 875 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) |
873 | { | 876 | { |
874 | if (type >= ARRAY_SIZE(bpf_prog_types) || !bpf_prog_types[type]) | 877 | const struct bpf_prog_ops *ops; |
878 | |||
879 | if (type >= ARRAY_SIZE(bpf_prog_types)) | ||
880 | return -EINVAL; | ||
881 | type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types)); | ||
882 | ops = bpf_prog_types[type]; | ||
883 | if (!ops) | ||
875 | return -EINVAL; | 884 | return -EINVAL; |
876 | 885 | ||
877 | if (!bpf_prog_is_dev_bound(prog->aux)) | 886 | if (!bpf_prog_is_dev_bound(prog->aux)) |
878 | prog->aux->ops = bpf_prog_types[type]; | 887 | prog->aux->ops = ops; |
879 | else | 888 | else |
880 | prog->aux->ops = &bpf_offload_prog_ops; | 889 | prog->aux->ops = &bpf_offload_prog_ops; |
881 | prog->type = type; | 890 | prog->type = type; |
diff --git a/net/9p/trans_common.c b/net/9p/trans_common.c index 38aa6345bdfa..b718db2085b2 100644 --- a/net/9p/trans_common.c +++ b/net/9p/trans_common.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * p9_release_req_pages - Release pages after the transaction. | 19 | * p9_release_pages - Release pages after the transaction. |
20 | */ | 20 | */ |
21 | void p9_release_pages(struct page **pages, int nr_pages) | 21 | void p9_release_pages(struct page **pages, int nr_pages) |
22 | { | 22 | { |
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 0cfba919d167..848969fe7979 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -1092,8 +1092,8 @@ static struct p9_trans_module p9_fd_trans = { | |||
1092 | }; | 1092 | }; |
1093 | 1093 | ||
1094 | /** | 1094 | /** |
1095 | * p9_poll_proc - poll worker thread | 1095 | * p9_poll_workfn - poll worker thread |
1096 | * @a: thread state and arguments | 1096 | * @work: work queue |
1097 | * | 1097 | * |
1098 | * polls all v9fs transports for new events and queues the appropriate | 1098 | * polls all v9fs transports for new events and queues the appropriate |
1099 | * work to the work queue | 1099 | * work to the work queue |
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 6d8e3031978f..3d414acb7015 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
@@ -68,8 +68,6 @@ | |||
68 | * @pd: Protection Domain pointer | 68 | * @pd: Protection Domain pointer |
69 | * @qp: Queue Pair pointer | 69 | * @qp: Queue Pair pointer |
70 | * @cq: Completion Queue pointer | 70 | * @cq: Completion Queue pointer |
71 | * @dm_mr: DMA Memory Region pointer | ||
72 | * @lkey: The local access only memory region key | ||
73 | * @timeout: Number of uSecs to wait for connection management events | 71 | * @timeout: Number of uSecs to wait for connection management events |
74 | * @privport: Whether a privileged port may be used | 72 | * @privport: Whether a privileged port may be used |
75 | * @port: The port to use | 73 | * @port: The port to use |
@@ -632,7 +630,7 @@ static int p9_rdma_bind_privport(struct p9_trans_rdma *rdma) | |||
632 | } | 630 | } |
633 | 631 | ||
634 | /** | 632 | /** |
635 | * trans_create_rdma - Transport method for creating atransport instance | 633 | * rdma_create_trans - Transport method for creating a transport instance |
636 | * @client: client instance | 634 | * @client: client instance |
637 | * @addr: IP address string | 635 | * @addr: IP address string |
638 | * @args: Mount options string | 636 | * @args: Mount options string |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 3aa5a93ad107..4d0372263e5d 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -60,7 +60,6 @@ static atomic_t vp_pinned = ATOMIC_INIT(0); | |||
60 | 60 | ||
61 | /** | 61 | /** |
62 | * struct virtio_chan - per-instance transport information | 62 | * struct virtio_chan - per-instance transport information |
63 | * @initialized: whether the channel is initialized | ||
64 | * @inuse: whether the channel is in use | 63 | * @inuse: whether the channel is in use |
65 | * @lock: protects multiple elements within this structure | 64 | * @lock: protects multiple elements within this structure |
66 | * @client: client instance | 65 | * @client: client instance |
@@ -385,8 +384,8 @@ static int p9_get_mapped_pages(struct virtio_chan *chan, | |||
385 | * @uidata: user bffer that should be ued for zero copy read | 384 | * @uidata: user bffer that should be ued for zero copy read |
386 | * @uodata: user buffer that shoud be user for zero copy write | 385 | * @uodata: user buffer that shoud be user for zero copy write |
387 | * @inlen: read buffer size | 386 | * @inlen: read buffer size |
388 | * @olen: write buffer size | 387 | * @outlen: write buffer size |
389 | * @hdrlen: reader header size, This is the size of response protocol data | 388 | * @in_hdr_len: reader header size, This is the size of response protocol data |
390 | * | 389 | * |
391 | */ | 390 | */ |
392 | static int | 391 | static int |
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index 086a4abdfa7c..0f19960390a6 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c | |||
@@ -485,7 +485,7 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev, | |||
485 | 485 | ||
486 | static int xen_9pfs_front_resume(struct xenbus_device *dev) | 486 | static int xen_9pfs_front_resume(struct xenbus_device *dev) |
487 | { | 487 | { |
488 | dev_warn(&dev->dev, "suspsend/resume unsupported\n"); | 488 | dev_warn(&dev->dev, "suspend/resume unsupported\n"); |
489 | return 0; | 489 | return 0; |
490 | } | 490 | } |
491 | 491 | ||
diff --git a/net/atm/lec.c b/net/atm/lec.c index 01d5d20a6eb1..3138a869b5c0 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -41,6 +41,9 @@ static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 }; | |||
41 | #include <linux/module.h> | 41 | #include <linux/module.h> |
42 | #include <linux/init.h> | 42 | #include <linux/init.h> |
43 | 43 | ||
44 | /* Hardening for Spectre-v1 */ | ||
45 | #include <linux/nospec.h> | ||
46 | |||
44 | #include "lec.h" | 47 | #include "lec.h" |
45 | #include "lec_arpc.h" | 48 | #include "lec_arpc.h" |
46 | #include "resources.h" | 49 | #include "resources.h" |
@@ -687,8 +690,10 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg) | |||
687 | bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmlec_ioc)); | 690 | bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmlec_ioc)); |
688 | if (bytes_left != 0) | 691 | if (bytes_left != 0) |
689 | pr_info("copy from user failed for %d bytes\n", bytes_left); | 692 | pr_info("copy from user failed for %d bytes\n", bytes_left); |
690 | if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF || | 693 | if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF) |
691 | !dev_lec[ioc_data.dev_num]) | 694 | return -EINVAL; |
695 | ioc_data.dev_num = array_index_nospec(ioc_data.dev_num, MAX_LEC_ITF); | ||
696 | if (!dev_lec[ioc_data.dev_num]) | ||
692 | return -EINVAL; | 697 | return -EINVAL; |
693 | vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL); | 698 | vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL); |
694 | if (!vpriv) | 699 | if (!vpriv) |
diff --git a/net/ieee802154/6lowpan/6lowpan_i.h b/net/ieee802154/6lowpan/6lowpan_i.h index b8d95cb71c25..44a7e16bf3b5 100644 --- a/net/ieee802154/6lowpan/6lowpan_i.h +++ b/net/ieee802154/6lowpan/6lowpan_i.h | |||
@@ -20,8 +20,8 @@ typedef unsigned __bitwise lowpan_rx_result; | |||
20 | struct frag_lowpan_compare_key { | 20 | struct frag_lowpan_compare_key { |
21 | u16 tag; | 21 | u16 tag; |
22 | u16 d_size; | 22 | u16 d_size; |
23 | const struct ieee802154_addr src; | 23 | struct ieee802154_addr src; |
24 | const struct ieee802154_addr dst; | 24 | struct ieee802154_addr dst; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | /* Equivalent of ipv4 struct ipq | 27 | /* Equivalent of ipv4 struct ipq |
diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c index 1790b65944b3..2cc224106b69 100644 --- a/net/ieee802154/6lowpan/reassembly.c +++ b/net/ieee802154/6lowpan/reassembly.c | |||
@@ -75,14 +75,14 @@ fq_find(struct net *net, const struct lowpan_802154_cb *cb, | |||
75 | { | 75 | { |
76 | struct netns_ieee802154_lowpan *ieee802154_lowpan = | 76 | struct netns_ieee802154_lowpan *ieee802154_lowpan = |
77 | net_ieee802154_lowpan(net); | 77 | net_ieee802154_lowpan(net); |
78 | struct frag_lowpan_compare_key key = { | 78 | struct frag_lowpan_compare_key key = {}; |
79 | .tag = cb->d_tag, | ||
80 | .d_size = cb->d_size, | ||
81 | .src = *src, | ||
82 | .dst = *dst, | ||
83 | }; | ||
84 | struct inet_frag_queue *q; | 79 | struct inet_frag_queue *q; |
85 | 80 | ||
81 | key.tag = cb->d_tag; | ||
82 | key.d_size = cb->d_size; | ||
83 | key.src = *src; | ||
84 | key.dst = *dst; | ||
85 | |||
86 | q = inet_frag_find(&ieee802154_lowpan->frags, &key); | 86 | q = inet_frag_find(&ieee802154_lowpan->frags, &key); |
87 | if (!q) | 87 | if (!q) |
88 | return NULL; | 88 | return NULL; |
@@ -372,7 +372,7 @@ int lowpan_frag_rcv(struct sk_buff *skb, u8 frag_type) | |||
372 | struct lowpan_frag_queue *fq; | 372 | struct lowpan_frag_queue *fq; |
373 | struct net *net = dev_net(skb->dev); | 373 | struct net *net = dev_net(skb->dev); |
374 | struct lowpan_802154_cb *cb = lowpan_802154_cb(skb); | 374 | struct lowpan_802154_cb *cb = lowpan_802154_cb(skb); |
375 | struct ieee802154_hdr hdr; | 375 | struct ieee802154_hdr hdr = {}; |
376 | int err; | 376 | int err; |
377 | 377 | ||
378 | if (ieee802154_hdr_peek_addrs(skb, &hdr) < 0) | 378 | if (ieee802154_hdr_peek_addrs(skb, &hdr) < 0) |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 05e47d777009..56a010622f70 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -775,8 +775,10 @@ static int ping_v4_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) | |||
775 | ipc.addr = faddr = daddr; | 775 | ipc.addr = faddr = daddr; |
776 | 776 | ||
777 | if (ipc.opt && ipc.opt->opt.srr) { | 777 | if (ipc.opt && ipc.opt->opt.srr) { |
778 | if (!daddr) | 778 | if (!daddr) { |
779 | return -EINVAL; | 779 | err = -EINVAL; |
780 | goto out_free; | ||
781 | } | ||
780 | faddr = ipc.opt->opt.faddr; | 782 | faddr = ipc.opt->opt.faddr; |
781 | } | 783 | } |
782 | tos = get_rttos(&ipc, inet); | 784 | tos = get_rttos(&ipc, inet); |
@@ -842,6 +844,7 @@ back_from_confirm: | |||
842 | 844 | ||
843 | out: | 845 | out: |
844 | ip_rt_put(rt); | 846 | ip_rt_put(rt); |
847 | out_free: | ||
845 | if (free) | 848 | if (free) |
846 | kfree(ipc.opt); | 849 | kfree(ipc.opt); |
847 | if (!err) { | 850 | if (!err) { |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 1412a7baf0b9..29268efad247 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1375,6 +1375,7 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe, | |||
1375 | fnhe->fnhe_gw = 0; | 1375 | fnhe->fnhe_gw = 0; |
1376 | fnhe->fnhe_pmtu = 0; | 1376 | fnhe->fnhe_pmtu = 0; |
1377 | fnhe->fnhe_expires = 0; | 1377 | fnhe->fnhe_expires = 0; |
1378 | fnhe->fnhe_mtu_locked = false; | ||
1378 | fnhe_flush_routes(fnhe); | 1379 | fnhe_flush_routes(fnhe); |
1379 | orig = NULL; | 1380 | orig = NULL; |
1380 | } | 1381 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 24b5c59b1c53..b61a770884fa 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -401,9 +401,9 @@ static int compute_score(struct sock *sk, struct net *net, | |||
401 | bool dev_match = (sk->sk_bound_dev_if == dif || | 401 | bool dev_match = (sk->sk_bound_dev_if == dif || |
402 | sk->sk_bound_dev_if == sdif); | 402 | sk->sk_bound_dev_if == sdif); |
403 | 403 | ||
404 | if (exact_dif && !dev_match) | 404 | if (!dev_match) |
405 | return -1; | 405 | return -1; |
406 | if (sk->sk_bound_dev_if && dev_match) | 406 | if (sk->sk_bound_dev_if) |
407 | score += 4; | 407 | score += 4; |
408 | } | 408 | } |
409 | 409 | ||
@@ -952,8 +952,10 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) | |||
952 | sock_tx_timestamp(sk, ipc.sockc.tsflags, &ipc.tx_flags); | 952 | sock_tx_timestamp(sk, ipc.sockc.tsflags, &ipc.tx_flags); |
953 | 953 | ||
954 | if (ipc.opt && ipc.opt->opt.srr) { | 954 | if (ipc.opt && ipc.opt->opt.srr) { |
955 | if (!daddr) | 955 | if (!daddr) { |
956 | return -EINVAL; | 956 | err = -EINVAL; |
957 | goto out_free; | ||
958 | } | ||
957 | faddr = ipc.opt->opt.faddr; | 959 | faddr = ipc.opt->opt.faddr; |
958 | connected = 0; | 960 | connected = 0; |
959 | } | 961 | } |
@@ -1074,6 +1076,7 @@ do_append_data: | |||
1074 | 1076 | ||
1075 | out: | 1077 | out: |
1076 | ip_rt_put(rt); | 1078 | ip_rt_put(rt); |
1079 | out_free: | ||
1077 | if (free) | 1080 | if (free) |
1078 | kfree(ipc.opt); | 1081 | kfree(ipc.opt); |
1079 | if (!err) | 1082 | if (!err) |
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig index 6794ddf0547c..11e4e80cf7e9 100644 --- a/net/ipv6/Kconfig +++ b/net/ipv6/Kconfig | |||
@@ -34,16 +34,15 @@ config IPV6_ROUTE_INFO | |||
34 | bool "IPv6: Route Information (RFC 4191) support" | 34 | bool "IPv6: Route Information (RFC 4191) support" |
35 | depends on IPV6_ROUTER_PREF | 35 | depends on IPV6_ROUTER_PREF |
36 | ---help--- | 36 | ---help--- |
37 | This is experimental support of Route Information. | 37 | Support of Route Information. |
38 | 38 | ||
39 | If unsure, say N. | 39 | If unsure, say N. |
40 | 40 | ||
41 | config IPV6_OPTIMISTIC_DAD | 41 | config IPV6_OPTIMISTIC_DAD |
42 | bool "IPv6: Enable RFC 4429 Optimistic DAD" | 42 | bool "IPv6: Enable RFC 4429 Optimistic DAD" |
43 | ---help--- | 43 | ---help--- |
44 | This is experimental support for optimistic Duplicate | 44 | Support for optimistic Duplicate Address Detection. It allows for |
45 | Address Detection. It allows for autoconfigured addresses | 45 | autoconfigured addresses to be used more quickly. |
46 | to be used more quickly. | ||
47 | 46 | ||
48 | If unsure, say N. | 47 | If unsure, say N. |
49 | 48 | ||
@@ -280,7 +279,7 @@ config IPV6_MROUTE | |||
280 | depends on IPV6 | 279 | depends on IPV6 |
281 | select IP_MROUTE_COMMON | 280 | select IP_MROUTE_COMMON |
282 | ---help--- | 281 | ---help--- |
283 | Experimental support for IPv6 multicast forwarding. | 282 | Support for IPv6 multicast forwarding. |
284 | If unsure, say N. | 283 | If unsure, say N. |
285 | 284 | ||
286 | config IPV6_MROUTE_MULTIPLE_TABLES | 285 | config IPV6_MROUTE_MULTIPLE_TABLES |
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index c214ffec02f0..ca957dd93a29 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c | |||
@@ -669,7 +669,7 @@ static void vti6_link_config(struct ip6_tnl *t, bool keep_mtu) | |||
669 | else | 669 | else |
670 | mtu = ETH_DATA_LEN - LL_MAX_HEADER - sizeof(struct ipv6hdr); | 670 | mtu = ETH_DATA_LEN - LL_MAX_HEADER - sizeof(struct ipv6hdr); |
671 | 671 | ||
672 | dev->mtu = max_t(int, mtu, IPV6_MIN_MTU); | 672 | dev->mtu = max_t(int, mtu, IPV4_MIN_MTU); |
673 | } | 673 | } |
674 | 674 | ||
675 | /** | 675 | /** |
@@ -881,7 +881,7 @@ static void vti6_dev_setup(struct net_device *dev) | |||
881 | dev->priv_destructor = vti6_dev_free; | 881 | dev->priv_destructor = vti6_dev_free; |
882 | 882 | ||
883 | dev->type = ARPHRD_TUNNEL6; | 883 | dev->type = ARPHRD_TUNNEL6; |
884 | dev->min_mtu = IPV6_MIN_MTU; | 884 | dev->min_mtu = IPV4_MIN_MTU; |
885 | dev->max_mtu = IP_MAX_MTU - sizeof(struct ipv6hdr); | 885 | dev->max_mtu = IP_MAX_MTU - sizeof(struct ipv6hdr); |
886 | dev->flags |= IFF_NOARP; | 886 | dev->flags |= IFF_NOARP; |
887 | dev->addr_len = sizeof(struct in6_addr); | 887 | dev->addr_len = sizeof(struct in6_addr); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 4ec76a87aeb8..ea0730028e5d 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -148,9 +148,9 @@ static int compute_score(struct sock *sk, struct net *net, | |||
148 | bool dev_match = (sk->sk_bound_dev_if == dif || | 148 | bool dev_match = (sk->sk_bound_dev_if == dif || |
149 | sk->sk_bound_dev_if == sdif); | 149 | sk->sk_bound_dev_if == sdif); |
150 | 150 | ||
151 | if (exact_dif && !dev_match) | 151 | if (!dev_match) |
152 | return -1; | 152 | return -1; |
153 | if (sk->sk_bound_dev_if && dev_match) | 153 | if (sk->sk_bound_dev_if) |
154 | score++; | 154 | score++; |
155 | } | 155 | } |
156 | 156 | ||
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index f85f0d7480ac..4a46df8441c9 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c | |||
@@ -341,6 +341,9 @@ static void __net_exit xfrm6_tunnel_net_exit(struct net *net) | |||
341 | struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net); | 341 | struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net); |
342 | unsigned int i; | 342 | unsigned int i; |
343 | 343 | ||
344 | xfrm_state_flush(net, IPSEC_PROTO_ANY, false); | ||
345 | xfrm_flush_gc(); | ||
346 | |||
344 | for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++) | 347 | for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++) |
345 | WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byaddr[i])); | 348 | WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byaddr[i])); |
346 | 349 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index 7e2e7188e7f4..e62e52e8f141 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -437,6 +437,24 @@ static int verify_address_len(const void *p) | |||
437 | return 0; | 437 | return 0; |
438 | } | 438 | } |
439 | 439 | ||
440 | static inline int sadb_key_len(const struct sadb_key *key) | ||
441 | { | ||
442 | int key_bytes = DIV_ROUND_UP(key->sadb_key_bits, 8); | ||
443 | |||
444 | return DIV_ROUND_UP(sizeof(struct sadb_key) + key_bytes, | ||
445 | sizeof(uint64_t)); | ||
446 | } | ||
447 | |||
448 | static int verify_key_len(const void *p) | ||
449 | { | ||
450 | const struct sadb_key *key = p; | ||
451 | |||
452 | if (sadb_key_len(key) > key->sadb_key_len) | ||
453 | return -EINVAL; | ||
454 | |||
455 | return 0; | ||
456 | } | ||
457 | |||
440 | static inline int pfkey_sec_ctx_len(const struct sadb_x_sec_ctx *sec_ctx) | 458 | static inline int pfkey_sec_ctx_len(const struct sadb_x_sec_ctx *sec_ctx) |
441 | { | 459 | { |
442 | return DIV_ROUND_UP(sizeof(struct sadb_x_sec_ctx) + | 460 | return DIV_ROUND_UP(sizeof(struct sadb_x_sec_ctx) + |
@@ -533,16 +551,25 @@ static int parse_exthdrs(struct sk_buff *skb, const struct sadb_msg *hdr, void * | |||
533 | return -EINVAL; | 551 | return -EINVAL; |
534 | if (ext_hdrs[ext_type-1] != NULL) | 552 | if (ext_hdrs[ext_type-1] != NULL) |
535 | return -EINVAL; | 553 | return -EINVAL; |
536 | if (ext_type == SADB_EXT_ADDRESS_SRC || | 554 | switch (ext_type) { |
537 | ext_type == SADB_EXT_ADDRESS_DST || | 555 | case SADB_EXT_ADDRESS_SRC: |
538 | ext_type == SADB_EXT_ADDRESS_PROXY || | 556 | case SADB_EXT_ADDRESS_DST: |
539 | ext_type == SADB_X_EXT_NAT_T_OA) { | 557 | case SADB_EXT_ADDRESS_PROXY: |
558 | case SADB_X_EXT_NAT_T_OA: | ||
540 | if (verify_address_len(p)) | 559 | if (verify_address_len(p)) |
541 | return -EINVAL; | 560 | return -EINVAL; |
542 | } | 561 | break; |
543 | if (ext_type == SADB_X_EXT_SEC_CTX) { | 562 | case SADB_X_EXT_SEC_CTX: |
544 | if (verify_sec_ctx_len(p)) | 563 | if (verify_sec_ctx_len(p)) |
545 | return -EINVAL; | 564 | return -EINVAL; |
565 | break; | ||
566 | case SADB_EXT_KEY_AUTH: | ||
567 | case SADB_EXT_KEY_ENCRYPT: | ||
568 | if (verify_key_len(p)) | ||
569 | return -EINVAL; | ||
570 | break; | ||
571 | default: | ||
572 | break; | ||
546 | } | 573 | } |
547 | ext_hdrs[ext_type-1] = (void *) p; | 574 | ext_hdrs[ext_type-1] = (void *) p; |
548 | } | 575 | } |
@@ -1104,14 +1131,12 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1104 | key = ext_hdrs[SADB_EXT_KEY_AUTH - 1]; | 1131 | key = ext_hdrs[SADB_EXT_KEY_AUTH - 1]; |
1105 | if (key != NULL && | 1132 | if (key != NULL && |
1106 | sa->sadb_sa_auth != SADB_X_AALG_NULL && | 1133 | sa->sadb_sa_auth != SADB_X_AALG_NULL && |
1107 | ((key->sadb_key_bits+7) / 8 == 0 || | 1134 | key->sadb_key_bits == 0) |
1108 | (key->sadb_key_bits+7) / 8 > key->sadb_key_len * sizeof(uint64_t))) | ||
1109 | return ERR_PTR(-EINVAL); | 1135 | return ERR_PTR(-EINVAL); |
1110 | key = ext_hdrs[SADB_EXT_KEY_ENCRYPT-1]; | 1136 | key = ext_hdrs[SADB_EXT_KEY_ENCRYPT-1]; |
1111 | if (key != NULL && | 1137 | if (key != NULL && |
1112 | sa->sadb_sa_encrypt != SADB_EALG_NULL && | 1138 | sa->sadb_sa_encrypt != SADB_EALG_NULL && |
1113 | ((key->sadb_key_bits+7) / 8 == 0 || | 1139 | key->sadb_key_bits == 0) |
1114 | (key->sadb_key_bits+7) / 8 > key->sadb_key_len * sizeof(uint64_t))) | ||
1115 | return ERR_PTR(-EINVAL); | 1140 | return ERR_PTR(-EINVAL); |
1116 | 1141 | ||
1117 | x = xfrm_state_alloc(net); | 1142 | x = xfrm_state_alloc(net); |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index cb80ebb38311..1beeea9549fa 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -930,6 +930,9 @@ static int llc_ui_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) | |||
930 | if (size > llc->dev->mtu) | 930 | if (size > llc->dev->mtu) |
931 | size = llc->dev->mtu; | 931 | size = llc->dev->mtu; |
932 | copied = size - hdrlen; | 932 | copied = size - hdrlen; |
933 | rc = -EINVAL; | ||
934 | if (copied < 0) | ||
935 | goto release; | ||
933 | release_sock(sk); | 936 | release_sock(sk); |
934 | skb = sock_alloc_send_skb(sk, size, noblock, &rc); | 937 | skb = sock_alloc_send_skb(sk, size, noblock, &rc); |
935 | lock_sock(sk); | 938 | lock_sock(sk); |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 595c662a61e8..ac4295296514 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> | 8 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
9 | * Copyright 2007-2010, Intel Corporation | 9 | * Copyright 2007-2010, Intel Corporation |
10 | * Copyright(c) 2015-2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2015-2017 Intel Deutschland GmbH |
11 | * Copyright (C) 2018 Intel Corporation | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License version 2 as | 14 | * it under the terms of the GNU General Public License version 2 as |
@@ -970,6 +971,9 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
970 | 971 | ||
971 | sta->ampdu_mlme.addba_req_num[tid] = 0; | 972 | sta->ampdu_mlme.addba_req_num[tid] = 0; |
972 | 973 | ||
974 | tid_tx->timeout = | ||
975 | le16_to_cpu(mgmt->u.action.u.addba_resp.timeout); | ||
976 | |||
973 | if (tid_tx->timeout) { | 977 | if (tid_tx->timeout) { |
974 | mod_timer(&tid_tx->session_timer, | 978 | mod_timer(&tid_tx->session_timer, |
975 | TU_TO_EXP_TIME(tid_tx->timeout)); | 979 | TU_TO_EXP_TIME(tid_tx->timeout)); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 69449db7e283..233068756502 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #define IEEE80211_AUTH_TIMEOUT (HZ / 5) | 36 | #define IEEE80211_AUTH_TIMEOUT (HZ / 5) |
37 | #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) | 37 | #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) |
38 | #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) | 38 | #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) |
39 | #define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2) | ||
39 | #define IEEE80211_AUTH_MAX_TRIES 3 | 40 | #define IEEE80211_AUTH_MAX_TRIES 3 |
40 | #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) | 41 | #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) |
41 | #define IEEE80211_ASSOC_TIMEOUT (HZ / 5) | 42 | #define IEEE80211_ASSOC_TIMEOUT (HZ / 5) |
@@ -1787,7 +1788,7 @@ static bool ieee80211_sta_wmm_params(struct ieee80211_local *local, | |||
1787 | params[ac].acm = acm; | 1788 | params[ac].acm = acm; |
1788 | params[ac].uapsd = uapsd; | 1789 | params[ac].uapsd = uapsd; |
1789 | 1790 | ||
1790 | if (params->cw_min == 0 || | 1791 | if (params[ac].cw_min == 0 || |
1791 | params[ac].cw_min > params[ac].cw_max) { | 1792 | params[ac].cw_min > params[ac].cw_max) { |
1792 | sdata_info(sdata, | 1793 | sdata_info(sdata, |
1793 | "AP has invalid WMM params (CWmin/max=%d/%d for ACI %d), using defaults\n", | 1794 | "AP has invalid WMM params (CWmin/max=%d/%d for ACI %d), using defaults\n", |
@@ -3814,16 +3815,19 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) | |||
3814 | tx_flags); | 3815 | tx_flags); |
3815 | 3816 | ||
3816 | if (tx_flags == 0) { | 3817 | if (tx_flags == 0) { |
3817 | auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; | 3818 | if (auth_data->algorithm == WLAN_AUTH_SAE) |
3818 | auth_data->timeout_started = true; | 3819 | auth_data->timeout = jiffies + |
3819 | run_again(sdata, auth_data->timeout); | 3820 | IEEE80211_AUTH_TIMEOUT_SAE; |
3821 | else | ||
3822 | auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; | ||
3820 | } else { | 3823 | } else { |
3821 | auth_data->timeout = | 3824 | auth_data->timeout = |
3822 | round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG); | 3825 | round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG); |
3823 | auth_data->timeout_started = true; | ||
3824 | run_again(sdata, auth_data->timeout); | ||
3825 | } | 3826 | } |
3826 | 3827 | ||
3828 | auth_data->timeout_started = true; | ||
3829 | run_again(sdata, auth_data->timeout); | ||
3830 | |||
3827 | return 0; | 3831 | return 0; |
3828 | } | 3832 | } |
3829 | 3833 | ||
@@ -3894,8 +3898,15 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3894 | ifmgd->status_received = false; | 3898 | ifmgd->status_received = false; |
3895 | if (ifmgd->auth_data && ieee80211_is_auth(fc)) { | 3899 | if (ifmgd->auth_data && ieee80211_is_auth(fc)) { |
3896 | if (status_acked) { | 3900 | if (status_acked) { |
3897 | ifmgd->auth_data->timeout = | 3901 | if (ifmgd->auth_data->algorithm == |
3898 | jiffies + IEEE80211_AUTH_TIMEOUT_SHORT; | 3902 | WLAN_AUTH_SAE) |
3903 | ifmgd->auth_data->timeout = | ||
3904 | jiffies + | ||
3905 | IEEE80211_AUTH_TIMEOUT_SAE; | ||
3906 | else | ||
3907 | ifmgd->auth_data->timeout = | ||
3908 | jiffies + | ||
3909 | IEEE80211_AUTH_TIMEOUT_SHORT; | ||
3899 | run_again(sdata, ifmgd->auth_data->timeout); | 3910 | run_again(sdata, ifmgd->auth_data->timeout); |
3900 | } else { | 3911 | } else { |
3901 | ifmgd->auth_data->timeout = jiffies - 1; | 3912 | ifmgd->auth_data->timeout = jiffies - 1; |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 535de3161a78..05a265cd573d 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> | 4 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> |
5 | * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> | 5 | * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> |
6 | * Copyright 2013-2014 Intel Mobile Communications GmbH | 6 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
7 | * Copyright (C) 2018 Intel Corporation | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
@@ -1135,7 +1136,7 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, | |||
1135 | } | 1136 | } |
1136 | 1137 | ||
1137 | /* reset session timer */ | 1138 | /* reset session timer */ |
1138 | if (reset_agg_timer && tid_tx->timeout) | 1139 | if (reset_agg_timer) |
1139 | tid_tx->last_tx = jiffies; | 1140 | tid_tx->last_tx = jiffies; |
1140 | 1141 | ||
1141 | return queued; | 1142 | return queued; |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 55342c4d5cec..2e2dd88fc79f 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -2606,13 +2606,13 @@ static int netlink_seq_show(struct seq_file *seq, void *v) | |||
2606 | { | 2606 | { |
2607 | if (v == SEQ_START_TOKEN) { | 2607 | if (v == SEQ_START_TOKEN) { |
2608 | seq_puts(seq, | 2608 | seq_puts(seq, |
2609 | "sk Eth Pid Groups " | 2609 | "sk Eth Pid Groups " |
2610 | "Rmem Wmem Dump Locks Drops Inode\n"); | 2610 | "Rmem Wmem Dump Locks Drops Inode\n"); |
2611 | } else { | 2611 | } else { |
2612 | struct sock *s = v; | 2612 | struct sock *s = v; |
2613 | struct netlink_sock *nlk = nlk_sk(s); | 2613 | struct netlink_sock *nlk = nlk_sk(s); |
2614 | 2614 | ||
2615 | seq_printf(seq, "%pK %-3d %-6u %08x %-8d %-8d %d %-8d %-8d %-8lu\n", | 2615 | seq_printf(seq, "%pK %-3d %-10u %08x %-8d %-8d %-5d %-8d %-8d %-8lu\n", |
2616 | s, | 2616 | s, |
2617 | s->sk_protocol, | 2617 | s->sk_protocol, |
2618 | nlk->portid, | 2618 | nlk->portid, |
diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c index d7da99a0b0b8..9696ef96b719 100644 --- a/net/nsh/nsh.c +++ b/net/nsh/nsh.c | |||
@@ -57,6 +57,8 @@ int nsh_pop(struct sk_buff *skb) | |||
57 | return -ENOMEM; | 57 | return -ENOMEM; |
58 | nh = (struct nshhdr *)(skb->data); | 58 | nh = (struct nshhdr *)(skb->data); |
59 | length = nsh_hdr_len(nh); | 59 | length = nsh_hdr_len(nh); |
60 | if (length < NSH_BASE_HDR_LEN) | ||
61 | return -EINVAL; | ||
60 | inner_proto = tun_p_to_eth_p(nh->np); | 62 | inner_proto = tun_p_to_eth_p(nh->np); |
61 | if (!pskb_may_pull(skb, length)) | 63 | if (!pskb_may_pull(skb, length)) |
62 | return -ENOMEM; | 64 | return -ENOMEM; |
@@ -90,6 +92,8 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb, | |||
90 | if (unlikely(!pskb_may_pull(skb, NSH_BASE_HDR_LEN))) | 92 | if (unlikely(!pskb_may_pull(skb, NSH_BASE_HDR_LEN))) |
91 | goto out; | 93 | goto out; |
92 | nsh_len = nsh_hdr_len(nsh_hdr(skb)); | 94 | nsh_len = nsh_hdr_len(nsh_hdr(skb)); |
95 | if (nsh_len < NSH_BASE_HDR_LEN) | ||
96 | goto out; | ||
93 | if (unlikely(!pskb_may_pull(skb, nsh_len))) | 97 | if (unlikely(!pskb_may_pull(skb, nsh_len))) |
94 | goto out; | 98 | goto out; |
95 | 99 | ||
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 7322aa1e382e..492ab0c36f7c 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c | |||
@@ -1712,13 +1712,10 @@ static void nlattr_set(struct nlattr *attr, u8 val, | |||
1712 | 1712 | ||
1713 | /* The nlattr stream should already have been validated */ | 1713 | /* The nlattr stream should already have been validated */ |
1714 | nla_for_each_nested(nla, attr, rem) { | 1714 | nla_for_each_nested(nla, attr, rem) { |
1715 | if (tbl[nla_type(nla)].len == OVS_ATTR_NESTED) { | 1715 | if (tbl[nla_type(nla)].len == OVS_ATTR_NESTED) |
1716 | if (tbl[nla_type(nla)].next) | 1716 | nlattr_set(nla, val, tbl[nla_type(nla)].next ? : tbl); |
1717 | tbl = tbl[nla_type(nla)].next; | 1717 | else |
1718 | nlattr_set(nla, val, tbl); | ||
1719 | } else { | ||
1720 | memset(nla_data(nla), val, nla_len(nla)); | 1718 | memset(nla_data(nla), val, nla_len(nla)); |
1721 | } | ||
1722 | 1719 | ||
1723 | if (nla_type(nla) == OVS_KEY_ATTR_CT_STATE) | 1720 | if (nla_type(nla) == OVS_KEY_ATTR_CT_STATE) |
1724 | *(u32 *)nla_data(nla) &= CT_SUPPORTED_MASK; | 1721 | *(u32 *)nla_data(nla) &= CT_SUPPORTED_MASK; |
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 41bd496531d4..00192a996be0 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c | |||
@@ -137,13 +137,18 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
137 | 137 | ||
138 | ret = rfkill_register(rfkill->rfkill_dev); | 138 | ret = rfkill_register(rfkill->rfkill_dev); |
139 | if (ret < 0) | 139 | if (ret < 0) |
140 | return ret; | 140 | goto err_destroy; |
141 | 141 | ||
142 | platform_set_drvdata(pdev, rfkill); | 142 | platform_set_drvdata(pdev, rfkill); |
143 | 143 | ||
144 | dev_info(&pdev->dev, "%s device registered.\n", rfkill->name); | 144 | dev_info(&pdev->dev, "%s device registered.\n", rfkill->name); |
145 | 145 | ||
146 | return 0; | 146 | return 0; |
147 | |||
148 | err_destroy: | ||
149 | rfkill_destroy(rfkill->rfkill_dev); | ||
150 | |||
151 | return ret; | ||
147 | } | 152 | } |
148 | 153 | ||
149 | static int rfkill_gpio_remove(struct platform_device *pdev) | 154 | static int rfkill_gpio_remove(struct platform_device *pdev) |
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 9a2c8e7c000e..2b463047dd7b 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
@@ -313,7 +313,7 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock, | |||
313 | memset(&cp, 0, sizeof(cp)); | 313 | memset(&cp, 0, sizeof(cp)); |
314 | cp.local = rx->local; | 314 | cp.local = rx->local; |
315 | cp.key = key; | 315 | cp.key = key; |
316 | cp.security_level = 0; | 316 | cp.security_level = rx->min_sec_level; |
317 | cp.exclusive = false; | 317 | cp.exclusive = false; |
318 | cp.upgrade = upgrade; | 318 | cp.upgrade = upgrade; |
319 | cp.service_id = srx->srx_service; | 319 | cp.service_id = srx->srx_service; |
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 90d7079e0aa9..19975d2ca9a2 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h | |||
@@ -476,6 +476,7 @@ enum rxrpc_call_flag { | |||
476 | RXRPC_CALL_SEND_PING, /* A ping will need to be sent */ | 476 | RXRPC_CALL_SEND_PING, /* A ping will need to be sent */ |
477 | RXRPC_CALL_PINGING, /* Ping in process */ | 477 | RXRPC_CALL_PINGING, /* Ping in process */ |
478 | RXRPC_CALL_RETRANS_TIMEOUT, /* Retransmission due to timeout occurred */ | 478 | RXRPC_CALL_RETRANS_TIMEOUT, /* Retransmission due to timeout occurred */ |
479 | RXRPC_CALL_BEGAN_RX_TIMER, /* We began the expect_rx_by timer */ | ||
479 | }; | 480 | }; |
480 | 481 | ||
481 | /* | 482 | /* |
diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c index c717152070df..1350f1be8037 100644 --- a/net/rxrpc/conn_event.c +++ b/net/rxrpc/conn_event.c | |||
@@ -40,7 +40,7 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn, | |||
40 | } __attribute__((packed)) pkt; | 40 | } __attribute__((packed)) pkt; |
41 | struct rxrpc_ackinfo ack_info; | 41 | struct rxrpc_ackinfo ack_info; |
42 | size_t len; | 42 | size_t len; |
43 | int ioc; | 43 | int ret, ioc; |
44 | u32 serial, mtu, call_id, padding; | 44 | u32 serial, mtu, call_id, padding; |
45 | 45 | ||
46 | _enter("%d", conn->debug_id); | 46 | _enter("%d", conn->debug_id); |
@@ -135,10 +135,13 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn, | |||
135 | break; | 135 | break; |
136 | } | 136 | } |
137 | 137 | ||
138 | kernel_sendmsg(conn->params.local->socket, &msg, iov, ioc, len); | 138 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, ioc, len); |
139 | conn->params.peer->last_tx_at = ktime_get_real(); | 139 | conn->params.peer->last_tx_at = ktime_get_real(); |
140 | if (ret < 0) | ||
141 | trace_rxrpc_tx_fail(conn->debug_id, serial, ret, | ||
142 | rxrpc_tx_fail_call_final_resend); | ||
143 | |||
140 | _leave(""); | 144 | _leave(""); |
141 | return; | ||
142 | } | 145 | } |
143 | 146 | ||
144 | /* | 147 | /* |
@@ -236,6 +239,8 @@ static int rxrpc_abort_connection(struct rxrpc_connection *conn, | |||
236 | 239 | ||
237 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len); | 240 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len); |
238 | if (ret < 0) { | 241 | if (ret < 0) { |
242 | trace_rxrpc_tx_fail(conn->debug_id, serial, ret, | ||
243 | rxrpc_tx_fail_conn_abort); | ||
239 | _debug("sendmsg failed: %d", ret); | 244 | _debug("sendmsg failed: %d", ret); |
240 | return -EAGAIN; | 245 | return -EAGAIN; |
241 | } | 246 | } |
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index 0410d2277ca2..b5fd6381313d 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c | |||
@@ -971,7 +971,7 @@ static void rxrpc_input_call_packet(struct rxrpc_call *call, | |||
971 | if (timo) { | 971 | if (timo) { |
972 | unsigned long now = jiffies, expect_rx_by; | 972 | unsigned long now = jiffies, expect_rx_by; |
973 | 973 | ||
974 | expect_rx_by = jiffies + timo; | 974 | expect_rx_by = now + timo; |
975 | WRITE_ONCE(call->expect_rx_by, expect_rx_by); | 975 | WRITE_ONCE(call->expect_rx_by, expect_rx_by); |
976 | rxrpc_reduce_call_timer(call, expect_rx_by, now, | 976 | rxrpc_reduce_call_timer(call, expect_rx_by, now, |
977 | rxrpc_timer_set_for_normal); | 977 | rxrpc_timer_set_for_normal); |
diff --git a/net/rxrpc/local_event.c b/net/rxrpc/local_event.c index 93b5d910b4a1..8325f1b86840 100644 --- a/net/rxrpc/local_event.c +++ b/net/rxrpc/local_event.c | |||
@@ -71,7 +71,8 @@ static void rxrpc_send_version_request(struct rxrpc_local *local, | |||
71 | 71 | ||
72 | ret = kernel_sendmsg(local->socket, &msg, iov, 2, len); | 72 | ret = kernel_sendmsg(local->socket, &msg, iov, 2, len); |
73 | if (ret < 0) | 73 | if (ret < 0) |
74 | _debug("sendmsg failed: %d", ret); | 74 | trace_rxrpc_tx_fail(local->debug_id, 0, ret, |
75 | rxrpc_tx_fail_version_reply); | ||
75 | 76 | ||
76 | _leave(""); | 77 | _leave(""); |
77 | } | 78 | } |
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 8b54e9531d52..b493e6b62740 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c | |||
@@ -134,22 +134,49 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net) | |||
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | /* we want to receive ICMP errors */ | 137 | switch (local->srx.transport.family) { |
138 | opt = 1; | 138 | case AF_INET: |
139 | ret = kernel_setsockopt(local->socket, SOL_IP, IP_RECVERR, | 139 | /* we want to receive ICMP errors */ |
140 | (char *) &opt, sizeof(opt)); | 140 | opt = 1; |
141 | if (ret < 0) { | 141 | ret = kernel_setsockopt(local->socket, SOL_IP, IP_RECVERR, |
142 | _debug("setsockopt failed"); | 142 | (char *) &opt, sizeof(opt)); |
143 | goto error; | 143 | if (ret < 0) { |
144 | } | 144 | _debug("setsockopt failed"); |
145 | goto error; | ||
146 | } | ||
145 | 147 | ||
146 | /* we want to set the don't fragment bit */ | 148 | /* we want to set the don't fragment bit */ |
147 | opt = IP_PMTUDISC_DO; | 149 | opt = IP_PMTUDISC_DO; |
148 | ret = kernel_setsockopt(local->socket, SOL_IP, IP_MTU_DISCOVER, | 150 | ret = kernel_setsockopt(local->socket, SOL_IP, IP_MTU_DISCOVER, |
149 | (char *) &opt, sizeof(opt)); | 151 | (char *) &opt, sizeof(opt)); |
150 | if (ret < 0) { | 152 | if (ret < 0) { |
151 | _debug("setsockopt failed"); | 153 | _debug("setsockopt failed"); |
152 | goto error; | 154 | goto error; |
155 | } | ||
156 | break; | ||
157 | |||
158 | case AF_INET6: | ||
159 | /* we want to receive ICMP errors */ | ||
160 | opt = 1; | ||
161 | ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_RECVERR, | ||
162 | (char *) &opt, sizeof(opt)); | ||
163 | if (ret < 0) { | ||
164 | _debug("setsockopt failed"); | ||
165 | goto error; | ||
166 | } | ||
167 | |||
168 | /* we want to set the don't fragment bit */ | ||
169 | opt = IPV6_PMTUDISC_DO; | ||
170 | ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_MTU_DISCOVER, | ||
171 | (char *) &opt, sizeof(opt)); | ||
172 | if (ret < 0) { | ||
173 | _debug("setsockopt failed"); | ||
174 | goto error; | ||
175 | } | ||
176 | break; | ||
177 | |||
178 | default: | ||
179 | BUG(); | ||
153 | } | 180 | } |
154 | 181 | ||
155 | /* set the socket up */ | 182 | /* set the socket up */ |
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 7f1fc04775b3..f03de1c59ba3 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c | |||
@@ -210,6 +210,9 @@ int rxrpc_send_ack_packet(struct rxrpc_call *call, bool ping, | |||
210 | if (ping) | 210 | if (ping) |
211 | call->ping_time = now; | 211 | call->ping_time = now; |
212 | conn->params.peer->last_tx_at = ktime_get_real(); | 212 | conn->params.peer->last_tx_at = ktime_get_real(); |
213 | if (ret < 0) | ||
214 | trace_rxrpc_tx_fail(call->debug_id, serial, ret, | ||
215 | rxrpc_tx_fail_call_ack); | ||
213 | 216 | ||
214 | if (call->state < RXRPC_CALL_COMPLETE) { | 217 | if (call->state < RXRPC_CALL_COMPLETE) { |
215 | if (ret < 0) { | 218 | if (ret < 0) { |
@@ -294,6 +297,10 @@ int rxrpc_send_abort_packet(struct rxrpc_call *call) | |||
294 | ret = kernel_sendmsg(conn->params.local->socket, | 297 | ret = kernel_sendmsg(conn->params.local->socket, |
295 | &msg, iov, 1, sizeof(pkt)); | 298 | &msg, iov, 1, sizeof(pkt)); |
296 | conn->params.peer->last_tx_at = ktime_get_real(); | 299 | conn->params.peer->last_tx_at = ktime_get_real(); |
300 | if (ret < 0) | ||
301 | trace_rxrpc_tx_fail(call->debug_id, serial, ret, | ||
302 | rxrpc_tx_fail_call_abort); | ||
303 | |||
297 | 304 | ||
298 | rxrpc_put_connection(conn); | 305 | rxrpc_put_connection(conn); |
299 | return ret; | 306 | return ret; |
@@ -387,6 +394,9 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct sk_buff *skb, | |||
387 | conn->params.peer->last_tx_at = ktime_get_real(); | 394 | conn->params.peer->last_tx_at = ktime_get_real(); |
388 | 395 | ||
389 | up_read(&conn->params.local->defrag_sem); | 396 | up_read(&conn->params.local->defrag_sem); |
397 | if (ret < 0) | ||
398 | trace_rxrpc_tx_fail(call->debug_id, serial, ret, | ||
399 | rxrpc_tx_fail_call_data_nofrag); | ||
390 | if (ret == -EMSGSIZE) | 400 | if (ret == -EMSGSIZE) |
391 | goto send_fragmentable; | 401 | goto send_fragmentable; |
392 | 402 | ||
@@ -414,6 +424,17 @@ done: | |||
414 | rxrpc_timer_set_for_lost_ack); | 424 | rxrpc_timer_set_for_lost_ack); |
415 | } | 425 | } |
416 | } | 426 | } |
427 | |||
428 | if (sp->hdr.seq == 1 && | ||
429 | !test_and_set_bit(RXRPC_CALL_BEGAN_RX_TIMER, | ||
430 | &call->flags)) { | ||
431 | unsigned long nowj = jiffies, expect_rx_by; | ||
432 | |||
433 | expect_rx_by = nowj + call->next_rx_timo; | ||
434 | WRITE_ONCE(call->expect_rx_by, expect_rx_by); | ||
435 | rxrpc_reduce_call_timer(call, expect_rx_by, nowj, | ||
436 | rxrpc_timer_set_for_normal); | ||
437 | } | ||
417 | } | 438 | } |
418 | 439 | ||
419 | rxrpc_set_keepalive(call); | 440 | rxrpc_set_keepalive(call); |
@@ -465,6 +486,10 @@ send_fragmentable: | |||
465 | #endif | 486 | #endif |
466 | } | 487 | } |
467 | 488 | ||
489 | if (ret < 0) | ||
490 | trace_rxrpc_tx_fail(call->debug_id, serial, ret, | ||
491 | rxrpc_tx_fail_call_data_frag); | ||
492 | |||
468 | up_write(&conn->params.local->defrag_sem); | 493 | up_write(&conn->params.local->defrag_sem); |
469 | goto done; | 494 | goto done; |
470 | } | 495 | } |
@@ -482,6 +507,7 @@ void rxrpc_reject_packets(struct rxrpc_local *local) | |||
482 | struct kvec iov[2]; | 507 | struct kvec iov[2]; |
483 | size_t size; | 508 | size_t size; |
484 | __be32 code; | 509 | __be32 code; |
510 | int ret; | ||
485 | 511 | ||
486 | _enter("%d", local->debug_id); | 512 | _enter("%d", local->debug_id); |
487 | 513 | ||
@@ -516,7 +542,10 @@ void rxrpc_reject_packets(struct rxrpc_local *local) | |||
516 | whdr.flags ^= RXRPC_CLIENT_INITIATED; | 542 | whdr.flags ^= RXRPC_CLIENT_INITIATED; |
517 | whdr.flags &= RXRPC_CLIENT_INITIATED; | 543 | whdr.flags &= RXRPC_CLIENT_INITIATED; |
518 | 544 | ||
519 | kernel_sendmsg(local->socket, &msg, iov, 2, size); | 545 | ret = kernel_sendmsg(local->socket, &msg, iov, 2, size); |
546 | if (ret < 0) | ||
547 | trace_rxrpc_tx_fail(local->debug_id, 0, ret, | ||
548 | rxrpc_tx_fail_reject); | ||
520 | } | 549 | } |
521 | 550 | ||
522 | rxrpc_free_skb(skb, rxrpc_skb_rx_freed); | 551 | rxrpc_free_skb(skb, rxrpc_skb_rx_freed); |
@@ -567,7 +596,8 @@ void rxrpc_send_keepalive(struct rxrpc_peer *peer) | |||
567 | 596 | ||
568 | ret = kernel_sendmsg(peer->local->socket, &msg, iov, 2, len); | 597 | ret = kernel_sendmsg(peer->local->socket, &msg, iov, 2, len); |
569 | if (ret < 0) | 598 | if (ret < 0) |
570 | _debug("sendmsg failed: %d", ret); | 599 | trace_rxrpc_tx_fail(peer->debug_id, 0, ret, |
600 | rxrpc_tx_fail_version_keepalive); | ||
571 | 601 | ||
572 | peer->last_tx_at = ktime_get_real(); | 602 | peer->last_tx_at = ktime_get_real(); |
573 | _leave(""); | 603 | _leave(""); |
diff --git a/net/rxrpc/peer_event.c b/net/rxrpc/peer_event.c index 78c2f95d1f22..0ed8b651cec2 100644 --- a/net/rxrpc/peer_event.c +++ b/net/rxrpc/peer_event.c | |||
@@ -28,39 +28,39 @@ static void rxrpc_store_error(struct rxrpc_peer *, struct sock_exterr_skb *); | |||
28 | * Find the peer associated with an ICMP packet. | 28 | * Find the peer associated with an ICMP packet. |
29 | */ | 29 | */ |
30 | static struct rxrpc_peer *rxrpc_lookup_peer_icmp_rcu(struct rxrpc_local *local, | 30 | static struct rxrpc_peer *rxrpc_lookup_peer_icmp_rcu(struct rxrpc_local *local, |
31 | const struct sk_buff *skb) | 31 | const struct sk_buff *skb, |
32 | struct sockaddr_rxrpc *srx) | ||
32 | { | 33 | { |
33 | struct sock_exterr_skb *serr = SKB_EXT_ERR(skb); | 34 | struct sock_exterr_skb *serr = SKB_EXT_ERR(skb); |
34 | struct sockaddr_rxrpc srx; | ||
35 | 35 | ||
36 | _enter(""); | 36 | _enter(""); |
37 | 37 | ||
38 | memset(&srx, 0, sizeof(srx)); | 38 | memset(srx, 0, sizeof(*srx)); |
39 | srx.transport_type = local->srx.transport_type; | 39 | srx->transport_type = local->srx.transport_type; |
40 | srx.transport_len = local->srx.transport_len; | 40 | srx->transport_len = local->srx.transport_len; |
41 | srx.transport.family = local->srx.transport.family; | 41 | srx->transport.family = local->srx.transport.family; |
42 | 42 | ||
43 | /* Can we see an ICMP4 packet on an ICMP6 listening socket? and vice | 43 | /* Can we see an ICMP4 packet on an ICMP6 listening socket? and vice |
44 | * versa? | 44 | * versa? |
45 | */ | 45 | */ |
46 | switch (srx.transport.family) { | 46 | switch (srx->transport.family) { |
47 | case AF_INET: | 47 | case AF_INET: |
48 | srx.transport.sin.sin_port = serr->port; | 48 | srx->transport.sin.sin_port = serr->port; |
49 | switch (serr->ee.ee_origin) { | 49 | switch (serr->ee.ee_origin) { |
50 | case SO_EE_ORIGIN_ICMP: | 50 | case SO_EE_ORIGIN_ICMP: |
51 | _net("Rx ICMP"); | 51 | _net("Rx ICMP"); |
52 | memcpy(&srx.transport.sin.sin_addr, | 52 | memcpy(&srx->transport.sin.sin_addr, |
53 | skb_network_header(skb) + serr->addr_offset, | 53 | skb_network_header(skb) + serr->addr_offset, |
54 | sizeof(struct in_addr)); | 54 | sizeof(struct in_addr)); |
55 | break; | 55 | break; |
56 | case SO_EE_ORIGIN_ICMP6: | 56 | case SO_EE_ORIGIN_ICMP6: |
57 | _net("Rx ICMP6 on v4 sock"); | 57 | _net("Rx ICMP6 on v4 sock"); |
58 | memcpy(&srx.transport.sin.sin_addr, | 58 | memcpy(&srx->transport.sin.sin_addr, |
59 | skb_network_header(skb) + serr->addr_offset + 12, | 59 | skb_network_header(skb) + serr->addr_offset + 12, |
60 | sizeof(struct in_addr)); | 60 | sizeof(struct in_addr)); |
61 | break; | 61 | break; |
62 | default: | 62 | default: |
63 | memcpy(&srx.transport.sin.sin_addr, &ip_hdr(skb)->saddr, | 63 | memcpy(&srx->transport.sin.sin_addr, &ip_hdr(skb)->saddr, |
64 | sizeof(struct in_addr)); | 64 | sizeof(struct in_addr)); |
65 | break; | 65 | break; |
66 | } | 66 | } |
@@ -68,25 +68,25 @@ static struct rxrpc_peer *rxrpc_lookup_peer_icmp_rcu(struct rxrpc_local *local, | |||
68 | 68 | ||
69 | #ifdef CONFIG_AF_RXRPC_IPV6 | 69 | #ifdef CONFIG_AF_RXRPC_IPV6 |
70 | case AF_INET6: | 70 | case AF_INET6: |
71 | srx.transport.sin6.sin6_port = serr->port; | 71 | srx->transport.sin6.sin6_port = serr->port; |
72 | switch (serr->ee.ee_origin) { | 72 | switch (serr->ee.ee_origin) { |
73 | case SO_EE_ORIGIN_ICMP6: | 73 | case SO_EE_ORIGIN_ICMP6: |
74 | _net("Rx ICMP6"); | 74 | _net("Rx ICMP6"); |
75 | memcpy(&srx.transport.sin6.sin6_addr, | 75 | memcpy(&srx->transport.sin6.sin6_addr, |
76 | skb_network_header(skb) + serr->addr_offset, | 76 | skb_network_header(skb) + serr->addr_offset, |
77 | sizeof(struct in6_addr)); | 77 | sizeof(struct in6_addr)); |
78 | break; | 78 | break; |
79 | case SO_EE_ORIGIN_ICMP: | 79 | case SO_EE_ORIGIN_ICMP: |
80 | _net("Rx ICMP on v6 sock"); | 80 | _net("Rx ICMP on v6 sock"); |
81 | srx.transport.sin6.sin6_addr.s6_addr32[0] = 0; | 81 | srx->transport.sin6.sin6_addr.s6_addr32[0] = 0; |
82 | srx.transport.sin6.sin6_addr.s6_addr32[1] = 0; | 82 | srx->transport.sin6.sin6_addr.s6_addr32[1] = 0; |
83 | srx.transport.sin6.sin6_addr.s6_addr32[2] = htonl(0xffff); | 83 | srx->transport.sin6.sin6_addr.s6_addr32[2] = htonl(0xffff); |
84 | memcpy(srx.transport.sin6.sin6_addr.s6_addr + 12, | 84 | memcpy(srx->transport.sin6.sin6_addr.s6_addr + 12, |
85 | skb_network_header(skb) + serr->addr_offset, | 85 | skb_network_header(skb) + serr->addr_offset, |
86 | sizeof(struct in_addr)); | 86 | sizeof(struct in_addr)); |
87 | break; | 87 | break; |
88 | default: | 88 | default: |
89 | memcpy(&srx.transport.sin6.sin6_addr, | 89 | memcpy(&srx->transport.sin6.sin6_addr, |
90 | &ipv6_hdr(skb)->saddr, | 90 | &ipv6_hdr(skb)->saddr, |
91 | sizeof(struct in6_addr)); | 91 | sizeof(struct in6_addr)); |
92 | break; | 92 | break; |
@@ -98,7 +98,7 @@ static struct rxrpc_peer *rxrpc_lookup_peer_icmp_rcu(struct rxrpc_local *local, | |||
98 | BUG(); | 98 | BUG(); |
99 | } | 99 | } |
100 | 100 | ||
101 | return rxrpc_lookup_peer_rcu(local, &srx); | 101 | return rxrpc_lookup_peer_rcu(local, srx); |
102 | } | 102 | } |
103 | 103 | ||
104 | /* | 104 | /* |
@@ -146,6 +146,7 @@ static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, struct sock_exterr_skb *se | |||
146 | void rxrpc_error_report(struct sock *sk) | 146 | void rxrpc_error_report(struct sock *sk) |
147 | { | 147 | { |
148 | struct sock_exterr_skb *serr; | 148 | struct sock_exterr_skb *serr; |
149 | struct sockaddr_rxrpc srx; | ||
149 | struct rxrpc_local *local = sk->sk_user_data; | 150 | struct rxrpc_local *local = sk->sk_user_data; |
150 | struct rxrpc_peer *peer; | 151 | struct rxrpc_peer *peer; |
151 | struct sk_buff *skb; | 152 | struct sk_buff *skb; |
@@ -166,7 +167,7 @@ void rxrpc_error_report(struct sock *sk) | |||
166 | } | 167 | } |
167 | 168 | ||
168 | rcu_read_lock(); | 169 | rcu_read_lock(); |
169 | peer = rxrpc_lookup_peer_icmp_rcu(local, skb); | 170 | peer = rxrpc_lookup_peer_icmp_rcu(local, skb, &srx); |
170 | if (peer && !rxrpc_get_peer_maybe(peer)) | 171 | if (peer && !rxrpc_get_peer_maybe(peer)) |
171 | peer = NULL; | 172 | peer = NULL; |
172 | if (!peer) { | 173 | if (!peer) { |
@@ -176,6 +177,8 @@ void rxrpc_error_report(struct sock *sk) | |||
176 | return; | 177 | return; |
177 | } | 178 | } |
178 | 179 | ||
180 | trace_rxrpc_rx_icmp(peer, &serr->ee, &srx); | ||
181 | |||
179 | if ((serr->ee.ee_origin == SO_EE_ORIGIN_ICMP && | 182 | if ((serr->ee.ee_origin == SO_EE_ORIGIN_ICMP && |
180 | serr->ee.ee_type == ICMP_DEST_UNREACH && | 183 | serr->ee.ee_type == ICMP_DEST_UNREACH && |
181 | serr->ee.ee_code == ICMP_FRAG_NEEDED)) { | 184 | serr->ee.ee_code == ICMP_FRAG_NEEDED)) { |
@@ -209,9 +212,6 @@ static void rxrpc_store_error(struct rxrpc_peer *peer, | |||
209 | 212 | ||
210 | ee = &serr->ee; | 213 | ee = &serr->ee; |
211 | 214 | ||
212 | _net("Rx Error o=%d t=%d c=%d e=%d", | ||
213 | ee->ee_origin, ee->ee_type, ee->ee_code, ee->ee_errno); | ||
214 | |||
215 | err = ee->ee_errno; | 215 | err = ee->ee_errno; |
216 | 216 | ||
217 | switch (ee->ee_origin) { | 217 | switch (ee->ee_origin) { |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 588fea0dd362..6c0ae27fff84 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
@@ -664,7 +664,8 @@ static int rxkad_issue_challenge(struct rxrpc_connection *conn) | |||
664 | 664 | ||
665 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len); | 665 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len); |
666 | if (ret < 0) { | 666 | if (ret < 0) { |
667 | _debug("sendmsg failed: %d", ret); | 667 | trace_rxrpc_tx_fail(conn->debug_id, serial, ret, |
668 | rxrpc_tx_fail_conn_challenge); | ||
668 | return -EAGAIN; | 669 | return -EAGAIN; |
669 | } | 670 | } |
670 | 671 | ||
@@ -719,7 +720,8 @@ static int rxkad_send_response(struct rxrpc_connection *conn, | |||
719 | 720 | ||
720 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 3, len); | 721 | ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 3, len); |
721 | if (ret < 0) { | 722 | if (ret < 0) { |
722 | _debug("sendmsg failed: %d", ret); | 723 | trace_rxrpc_tx_fail(conn->debug_id, serial, ret, |
724 | rxrpc_tx_fail_conn_response); | ||
723 | return -EAGAIN; | 725 | return -EAGAIN; |
724 | } | 726 | } |
725 | 727 | ||
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 206e802ccbdc..be01f9c5d963 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c | |||
@@ -223,6 +223,15 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, | |||
223 | 223 | ||
224 | ret = rxrpc_send_data_packet(call, skb, false); | 224 | ret = rxrpc_send_data_packet(call, skb, false); |
225 | if (ret < 0) { | 225 | if (ret < 0) { |
226 | switch (ret) { | ||
227 | case -ENETUNREACH: | ||
228 | case -EHOSTUNREACH: | ||
229 | case -ECONNREFUSED: | ||
230 | rxrpc_set_call_completion(call, | ||
231 | RXRPC_CALL_LOCAL_ERROR, | ||
232 | 0, ret); | ||
233 | goto out; | ||
234 | } | ||
226 | _debug("need instant resend %d", ret); | 235 | _debug("need instant resend %d", ret); |
227 | rxrpc_instant_resend(call, ix); | 236 | rxrpc_instant_resend(call, ix); |
228 | } else { | 237 | } else { |
@@ -241,6 +250,7 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, | |||
241 | rxrpc_timer_set_for_send); | 250 | rxrpc_timer_set_for_send); |
242 | } | 251 | } |
243 | 252 | ||
253 | out: | ||
244 | rxrpc_free_skb(skb, rxrpc_skb_tx_freed); | 254 | rxrpc_free_skb(skb, rxrpc_skb_tx_freed); |
245 | _leave(""); | 255 | _leave(""); |
246 | } | 256 | } |
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index ddf69fc01bdf..6138d1d71900 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
@@ -121,7 +121,8 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, | |||
121 | return 0; | 121 | return 0; |
122 | 122 | ||
123 | if (!flags) { | 123 | if (!flags) { |
124 | tcf_idr_release(*a, bind); | 124 | if (exists) |
125 | tcf_idr_release(*a, bind); | ||
125 | return -EINVAL; | 126 | return -EINVAL; |
126 | } | 127 | } |
127 | 128 | ||
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index bbcbdce732cc..ad050d7d4b46 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c | |||
@@ -131,8 +131,11 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla, | |||
131 | if (exists && bind) | 131 | if (exists && bind) |
132 | return 0; | 132 | return 0; |
133 | 133 | ||
134 | if (!lflags) | 134 | if (!lflags) { |
135 | if (exists) | ||
136 | tcf_idr_release(*a, bind); | ||
135 | return -EINVAL; | 137 | return -EINVAL; |
138 | } | ||
136 | 139 | ||
137 | if (!exists) { | 140 | if (!exists) { |
138 | ret = tcf_idr_create(tn, parm->index, est, a, | 141 | ret = tcf_idr_create(tn, parm->index, est, a, |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index b66754f52a9f..963e4bf0aab8 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -152,8 +152,8 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol, | |||
152 | NL_SET_ERR_MSG(extack, "TC classifier not found"); | 152 | NL_SET_ERR_MSG(extack, "TC classifier not found"); |
153 | err = -ENOENT; | 153 | err = -ENOENT; |
154 | } | 154 | } |
155 | goto errout; | ||
156 | #endif | 155 | #endif |
156 | goto errout; | ||
157 | } | 157 | } |
158 | tp->classify = tp->ops->classify; | 158 | tp->classify = tp->ops->classify; |
159 | tp->protocol = protocol; | 159 | tp->protocol = protocol; |
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 837806dd5799..a47179da24e6 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -1024,8 +1024,9 @@ static void sctp_assoc_bh_rcv(struct work_struct *work) | |||
1024 | struct sctp_endpoint *ep; | 1024 | struct sctp_endpoint *ep; |
1025 | struct sctp_chunk *chunk; | 1025 | struct sctp_chunk *chunk; |
1026 | struct sctp_inq *inqueue; | 1026 | struct sctp_inq *inqueue; |
1027 | int state; | 1027 | int first_time = 1; /* is this the first time through the loop */ |
1028 | int error = 0; | 1028 | int error = 0; |
1029 | int state; | ||
1029 | 1030 | ||
1030 | /* The association should be held so we should be safe. */ | 1031 | /* The association should be held so we should be safe. */ |
1031 | ep = asoc->ep; | 1032 | ep = asoc->ep; |
@@ -1036,6 +1037,30 @@ static void sctp_assoc_bh_rcv(struct work_struct *work) | |||
1036 | state = asoc->state; | 1037 | state = asoc->state; |
1037 | subtype = SCTP_ST_CHUNK(chunk->chunk_hdr->type); | 1038 | subtype = SCTP_ST_CHUNK(chunk->chunk_hdr->type); |
1038 | 1039 | ||
1040 | /* If the first chunk in the packet is AUTH, do special | ||
1041 | * processing specified in Section 6.3 of SCTP-AUTH spec | ||
1042 | */ | ||
1043 | if (first_time && subtype.chunk == SCTP_CID_AUTH) { | ||
1044 | struct sctp_chunkhdr *next_hdr; | ||
1045 | |||
1046 | next_hdr = sctp_inq_peek(inqueue); | ||
1047 | if (!next_hdr) | ||
1048 | goto normal; | ||
1049 | |||
1050 | /* If the next chunk is COOKIE-ECHO, skip the AUTH | ||
1051 | * chunk while saving a pointer to it so we can do | ||
1052 | * Authentication later (during cookie-echo | ||
1053 | * processing). | ||
1054 | */ | ||
1055 | if (next_hdr->type == SCTP_CID_COOKIE_ECHO) { | ||
1056 | chunk->auth_chunk = skb_clone(chunk->skb, | ||
1057 | GFP_ATOMIC); | ||
1058 | chunk->auth = 1; | ||
1059 | continue; | ||
1060 | } | ||
1061 | } | ||
1062 | |||
1063 | normal: | ||
1039 | /* SCTP-AUTH, Section 6.3: | 1064 | /* SCTP-AUTH, Section 6.3: |
1040 | * The receiver has a list of chunk types which it expects | 1065 | * The receiver has a list of chunk types which it expects |
1041 | * to be received only after an AUTH-chunk. This list has | 1066 | * to be received only after an AUTH-chunk. This list has |
@@ -1074,6 +1099,9 @@ static void sctp_assoc_bh_rcv(struct work_struct *work) | |||
1074 | /* If there is an error on chunk, discard this packet. */ | 1099 | /* If there is an error on chunk, discard this packet. */ |
1075 | if (error && chunk) | 1100 | if (error && chunk) |
1076 | chunk->pdiscard = 1; | 1101 | chunk->pdiscard = 1; |
1102 | |||
1103 | if (first_time) | ||
1104 | first_time = 0; | ||
1077 | } | 1105 | } |
1078 | sctp_association_put(asoc); | 1106 | sctp_association_put(asoc); |
1079 | } | 1107 | } |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 5a4fb1dc8400..e62addb60434 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1152,7 +1152,7 @@ struct sctp_chunk *sctp_make_violation_max_retrans( | |||
1152 | const struct sctp_association *asoc, | 1152 | const struct sctp_association *asoc, |
1153 | const struct sctp_chunk *chunk) | 1153 | const struct sctp_chunk *chunk) |
1154 | { | 1154 | { |
1155 | static const char error[] = "Association exceeded its max_retans count"; | 1155 | static const char error[] = "Association exceeded its max_retrans count"; |
1156 | size_t payload_len = sizeof(error) + sizeof(struct sctp_errhdr); | 1156 | size_t payload_len = sizeof(error) + sizeof(struct sctp_errhdr); |
1157 | struct sctp_chunk *retval; | 1157 | struct sctp_chunk *retval; |
1158 | 1158 | ||
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 28c070e187c2..c9ae3404b1bb 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -153,10 +153,7 @@ static enum sctp_disposition sctp_sf_violation_chunk( | |||
153 | struct sctp_cmd_seq *commands); | 153 | struct sctp_cmd_seq *commands); |
154 | 154 | ||
155 | static enum sctp_ierror sctp_sf_authenticate( | 155 | static enum sctp_ierror sctp_sf_authenticate( |
156 | struct net *net, | ||
157 | const struct sctp_endpoint *ep, | ||
158 | const struct sctp_association *asoc, | 156 | const struct sctp_association *asoc, |
159 | const union sctp_subtype type, | ||
160 | struct sctp_chunk *chunk); | 157 | struct sctp_chunk *chunk); |
161 | 158 | ||
162 | static enum sctp_disposition __sctp_sf_do_9_1_abort( | 159 | static enum sctp_disposition __sctp_sf_do_9_1_abort( |
@@ -626,6 +623,38 @@ enum sctp_disposition sctp_sf_do_5_1C_ack(struct net *net, | |||
626 | return SCTP_DISPOSITION_CONSUME; | 623 | return SCTP_DISPOSITION_CONSUME; |
627 | } | 624 | } |
628 | 625 | ||
626 | static bool sctp_auth_chunk_verify(struct net *net, struct sctp_chunk *chunk, | ||
627 | const struct sctp_association *asoc) | ||
628 | { | ||
629 | struct sctp_chunk auth; | ||
630 | |||
631 | if (!chunk->auth_chunk) | ||
632 | return true; | ||
633 | |||
634 | /* SCTP-AUTH: auth_chunk pointer is only set when the cookie-echo | ||
635 | * is supposed to be authenticated and we have to do delayed | ||
636 | * authentication. We've just recreated the association using | ||
637 | * the information in the cookie and now it's much easier to | ||
638 | * do the authentication. | ||
639 | */ | ||
640 | |||
641 | /* Make sure that we and the peer are AUTH capable */ | ||
642 | if (!net->sctp.auth_enable || !asoc->peer.auth_capable) | ||
643 | return false; | ||
644 | |||
645 | /* set-up our fake chunk so that we can process it */ | ||
646 | auth.skb = chunk->auth_chunk; | ||
647 | auth.asoc = chunk->asoc; | ||
648 | auth.sctp_hdr = chunk->sctp_hdr; | ||
649 | auth.chunk_hdr = (struct sctp_chunkhdr *) | ||
650 | skb_push(chunk->auth_chunk, | ||
651 | sizeof(struct sctp_chunkhdr)); | ||
652 | skb_pull(chunk->auth_chunk, sizeof(struct sctp_chunkhdr)); | ||
653 | auth.transport = chunk->transport; | ||
654 | |||
655 | return sctp_sf_authenticate(asoc, &auth) == SCTP_IERROR_NO_ERROR; | ||
656 | } | ||
657 | |||
629 | /* | 658 | /* |
630 | * Respond to a normal COOKIE ECHO chunk. | 659 | * Respond to a normal COOKIE ECHO chunk. |
631 | * We are the side that is being asked for an association. | 660 | * We are the side that is being asked for an association. |
@@ -763,37 +792,9 @@ enum sctp_disposition sctp_sf_do_5_1D_ce(struct net *net, | |||
763 | if (error) | 792 | if (error) |
764 | goto nomem_init; | 793 | goto nomem_init; |
765 | 794 | ||
766 | /* SCTP-AUTH: auth_chunk pointer is only set when the cookie-echo | 795 | if (!sctp_auth_chunk_verify(net, chunk, new_asoc)) { |
767 | * is supposed to be authenticated and we have to do delayed | 796 | sctp_association_free(new_asoc); |
768 | * authentication. We've just recreated the association using | 797 | return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); |
769 | * the information in the cookie and now it's much easier to | ||
770 | * do the authentication. | ||
771 | */ | ||
772 | if (chunk->auth_chunk) { | ||
773 | struct sctp_chunk auth; | ||
774 | enum sctp_ierror ret; | ||
775 | |||
776 | /* Make sure that we and the peer are AUTH capable */ | ||
777 | if (!net->sctp.auth_enable || !new_asoc->peer.auth_capable) { | ||
778 | sctp_association_free(new_asoc); | ||
779 | return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); | ||
780 | } | ||
781 | |||
782 | /* set-up our fake chunk so that we can process it */ | ||
783 | auth.skb = chunk->auth_chunk; | ||
784 | auth.asoc = chunk->asoc; | ||
785 | auth.sctp_hdr = chunk->sctp_hdr; | ||
786 | auth.chunk_hdr = (struct sctp_chunkhdr *) | ||
787 | skb_push(chunk->auth_chunk, | ||
788 | sizeof(struct sctp_chunkhdr)); | ||
789 | skb_pull(chunk->auth_chunk, sizeof(struct sctp_chunkhdr)); | ||
790 | auth.transport = chunk->transport; | ||
791 | |||
792 | ret = sctp_sf_authenticate(net, ep, new_asoc, type, &auth); | ||
793 | if (ret != SCTP_IERROR_NO_ERROR) { | ||
794 | sctp_association_free(new_asoc); | ||
795 | return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); | ||
796 | } | ||
797 | } | 798 | } |
798 | 799 | ||
799 | repl = sctp_make_cookie_ack(new_asoc, chunk); | 800 | repl = sctp_make_cookie_ack(new_asoc, chunk); |
@@ -1797,13 +1798,15 @@ static enum sctp_disposition sctp_sf_do_dupcook_a( | |||
1797 | if (sctp_auth_asoc_init_active_key(new_asoc, GFP_ATOMIC)) | 1798 | if (sctp_auth_asoc_init_active_key(new_asoc, GFP_ATOMIC)) |
1798 | goto nomem; | 1799 | goto nomem; |
1799 | 1800 | ||
1801 | if (!sctp_auth_chunk_verify(net, chunk, new_asoc)) | ||
1802 | return SCTP_DISPOSITION_DISCARD; | ||
1803 | |||
1800 | /* Make sure no new addresses are being added during the | 1804 | /* Make sure no new addresses are being added during the |
1801 | * restart. Though this is a pretty complicated attack | 1805 | * restart. Though this is a pretty complicated attack |
1802 | * since you'd have to get inside the cookie. | 1806 | * since you'd have to get inside the cookie. |
1803 | */ | 1807 | */ |
1804 | if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands)) { | 1808 | if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands)) |
1805 | return SCTP_DISPOSITION_CONSUME; | 1809 | return SCTP_DISPOSITION_CONSUME; |
1806 | } | ||
1807 | 1810 | ||
1808 | /* If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes | 1811 | /* If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes |
1809 | * the peer has restarted (Action A), it MUST NOT setup a new | 1812 | * the peer has restarted (Action A), it MUST NOT setup a new |
@@ -1912,6 +1915,9 @@ static enum sctp_disposition sctp_sf_do_dupcook_b( | |||
1912 | if (sctp_auth_asoc_init_active_key(new_asoc, GFP_ATOMIC)) | 1915 | if (sctp_auth_asoc_init_active_key(new_asoc, GFP_ATOMIC)) |
1913 | goto nomem; | 1916 | goto nomem; |
1914 | 1917 | ||
1918 | if (!sctp_auth_chunk_verify(net, chunk, new_asoc)) | ||
1919 | return SCTP_DISPOSITION_DISCARD; | ||
1920 | |||
1915 | /* Update the content of current association. */ | 1921 | /* Update the content of current association. */ |
1916 | sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc)); | 1922 | sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc)); |
1917 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 1923 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, |
@@ -2009,6 +2015,9 @@ static enum sctp_disposition sctp_sf_do_dupcook_d( | |||
2009 | * a COOKIE ACK. | 2015 | * a COOKIE ACK. |
2010 | */ | 2016 | */ |
2011 | 2017 | ||
2018 | if (!sctp_auth_chunk_verify(net, chunk, asoc)) | ||
2019 | return SCTP_DISPOSITION_DISCARD; | ||
2020 | |||
2012 | /* Don't accidentally move back into established state. */ | 2021 | /* Don't accidentally move back into established state. */ |
2013 | if (asoc->state < SCTP_STATE_ESTABLISHED) { | 2022 | if (asoc->state < SCTP_STATE_ESTABLISHED) { |
2014 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 2023 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
@@ -4171,10 +4180,7 @@ gen_shutdown: | |||
4171 | * The return value is the disposition of the chunk. | 4180 | * The return value is the disposition of the chunk. |
4172 | */ | 4181 | */ |
4173 | static enum sctp_ierror sctp_sf_authenticate( | 4182 | static enum sctp_ierror sctp_sf_authenticate( |
4174 | struct net *net, | ||
4175 | const struct sctp_endpoint *ep, | ||
4176 | const struct sctp_association *asoc, | 4183 | const struct sctp_association *asoc, |
4177 | const union sctp_subtype type, | ||
4178 | struct sctp_chunk *chunk) | 4184 | struct sctp_chunk *chunk) |
4179 | { | 4185 | { |
4180 | struct sctp_shared_key *sh_key = NULL; | 4186 | struct sctp_shared_key *sh_key = NULL; |
@@ -4275,7 +4281,7 @@ enum sctp_disposition sctp_sf_eat_auth(struct net *net, | |||
4275 | commands); | 4281 | commands); |
4276 | 4282 | ||
4277 | auth_hdr = (struct sctp_authhdr *)chunk->skb->data; | 4283 | auth_hdr = (struct sctp_authhdr *)chunk->skb->data; |
4278 | error = sctp_sf_authenticate(net, ep, asoc, type, chunk); | 4284 | error = sctp_sf_authenticate(asoc, chunk); |
4279 | switch (error) { | 4285 | switch (error) { |
4280 | case SCTP_IERROR_AUTH_BAD_HMAC: | 4286 | case SCTP_IERROR_AUTH_BAD_HMAC: |
4281 | /* Generate the ERROR chunk and discard the rest | 4287 | /* Generate the ERROR chunk and discard the rest |
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index 84207ad33e8e..8cb7d9858270 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c | |||
@@ -715,7 +715,6 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, | |||
715 | return event; | 715 | return event; |
716 | 716 | ||
717 | fail_mark: | 717 | fail_mark: |
718 | sctp_chunk_put(chunk); | ||
719 | kfree_skb(skb); | 718 | kfree_skb(skb); |
720 | fail: | 719 | fail: |
721 | return NULL; | 720 | return NULL; |
diff --git a/net/tipc/node.c b/net/tipc/node.c index baaf93f12cbd..f29549de9245 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1950,6 +1950,7 @@ out: | |||
1950 | int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) | 1950 | int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) |
1951 | { | 1951 | { |
1952 | struct net *net = genl_info_net(info); | 1952 | struct net *net = genl_info_net(info); |
1953 | struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1]; | ||
1953 | struct tipc_nl_msg msg; | 1954 | struct tipc_nl_msg msg; |
1954 | char *name; | 1955 | char *name; |
1955 | int err; | 1956 | int err; |
@@ -1957,9 +1958,19 @@ int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) | |||
1957 | msg.portid = info->snd_portid; | 1958 | msg.portid = info->snd_portid; |
1958 | msg.seq = info->snd_seq; | 1959 | msg.seq = info->snd_seq; |
1959 | 1960 | ||
1960 | if (!info->attrs[TIPC_NLA_LINK_NAME]) | 1961 | if (!info->attrs[TIPC_NLA_LINK]) |
1961 | return -EINVAL; | 1962 | return -EINVAL; |
1962 | name = nla_data(info->attrs[TIPC_NLA_LINK_NAME]); | 1963 | |
1964 | err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, | ||
1965 | info->attrs[TIPC_NLA_LINK], | ||
1966 | tipc_nl_link_policy, info->extack); | ||
1967 | if (err) | ||
1968 | return err; | ||
1969 | |||
1970 | if (!attrs[TIPC_NLA_LINK_NAME]) | ||
1971 | return -EINVAL; | ||
1972 | |||
1973 | name = nla_data(attrs[TIPC_NLA_LINK_NAME]); | ||
1963 | 1974 | ||
1964 | msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 1975 | msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); |
1965 | if (!msg.skb) | 1976 | if (!msg.skb) |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 252a52ae0893..6be21575503a 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -1516,10 +1516,10 @@ static void tipc_sk_set_orig_addr(struct msghdr *m, struct sk_buff *skb) | |||
1516 | 1516 | ||
1517 | srcaddr->sock.family = AF_TIPC; | 1517 | srcaddr->sock.family = AF_TIPC; |
1518 | srcaddr->sock.addrtype = TIPC_ADDR_ID; | 1518 | srcaddr->sock.addrtype = TIPC_ADDR_ID; |
1519 | srcaddr->sock.scope = 0; | ||
1519 | srcaddr->sock.addr.id.ref = msg_origport(hdr); | 1520 | srcaddr->sock.addr.id.ref = msg_origport(hdr); |
1520 | srcaddr->sock.addr.id.node = msg_orignode(hdr); | 1521 | srcaddr->sock.addr.id.node = msg_orignode(hdr); |
1521 | srcaddr->sock.addr.name.domain = 0; | 1522 | srcaddr->sock.addr.name.domain = 0; |
1522 | srcaddr->sock.scope = 0; | ||
1523 | m->msg_namelen = sizeof(struct sockaddr_tipc); | 1523 | m->msg_namelen = sizeof(struct sockaddr_tipc); |
1524 | 1524 | ||
1525 | if (!msg_in_group(hdr)) | 1525 | if (!msg_in_group(hdr)) |
@@ -1528,6 +1528,7 @@ static void tipc_sk_set_orig_addr(struct msghdr *m, struct sk_buff *skb) | |||
1528 | /* Group message users may also want to know sending member's id */ | 1528 | /* Group message users may also want to know sending member's id */ |
1529 | srcaddr->member.family = AF_TIPC; | 1529 | srcaddr->member.family = AF_TIPC; |
1530 | srcaddr->member.addrtype = TIPC_ADDR_NAME; | 1530 | srcaddr->member.addrtype = TIPC_ADDR_NAME; |
1531 | srcaddr->member.scope = 0; | ||
1531 | srcaddr->member.addr.name.name.type = msg_nametype(hdr); | 1532 | srcaddr->member.addr.name.name.type = msg_nametype(hdr); |
1532 | srcaddr->member.addr.name.name.instance = TIPC_SKB_CB(skb)->orig_member; | 1533 | srcaddr->member.addr.name.name.instance = TIPC_SKB_CB(skb)->orig_member; |
1533 | srcaddr->member.addr.name.domain = 0; | 1534 | srcaddr->member.addr.name.domain = 0; |
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index cc03e00785c7..20cd93be6236 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c | |||
@@ -135,6 +135,7 @@ retry: | |||
135 | offset -= sg->offset; | 135 | offset -= sg->offset; |
136 | ctx->partially_sent_offset = offset; | 136 | ctx->partially_sent_offset = offset; |
137 | ctx->partially_sent_record = (void *)sg; | 137 | ctx->partially_sent_record = (void *)sg; |
138 | ctx->in_tcp_sendpages = false; | ||
138 | return ret; | 139 | return ret; |
139 | } | 140 | } |
140 | 141 | ||
@@ -248,16 +249,13 @@ static void tls_sk_proto_close(struct sock *sk, long timeout) | |||
248 | struct tls_context *ctx = tls_get_ctx(sk); | 249 | struct tls_context *ctx = tls_get_ctx(sk); |
249 | long timeo = sock_sndtimeo(sk, 0); | 250 | long timeo = sock_sndtimeo(sk, 0); |
250 | void (*sk_proto_close)(struct sock *sk, long timeout); | 251 | void (*sk_proto_close)(struct sock *sk, long timeout); |
252 | bool free_ctx = false; | ||
251 | 253 | ||
252 | lock_sock(sk); | 254 | lock_sock(sk); |
253 | sk_proto_close = ctx->sk_proto_close; | 255 | sk_proto_close = ctx->sk_proto_close; |
254 | 256 | ||
255 | if (ctx->conf == TLS_HW_RECORD) | 257 | if (ctx->conf == TLS_BASE || ctx->conf == TLS_HW_RECORD) { |
256 | goto skip_tx_cleanup; | 258 | free_ctx = true; |
257 | |||
258 | if (ctx->conf == TLS_BASE) { | ||
259 | kfree(ctx); | ||
260 | ctx = NULL; | ||
261 | goto skip_tx_cleanup; | 259 | goto skip_tx_cleanup; |
262 | } | 260 | } |
263 | 261 | ||
@@ -294,7 +292,7 @@ skip_tx_cleanup: | |||
294 | /* free ctx for TLS_HW_RECORD, used by tcp_set_state | 292 | /* free ctx for TLS_HW_RECORD, used by tcp_set_state |
295 | * for sk->sk_prot->unhash [tls_hw_unhash] | 293 | * for sk->sk_prot->unhash [tls_hw_unhash] |
296 | */ | 294 | */ |
297 | if (ctx && ctx->conf == TLS_HW_RECORD) | 295 | if (free_ctx) |
298 | kfree(ctx); | 296 | kfree(ctx); |
299 | } | 297 | } |
300 | 298 | ||
diff --git a/net/wireless/core.c b/net/wireless/core.c index a6f3cac8c640..c0fd8a85e7f7 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -95,6 +95,9 @@ static int cfg80211_dev_check_name(struct cfg80211_registered_device *rdev, | |||
95 | 95 | ||
96 | ASSERT_RTNL(); | 96 | ASSERT_RTNL(); |
97 | 97 | ||
98 | if (strlen(newname) > NL80211_WIPHY_NAME_MAXLEN) | ||
99 | return -EINVAL; | ||
100 | |||
98 | /* prohibit calling the thing phy%d when %d is not its number */ | 101 | /* prohibit calling the thing phy%d when %d is not its number */ |
99 | sscanf(newname, PHY_NAME "%d%n", &wiphy_idx, &taken); | 102 | sscanf(newname, PHY_NAME "%d%n", &wiphy_idx, &taken); |
100 | if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) { | 103 | if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index ff28f8feeb09..a052693c2e85 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -9214,6 +9214,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) | |||
9214 | 9214 | ||
9215 | if (nla_get_flag(info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])) { | 9215 | if (nla_get_flag(info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])) { |
9216 | if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) { | 9216 | if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) { |
9217 | kzfree(connkeys); | ||
9217 | GENL_SET_ERR_MSG(info, | 9218 | GENL_SET_ERR_MSG(info, |
9218 | "external auth requires connection ownership"); | 9219 | "external auth requires connection ownership"); |
9219 | return -EINVAL; | 9220 | return -EINVAL; |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 16c7e4ef5820..ac3e12c32aa3 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1026,6 +1026,7 @@ static int regdb_query_country(const struct fwdb_header *db, | |||
1026 | 1026 | ||
1027 | if (!tmp_rd) { | 1027 | if (!tmp_rd) { |
1028 | kfree(regdom); | 1028 | kfree(regdom); |
1029 | kfree(wmm_ptrs); | ||
1029 | return -ENOMEM; | 1030 | return -ENOMEM; |
1030 | } | 1031 | } |
1031 | regdom = tmp_rd; | 1032 | regdom = tmp_rd; |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index f9d2f2233f09..6c177ae7a6d9 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -2175,6 +2175,12 @@ struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family) | |||
2175 | return afinfo; | 2175 | return afinfo; |
2176 | } | 2176 | } |
2177 | 2177 | ||
2178 | void xfrm_flush_gc(void) | ||
2179 | { | ||
2180 | flush_work(&xfrm_state_gc_work); | ||
2181 | } | ||
2182 | EXPORT_SYMBOL(xfrm_flush_gc); | ||
2183 | |||
2178 | /* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */ | 2184 | /* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */ |
2179 | void xfrm_state_delete_tunnel(struct xfrm_state *x) | 2185 | void xfrm_state_delete_tunnel(struct xfrm_state *x) |
2180 | { | 2186 | { |
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index daf5effec3f0..3ff81a478dbe 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile | |||
@@ -6,7 +6,7 @@ CFLAGS += -I../../../../usr/include/ | |||
6 | 6 | ||
7 | TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh | 7 | TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh |
8 | TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh | 8 | TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh |
9 | TEST_GEN_PROGS_EXTENDED := in_netns.sh | 9 | TEST_PROGS_EXTENDED := in_netns.sh |
10 | TEST_GEN_FILES = socket | 10 | TEST_GEN_FILES = socket |
11 | TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy | 11 | TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy |
12 | TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa | 12 | TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa |
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json b/tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json index 5b012f4981d4..6f289a49e5ec 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json | |||
@@ -66,7 +66,7 @@ | |||
66 | "cmdUnderTest": "$TC action add action bpf object-file _b.o index 667", | 66 | "cmdUnderTest": "$TC action add action bpf object-file _b.o index 667", |
67 | "expExitCode": "0", | 67 | "expExitCode": "0", |
68 | "verifyCmd": "$TC action get action bpf index 667", | 68 | "verifyCmd": "$TC action get action bpf index 667", |
69 | "matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id [0-9]* tag 3b185187f1855c4c default-action pipe.*index 667 ref", | 69 | "matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id [0-9]* tag 3b185187f1855c4c( jited)? default-action pipe.*index 667 ref", |
70 | "matchCount": "1", | 70 | "matchCount": "1", |
71 | "teardown": [ | 71 | "teardown": [ |
72 | "$TC action flush action bpf", | 72 | "$TC action flush action bpf", |
@@ -92,10 +92,15 @@ | |||
92 | "cmdUnderTest": "$TC action add action bpf object-file _c.o index 667", | 92 | "cmdUnderTest": "$TC action add action bpf object-file _c.o index 667", |
93 | "expExitCode": "255", | 93 | "expExitCode": "255", |
94 | "verifyCmd": "$TC action get action bpf index 667", | 94 | "verifyCmd": "$TC action get action bpf index 667", |
95 | "matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id [0-9].*index 667 ref", | 95 | "matchPattern": "action order [0-9]*: bpf _c.o:\\[action\\] id [0-9].*index 667 ref", |
96 | "matchCount": "0", | 96 | "matchCount": "0", |
97 | "teardown": [ | 97 | "teardown": [ |
98 | "$TC action flush action bpf", | 98 | [ |
99 | "$TC action flush action bpf", | ||
100 | 0, | ||
101 | 1, | ||
102 | 255 | ||
103 | ], | ||
99 | "rm -f _c.o" | 104 | "rm -f _c.o" |
100 | ] | 105 | ] |
101 | }, | 106 | }, |