Skip to content

Commit 735a580

Browse files
committed
Merge: net/sfc: driver update
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1108 JIRA: https://issues.redhat.com/browse/RHEL-72659 Updated the sfc driver to upstream kernel net-next. Tested: http://dashboard.lnst.anl.eng.rdu2.dc.redhat.com/pipeline/7175 Signed-off-by: Dennis Chen <dechen@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 42421eb + 6fb8f60 commit 735a580

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+9344
-12491
lines changed

Documentation/networking/devlink/sfc.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sfc devlink support
55
===================
66

77
This document describes the devlink features implemented by the ``sfc``
8-
device driver for the ef100 device.
8+
device driver for the ef10 and ef100 devices.
99

1010
Info versions
1111
=============
@@ -18,6 +18,10 @@ The ``sfc`` driver reports the following versions
1818
* - Name
1919
- Type
2020
- Description
21+
* - ``fw.bundle_id``
22+
- stored
23+
- Version of the firmware "bundle" image that was last used to update
24+
multiple components.
2125
* - ``fw.mgmt.suc``
2226
- running
2327
- For boards where the management function is split between multiple
@@ -55,3 +59,13 @@ The ``sfc`` driver reports the following versions
5559
* - ``fw.uefi``
5660
- running
5761
- UEFI driver version (No UNDI support).
62+
63+
Flash Update
64+
============
65+
66+
The ``sfc`` driver implements support for flash update using the
67+
``devlink-flash`` interface. It supports updating the device flash using a
68+
combined flash image ("bundle") that contains multiple components (on ef10,
69+
typically ``fw.mgmt``, ``fw.app``, ``fw.exprom`` and ``fw.uefi``).
70+
71+
The driver does not support any overwrite mask flags.

drivers/net/ethernet/sfc/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ config SFC_MTD
3838
default y
3939
help
4040
This exposes the on-board flash and/or EEPROM as MTD devices
41-
(e.g. /dev/mtd1). This is required to update the firmware or
42-
the boot configuration under Linux.
41+
(e.g. /dev/mtd1). This is required to update the boot
42+
configuration under Linux, or use some older userland tools to
43+
update the firmware.
4344
config SFC_MCDI_MON
4445
bool "Solarflare SFC9100-family hwmon support"
4546
depends on SFC && HWMON && !(SFC=y && HWMON=m)

drivers/net/ethernet/sfc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sfc-y += efx.o efx_common.o efx_channels.o nic.o \
77
mcdi_functions.o mcdi_filters.o mcdi_mon.o \
88
ef100.o ef100_nic.o ef100_netdev.o \
99
ef100_ethtool.o ef100_rx.o ef100_tx.o \
10-
efx_devlink.o
10+
efx_devlink.o efx_reflash.o
1111
sfc-$(CONFIG_SFC_MTD) += mtd.o
1212
sfc-$(CONFIG_SFC_SRIOV) += sriov.o ef10_sriov.o ef100_sriov.o ef100_rep.o \
1313
mae.o tc.o tc_bindings.o tc_counters.o \

drivers/net/ethernet/sfc/ef10.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ static void efx_ef10_get_stat_mask(struct efx_nic *efx, unsigned long *mask)
17511751
#endif
17521752
}
17531753

1754-
static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names)
1754+
static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 **names)
17551755
{
17561756
DECLARE_BITMAP(mask, EF10_STAT_COUNT);
17571757

@@ -3501,7 +3501,7 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
35013501
MCDI_DECLARE_BUF(inbuf, MC_CMD_NVRAM_METADATA_IN_LEN);
35023502
MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_METADATA_OUT_LENMAX);
35033503
const struct efx_ef10_nvram_type_info *info;
3504-
size_t size, erase_size, outlen;
3504+
size_t size, erase_size, write_size, outlen;
35053505
int type_idx = 0;
35063506
bool protected;
35073507
int rc;
@@ -3516,7 +3516,8 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
35163516
if (info->port != efx_port_num(efx))
35173517
return -ENODEV;
35183518

3519-
rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &protected);
3519+
rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &write_size,
3520+
&protected);
35203521
if (rc)
35213522
return rc;
35223523
if (protected &&
@@ -3561,6 +3562,8 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
35613562
if (!erase_size)
35623563
part->common.mtd.flags |= MTD_NO_ERASE;
35633564

3565+
part->common.mtd.writesize = write_size;
3566+
35643567
return 0;
35653568
}
35663569

@@ -4416,6 +4419,7 @@ const struct efx_nic_type efx_x4_nic_type = {
44164419
.can_rx_scatter = true,
44174420
.always_rx_scatter = true,
44184421
.option_descriptors = true,
4422+
.flash_auto_partition = true,
44194423
.min_interrupt_mode = EFX_INT_MODE_MSIX,
44204424
.timer_period_max = 1 << ERF_DD_EVQ_IND_TIMER_VAL_WIDTH,
44214425
.offload_features = EF10_OFFLOAD_FEATURES,

drivers/net/ethernet/sfc/ef100_netdev.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data)
450450
net_dev->hw_enc_features |= efx->type->offload_features;
451451
net_dev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_SG |
452452
NETIF_F_HIGHDMA | NETIF_F_ALL_TSO;
453-
netif_set_tso_max_segs(net_dev,
454-
ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS_DEFAULT);
455-
efx->mdio.dev = net_dev;
453+
nic_data = efx->nic_data;
454+
netif_set_tso_max_size(efx->net_dev, nic_data->tso_max_payload_len);
455+
netif_set_tso_max_segs(efx->net_dev, nic_data->tso_max_payload_num_segs);
456456

457457
rc = efx_ef100_init_datapath_caps(efx);
458458
if (rc < 0)
@@ -478,7 +478,6 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data)
478478
/* Don't fail init if RSS setup doesn't work. */
479479
efx_mcdi_push_default_indir_table(efx, efx->n_rx_channels);
480480

481-
nic_data = efx->nic_data;
482481
rc = ef100_get_mac_address(efx, net_dev->perm_addr, CLIENT_HANDLE_SELF,
483482
efx->type->is_vf);
484483
if (rc)

drivers/net/ethernet/sfc/ef100_nic.c

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static const struct efx_hw_stat_desc ef100_stat_desc[EF100_STAT_COUNT] = {
583583
EFX_GENERIC_SW_STAT(rx_noskb_drops),
584584
};
585585

586-
static size_t ef100_describe_stats(struct efx_nic *efx, u8 *names)
586+
static size_t ef100_describe_stats(struct efx_nic *efx, u8 **names)
587587
{
588588
DECLARE_BITMAP(mask, EF100_STAT_COUNT) = {};
589589

@@ -887,8 +887,7 @@ static int ef100_process_design_param(struct efx_nic *efx,
887887
case ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS:
888888
/* We always put HDR_NUM_SEGS=1 in our TSO descriptors */
889889
if (!reader->value) {
890-
netif_err(efx, probe, efx->net_dev,
891-
"TSO_MAX_HDR_NUM_SEGS < 1\n");
890+
pci_err(efx->pci_dev, "TSO_MAX_HDR_NUM_SEGS < 1\n");
892891
return -EOPNOTSUPP;
893892
}
894893
return 0;
@@ -901,32 +900,28 @@ static int ef100_process_design_param(struct efx_nic *efx,
901900
*/
902901
if (!reader->value || reader->value > EFX_MIN_DMAQ_SIZE ||
903902
EFX_MIN_DMAQ_SIZE % (u32)reader->value) {
904-
netif_err(efx, probe, efx->net_dev,
905-
"%s size granularity is %llu, can't guarantee safety\n",
906-
reader->type == ESE_EF100_DP_GZ_RXQ_SIZE_GRANULARITY ? "RXQ" : "TXQ",
907-
reader->value);
903+
pci_err(efx->pci_dev,
904+
"%s size granularity is %llu, can't guarantee safety\n",
905+
reader->type == ESE_EF100_DP_GZ_RXQ_SIZE_GRANULARITY ? "RXQ" : "TXQ",
906+
reader->value);
908907
return -EOPNOTSUPP;
909908
}
910909
return 0;
911910
case ESE_EF100_DP_GZ_TSO_MAX_PAYLOAD_LEN:
912911
nic_data->tso_max_payload_len = min_t(u64, reader->value,
913912
GSO_LEGACY_MAX_SIZE);
914-
netif_set_tso_max_size(efx->net_dev,
915-
nic_data->tso_max_payload_len);
916913
return 0;
917914
case ESE_EF100_DP_GZ_TSO_MAX_PAYLOAD_NUM_SEGS:
918915
nic_data->tso_max_payload_num_segs = min_t(u64, reader->value, 0xffff);
919-
netif_set_tso_max_segs(efx->net_dev,
920-
nic_data->tso_max_payload_num_segs);
921916
return 0;
922917
case ESE_EF100_DP_GZ_TSO_MAX_NUM_FRAMES:
923918
nic_data->tso_max_frames = min_t(u64, reader->value, 0xffff);
924919
return 0;
925920
case ESE_EF100_DP_GZ_COMPAT:
926921
if (reader->value) {
927-
netif_err(efx, probe, efx->net_dev,
928-
"DP_COMPAT has unknown bits %#llx, driver not compatible with this hw\n",
929-
reader->value);
922+
pci_err(efx->pci_dev,
923+
"DP_COMPAT has unknown bits %#llx, driver not compatible with this hw\n",
924+
reader->value);
930925
return -EOPNOTSUPP;
931926
}
932927
return 0;
@@ -946,10 +941,10 @@ static int ef100_process_design_param(struct efx_nic *efx,
946941
* So the value of this shouldn't matter.
947942
*/
948943
if (reader->value != ESE_EF100_DP_GZ_VI_STRIDES_DEFAULT)
949-
netif_dbg(efx, probe, efx->net_dev,
950-
"NIC has other than default VI_STRIDES (mask "
951-
"%#llx), early probing might use wrong one\n",
952-
reader->value);
944+
pci_dbg(efx->pci_dev,
945+
"NIC has other than default VI_STRIDES (mask "
946+
"%#llx), early probing might use wrong one\n",
947+
reader->value);
953948
return 0;
954949
case ESE_EF100_DP_GZ_RX_MAX_RUNT:
955950
/* Driver doesn't look at L2_STATUS:LEN_ERR bit, so we don't
@@ -961,9 +956,9 @@ static int ef100_process_design_param(struct efx_nic *efx,
961956
/* Host interface says "Drivers should ignore design parameters
962957
* that they do not recognise."
963958
*/
964-
netif_dbg(efx, probe, efx->net_dev,
965-
"Ignoring unrecognised design parameter %u\n",
966-
reader->type);
959+
pci_dbg(efx->pci_dev,
960+
"Ignoring unrecognised design parameter %u\n",
961+
reader->type);
967962
return 0;
968963
}
969964
}
@@ -999,13 +994,13 @@ static int ef100_check_design_params(struct efx_nic *efx)
999994
*/
1000995
if (reader.state != EF100_TLV_TYPE) {
1001996
if (reader.state == EF100_TLV_TYPE_CONT)
1002-
netif_err(efx, probe, efx->net_dev,
1003-
"truncated design parameter (incomplete type %u)\n",
1004-
reader.type);
997+
pci_err(efx->pci_dev,
998+
"truncated design parameter (incomplete type %u)\n",
999+
reader.type);
10051000
else
1006-
netif_err(efx, probe, efx->net_dev,
1007-
"truncated design parameter %u\n",
1008-
reader.type);
1001+
pci_err(efx->pci_dev,
1002+
"truncated design parameter %u\n",
1003+
reader.type);
10091004
rc = -EIO;
10101005
}
10111006
out:

drivers/net/ethernet/sfc/ef100_rx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ void __ef100_rx_packet(struct efx_channel *channel)
134134
goto free_rx_buffer;
135135
}
136136

137+
++rx_queue->rx_packets;
138+
rx_queue->rx_bytes += rx_buf->len;
139+
137140
efx_rx_packet_gro(channel, rx_buf, channel->rx_pkt_n_frags, eh, csum);
138141
goto out;
139142

@@ -149,8 +152,6 @@ static void ef100_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index)
149152
struct efx_channel *channel = efx_rx_queue_channel(rx_queue);
150153
struct efx_nic *efx = rx_queue->efx;
151154

152-
++rx_queue->rx_packets;
153-
154155
netif_vdbg(efx, rx_status, efx->net_dev,
155156
"RX queue %d received id %x\n",
156157
efx_rx_queue_index(rx_queue), index);

0 commit comments

Comments
 (0)