Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) Limit the number of can filters to avoid > MAX_ORDER allocations.
Fix from Marc Kleine-Budde.

2) Limit GSO max size in netvsc driver to avoid problems with NVGRE
configurations. From Stephen Hemminger.

3) Return proper error when memory allocation fails in
ser_gigaset_init(), from Dan Carpenter.

4) Missing linkage undo in error paths of ipvlan_link_new(), from Gao
Feng.

5) Missing necessayr SET_NETDEV_DEV in lantiq and cpmac drivers, from
Florian Fainelli.

6) Handle probe deferral properly in smsc911x driver.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
net: mlx5: Fix Kconfig help text
net: smsc911x: back out silently on probe deferrals
ibmveth: set correct gso_size and gso_type
net: ethernet: cpmac: Call SET_NETDEV_DEV()
net: ethernet: lantiq_etop: Call SET_NETDEV_DEV()
vhost-vsock: fix orphan connection reset
cxgb4/cxgb4vf: Assign netdev->dev_port with port ID
driver: ipvlan: Unlink the upper dev when ipvlan_link_new failed
ser_gigaset: return -ENOMEM on error instead of success
NET: usb: cdc_mbim: add quirk for supporting Telit LE922A
can: peak: fix bad memory access and free sequence
phy: Don't increment MDIO bus refcount unless it's a different owner
netvsc: reduce maximum GSO size
drivers: net: cpsw-phy-sel: Clear RGMII_IDMODE on "rgmii" links
can: raw: raw_setsockopt: limit number of can_filter that can be set

+142 -20
+3 -1
drivers/isdn/gigaset/ser-gigaset.c
··· 755 755 driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, 756 756 GIGASET_MODULENAME, GIGASET_DEVNAME, 757 757 &ops, THIS_MODULE); 758 - if (!driver) 758 + if (!driver) { 759 + rc = -ENOMEM; 759 760 goto error; 761 + } 760 762 761 763 rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc); 762 764 if (rc != 0) {
+4 -2
drivers/net/can/usb/peak_usb/pcan_usb_core.c
··· 870 870 static void peak_usb_disconnect(struct usb_interface *intf) 871 871 { 872 872 struct peak_usb_device *dev; 873 + struct peak_usb_device *dev_prev_siblings; 873 874 874 875 /* unregister as many netdev devices as siblings */ 875 - for (dev = usb_get_intfdata(intf); dev; dev = dev->prev_siblings) { 876 + for (dev = usb_get_intfdata(intf); dev; dev = dev_prev_siblings) { 876 877 struct net_device *netdev = dev->netdev; 877 878 char name[IFNAMSIZ]; 878 879 880 + dev_prev_siblings = dev->prev_siblings; 879 881 dev->state &= ~PCAN_USB_STATE_CONNECTED; 880 882 strncpy(name, netdev->name, IFNAMSIZ); 881 883 882 884 unregister_netdev(netdev); 883 - free_candev(netdev); 884 885 885 886 kfree(dev->cmd_buf); 886 887 dev->next_siblings = NULL; 887 888 if (dev->adapter->dev_free) 888 889 dev->adapter->dev_free(dev); 889 890 891 + free_candev(netdev); 890 892 dev_info(&intf->dev, "%s removed\n", name); 891 893 } 892 894
+1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 4931 4931 */ 4932 4932 for_each_port(adapter, i) { 4933 4933 pi = adap2pinfo(adapter, i); 4934 + adapter->port[i]->dev_port = pi->lport; 4934 4935 netif_set_real_num_tx_queues(adapter->port[i], pi->nqsets); 4935 4936 netif_set_real_num_rx_queues(adapter->port[i], pi->nqsets); 4936 4937
-1
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
··· 7851 7851 return ret; 7852 7852 7853 7853 memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN); 7854 - adap->port[i]->dev_port = j; 7855 7854 j++; 7856 7855 } 7857 7856 return 0;
+1
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
··· 2969 2969 2970 2970 netdev->netdev_ops = &cxgb4vf_netdev_ops; 2971 2971 netdev->ethtool_ops = &cxgb4vf_ethtool_ops; 2972 + netdev->dev_port = pi->port_id; 2972 2973 2973 2974 /* 2974 2975 * Initialize the hardware/software state for the port.
+63 -2
drivers/net/ethernet/ibm/ibmveth.c
··· 58 58 59 59 static const char ibmveth_driver_name[] = "ibmveth"; 60 60 static const char ibmveth_driver_string[] = "IBM Power Virtual Ethernet Driver"; 61 - #define ibmveth_driver_version "1.05" 61 + #define ibmveth_driver_version "1.06" 62 62 63 63 MODULE_AUTHOR("Santiago Leon <santil@linux.vnet.ibm.com>"); 64 64 MODULE_DESCRIPTION("IBM Power Virtual Ethernet Driver"); ··· 135 135 static inline int ibmveth_rxq_frame_offset(struct ibmveth_adapter *adapter) 136 136 { 137 137 return ibmveth_rxq_flags(adapter) & IBMVETH_RXQ_OFF_MASK; 138 + } 139 + 140 + static inline int ibmveth_rxq_large_packet(struct ibmveth_adapter *adapter) 141 + { 142 + return ibmveth_rxq_flags(adapter) & IBMVETH_RXQ_LRG_PKT; 138 143 } 139 144 140 145 static inline int ibmveth_rxq_frame_length(struct ibmveth_adapter *adapter) ··· 1179 1174 goto retry_bounce; 1180 1175 } 1181 1176 1177 + static void ibmveth_rx_mss_helper(struct sk_buff *skb, u16 mss, int lrg_pkt) 1178 + { 1179 + int offset = 0; 1180 + 1181 + /* only TCP packets will be aggregated */ 1182 + if (skb->protocol == htons(ETH_P_IP)) { 1183 + struct iphdr *iph = (struct iphdr *)skb->data; 1184 + 1185 + if (iph->protocol == IPPROTO_TCP) { 1186 + offset = iph->ihl * 4; 1187 + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; 1188 + } else { 1189 + return; 1190 + } 1191 + } else if (skb->protocol == htons(ETH_P_IPV6)) { 1192 + struct ipv6hdr *iph6 = (struct ipv6hdr *)skb->data; 1193 + 1194 + if (iph6->nexthdr == IPPROTO_TCP) { 1195 + offset = sizeof(struct ipv6hdr); 1196 + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; 1197 + } else { 1198 + return; 1199 + } 1200 + } else { 1201 + return; 1202 + } 1203 + /* if mss is not set through Large Packet bit/mss in rx buffer, 1204 + * expect that the mss will be written to the tcp header checksum. 1205 + */ 1206 + if (lrg_pkt) { 1207 + skb_shinfo(skb)->gso_size = mss; 1208 + } else if (offset) { 1209 + struct tcphdr *tcph = (struct tcphdr *)(skb->data + offset); 1210 + 1211 + skb_shinfo(skb)->gso_size = ntohs(tcph->check); 1212 + tcph->check = 0; 1213 + } 1214 + } 1215 + 1182 1216 static int ibmveth_poll(struct napi_struct *napi, int budget) 1183 1217 { 1184 1218 struct ibmveth_adapter *adapter = ··· 1226 1182 int frames_processed = 0; 1227 1183 unsigned long lpar_rc; 1228 1184 struct iphdr *iph; 1185 + u16 mss = 0; 1229 1186 1230 1187 restart_poll: 1231 1188 while (frames_processed < budget) { ··· 1244 1199 int length = ibmveth_rxq_frame_length(adapter); 1245 1200 int offset = ibmveth_rxq_frame_offset(adapter); 1246 1201 int csum_good = ibmveth_rxq_csum_good(adapter); 1202 + int lrg_pkt = ibmveth_rxq_large_packet(adapter); 1247 1203 1248 1204 skb = ibmveth_rxq_get_buffer(adapter); 1205 + 1206 + /* if the large packet bit is set in the rx queue 1207 + * descriptor, the mss will be written by PHYP eight 1208 + * bytes from the start of the rx buffer, which is 1209 + * skb->data at this stage 1210 + */ 1211 + if (lrg_pkt) { 1212 + __be64 *rxmss = (__be64 *)(skb->data + 8); 1213 + 1214 + mss = (u16)be64_to_cpu(*rxmss); 1215 + } 1249 1216 1250 1217 new_skb = NULL; 1251 1218 if (length < rx_copybreak) ··· 1292 1235 if (iph->check == 0xffff) { 1293 1236 iph->check = 0; 1294 1237 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 1295 - adapter->rx_large_packets++; 1296 1238 } 1297 1239 } 1240 + } 1241 + 1242 + if (length > netdev->mtu + ETH_HLEN) { 1243 + ibmveth_rx_mss_helper(skb, mss, lrg_pkt); 1244 + adapter->rx_large_packets++; 1298 1245 } 1299 1246 1300 1247 napi_gro_receive(napi, skb); /* send it up */
+1
drivers/net/ethernet/ibm/ibmveth.h
··· 209 209 #define IBMVETH_RXQ_TOGGLE 0x80000000 210 210 #define IBMVETH_RXQ_TOGGLE_SHIFT 31 211 211 #define IBMVETH_RXQ_VALID 0x40000000 212 + #define IBMVETH_RXQ_LRG_PKT 0x04000000 212 213 #define IBMVETH_RXQ_NO_CSUM 0x02000000 213 214 #define IBMVETH_RXQ_CSUM_GOOD 0x01000000 214 215 #define IBMVETH_RXQ_OFF_MASK 0x0000FFFF
+1
drivers/net/ethernet/lantiq_etop.c
··· 704 704 priv->pldata = dev_get_platdata(&pdev->dev); 705 705 priv->netdev = dev; 706 706 spin_lock_init(&priv->lock); 707 + SET_NETDEV_DEV(dev, &pdev->dev); 707 708 708 709 for (i = 0; i < MAX_DMA_CHAN; i++) { 709 710 if (IS_TX(i))
-2
drivers/net/ethernet/mellanox/mlx5/core/Kconfig
··· 18 18 default n 19 19 ---help--- 20 20 Ethernet support in Mellanox Technologies ConnectX-4 NIC. 21 - Ethernet and Infiniband support in ConnectX-4 are currently mutually 22 - exclusive. 23 21 24 22 config MLX5_CORE_EN_DCB 25 23 bool "Data Center Bridging (DCB) Support"
+8 -1
drivers/net/ethernet/smsc/smsc911x.c
··· 438 438 ret = regulator_bulk_get(&pdev->dev, 439 439 ARRAY_SIZE(pdata->supplies), 440 440 pdata->supplies); 441 - if (ret) 441 + if (ret) { 442 + /* 443 + * Retry on deferrals, else just report the error 444 + * and try to continue. 445 + */ 446 + if (ret == -EPROBE_DEFER) 447 + return ret; 442 448 netdev_err(ndev, "couldn't get regulators %d\n", 443 449 ret); 450 + } 444 451 445 452 /* Request optional RESET GPIO */ 446 453 pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
+1
drivers/net/ethernet/ti/cpmac.c
··· 1113 1113 if (!dev) 1114 1114 return -ENOMEM; 1115 1115 1116 + SET_NETDEV_DEV(dev, &pdev->dev); 1116 1117 platform_set_drvdata(pdev, dev); 1117 1118 priv = netdev_priv(dev); 1118 1119
+1
drivers/net/ethernet/ti/cpsw-phy-sel.c
··· 81 81 }; 82 82 83 83 mask = GMII_SEL_MODE_MASK << (slave * 2) | BIT(slave + 6); 84 + mask |= BIT(slave + 4); 84 85 mode <<= slave * 2; 85 86 86 87 if (priv->rmii_clock_external) {
+5
drivers/net/hyperv/netvsc_drv.c
··· 47 47 NETIF_F_TSO | \ 48 48 NETIF_F_TSO6 | \ 49 49 NETIF_F_HW_CSUM) 50 + 51 + /* Restrict GSO size to account for NVGRE */ 52 + #define NETVSC_GSO_MAX_SIZE 62768 53 + 50 54 static int ring_size = 128; 51 55 module_param(ring_size, int, S_IRUGO); 52 56 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); ··· 1404 1400 nvdev = net_device_ctx->nvdev; 1405 1401 netif_set_real_num_tx_queues(net, nvdev->num_chn); 1406 1402 netif_set_real_num_rx_queues(net, nvdev->num_chn); 1403 + netif_set_gso_max_size(net, NETVSC_GSO_MAX_SIZE); 1407 1404 1408 1405 ret = register_netdev(net); 1409 1406 if (ret != 0) {
+3 -1
drivers/net/ipvlan/ipvlan_main.c
··· 546 546 } 547 547 err = ipvlan_set_port_mode(port, mode); 548 548 if (err) { 549 - goto unregister_netdev; 549 + goto unlink_netdev; 550 550 } 551 551 552 552 list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans); 553 553 netif_stacked_transfer_operstate(phy_dev, dev); 554 554 return 0; 555 555 556 + unlink_netdev: 557 + netdev_upper_dev_unlink(phy_dev, dev); 556 558 unregister_netdev: 557 559 unregister_netdevice(dev); 558 560 destroy_ipvlan_port:
+13 -3
drivers/net/phy/phy_device.c
··· 857 857 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, 858 858 u32 flags, phy_interface_t interface) 859 859 { 860 + struct module *ndev_owner = dev->dev.parent->driver->owner; 860 861 struct mii_bus *bus = phydev->mdio.bus; 861 862 struct device *d = &phydev->mdio.dev; 862 863 int err; 863 864 864 - if (!try_module_get(bus->owner)) { 865 + /* For Ethernet device drivers that register their own MDIO bus, we 866 + * will have bus->owner match ndev_mod, so we do not want to increment 867 + * our own module->refcnt here, otherwise we would not be able to 868 + * unload later on. 869 + */ 870 + if (ndev_owner != bus->owner && !try_module_get(bus->owner)) { 865 871 dev_err(&dev->dev, "failed to get the bus module\n"); 866 872 return -EIO; 867 873 } ··· 927 921 928 922 error: 929 923 put_device(d); 930 - module_put(bus->owner); 924 + if (ndev_owner != bus->owner) 925 + module_put(bus->owner); 931 926 return err; 932 927 } 933 928 EXPORT_SYMBOL(phy_attach_direct); ··· 978 971 */ 979 972 void phy_detach(struct phy_device *phydev) 980 973 { 974 + struct net_device *dev = phydev->attached_dev; 975 + struct module *ndev_owner = dev->dev.parent->driver->owner; 981 976 struct mii_bus *bus; 982 977 int i; 983 978 ··· 1007 998 bus = phydev->mdio.bus; 1008 999 1009 1000 put_device(&phydev->mdio.dev); 1010 - module_put(bus->owner); 1001 + if (ndev_owner != bus->owner) 1002 + module_put(bus->owner); 1011 1003 } 1012 1004 EXPORT_SYMBOL(phy_detach); 1013 1005
+21
drivers/net/usb/cdc_mbim.c
··· 602 602 .data = CDC_NCM_FLAG_NDP_TO_END, 603 603 }; 604 604 605 + /* Some modems (e.g. Telit LE922A6) do not work properly with altsetting 606 + * toggle done in cdc_ncm_bind_common. CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 607 + * flag is used to avoid this procedure. 608 + */ 609 + static const struct driver_info cdc_mbim_info_avoid_altsetting_toggle = { 610 + .description = "CDC MBIM", 611 + .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN, 612 + .bind = cdc_mbim_bind, 613 + .unbind = cdc_mbim_unbind, 614 + .manage_power = cdc_mbim_manage_power, 615 + .rx_fixup = cdc_mbim_rx_fixup, 616 + .tx_fixup = cdc_mbim_tx_fixup, 617 + .data = CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE, 618 + }; 619 + 605 620 static const struct usb_device_id mbim_devs[] = { 606 621 /* This duplicate NCM entry is intentional. MBIM devices can 607 622 * be disguised as NCM by default, and this is necessary to ··· 641 626 { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), 642 627 .driver_info = (unsigned long)&cdc_mbim_info_ndp_to_end, 643 628 }, 629 + 630 + /* Telit LE922A6 in MBIM composition */ 631 + { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1041, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), 632 + .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle, 633 + }, 634 + 644 635 /* default entry */ 645 636 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), 646 637 .driver_info = (unsigned long)&cdc_mbim_info_zlp,
+9 -5
drivers/net/usb/cdc_ncm.c
··· 839 839 840 840 iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber; 841 841 842 + /* Device-specific flags */ 843 + ctx->drvflags = drvflags; 844 + 842 845 /* Reset data interface. Some devices will not reset properly 843 846 * unless they are configured first. Toggle the altsetting to 844 - * force a reset 847 + * force a reset. 848 + * Some other devices do not work properly with this procedure 849 + * that can be avoided using quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 845 850 */ 846 - usb_set_interface(dev->udev, iface_no, data_altsetting); 851 + if (!(ctx->drvflags & CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE)) 852 + usb_set_interface(dev->udev, iface_no, data_altsetting); 853 + 847 854 temp = usb_set_interface(dev->udev, iface_no, 0); 848 855 if (temp) { 849 856 dev_dbg(&intf->dev, "set interface failed\n"); ··· 896 889 897 890 /* finish setting up the device specific data */ 898 891 cdc_ncm_setup(dev); 899 - 900 - /* Device-specific flags */ 901 - ctx->drvflags = drvflags; 902 892 903 893 /* Allocate the delayed NDP if needed. */ 904 894 if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) {
+1 -1
drivers/vhost/vsock.c
··· 506 506 * executing. 507 507 */ 508 508 509 - if (!vhost_vsock_get(vsk->local_addr.svm_cid)) { 509 + if (!vhost_vsock_get(vsk->remote_addr.svm_cid)) { 510 510 sock_set_flag(sk, SOCK_DONE); 511 511 vsk->peer_shutdown = SHUTDOWN_MASK; 512 512 sk->sk_state = SS_UNCONNECTED;
+2 -1
include/linux/usb/cdc_ncm.h
··· 81 81 #define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC) 82 82 83 83 /* Driver flags */ 84 - #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */ 84 + #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */ 85 + #define CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 0x04 /* Avoid altsetting toggle during init */ 85 86 86 87 #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ 87 88 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
+1
include/uapi/linux/can.h
··· 196 196 }; 197 197 198 198 #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ 199 + #define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */ 199 200 200 201 #endif /* !_UAPI_CAN_H */
+3
net/can/raw.c
··· 499 499 if (optlen % sizeof(struct can_filter) != 0) 500 500 return -EINVAL; 501 501 502 + if (optlen > CAN_RAW_FILTER_MAX * sizeof(struct can_filter)) 503 + return -EINVAL; 504 + 502 505 count = optlen / sizeof(struct can_filter); 503 506 504 507 if (count > 1) {