Commit d289cbed authored by David S. Miller's avatar David S. Miller

Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2016-02-18

This series contains updates to i40e and i40evf only.

Alex Duyck provides all the patches in the series to update and fix the
drivers.  Fixed the driver to drop the outer checksum offload on UDP
tunnels, since the issue is that the upper levels of the stack never
requested such an offload and it results in possible errors.  Updates the
TSO function to just use u64 values, so we do not have to end up casting
u32 values.  In the TSO path, factored out the L4 header offsets allowing
us to ignore the L4 header offsets when dealing with the L3 checksum and
length update.  Consolidates all of the spots where we were updating
either the TCP or IP checksums in the TSO and checksum path into the TSO
function.  Fixed two issues by adding support for IPv4 encapsulated in
IPv6, first issue was the fact that iphdr(skb)->protocol was being used to
test for the outer transport protocol which breaks IPv6 support.  The second
was that we cleared the flag for v4 going to v6, but we did not take care
of txflags going the other way.  Added support for IPv6 extension headers
in setting up the Tx checksum.  Added exception handling to the Tx
checksum path so that we can handle cases of TSO where the frame is bad,
or Tx checksum where we did not recognize a protocol.  Fixed a number of
issues to make certain that we are using the correct protocols when
parsing both the inner and outer headers of a frame that is mixed between
IPv4 and IPv6 for inner and outer.  Updated the feature flags to reflect
the newly enabled/added features.

Sorry, no witty patch descriptions this time around, probably should
let Mitch help in writing patch descriptions for Alex. :-)
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 376471a7 ffcc55c0
...@@ -7474,8 +7474,6 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi) ...@@ -7474,8 +7474,6 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi)
tx_ring->dcb_tc = 0; tx_ring->dcb_tc = 0;
if (vsi->back->flags & I40E_FLAG_WB_ON_ITR_CAPABLE) if (vsi->back->flags & I40E_FLAG_WB_ON_ITR_CAPABLE)
tx_ring->flags = I40E_TXR_FLAGS_WB_ON_ITR; tx_ring->flags = I40E_TXR_FLAGS_WB_ON_ITR;
if (vsi->back->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE)
tx_ring->flags |= I40E_TXR_FLAGS_OUTER_UDP_CSUM;
vsi->tx_rings[i] = tx_ring; vsi->tx_rings[i] = tx_ring;
rx_ring = &tx_ring[1]; rx_ring = &tx_ring[1];
...@@ -8628,9 +8626,6 @@ static void i40e_add_vxlan_port(struct net_device *netdev, ...@@ -8628,9 +8626,6 @@ static void i40e_add_vxlan_port(struct net_device *netdev,
u8 next_idx; u8 next_idx;
u8 idx; u8 idx;
if (sa_family == AF_INET6)
return;
idx = i40e_get_udp_port_idx(pf, port); idx = i40e_get_udp_port_idx(pf, port);
/* Check if port already exists */ /* Check if port already exists */
...@@ -8670,9 +8665,6 @@ static void i40e_del_vxlan_port(struct net_device *netdev, ...@@ -8670,9 +8665,6 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
u8 idx; u8 idx;
if (sa_family == AF_INET6)
return;
idx = i40e_get_udp_port_idx(pf, port); idx = i40e_get_udp_port_idx(pf, port);
/* Check if port already exists */ /* Check if port already exists */
...@@ -8709,9 +8701,6 @@ static void i40e_add_geneve_port(struct net_device *netdev, ...@@ -8709,9 +8701,6 @@ static void i40e_add_geneve_port(struct net_device *netdev,
if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE)) if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
return; return;
if (sa_family == AF_INET6)
return;
idx = i40e_get_udp_port_idx(pf, port); idx = i40e_get_udp_port_idx(pf, port);
/* Check if port already exists */ /* Check if port already exists */
...@@ -8753,9 +8742,6 @@ static void i40e_del_geneve_port(struct net_device *netdev, ...@@ -8753,9 +8742,6 @@ static void i40e_del_geneve_port(struct net_device *netdev,
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
u8 idx; u8 idx;
if (sa_family == AF_INET6)
return;
if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE)) if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
return; return;
...@@ -9046,10 +9032,14 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) ...@@ -9046,10 +9032,14 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
np = netdev_priv(netdev); np = netdev_priv(netdev);
np->vsi = vsi; np->vsi = vsi;
netdev->hw_enc_features |= NETIF_F_IP_CSUM | netdev->hw_enc_features |= NETIF_F_IP_CSUM |
NETIF_F_GSO_UDP_TUNNEL | NETIF_F_IPV6_CSUM |
NETIF_F_GSO_GRE | NETIF_F_TSO |
NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_TSO_ECN |
NETIF_F_GSO_GRE |
NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_UDP_TUNNEL_CSUM |
0; 0;
netdev->features = NETIF_F_SG | netdev->features = NETIF_F_SG |
...@@ -9071,6 +9061,8 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) ...@@ -9071,6 +9061,8 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
netdev->features |= NETIF_F_NTUPLE; netdev->features |= NETIF_F_NTUPLE;
if (pf->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE)
netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
/* copy netdev features into list of user selectable features */ /* copy netdev features into list of user selectable features */
netdev->hw_features |= netdev->features; netdev->hw_features |= netdev->features;
......
This diff is collapsed.
...@@ -153,7 +153,6 @@ enum i40e_dyn_idx_t { ...@@ -153,7 +153,6 @@ enum i40e_dyn_idx_t {
#define DESC_NEEDED (MAX_SKB_FRAGS + 4) #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
#define I40E_MIN_DESC_PENDING 4 #define I40E_MIN_DESC_PENDING 4
#define I40E_TX_FLAGS_CSUM BIT(0)
#define I40E_TX_FLAGS_HW_VLAN BIT(1) #define I40E_TX_FLAGS_HW_VLAN BIT(1)
#define I40E_TX_FLAGS_SW_VLAN BIT(2) #define I40E_TX_FLAGS_SW_VLAN BIT(2)
#define I40E_TX_FLAGS_TSO BIT(3) #define I40E_TX_FLAGS_TSO BIT(3)
...@@ -277,7 +276,6 @@ struct i40e_ring { ...@@ -277,7 +276,6 @@ struct i40e_ring {
u16 flags; u16 flags;
#define I40E_TXR_FLAGS_WB_ON_ITR BIT(0) #define I40E_TXR_FLAGS_WB_ON_ITR BIT(0)
#define I40E_TXR_FLAGS_OUTER_UDP_CSUM BIT(1)
#define I40E_TXR_FLAGS_LAST_XMIT_MORE_SET BIT(2) #define I40E_TXR_FLAGS_LAST_XMIT_MORE_SET BIT(2)
/* stats structs */ /* stats structs */
......
...@@ -153,7 +153,6 @@ enum i40e_dyn_idx_t { ...@@ -153,7 +153,6 @@ enum i40e_dyn_idx_t {
#define DESC_NEEDED (MAX_SKB_FRAGS + 4) #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
#define I40E_MIN_DESC_PENDING 4 #define I40E_MIN_DESC_PENDING 4
#define I40E_TX_FLAGS_CSUM BIT(0)
#define I40E_TX_FLAGS_HW_VLAN BIT(1) #define I40E_TX_FLAGS_HW_VLAN BIT(1)
#define I40E_TX_FLAGS_SW_VLAN BIT(2) #define I40E_TX_FLAGS_SW_VLAN BIT(2)
#define I40E_TX_FLAGS_TSO BIT(3) #define I40E_TX_FLAGS_TSO BIT(3)
...@@ -275,7 +274,6 @@ struct i40e_ring { ...@@ -275,7 +274,6 @@ struct i40e_ring {
u16 flags; u16 flags;
#define I40E_TXR_FLAGS_WB_ON_ITR BIT(0) #define I40E_TXR_FLAGS_WB_ON_ITR BIT(0)
#define I40E_TXR_FLAGS_OUTER_UDP_CSUM BIT(1)
/* stats structs */ /* stats structs */
struct i40e_queue_stats stats; struct i40e_queue_stats stats;
......
...@@ -2337,9 +2337,24 @@ int i40evf_process_config(struct i40evf_adapter *adapter) ...@@ -2337,9 +2337,24 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
NETIF_F_IPV6_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_TSO | NETIF_F_TSO |
NETIF_F_TSO6 | NETIF_F_TSO6 |
NETIF_F_TSO_ECN |
NETIF_F_GSO_GRE |
NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_RXCSUM | NETIF_F_RXCSUM |
NETIF_F_GRO; NETIF_F_GRO;
netdev->hw_enc_features |= NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM |
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_TSO_ECN |
NETIF_F_GSO_GRE |
NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_UDP_TUNNEL_CSUM;
if (adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE)
netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
/* copy netdev features into list of user selectable features */ /* copy netdev features into list of user selectable features */
netdev->hw_features |= netdev->features; netdev->hw_features |= netdev->features;
netdev->hw_features &= ~NETIF_F_RXCSUM; netdev->hw_features &= ~NETIF_F_RXCSUM;
...@@ -2478,6 +2493,10 @@ static void i40evf_init_task(struct work_struct *work) ...@@ -2478,6 +2493,10 @@ static void i40evf_init_task(struct work_struct *work)
default: default:
goto err_alloc; goto err_alloc;
} }
if (hw->mac.type == I40E_MAC_X722_VF)
adapter->flags |= I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE;
if (i40evf_process_config(adapter)) if (i40evf_process_config(adapter))
goto err_alloc; goto err_alloc;
adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN; adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
...@@ -2518,10 +2537,6 @@ static void i40evf_init_task(struct work_struct *work) ...@@ -2518,10 +2537,6 @@ static void i40evf_init_task(struct work_struct *work)
if (err) if (err)
goto err_sw_init; goto err_sw_init;
i40evf_map_rings_to_vectors(adapter); i40evf_map_rings_to_vectors(adapter);
if (adapter->vf_res->vf_offload_flags &
I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)
adapter->flags |= I40EVF_FLAG_WB_ON_ITR_CAPABLE;
if (adapter->vf_res->vf_offload_flags & if (adapter->vf_res->vf_offload_flags &
I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)
adapter->flags |= I40EVF_FLAG_WB_ON_ITR_CAPABLE; adapter->flags |= I40EVF_FLAG_WB_ON_ITR_CAPABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment