@@ -3055,16 +3055,23 @@ static void efx_ef10_tx_write(struct efx_tx_queue *tx_queue)
30553055 }
30563056}
30573057
3058+ /* Check that we assume that we don't need to fragment a descriptor due to
3059+ * a DMA boundary for a single output packet. Use for initialising the
3060+ * default_max_mtu field of struct efx_nic_type.
3061+ */
3062+ #define EFX_EF10_VERIFY_MAX_MTU (mtu ) \
3063+ (BUILD_BUG_ON_ZERO((mtu) > EFX_EF10_MAX_TX_DESCRIPTOR_LEN) + (mtu))
3064+
30583065/* Maximum number of descriptors required for a single SKB */
30593066static unsigned int efx_ef10_tx_max_skb_descs (struct efx_nic * efx )
30603067{
30613068 struct efx_ef10_nic_data * nic_data = efx -> nic_data ;
30623069 unsigned int max_descs ;
30633070
30643071 /* In all cases we assume that we don't need to fragment a descriptor
3065- * due to a DMA boundary for a single output packet.
3072+ * due to a DMA boundary for a single output packet. Checked by using
3073+ * EFX_EF10_VERIFY_MAX_MTU().
30663074 */
3067- BUILD_BUG_ON (EFX_MAX_MTU > EFX_EF10_MAX_TX_DESCRIPTOR_LEN );
30683075
30693076 if (efx_ef10_has_cap (nic_data -> datapath_caps , TX_TSO )) {
30703077 /* We need a header, option and payload descriptor for each
@@ -5181,7 +5188,9 @@ static int efx_ef10_udp_tnl_unset_port(struct net_device *dev,
51815188static const struct udp_tunnel_nic_info efx_ef10_udp_tunnels = {
51825189 .set_port = efx_ef10_udp_tnl_set_port ,
51835190 .unset_port = efx_ef10_udp_tnl_unset_port ,
5191+ #if defined(EFX_USE_KCOMPAT ) && defined (EFX_HAVE_UDP_TUNNEL_NIC_INFO_MAY_SLEEP )
51845192 .flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP ,
5193+ #endif
51855194 .tables = {
51865195 {
51875196 .n_entries = 16 ,
@@ -6214,6 +6223,10 @@ static bool efx_ef10_vf_client_supported(struct efx_nic *efx,
62146223 NETIF_F_RXHASH | \
62156224 NETIF_F_NTUPLE)
62166225
6226+ /* Maximum possible MTU the driver supports */
6227+ #define EFX_EF10_DEFAULT_MAX_MTU EFX_EF10_VERIFY_MAX_MTU(9216)
6228+ #define EFX_X4_DEFAULT_MAX_MTU EFX_EF10_VERIFY_MAX_MTU(9100)
6229+
62176230#ifdef CONFIG_SFC_SRIOV
62186231const struct efx_nic_type efx_hunt_a0_vf_nic_type = {
62196232 .is_vf = true,
@@ -6376,6 +6389,7 @@ const struct efx_nic_type efx_hunt_a0_vf_nic_type = {
63766389 .check_caps = ef10_check_caps ,
63776390 .rx_recycle_ring_size = efx_ef10_recycle_ring_size ,
63786391 .has_fw_variants = true,
6392+ .default_max_mtu = EFX_EF10_DEFAULT_MAX_MTU ,
63796393};
63806394
63816395const struct efx_nic_type efx_x4_vf_nic_type = {
@@ -6406,6 +6420,7 @@ const struct efx_nic_type efx_x4_vf_nic_type = {
64066420 .stop_stats = efx_ef10_stop_stats_vf ,
64076421 .update_stats_period = efx_ef10_vf_schedule_stats_work ,
64086422 .push_irq_moderation = efx_ef10_push_irq_moderation ,
6423+ .hw_max_mtu = efx_x4_hw_max_mtu ,
64096424 .reconfigure_mac = efx_x4_mac_reconfigure ,
64106425 .check_mac_fault = efx_x4_mcdi_mac_check_fault ,
64116426 .reconfigure_port = efx_x4_mcdi_port_reconfigure ,
@@ -6540,6 +6555,7 @@ const struct efx_nic_type efx_x4_vf_nic_type = {
65406555 .rx_recycle_ring_size = efx_ef10_recycle_ring_size ,
65416556 .has_dynamic_sensors = ef10_has_dynamic_sensors ,
65426557 .has_fw_variants = true,
6558+ .default_max_mtu = EFX_X4_DEFAULT_MAX_MTU ,
65436559};
65446560#endif
65456561
@@ -6746,6 +6762,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = {
67466762 .check_caps = ef10_check_caps ,
67476763 .rx_recycle_ring_size = efx_ef10_recycle_ring_size ,
67486764 .has_fw_variants = true,
6765+ .default_max_mtu = EFX_EF10_DEFAULT_MAX_MTU ,
67496766};
67506767
67516768const struct efx_nic_type efx_x4_nic_type = {
@@ -6775,6 +6792,7 @@ const struct efx_nic_type efx_x4_nic_type = {
67756792 .update_stats = efx_ef10_update_stats_pf ,
67766793 .pull_stats = efx_ef10_pull_stats_pf ,
67776794 .push_irq_moderation = efx_ef10_push_irq_moderation ,
6795+ .hw_max_mtu = efx_x4_hw_max_mtu ,
67786796 .reconfigure_mac = efx_x4_mac_reconfigure ,
67796797 .check_mac_fault = efx_x4_mcdi_mac_check_fault ,
67806798 .reconfigure_port = efx_x4_mcdi_port_reconfigure ,
@@ -6952,5 +6970,6 @@ const struct efx_nic_type efx_x4_nic_type = {
69526970 .rx_recycle_ring_size = efx_ef10_recycle_ring_size ,
69536971 .has_dynamic_sensors = ef10_has_dynamic_sensors ,
69546972 .has_fw_variants = true,
6973+ .default_max_mtu = EFX_X4_DEFAULT_MAX_MTU ,
69556974};
69566975
0 commit comments