Skip to content

Commit 8ce6f4b

Browse files
committed
Merge branch 'onload-9.1'
2 parents 2f35a2c + f8dc5d2 commit 8ce6f4b

File tree

14 files changed

+86
-29
lines changed

14 files changed

+86
-29
lines changed

src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/pci.h>
1313
#include <linux/debugfs.h>
1414
#include <linux/dcache.h>
15+
#include <linux/namei.h>
1516
#include <linux/seq_file.h>
1617
#include <linux/slab.h>
1718
#include "net_driver.h"
@@ -87,7 +88,7 @@ void efx_fini_debugfs_child(struct dentry *dir, const char *name)
8788
struct qstr child_name = QSTR_INIT(name, strlen(name));
8889
struct dentry *child;
8990

90-
child = d_hash_and_lookup(dir, &child_name);
91+
child = try_lookup_noperm(&child_name, dir);
9192
if (!IS_ERR_OR_NULL(child)) {
9293
/* If it's a "regular" file, free its parameter binding */
9394
if (S_ISREG(child->d_inode->i_mode))

src/driver/linux_net/drivers/net/ethernet/sfc/ef10.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */
30593066
static 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,
51815188
static 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
62186231
const 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

63816395
const 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

67516768
const 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

src/driver/linux_net/drivers/net/ethernet/sfc/ef100_netdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,10 @@ static int ef100_register_netdev(struct efx_nic *efx)
754754
net_dev->netdev_ops = &ef100_netdev_ops;
755755
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_NETDEV_MTU_LIMITS)
756756
net_dev->min_mtu = EFX_MIN_MTU;
757-
net_dev->max_mtu = EFX_100_MAX_MTU;
757+
net_dev->max_mtu = efx_max_mtu(efx);
758758
#elif defined(EFX_HAVE_NETDEV_EXT_MTU_LIMITS)
759759
net_dev->extended->min_mtu = EFX_MIN_MTU;
760-
net_dev->extended->max_mtu = EFX_100_MAX_MTU;
760+
net_dev->extended->max_mtu = efx_max_mtu(efx);
761761
#endif
762762
net_dev->ethtool_ops = &ef100_ethtool_ops;
763763

src/driver/linux_net/drivers/net/ethernet/sfc/ef100_nic.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,9 @@ void ef100_remove(struct efx_nic *efx)
17831783
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_FILTER)
17841784
#endif
17851785

1786+
/* Maximum possible MTU the driver supports */
1787+
#define EFX_EF100_DEFAULT_MAX_MTU 9600
1788+
17861789
const struct efx_nic_type ef100_pf_nic_type = {
17871790
.revision = EFX_REV_EF100,
17881791
.is_vf = false,
@@ -1921,6 +1924,7 @@ const struct efx_nic_type ef100_pf_nic_type = {
19211924
},
19221925
#endif
19231926
#endif
1927+
.default_max_mtu = EFX_EF100_DEFAULT_MAX_MTU,
19241928
};
19251929

19261930
const struct efx_nic_type ef100_vf_nic_type = {
@@ -2030,4 +2034,5 @@ const struct efx_nic_type ef100_vf_nic_type = {
20302034
},
20312035
#endif
20322036
#endif
2037+
.default_max_mtu = EFX_EF100_DEFAULT_MAX_MTU,
20332038
};

src/driver/linux_net/drivers/net/ethernet/sfc/ef100_rep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ static struct efx_rep *efx_ef100_rep_create_netdev(struct efx_nic *efx,
326326
net_dev->ethtool_ops = &efx_ef100_rep_ethtool_ops;
327327
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_NETDEV_MTU_LIMITS)
328328
net_dev->min_mtu = EFX_MIN_MTU;
329-
net_dev->max_mtu = EFX_100_MAX_MTU;
329+
net_dev->max_mtu = efx_max_mtu(efx);
330330
#elif defined(EFX_HAVE_NETDEV_EXT_MTU_LIMITS)
331331
net_dev->extended->min_mtu = EFX_MIN_MTU;
332-
net_dev->extended->max_mtu = EFX_100_MAX_MTU;
332+
net_dev->extended->max_mtu = efx_max_mtu(efx);
333333
#endif
334334
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_NETDEV_LLTX)
335335
net_dev->lltx = true;

src/driver/linux_net/drivers/net/ethernet/sfc/efx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,10 @@ static int efx_register_netdev(struct efx_nic *efx)
845845
netif_set_tso_max_segs(net_dev, EFX_TSO_MAX_SEGS);
846846
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_NETDEV_MTU_LIMITS)
847847
net_dev->min_mtu = EFX_MIN_MTU;
848-
net_dev->max_mtu = EFX_MAX_MTU;
848+
net_dev->max_mtu = efx_max_mtu(efx);
849849
#elif defined(EFX_HAVE_NETDEV_EXT_MTU_LIMITS)
850850
net_dev->extended->min_mtu = EFX_MIN_MTU;
851-
net_dev->extended->max_mtu = EFX_MAX_MTU;
851+
net_dev->extended->max_mtu = efx_max_mtu(efx);
852852
#endif
853853

854854
rtnl_lock();

src/driver/linux_net/drivers/net/ethernet/sfc/efx_common.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ int efx_change_mtu(struct net_device *net_dev, int new_mtu)
324324
return rc;
325325

326326
#if defined(EFX_USE_KCOMPAT) && !(defined(EFX_HAVE_NETDEV_MTU_LIMITS) || defined(EFX_HAVE_NETDEV_EXT_MTU_LIMITS))
327-
if (new_mtu > (efx_nic_rev(efx) == EFX_REV_EF100? EFX_100_MAX_MTU: EFX_MAX_MTU)) {
327+
if (new_mtu > efx_max_mtu(efx)) {
328328
netif_err(efx, drv, efx->net_dev,
329329
"Requested MTU of %d too big (max: %d)\n",
330-
new_mtu, EFX_MAX_MTU);
330+
new_mtu, efx_max_mtu(efx));
331331
return -EINVAL;
332332
}
333333
if (new_mtu < EFX_MIN_MTU) {
@@ -501,8 +501,9 @@ static int efx_start_datapath(struct efx_nic *efx)
501501
/* Each packet can consume up to
502502
* ceil(max_frame_len / buffer_size) buffers
503503
*/
504-
efx->rx_max_frags = DIV_ROUND_UP(EFX_MAX_FRAME_LEN(EFX_MAX_MTU),
505-
efx->rx_dma_len);
504+
efx->rx_max_frags =
505+
DIV_ROUND_UP(EFX_MAX_FRAME_LEN(efx_max_mtu(efx)),
506+
efx->rx_dma_len);
506507
efx->rx_buffer_order = 0;
507508
#if defined(EFX_NOT_UPSTREAM) && defined(EFX_USE_SFC_LRO)
508509
efx->lro_available = false;

src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,4 +1977,11 @@ static inline void time64_to_tm(time64_t totalsecs, int offset, struct tm *resul
19771977
#define skb_gro_may_pull(_s, _l) !skb_gro_header_hard(_s, _l)
19781978
#endif
19791979

1980+
#ifdef EFX_NEED_TRY_LOOKUP_NOPERM
1981+
static inline struct dentry *try_lookup_noperm(struct qstr *name, struct dentry *base)
1982+
{
1983+
return d_hash_and_lookup(base, name);
1984+
}
1985+
#endif
1986+
19801987
#endif /* EFX_KERNEL_COMPAT_H */

src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ EFX_NEED_PAGE_REF_ADD nfile include/linux/page_ref.h
128128
EFX_NEED_HWMON_DEVICE_REGISTER_WITH_INFO nsymbol hwmon_device_register_with_info include/linux/hwmon.h
129129
EFX_HAVE_NDO_UDP_TUNNEL_ADD member struct_net_device_ops ndo_udp_tunnel_add include/linux/netdevice.h
130130
EFX_HAVE_UDP_TUNNEL_NIC_INFO symbol udp_tunnel_nic_info include/net/udp_tunnel.h
131+
EFX_HAVE_UDP_TUNNEL_NIC_INFO_MAY_SLEEP symbol UDP_TUNNEL_NIC_INFO_MAY_SLEEP include/net/udp_tunnel.h
131132
EFX_HAVE_NEW_FLOW_KEYS member struct_flow_keys basic include/net/flow_dissector.h
132133
EFX_HAVE_NDO_ADD_GENEVE_PORT member struct_net_device_ops ndo_add_geneve_port include/linux/netdevice.h
133134
EFX_HAVE_NETDEV_LLTX nsymbol NETIF_F_LLTX include/linux/netdev_features.h
@@ -291,6 +292,7 @@ EFX_HAVE_NET_RPS_H file include/net/rps.h
291292
EFX_HAVE_IP_TUNNEL_FLAGS_TO_BE16 symbol ip_tunnel_flags_to_be16 include/net/ip_tunnels.h
292293
EFX_NEED_TIME64_TO_TM nsymbol time64_to_tm include/linux/time.h
293294
EFX_HAVE_ASSIGN_STR_NO_SRC_ARG custom
295+
EFX_NEED_TRY_LOOKUP_NOPERM nsymbol try_lookup_noperm include/linux/namei.h
294296
" | grep -E -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g'
295297
}
296298

src/driver/linux_net/drivers/net/ethernet/sfc/mcdi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ struct efx_mcdi_mon {
200200
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_RHASHTABLE)
201201
struct rhashtable sensor_table;
202202
#endif
203-
unsigned int generation_count;
204203
unsigned int n_dynamic_sensors;
205204
int pend_sensor_state_handle;
206205
};

0 commit comments

Comments
 (0)