aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-10-16 14:42:51 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-16 14:42:51 -0400
commit3331177cbde01e03e2eae7aee13ad87fffd7be42 (patch)
tree7adb7e47650db14b864e21d7bc31e54ad6914c72
parentf5b720b85944413491df106f05a784cd1714436e (diff)
parent600a507ddcb99096731e1d96a3ebf43e20fc7f80 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2014-10-16 This series contains updates to fm10k and ixgbe. Matthew provides two fixes for fm10k, first sets the flag to fetch the host state before kicking off the service task that reads the host state when bringing the interface up. The second makes sure that we release the mailbox lock after detecting an error and before we return the error code. Andy Zhou provides a compile fix for fm10k, when the driver is compiled into the kernel and the VXLAN driver is compiled as a module. Emil provides a fix for ixgbe to prevent against a panic by trying to dereference a NULL pointer in ixgbe_ndo_set_vf_spoofchk(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/Kconfig11
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_netdev.c13
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_pci.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c3
-rw-r--r--drivers/net/vxlan.c14
-rw-r--r--net/openvswitch/vport-geneve.c2
-rw-r--r--net/openvswitch/vport.c4
7 files changed, 32 insertions, 16 deletions
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 6919adb66f53..5b8300a32bf5 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -320,4 +320,15 @@ config FM10K
320 To compile this driver as a module, choose M here. The module 320 To compile this driver as a module, choose M here. The module
321 will be called fm10k. MSI-X interrupt support is required 321 will be called fm10k. MSI-X interrupt support is required
322 322
323config FM10K_VXLAN
324 bool "Virtual eXtensible Local Area Network Support"
325 default n
326 depends on FM10K && VXLAN && !(FM10K=y && VXLAN=m)
327 ---help---
328 This allows one to create VXLAN virtual interfaces that provide
329 Layer 2 Networks over Layer 3 Networks. VXLAN is often used
330 to tunnel virtual network infrastructure in virtualized environments.
331 Say Y here if you want to use Virtual eXtensible Local Area Network
332 (VXLAN) in the driver.
333
323endif # NET_VENDOR_INTEL 334endif # NET_VENDOR_INTEL
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index bf44a8fe711f..8811364b91cb 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -20,9 +20,9 @@
20 20
21#include "fm10k.h" 21#include "fm10k.h"
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#if IS_ENABLED(CONFIG_VXLAN) 23#if IS_ENABLED(CONFIG_FM10K_VXLAN)
24#include <net/vxlan.h> 24#include <net/vxlan.h>
25#endif /* CONFIG_VXLAN */ 25#endif /* CONFIG_FM10K_VXLAN */
26 26
27/** 27/**
28 * fm10k_setup_tx_resources - allocate Tx resources (Descriptors) 28 * fm10k_setup_tx_resources - allocate Tx resources (Descriptors)
@@ -556,7 +556,7 @@ int fm10k_open(struct net_device *netdev)
556 if (err) 556 if (err)
557 goto err_set_queues; 557 goto err_set_queues;
558 558
559#if IS_ENABLED(CONFIG_VXLAN) 559#if IS_ENABLED(CONFIG_FM10K_VXLAN)
560 /* update VXLAN port configuration */ 560 /* update VXLAN port configuration */
561 vxlan_get_rx_port(netdev); 561 vxlan_get_rx_port(netdev);
562 562
@@ -785,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
785 if (!(netdev->flags & IFF_PROMISC)) { 785 if (!(netdev->flags & IFF_PROMISC)) {
786 err = hw->mac.ops.update_vlan(hw, vid, 0, set); 786 err = hw->mac.ops.update_vlan(hw, vid, 0, set);
787 if (err) 787 if (err)
788 return err; 788 goto err_out;
789 } 789 }
790 790
791 /* update our base MAC address */ 791 /* update our base MAC address */
792 err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr, 792 err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr,
793 vid, set, 0); 793 vid, set, 0);
794 if (err) 794 if (err)
795 return err; 795 goto err_out;
796 796
797 /* set vid prior to syncing/unsyncing the VLAN */ 797 /* set vid prior to syncing/unsyncing the VLAN */
798 interface->vid = vid + (set ? VLAN_N_VID : 0); 798 interface->vid = vid + (set ? VLAN_N_VID : 0);
@@ -801,9 +801,10 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
801 __dev_uc_unsync(netdev, fm10k_uc_vlan_unsync); 801 __dev_uc_unsync(netdev, fm10k_uc_vlan_unsync);
802 __dev_mc_unsync(netdev, fm10k_mc_vlan_unsync); 802 __dev_mc_unsync(netdev, fm10k_mc_vlan_unsync);
803 803
804err_out:
804 fm10k_mbx_unlock(interface); 805 fm10k_mbx_unlock(interface);
805 806
806 return 0; 807 return err;
807} 808}
808 809
809static int fm10k_vlan_rx_add_vid(struct net_device *netdev, 810static int fm10k_vlan_rx_add_vid(struct net_device *netdev,
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index e02036c427b9..a0cb74ab3dc6 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1489,6 +1489,7 @@ void fm10k_up(struct fm10k_intfc *interface)
1489 netif_tx_start_all_queues(interface->netdev); 1489 netif_tx_start_all_queues(interface->netdev);
1490 1490
1491 /* kick off the service timer */ 1491 /* kick off the service timer */
1492 hw->mac.get_host_state = 1;
1492 mod_timer(&interface->service_timer, jiffies); 1493 mod_timer(&interface->service_timer, jiffies);
1493} 1494}
1494 1495
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 706fc69aa0c5..97c85b859536 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -1261,6 +1261,9 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)
1261 struct ixgbe_hw *hw = &adapter->hw; 1261 struct ixgbe_hw *hw = &adapter->hw;
1262 u32 regval; 1262 u32 regval;
1263 1263
1264 if (vf >= adapter->num_vfs)
1265 return -EINVAL;
1266
1264 adapter->vfinfo[vf].spoofchk_enabled = setting; 1267 adapter->vfinfo[vf].spoofchk_enabled = setting;
1265 1268
1266 regval = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg)); 1269 regval = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg));
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 2a51e6e48e1e..77ab844cd8ae 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1437,9 +1437,6 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
1437 if (!in6_dev) 1437 if (!in6_dev)
1438 goto out; 1438 goto out;
1439 1439
1440 if (!pskb_may_pull(skb, skb->len))
1441 goto out;
1442
1443 iphdr = ipv6_hdr(skb); 1440 iphdr = ipv6_hdr(skb);
1444 saddr = &iphdr->saddr; 1441 saddr = &iphdr->saddr;
1445 daddr = &iphdr->daddr; 1442 daddr = &iphdr->daddr;
@@ -1668,6 +1665,8 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
1668 struct pcpu_sw_netstats *tx_stats, *rx_stats; 1665 struct pcpu_sw_netstats *tx_stats, *rx_stats;
1669 union vxlan_addr loopback; 1666 union vxlan_addr loopback;
1670 union vxlan_addr *remote_ip = &dst_vxlan->default_dst.remote_ip; 1667 union vxlan_addr *remote_ip = &dst_vxlan->default_dst.remote_ip;
1668 struct net_device *dev = skb->dev;
1669 int len = skb->len;
1671 1670
1672 tx_stats = this_cpu_ptr(src_vxlan->dev->tstats); 1671 tx_stats = this_cpu_ptr(src_vxlan->dev->tstats);
1673 rx_stats = this_cpu_ptr(dst_vxlan->dev->tstats); 1672 rx_stats = this_cpu_ptr(dst_vxlan->dev->tstats);
@@ -1691,16 +1690,16 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
1691 1690
1692 u64_stats_update_begin(&tx_stats->syncp); 1691 u64_stats_update_begin(&tx_stats->syncp);
1693 tx_stats->tx_packets++; 1692 tx_stats->tx_packets++;
1694 tx_stats->tx_bytes += skb->len; 1693 tx_stats->tx_bytes += len;
1695 u64_stats_update_end(&tx_stats->syncp); 1694 u64_stats_update_end(&tx_stats->syncp);
1696 1695
1697 if (netif_rx(skb) == NET_RX_SUCCESS) { 1696 if (netif_rx(skb) == NET_RX_SUCCESS) {
1698 u64_stats_update_begin(&rx_stats->syncp); 1697 u64_stats_update_begin(&rx_stats->syncp);
1699 rx_stats->rx_packets++; 1698 rx_stats->rx_packets++;
1700 rx_stats->rx_bytes += skb->len; 1699 rx_stats->rx_bytes += len;
1701 u64_stats_update_end(&rx_stats->syncp); 1700 u64_stats_update_end(&rx_stats->syncp);
1702 } else { 1701 } else {
1703 skb->dev->stats.rx_dropped++; 1702 dev->stats.rx_dropped++;
1704 } 1703 }
1705} 1704}
1706 1705
@@ -1878,7 +1877,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
1878 return arp_reduce(dev, skb); 1877 return arp_reduce(dev, skb);
1879#if IS_ENABLED(CONFIG_IPV6) 1878#if IS_ENABLED(CONFIG_IPV6)
1880 else if (ntohs(eth->h_proto) == ETH_P_IPV6 && 1879 else if (ntohs(eth->h_proto) == ETH_P_IPV6 &&
1881 skb->len >= sizeof(struct ipv6hdr) + sizeof(struct nd_msg) && 1880 pskb_may_pull(skb, sizeof(struct ipv6hdr)
1881 + sizeof(struct nd_msg)) &&
1882 ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) { 1882 ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) {
1883 struct nd_msg *msg; 1883 struct nd_msg *msg;
1884 1884
diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c
index 910b3ef2c0d5..106a9d80b663 100644
--- a/net/openvswitch/vport-geneve.c
+++ b/net/openvswitch/vport-geneve.c
@@ -30,7 +30,7 @@
30 30
31/** 31/**
32 * struct geneve_port - Keeps track of open UDP ports 32 * struct geneve_port - Keeps track of open UDP ports
33 * @sock: The socket created for this port number. 33 * @gs: The socket created for this port number.
34 * @name: vport name. 34 * @name: vport name.
35 */ 35 */
36struct geneve_port { 36struct geneve_port {
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 53001b020ca7..6015802ebe6f 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -408,13 +408,13 @@ int ovs_vport_get_upcall_portids(const struct vport *vport,
408 * 408 *
409 * Returns the portid of the target socket. Must be called with rcu_read_lock. 409 * Returns the portid of the target socket. Must be called with rcu_read_lock.
410 */ 410 */
411u32 ovs_vport_find_upcall_portid(const struct vport *p, struct sk_buff *skb) 411u32 ovs_vport_find_upcall_portid(const struct vport *vport, struct sk_buff *skb)
412{ 412{
413 struct vport_portids *ids; 413 struct vport_portids *ids;
414 u32 ids_index; 414 u32 ids_index;
415 u32 hash; 415 u32 hash;
416 416
417 ids = rcu_dereference(p->upcall_portids); 417 ids = rcu_dereference(vport->upcall_portids);
418 418
419 if (ids->n_ids == 1 && ids->ids[0] == 0) 419 if (ids->n_ids == 1 && ids->ids[0] == 0)
420 return 0; 420 return 0;