Skip to content

Commit f290040

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2016-08-20 This series contains updates to ixgbe and ixgbevf. Veola fixes how the backplane reports the media in ethtool, as KR, KX or KX4 based on the backplane interface present. Emil fixes ixgbevf since an incorrect size parameter for ixgbevf_write_msg_read_ack() ended up only giving the PF the first 4 bytes of the MAC address, so correct the size by calculating it on the fly for all instances where we call ixgbevf_write_msg_read_ack(). Added geneve receive offload support for x550em_a. Don fixes the LED interface for x557 since it uses a different interface. Added support for the new x557 copper device. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 8238ac0 + 92ed843 commit f290040

File tree

7 files changed

+217
-61
lines changed

7 files changed

+217
-61
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ struct ixgbe_adapter {
645645
#define IXGBE_FLAG_RX_HWTSTAMP_ENABLED BIT(25)
646646
#define IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER BIT(26)
647647
#define IXGBE_FLAG_DCB_CAPABLE BIT(27)
648+
#define IXGBE_FLAG_GENEVE_OFFLOAD_CAPABLE BIT(28)
648649

649650
u32 flags2;
650651
#define IXGBE_FLAG2_RSC_CAPABLE BIT(0)
@@ -658,7 +659,7 @@ struct ixgbe_adapter {
658659
#define IXGBE_FLAG2_RSS_FIELD_IPV6_UDP BIT(9)
659660
#define IXGBE_FLAG2_PTP_PPS_ENABLED BIT(10)
660661
#define IXGBE_FLAG2_PHY_INTERRUPT BIT(11)
661-
#define IXGBE_FLAG2_VXLAN_REREG_NEEDED BIT(12)
662+
#define IXGBE_FLAG2_UDP_TUN_REREG_NEEDED BIT(12)
662663
#define IXGBE_FLAG2_VLAN_PROMISC BIT(13)
663664

664665
/* Tx fast path data */
@@ -672,6 +673,7 @@ struct ixgbe_adapter {
672673

673674
/* Port number used to identify VXLAN traffic */
674675
__be16 vxlan_port;
676+
__be16 geneve_port;
675677

676678
/* TX */
677679
struct ixgbe_ring *tx_ring[MAX_TX_QUEUES] ____cacheline_aligned_in_smp;

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ bool ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
9999
case IXGBE_DEV_ID_X550T:
100100
case IXGBE_DEV_ID_X550T1:
101101
case IXGBE_DEV_ID_X550EM_X_10G_T:
102+
case IXGBE_DEV_ID_X550EM_A_10G_T:
102103
supported = true;
103104
break;
104105
default:

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ static int ixgbe_get_settings(struct net_device *netdev,
193193
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
194194
ecmd->supported |= ixgbe_get_supported_10gtypes(hw);
195195
if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
196-
ecmd->supported |= SUPPORTED_1000baseT_Full;
196+
ecmd->supported |= (ixgbe_isbackplane(hw->phy.media_type)) ?
197+
SUPPORTED_1000baseKX_Full :
198+
SUPPORTED_1000baseT_Full;
197199
if (supported_link & IXGBE_LINK_SPEED_100_FULL)
198200
ecmd->supported |= ixgbe_isbackplane(hw->phy.media_type) ?
199201
SUPPORTED_1000baseKX_Full :

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 125 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static const struct pci_device_id ixgbe_pci_tbl[] = {
137137
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP_N), board_x550em_a },
138138
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SGMII), board_x550em_a },
139139
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SGMII_L), board_x550em_a },
140+
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_10G_T), board_x550em_a},
140141
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP), board_x550em_a },
141142
/* required last entry */
142143
{0, }
@@ -1495,7 +1496,6 @@ static inline void ixgbe_rx_checksum(struct ixgbe_ring *ring,
14951496
struct sk_buff *skb)
14961497
{
14971498
__le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
1498-
__le16 hdr_info = rx_desc->wb.lower.lo_dword.hs_rss.hdr_info;
14991499
bool encap_pkt = false;
15001500

15011501
skb_checksum_none_assert(skb);
@@ -1504,8 +1504,8 @@ static inline void ixgbe_rx_checksum(struct ixgbe_ring *ring,
15041504
if (!(ring->netdev->features & NETIF_F_RXCSUM))
15051505
return;
15061506

1507-
if ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_VXLAN)) &&
1508-
(hdr_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_TUNNEL >> 16))) {
1507+
/* check for VXLAN and Geneve packets */
1508+
if (pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_VXLAN)) {
15091509
encap_pkt = true;
15101510
skb->encapsulation = 1;
15111511
}
@@ -3922,6 +3922,9 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
39223922
rfctl &= ~IXGBE_RFCTL_RSC_DIS;
39233923
if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))
39243924
rfctl |= IXGBE_RFCTL_RSC_DIS;
3925+
3926+
/* disable NFS filtering */
3927+
rfctl |= (IXGBE_RFCTL_NFSW_DIS | IXGBE_RFCTL_NFSR_DIS);
39253928
IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl);
39263929

39273930
/* Program registers for the distribution of queues */
@@ -4586,18 +4589,23 @@ static void ixgbe_napi_disable_all(struct ixgbe_adapter *adapter)
45864589
}
45874590
}
45884591

4589-
static void ixgbe_clear_vxlan_port(struct ixgbe_adapter *adapter)
4592+
static void ixgbe_clear_udp_tunnel_port(struct ixgbe_adapter *adapter, u32 mask)
45904593
{
4591-
switch (adapter->hw.mac.type) {
4592-
case ixgbe_mac_X550:
4593-
case ixgbe_mac_X550EM_x:
4594-
case ixgbe_mac_x550em_a:
4595-
IXGBE_WRITE_REG(&adapter->hw, IXGBE_VXLANCTRL, 0);
4594+
struct ixgbe_hw *hw = &adapter->hw;
4595+
u32 vxlanctrl;
4596+
4597+
if (!(adapter->flags & (IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE |
4598+
IXGBE_FLAG_GENEVE_OFFLOAD_CAPABLE)))
4599+
return;
4600+
4601+
vxlanctrl = IXGBE_READ_REG(hw, IXGBE_VXLANCTRL) && ~mask;
4602+
IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, vxlanctrl);
4603+
4604+
if (mask & IXGBE_VXLANCTRL_VXLAN_UDPPORT_MASK)
45964605
adapter->vxlan_port = 0;
4597-
break;
4598-
default:
4599-
break;
4600-
}
4606+
4607+
if (mask & IXGBE_VXLANCTRL_GENEVE_UDPPORT_MASK)
4608+
adapter->geneve_port = 0;
46014609
}
46024610

46034611
#ifdef CONFIG_IXGBE_DCB
@@ -5711,8 +5719,10 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
57115719
if (fwsm & IXGBE_FWSM_TS_ENABLED)
57125720
adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE;
57135721
break;
5714-
case ixgbe_mac_X550EM_x:
57155722
case ixgbe_mac_x550em_a:
5723+
adapter->flags |= IXGBE_FLAG_GENEVE_OFFLOAD_CAPABLE;
5724+
/* fall through */
5725+
case ixgbe_mac_X550EM_x:
57165726
#ifdef CONFIG_IXGBE_DCB
57175727
adapter->flags &= ~IXGBE_FLAG_DCB_CAPABLE;
57185728
#endif
@@ -6144,7 +6154,7 @@ int ixgbe_open(struct net_device *netdev)
61446154

61456155
ixgbe_up_complete(adapter);
61466156

6147-
ixgbe_clear_vxlan_port(adapter);
6157+
ixgbe_clear_udp_tunnel_port(adapter, IXGBE_VXLANCTRL_ALL_UDPPORT_MASK);
61486158
udp_tunnel_get_rx_info(netdev);
61496159

61506160
return 0;
@@ -7223,9 +7233,9 @@ static void ixgbe_service_task(struct work_struct *work)
72237233
ixgbe_service_event_complete(adapter);
72247234
return;
72257235
}
7226-
if (adapter->flags2 & IXGBE_FLAG2_VXLAN_REREG_NEEDED) {
7236+
if (adapter->flags2 & IXGBE_FLAG2_UDP_TUN_REREG_NEEDED) {
72277237
rtnl_lock();
7228-
adapter->flags2 &= ~IXGBE_FLAG2_VXLAN_REREG_NEEDED;
7238+
adapter->flags2 &= ~IXGBE_FLAG2_UDP_TUN_REREG_NEEDED;
72297239
udp_tunnel_get_rx_info(adapter->netdev);
72307240
rtnl_unlock();
72317241
}
@@ -7665,6 +7675,10 @@ static void ixgbe_atr(struct ixgbe_ring *ring,
76657675
if (adapter->vxlan_port &&
76667676
udp_hdr(skb)->dest == adapter->vxlan_port)
76677677
hdr.network = skb_inner_network_header(skb);
7678+
7679+
if (adapter->geneve_port &&
7680+
udp_hdr(skb)->dest == adapter->geneve_port)
7681+
hdr.network = skb_inner_network_header(skb);
76687682
}
76697683

76707684
/* Currently only IPv4/IPv6 with TCP is supported */
@@ -8800,10 +8814,23 @@ static int ixgbe_set_features(struct net_device *netdev,
88008814
netdev->features = features;
88018815

88028816
if ((adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE)) {
8803-
if (features & NETIF_F_RXCSUM)
8804-
adapter->flags2 |= IXGBE_FLAG2_VXLAN_REREG_NEEDED;
8805-
else
8806-
ixgbe_clear_vxlan_port(adapter);
8817+
if (features & NETIF_F_RXCSUM) {
8818+
adapter->flags2 |= IXGBE_FLAG2_UDP_TUN_REREG_NEEDED;
8819+
} else {
8820+
u32 port_mask = IXGBE_VXLANCTRL_VXLAN_UDPPORT_MASK;
8821+
8822+
ixgbe_clear_udp_tunnel_port(adapter, port_mask);
8823+
}
8824+
}
8825+
8826+
if ((adapter->flags & IXGBE_FLAG_GENEVE_OFFLOAD_CAPABLE)) {
8827+
if (features & NETIF_F_RXCSUM) {
8828+
adapter->flags2 |= IXGBE_FLAG2_UDP_TUN_REREG_NEEDED;
8829+
} else {
8830+
u32 port_mask = IXGBE_VXLANCTRL_GENEVE_UDPPORT_MASK;
8831+
8832+
ixgbe_clear_udp_tunnel_port(adapter, port_mask);
8833+
}
88078834
}
88088835

88098836
if (need_reset)
@@ -8816,67 +8843,115 @@ static int ixgbe_set_features(struct net_device *netdev,
88168843
}
88178844

88188845
/**
8819-
* ixgbe_add_vxlan_port - Get notifications about VXLAN ports that come up
8846+
* ixgbe_add_udp_tunnel_port - Get notifications about adding UDP tunnel ports
88208847
* @dev: The port's netdev
88218848
* @ti: Tunnel endpoint information
88228849
**/
8823-
static void ixgbe_add_vxlan_port(struct net_device *dev,
8824-
struct udp_tunnel_info *ti)
8850+
static void ixgbe_add_udp_tunnel_port(struct net_device *dev,
8851+
struct udp_tunnel_info *ti)
88258852
{
88268853
struct ixgbe_adapter *adapter = netdev_priv(dev);
88278854
struct ixgbe_hw *hw = &adapter->hw;
88288855
__be16 port = ti->port;
8829-
8830-
if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
8831-
return;
8856+
u32 port_shift = 0;
8857+
u32 reg;
88328858

88338859
if (ti->sa_family != AF_INET)
88348860
return;
88358861

8836-
if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
8837-
return;
8862+
switch (ti->type) {
8863+
case UDP_TUNNEL_TYPE_VXLAN:
8864+
if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
8865+
return;
88388866

8839-
if (adapter->vxlan_port == port)
8840-
return;
8867+
if (adapter->vxlan_port == port)
8868+
return;
8869+
8870+
if (adapter->vxlan_port) {
8871+
netdev_info(dev,
8872+
"VXLAN port %d set, not adding port %d\n",
8873+
ntohs(adapter->vxlan_port),
8874+
ntohs(port));
8875+
return;
8876+
}
8877+
8878+
adapter->vxlan_port = port;
8879+
break;
8880+
case UDP_TUNNEL_TYPE_GENEVE:
8881+
if (!(adapter->flags & IXGBE_FLAG_GENEVE_OFFLOAD_CAPABLE))
8882+
return;
8883+
8884+
if (adapter->geneve_port == port)
8885+
return;
8886+
8887+
if (adapter->geneve_port) {
8888+
netdev_info(dev,
8889+
"GENEVE port %d set, not adding port %d\n",
8890+
ntohs(adapter->geneve_port),
8891+
ntohs(port));
8892+
return;
8893+
}
88418894

8842-
if (adapter->vxlan_port) {
8843-
netdev_info(dev,
8844-
"Hit Max num of VXLAN ports, not adding port %d\n",
8845-
ntohs(port));
8895+
port_shift = IXGBE_VXLANCTRL_GENEVE_UDPPORT_SHIFT;
8896+
adapter->geneve_port = port;
8897+
break;
8898+
default:
88468899
return;
88478900
}
88488901

8849-
adapter->vxlan_port = port;
8850-
IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, ntohs(port));
8902+
reg = IXGBE_READ_REG(hw, IXGBE_VXLANCTRL) | ntohs(port) << port_shift;
8903+
IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, reg);
88518904
}
88528905

88538906
/**
8854-
* ixgbe_del_vxlan_port - Get notifications about VXLAN ports that go away
8907+
* ixgbe_del_udp_tunnel_port - Get notifications about removing UDP tunnel ports
88558908
* @dev: The port's netdev
88568909
* @ti: Tunnel endpoint information
88578910
**/
8858-
static void ixgbe_del_vxlan_port(struct net_device *dev,
8859-
struct udp_tunnel_info *ti)
8911+
static void ixgbe_del_udp_tunnel_port(struct net_device *dev,
8912+
struct udp_tunnel_info *ti)
88608913
{
88618914
struct ixgbe_adapter *adapter = netdev_priv(dev);
8915+
u32 port_mask;
88628916

8863-
if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
8917+
if (ti->type != UDP_TUNNEL_TYPE_VXLAN &&
8918+
ti->type != UDP_TUNNEL_TYPE_GENEVE)
88648919
return;
88658920

88668921
if (ti->sa_family != AF_INET)
88678922
return;
88688923

8869-
if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
8870-
return;
8924+
switch (ti->type) {
8925+
case UDP_TUNNEL_TYPE_VXLAN:
8926+
if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
8927+
return;
88718928

8872-
if (adapter->vxlan_port != ti->port) {
8873-
netdev_info(dev, "Port %d was not found, not deleting\n",
8874-
ntohs(ti->port));
8929+
if (adapter->vxlan_port != ti->port) {
8930+
netdev_info(dev, "VXLAN port %d not found\n",
8931+
ntohs(ti->port));
8932+
return;
8933+
}
8934+
8935+
port_mask = IXGBE_VXLANCTRL_VXLAN_UDPPORT_MASK;
8936+
break;
8937+
case UDP_TUNNEL_TYPE_GENEVE:
8938+
if (!(adapter->flags & IXGBE_FLAG_GENEVE_OFFLOAD_CAPABLE))
8939+
return;
8940+
8941+
if (adapter->geneve_port != ti->port) {
8942+
netdev_info(dev, "GENEVE port %d not found\n",
8943+
ntohs(ti->port));
8944+
return;
8945+
}
8946+
8947+
port_mask = IXGBE_VXLANCTRL_GENEVE_UDPPORT_MASK;
8948+
break;
8949+
default:
88758950
return;
88768951
}
88778952

8878-
ixgbe_clear_vxlan_port(adapter);
8879-
adapter->flags2 |= IXGBE_FLAG2_VXLAN_REREG_NEEDED;
8953+
ixgbe_clear_udp_tunnel_port(adapter, port_mask);
8954+
adapter->flags2 |= IXGBE_FLAG2_UDP_TUN_REREG_NEEDED;
88808955
}
88818956

88828957
static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
@@ -9190,8 +9265,8 @@ static const struct net_device_ops ixgbe_netdev_ops = {
91909265
.ndo_bridge_getlink = ixgbe_ndo_bridge_getlink,
91919266
.ndo_dfwd_add_station = ixgbe_fwd_add,
91929267
.ndo_dfwd_del_station = ixgbe_fwd_del,
9193-
.ndo_udp_tunnel_add = ixgbe_add_vxlan_port,
9194-
.ndo_udp_tunnel_del = ixgbe_del_vxlan_port,
9268+
.ndo_udp_tunnel_add = ixgbe_add_udp_tunnel_port,
9269+
.ndo_udp_tunnel_del = ixgbe_del_udp_tunnel_port,
91959270
.ndo_features_check = ixgbe_features_check,
91969271
};
91979272

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
#define IXGBE_DEV_ID_X550EM_A_SFP_N 0x15C4
9191
#define IXGBE_DEV_ID_X550EM_A_SGMII 0x15C6
9292
#define IXGBE_DEV_ID_X550EM_A_SGMII_L 0x15C7
93+
#define IXGBE_DEV_ID_X550EM_A_10G_T 0x15C8
9394
#define IXGBE_DEV_ID_X550EM_A_SFP 0x15CE
9495

9596
/* VF Device IDs */
@@ -487,6 +488,13 @@ struct ixgbe_thermal_sensor_data {
487488
#define IXGBE_FHFT_EXT(_n) (0x09800 + ((_n) * 0x100)) /* Ext Flexible Host
488489
* Filter Table */
489490

491+
/* masks for accessing VXLAN and GENEVE UDP ports */
492+
#define IXGBE_VXLANCTRL_VXLAN_UDPPORT_MASK 0x0000ffff /* VXLAN port */
493+
#define IXGBE_VXLANCTRL_GENEVE_UDPPORT_MASK 0xffff0000 /* GENEVE port */
494+
#define IXGBE_VXLANCTRL_ALL_UDPPORT_MASK 0xffffffff /* GENEVE/VXLAN */
495+
496+
#define IXGBE_VXLANCTRL_GENEVE_UDPPORT_SHIFT 16
497+
490498
#define IXGBE_FLEXIBLE_FILTER_COUNT_MAX 4
491499
#define IXGBE_EXT_FLEXIBLE_FILTER_COUNT_MAX 2
492500

@@ -1823,6 +1831,9 @@ enum {
18231831
#define IXGBE_LED_IVRT(_i) IXGBE_LED_OFFSET(IXGBE_LED_IVRT_BASE, _i)
18241832
#define IXGBE_LED_BLINK(_i) IXGBE_LED_OFFSET(IXGBE_LED_BLINK_BASE, _i)
18251833
#define IXGBE_LED_MODE_MASK(_i) IXGBE_LED_OFFSET(IXGBE_LED_MODE_MASK_BASE, _i)
1834+
#define IXGBE_X557_LED_MANUAL_SET_MASK BIT(8)
1835+
#define IXGBE_X557_MAX_LED_INDEX 3
1836+
#define IXGBE_X557_LED_PROVISIONING 0xC430
18261837

18271838
/* LED modes */
18281839
#define IXGBE_LED_LINK_UP 0x0

0 commit comments

Comments
 (0)