diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/Makefile b/src/driver/linux_net/drivers/net/ethernet/sfc/Makefile index 4165e8ecd..8c6d05f08 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/Makefile +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/Makefile @@ -32,11 +32,16 @@ export CONFIG_SFC_SRIOV := y export CONFIG_SFC_PTP := y export CONFIG_SFC_TRACING := export CONFIG_SFC_MCDI_LOGGING := y -export CONFIG_SFC_SIENA := export CONFIG_SFC_DRIVERLINK := m export CONFIG_SFC_AOE := $(subst m,y,$(CONFIG_SFC_DRIVERLINK)) export CONFIG_SFC_BUSYPOLL := n export CONFIG_SFC_VDPA := y + +ifndef CONFIG_SFC_SIENA +export CONFIG_SFC_SIENA := +endif +else +export CONFIG_SFC_SIENA := endif ifdef KSRCDIR @@ -163,6 +168,7 @@ ifeq ($(filter export export-xen,$(MAKECMDGOALS)),) ifndef EFX_FOR_UPSTREAM sfc-y += sfctool.o ef100_dump.o sfc-$(CONFIG_SFC_AOE) += aoe.o +sfc-$(CONFIG_SFC_VDPA) += ef100_vdpa_dbg.o endif # !EFX_FOR_UPSTREAM sfc-$(CONFIG_SFC_DUMP) += dump.o endif diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.c b/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.c index 638355fe2..c1d48eca2 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.c @@ -32,44 +32,6 @@ struct efx_debugfs_bound_param { unsigned int index; }; - -#ifdef EFX_USE_KCOMPAT - -#ifndef EFX_HAVE_DEBUGFS_CREATE_SYMLINK - -/* We don't absolutely need the symlinks, and we don't do anything - * with the returned dentry pointer except compare it to NULL and then - * later pass it to debugfs_remove(). So make - * debugfs_create_symlink() return a fake dentry and filter that out - * in debugfs_remove(). - */ - -static struct dentry efx_debugfs_dummy_dentry; - -static struct dentry * -efx_debugfs_create_symlink(const char *name, struct dentry *old_dentry, - const char *dest) -{ - return &efx_debugfs_dummy_dentry; -} -#define debugfs_create_symlink efx_debugfs_create_symlink - -static void efx_debugfs_remove(struct dentry *dentry) -{ - if (dentry != &efx_debugfs_dummy_dentry) - debugfs_remove(dentry); -} -#define debugfs_remove efx_debugfs_remove - -#endif - -#ifdef EFX_HAVE_INODE_U_GENERIC_IP -#define i_private u.generic_ip -#endif - -#endif /* EFX_USE_KCOMPAT */ - - /* Maximum length for a name component or symlink target */ #define EFX_DEBUGFS_NAME_LEN 32 @@ -113,54 +75,6 @@ static struct file_operations efx_debugfs_file_ops = { .release = single_release }; - -/** - * efx_fini_debugfs_child - remove a named child of a debugfs directory - * @dir: Directory - * @name: Name of child - * - * This removes the named child from the directory, if it exists. - */ -void efx_fini_debugfs_child(struct dentry *dir, const char *name) -{ - struct qstr child_name = QSTR_INIT(name, strlen(name)); - struct dentry *child; - - child = d_hash_and_lookup(dir, &child_name); - if (!IS_ERR_OR_NULL(child)) { - /* If it's a "regular" file, free its parameter binding */ - if (S_ISREG(child->d_inode->i_mode)) - kfree(child->d_inode->i_private); - debugfs_remove(child); - dput(child); - } -} - -/* - * Remove a debugfs directory. - * - * This removes the named parameter-files and sym-links from the - * directory, and the directory itself. It does not do any recursion - * to subdirectories. - */ -static void efx_fini_debugfs_dir(struct dentry *dir, - const struct efx_debugfs_parameter *params, - const char *const *symlink_names) -{ - if (!dir) - return; - - while (params->name) { - efx_fini_debugfs_child(dir, params->name); - params++; - } - while (symlink_names && *symlink_names) { - efx_fini_debugfs_child(dir, *symlink_names); - symlink_names++; - } - debugfs_remove(dir); -} - /* Functions for printing various types of parameter. */ int efx_debugfs_read_ushort(struct seq_file *file, void *data) @@ -195,15 +109,6 @@ int efx_debugfs_read_atomic(struct seq_file *file, void *data) return 0; } -int efx_debugfs_read_dword(struct seq_file *file, void *data) -{ - unsigned int value = EFX_DWORD_FIELD(*(efx_dword_t *) data, - EFX_DWORD_0); - - seq_printf(file, "%#x\n", value); - return 0; -} - int efx_debugfs_read_u64(struct seq_file *file, void *data) { unsigned long long value = *((u64 *) data); @@ -339,7 +244,7 @@ efx_init_debugfs_files(struct dentry *parent, if ((1ULL << pos) & ignore) continue; - efx_fini_debugfs_child(parent, params[pos].name); + debugfs_lookup_and_remove(params[pos].name, parent); } return -ENOMEM; } @@ -495,7 +400,7 @@ void efx_trim_debugfs_port(struct efx_nic *efx, if (dir) { const struct efx_debugfs_parameter *field; for (field = params; field->name; field++) - efx_fini_debugfs_child(dir, field->name); + debugfs_lookup_and_remove(field->name, dir); } } @@ -582,8 +487,7 @@ int efx_init_debugfs_vdpa(struct ef100_vdpa_nic *vdpa) */ void efx_fini_debugfs_vdpa(struct ef100_vdpa_nic *vdpa) { - efx_fini_debugfs_dir(vdpa->debug_dir, - efx_debugfs_vdpa_parameters, NULL); + debugfs_remove_recursive(vdpa->debug_dir); vdpa->debug_dir = NULL; } @@ -658,9 +562,7 @@ int efx_init_debugfs_vdpa_vring(struct ef100_vdpa_nic *vdpa, */ void efx_fini_debugfs_vdpa_vring(struct ef100_vdpa_vring_info *vdpa_vring) { - if (vdpa_vring->debug_dir) - efx_fini_debugfs_dir(vdpa_vring->debug_dir, - efx_debugfs_vdpa_vring_parameters, NULL); + debugfs_remove_recursive(vdpa_vring->debug_dir); vdpa_vring->debug_dir = NULL; } #endif @@ -763,12 +665,7 @@ static int efx_init_debugfs_tx_queue(struct efx_tx_queue *tx_queue) */ static void efx_fini_debugfs_tx_queue(struct efx_tx_queue *tx_queue) { - static const char *const symlink_names[] = { - "channel", "port", NULL - }; - - efx_fini_debugfs_dir(tx_queue->debug_dir, - efx_debugfs_tx_queue_parameters, symlink_names); + debugfs_remove_recursive(tx_queue->debug_dir); tx_queue->debug_dir = NULL; } @@ -885,12 +782,7 @@ static int efx_init_debugfs_rx_queue(struct efx_rx_queue *rx_queue) */ static void efx_fini_debugfs_rx_queue(struct efx_rx_queue *rx_queue) { - const char *const symlink_names[] = { - "channel", NULL - }; - - efx_fini_debugfs_dir(rx_queue->debug_dir, - efx_debugfs_rx_queue_parameters, symlink_names); + debugfs_remove_recursive(rx_queue->debug_dir); rx_queue->debug_dir = NULL; } @@ -967,8 +859,7 @@ static int efx_init_debugfs_channel(struct efx_channel *channel) */ static void efx_fini_debugfs_channel(struct efx_channel *channel) { - efx_fini_debugfs_dir(channel->debug_dir, - efx_debugfs_channel_parameters, NULL); + debugfs_remove_recursive(channel->debug_dir); channel->debug_dir = NULL; } @@ -1138,19 +1029,16 @@ int efx_init_debugfs_nic(struct efx_nic *efx) */ void efx_fini_debugfs_nic(struct efx_nic *efx) { - efx_fini_debugfs_dir(efx->debug_port_dir, - efx_debugfs_port_parameters, NULL); + debugfs_remove_recursive(efx->debug_port_dir); efx->debug_port_dir = NULL; - efx_fini_debugfs_dir(efx->errors.debug_dir, - efx_debugfs_nic_error_parameters, NULL); + debugfs_remove_recursive(efx->errors.debug_dir); efx->errors.debug_dir = NULL; - efx_fini_debugfs_dir(efx->debug_dir, efx_debugfs_nic_parameters, NULL); + debugfs_remove_recursive(efx->debug_dir); efx->debug_dir = NULL; } /** * efx_init_debugfs - create debugfs directories for sfc driver - * @module: Name of the kernel module. * * Create debugfs directories "sfc" and "sfc/cards". This must be * called before any of the other functions that create debugfs @@ -1159,19 +1047,20 @@ void efx_fini_debugfs_nic(struct efx_nic *efx) * * Return: a negative error code or 0 on success. */ -int efx_init_debugfs(const char *module) +int efx_init_debugfs(void) { int rc; /* Create top-level directory */ - efx_debug_root = debugfs_create_dir(module, NULL); + efx_debug_root = debugfs_create_dir(KBUILD_MODNAME, NULL); if (!efx_debug_root) { - printk(KERN_ERR "debugfs_create_dir %s failed.\n", module); + pr_err("debugfs_create_dir %s failed.\n", KBUILD_MODNAME); rc = -ENOMEM; goto err; } else if (IS_ERR(efx_debug_root)) { rc = PTR_ERR(efx_debug_root); - printk(KERN_ERR "debugfs_create_dir %s failed, rc=%d.\n", module, rc); + pr_err("debugfs_create_dir %s failed, rc=%d.\n", + KBUILD_MODNAME, rc); goto err; } @@ -1202,9 +1091,8 @@ int efx_init_debugfs(const char *module) */ void efx_fini_debugfs(void) { - debugfs_remove(efx_debug_cards); + debugfs_remove_recursive(efx_debug_root); efx_debug_cards = NULL; - debugfs_remove(efx_debug_root); efx_debug_root = NULL; } diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.h b/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.h index b9aa002c3..763918819 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.h +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/debugfs.h @@ -23,7 +23,6 @@ struct efx_debugfs_parameter { }; #ifdef CONFIG_DEBUG_FS -void efx_fini_debugfs_child(struct dentry *dir, const char *name); int efx_init_debugfs_netdev(struct net_device *net_dev); void efx_fini_debugfs_netdev(struct net_device *net_dev); void efx_update_debugfs_netdev(struct efx_nic *efx); @@ -31,7 +30,7 @@ int efx_init_debugfs_nic(struct efx_nic *efx); void efx_fini_debugfs_nic(struct efx_nic *efx); int efx_init_debugfs_channels(struct efx_nic *efx); void efx_fini_debugfs_channels(struct efx_nic *efx); -int efx_init_debugfs(const char *module); +int efx_init_debugfs(void); void efx_fini_debugfs(void); int efx_extend_debugfs_port(struct efx_nic *efx, void *context, u64 ignore, @@ -54,7 +53,6 @@ int efx_debugfs_read_ulong(struct seq_file *, void *); int efx_debugfs_read_string(struct seq_file *, void *); int efx_debugfs_read_int(struct seq_file *, void *); int efx_debugfs_read_atomic(struct seq_file *, void *); -int efx_debugfs_read_dword(struct seq_file *, void *); int efx_debugfs_read_u64(struct seq_file *, void *); int efx_debugfs_read_bool(struct seq_file *, void *); #ifdef CONFIG_SFC_VDPA @@ -99,29 +97,6 @@ int efx_debugfs_read_x64(struct seq_file *, void *); .reader = reader_function, \ } -/* Likewise, but with one file for each of 4 lanes */ -#define EFX_PER_LANE_PARAMETER(prefix, suffix, container_type, parameter, \ - field_type, reader_function) { \ - .name = prefix "0" suffix, \ - .offset = ((((field_type *) 0) == \ - ((container_type *) 0)->parameter) ? \ - offsetof(container_type, parameter[0]) : \ - offsetof(container_type, parameter[0])), \ - .reader = reader_function, \ -}, { \ - .name = prefix "1" suffix, \ - .offset = offsetof(container_type, parameter[1]), \ - .reader = reader_function, \ -}, { \ - .name = prefix "2" suffix, \ - .offset = offsetof(container_type, parameter[2]), \ - .reader = reader_function, \ -}, { \ - .name = prefix "3" suffix, \ - .offset = offsetof(container_type, parameter[3]), \ - .reader = reader_function, \ -} - /* A string parameter (string embedded in the structure) */ #define EFX_STRING_PARAMETER(container_type, parameter) { \ .name = #parameter, \ @@ -147,11 +122,6 @@ int efx_debugfs_read_x64(struct seq_file *, void *); EFX_PARAMETER(container_type, parameter, \ unsigned long, efx_debugfs_read_ulong) -/* A dword parameter */ -#define EFX_DWORD_PARAMETER(container_type, parameter) \ - EFX_PARAMETER(container_type, parameter, \ - efx_dword_t, efx_debugfs_read_dword) - /* A u64 parameter */ #define EFX_U64_PARAMETER(container_type, parameter) \ EFX_PARAMETER(container_type, parameter, \ diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef10.c b/src/driver/linux_net/drivers/net/ethernet/sfc/ef10.c index 418780505..56a2e7527 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/ef10.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef10.c @@ -3061,12 +3061,10 @@ static int efx_ef10_probe_multicast_chaining(struct efx_nic *efx) static int efx_ef10_filter_table_probe(struct efx_nic *efx) { struct efx_ef10_nic_data *nic_data = efx->nic_data; - bool rss_limited = efx_ef10_has_cap(nic_data->datapath_caps, - RX_RSS_LIMITED); bool additional_rss = efx_ef10_has_cap(nic_data->datapath_caps, ADDITIONAL_RSS_MODES); - return efx_mcdi_filter_table_probe(efx, rss_limited, additional_rss); + return efx_mcdi_filter_table_probe(efx, additional_rss); } static int efx_ef10_filter_table_init(struct efx_nic *efx) @@ -3113,6 +3111,39 @@ static void efx_ef10_filter_table_fini(struct efx_nic *efx) efx_mcdi_filter_table_fini(efx); } +static int efx_ef10_pf_rx_push_rss_config(struct efx_nic *efx, bool user, + const u32 *rx_indir_table, + const u8 *key) +{ + struct efx_ef10_nic_data *nic_data = efx->nic_data; + + if (efx_ef10_has_cap(nic_data->datapath_caps, RX_RSS_LIMITED)) + return -EOPNOTSUPP; + return efx_mcdi_rx_push_rss_config(efx, user, rx_indir_table, key); +} + +#ifdef CONFIG_SFC_SRIOV +static int efx_ef10_vf_rx_push_rss_config(struct efx_nic *efx, bool user, + const u32 *rx_indir_table, + const u8 *key) +{ + struct efx_ef10_nic_data *nic_data = efx->nic_data; + + if (efx_ef10_has_cap(nic_data->datapath_caps, RX_RSS_LIMITED)) + return -EOPNOTSUPP; + + /* on EF10 we're limited on RSS contexts, so do not push an exclusive + * context, only accept a shared. + */ + if (user) + return -EOPNOTSUPP; + if (efx->rss_context.context_id != EFX_MCDI_RSS_CONTEXT_INVALID) + return 0; + + return efx_mcdi_rx_push_shared_rss_config(efx, NULL); +} +#endif + static int efx_ef10_rx_init(struct efx_rx_queue *rx_queue) { bool want_outer_classes = false; @@ -5877,7 +5908,7 @@ const struct efx_nic_type efx_hunt_a0_vf_nic_type = { .tx_limit_len = efx_ef10_tx_limit_len, .tx_enqueue = __efx_enqueue_skb, .tx_max_skb_descs = efx_ef10_tx_max_skb_descs, - .rx_push_rss_config = efx_mcdi_vf_rx_push_rss_config, + .rx_push_rss_config = efx_ef10_vf_rx_push_rss_config, .rx_pull_rss_config = efx_mcdi_rx_pull_rss_config, .rx_probe = efx_mcdi_rx_probe, .rx_init = efx_ef10_rx_init, @@ -6034,7 +6065,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = { .tx_limit_len = efx_ef10_tx_limit_len, .tx_max_skb_descs = efx_ef10_tx_max_skb_descs, .tx_enqueue = __efx_enqueue_skb, - .rx_push_rss_config = efx_mcdi_pf_rx_push_rss_config, + .rx_push_rss_config = efx_ef10_pf_rx_push_rss_config, .rx_pull_rss_config = efx_mcdi_rx_pull_rss_config, .rx_push_rss_context_config = efx_mcdi_rx_push_rss_context_config, .rx_pull_rss_context_config = efx_mcdi_rx_pull_rss_context_config, diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_nic.c b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_nic.c index 11d8e84ef..953edf33b 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_nic.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_nic.c @@ -585,15 +585,12 @@ int ef100_phy_probe(struct efx_nic *efx) int ef100_filter_table_probe(struct efx_nic *efx) { struct ef100_nic_data *nic_data = efx->nic_data; - bool rss_limited, additional_rss; + bool additional_rss; - rss_limited = efx_ef100_has_cap(nic_data->datapath_caps, - RX_RSS_LIMITED); additional_rss = efx_ef100_has_cap(nic_data->datapath_caps, ADDITIONAL_RSS_MODES); - return efx_mcdi_filter_table_probe(efx, rss_limited, - additional_rss); + return efx_mcdi_filter_table_probe(efx, additional_rss); } static int ef100_filter_table_init(struct efx_nic *efx) @@ -646,6 +643,21 @@ static void ef100_filter_table_down(struct efx_nic *efx) up_write(&efx->filter_sem); } +static int efx_ef100_rx_push_rss_config(struct efx_nic *efx, bool user, + const u32 *rx_indir_table, + const u8 *key) +{ + struct ef100_nic_data *nic_data = efx->nic_data; + + if (efx_ef100_has_cap(nic_data->datapath_caps, RX_RSS_LIMITED)) + return -EOPNOTSUPP; + /* on EF100 we have many available RSS contexts, so use the PF version + * of push_rss_config for both PFs and VFs rather than the "VF" + * version that's conservative about allocating RSS contexts. + */ + return efx_mcdi_rx_push_rss_config(efx, user, rx_indir_table, key); +} + /* Other */ static int ef100_reconfigure_mac(struct efx_nic *efx, bool mtu_only) @@ -1937,7 +1949,7 @@ const struct efx_nic_type ef100_pf_nic_type = { .rx_ts_offset = ESF_GZ_RX_PREFIX_PARTIAL_TSTAMP_LBN / 8, .rx_hash_key_size = 40, .rx_pull_rss_config = efx_mcdi_rx_pull_rss_config, - .rx_push_rss_config = efx_mcdi_pf_rx_push_rss_config, + .rx_push_rss_config = efx_ef100_rx_push_rss_config, .rx_push_rss_context_config = efx_mcdi_rx_push_rss_context_config, .rx_pull_rss_context_config = efx_mcdi_rx_pull_rss_context_config, .rx_restore_rss_contexts = efx_mcdi_rx_restore_rss_contexts, @@ -2070,7 +2082,7 @@ const struct efx_nic_type ef100_vf_nic_type = { .rx_ts_offset = ESF_GZ_RX_PREFIX_PARTIAL_TSTAMP_LBN / 8, .rx_hash_key_size = 40, .rx_pull_rss_config = efx_mcdi_rx_pull_rss_config, - .rx_push_rss_config = efx_mcdi_pf_rx_push_rss_config, + .rx_push_rss_config = efx_ef100_rx_push_rss_config, .rx_restore_rss_contexts = efx_mcdi_rx_restore_rss_contexts, .rx_recycle_ring_size = efx_ef100_recycle_ring_size, diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.c b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.c index 2bd39bfe4..8a67eaab3 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.c @@ -151,10 +151,10 @@ int ef100_vdpa_register_mgmtdev(struct efx_nic *efx) return -ENOMEM; rc = efx_vdpa_get_features(efx, EF100_VDPA_DEVICE_TYPE_NET, &features); - if (rc != 0) { + if (rc) { pci_err(efx->pci_dev, "%s: MCDI get features error:%d\n", __func__, rc); - return rc; + goto free_mgmt_dev; } efx->mgmt_dev = mgmt_dev; @@ -175,21 +175,31 @@ int ef100_vdpa_register_mgmtdev(struct efx_nic *efx) pci_err(efx->pci_dev, "vdpa management device register failed, err: %d\n", rc); - kfree(mgmt_dev); - efx->mgmt_dev = NULL; + goto free_mgmt_dev; +#ifdef EFX_NOT_UPSTREAM } else { pci_dbg(efx->pci_dev, "vdpa management device created\n"); +#endif } + return 0; + +free_mgmt_dev: + kfree(mgmt_dev); + efx->mgmt_dev = NULL; return rc; } void ef100_vdpa_unregister_mgmtdev(struct efx_nic *efx) { +#ifdef EFX_NOT_UPSTREAM pci_dbg(efx->pci_dev, "Unregister vdpa_management_device\n"); - if (efx->mgmt_dev) +#endif + if (efx->mgmt_dev) { vdpa_mgmtdev_unregister(efx->mgmt_dev); - efx->mgmt_dev = NULL; + kfree(efx->mgmt_dev); + efx->mgmt_dev = NULL; + } } #endif @@ -528,7 +538,7 @@ void ef100_vdpa_fini(struct efx_probe_data *probe_data) #endif if (efx->state != STATE_VDPA && efx->state != STATE_DISABLED) { - pci_dbg(efx->pci_dev, "%s: Invalid efx state %u", + pci_err(efx->pci_dev, "%s: Invalid efx state %u", __func__, efx->state); return; } @@ -566,7 +576,7 @@ static int get_net_config(struct ef100_vdpa_nic *vdpa_nic) } vdpa_nic->net_config.max_virtqueue_pairs = - (__virtio16 __force)vdpa_nic->max_queue_pairs; + cpu_to_efx_vdpa16(vdpa_nic, vdpa_nic->max_queue_pairs); rc = efx_vdpa_get_mtu(efx, &mtu); if (rc) { @@ -575,7 +585,7 @@ static int get_net_config(struct ef100_vdpa_nic *vdpa_nic) vdpa_nic->vf_index, rc); return rc; } - vdpa_nic->net_config.mtu = (__virtio16 __force)mtu; + vdpa_nic->net_config.mtu = cpu_to_efx_vdpa16(vdpa_nic, mtu); rc = efx_vdpa_get_link_details(efx, &link_up, &speed, &duplex); if (rc) { @@ -584,10 +594,11 @@ static int get_net_config(struct ef100_vdpa_nic *vdpa_nic) vdpa_nic->vf_index, rc); return rc; } - vdpa_nic->net_config.status = (__virtio16 __force)link_up; - vdpa_nic->net_config.speed = (__le32 __force)speed; + vdpa_nic->net_config.status = cpu_to_efx_vdpa16(vdpa_nic, link_up); + vdpa_nic->net_config.speed = cpu_to_efx_vdpa32(vdpa_nic, speed); vdpa_nic->net_config.duplex = duplex; +#ifdef EFX_NOT_UPSTREAM dev_info(&vdpa_nic->vdpa_dev.dev, "%s: mac address: %pM\n", __func__, vdpa_nic->net_config.mac); dev_info(&vdpa_nic->vdpa_dev.dev, "%s: MTU:%u\n", __func__, @@ -597,6 +608,7 @@ static int get_net_config(struct ef100_vdpa_nic *vdpa_nic) vdpa_nic->net_config.status, vdpa_nic->net_config.speed, vdpa_nic->net_config.duplex); +#endif return 0; } @@ -716,9 +728,11 @@ struct ef100_vdpa_nic *ef100_vdpa_create(struct efx_nic *efx, vdpa_nic->mac_address = (u8 *)&vdpa_nic->net_config.mac; dev = &vdpa_nic->vdpa_dev.dev; +#ifdef EFX_NOT_UPSTREAM dev_info(dev, "%s: vDPA dev pf_index:%u vf_index:%u max_queues:%u\n", __func__, vdpa_nic->pf_index, vdpa_nic->vf_index, vdpa_nic->max_queue_pairs); +#endif for (i = 0; i < (2 * vdpa_nic->max_queue_pairs); i++) { rc = ef100_vdpa_init_vring(vdpa_nic, i); diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.h b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.h index 1411ee233..854317e34 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.h +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa.h @@ -23,7 +23,7 @@ #define EF100_VDPA_VIRTIO_NET_DEVICE_ID VIRTIO_ID_NET /* Vendor ID of Xilinx vDPA NIC */ -#define EF100_VDPA_XNX_VENDOR_ID PCI_VENDOR_ID_XILINX +#define EF100_VDPA_VENDOR_ID PCI_VENDOR_ID_XILINX /* Max Queue pairs currently supported */ #define EF100_VDPA_MAX_QUEUES_PAIRS 1 @@ -56,43 +56,42 @@ #define EFX_VDPA_NAME(_vdpa) "vdpa_%d_%d", (_vdpa)->pf_index, (_vdpa)->vf_index #define EFX_VDPA_VRING_NAME(_idx) "vring_%d", _idx -/* Following are the states for a vDPA NIC +/** + * enum ef100_vdpa_nic_state - possible states for a vDPA NIC + * * @EF100_VDPA_STATE_INITIALIZED: State after vDPA NIC created * @EF100_VDPA_STATE_NEGOTIATED: State after feature negotiation * @EF100_VDPA_STATE_STARTED: State after driver ok + * @EF100_VDPA_STATE_SUSPENDED: State after device suspend + * @EF100_VDPA_STATE_NSTATES: Number of VDPA states */ enum ef100_vdpa_nic_state { - EF100_VDPA_STATE_INITIALIZED = 0, - EF100_VDPA_STATE_NEGOTIATED = 1, - EF100_VDPA_STATE_STARTED = 2, + EF100_VDPA_STATE_INITIALIZED, + EF100_VDPA_STATE_NEGOTIATED, + EF100_VDPA_STATE_STARTED, + EF100_VDPA_STATE_SUSPENDED, EF100_VDPA_STATE_NSTATES }; -/* Enum defining the virtio device types - * @EF100_VDPA_DEVICE_TYPE_NET: virtio net device type - */ enum ef100_vdpa_device_type { EF100_VDPA_DEVICE_TYPE_NET, EF100_VDPA_DEVICE_NTYPES }; -/* Enum defining the virtquque types - * @EF100_VDPA_VQ_TYPE_NET_RXQ: NET RX type - * @EF100_VDPA_VQ_TYPE_NET_TXQ: NET TX type - */ enum ef100_vdpa_vq_type { EF100_VDPA_VQ_TYPE_NET_RXQ, EF100_VDPA_VQ_TYPE_NET_TXQ, EF100_VDPA_VQ_NTYPES }; -/* struct ef100_vdpa_vring_info - vDPA vring data structure +/** + * struct ef100_vdpa_vring_info - vDPA vring data structure + * * @desc: Descriptor area address of the vring * @avail: Available area address of the vring * @used: Device area address of the vring - * @size: Size of the vring + * @size: Number of entries in the vring * @vring_state: bit map to track vring configuration - * @vring_created: set to true when vring is created. * @last_avail_idx: last available index of the vring * @last_used_idx: last used index of the vring * @doorbell_offset: doorbell offset @@ -124,9 +123,11 @@ struct ef100_vdpa_vring_info { #endif }; -/* struct ef100_vdpa_nic - vDPA NIC data structure +/** + * struct ef100_vdpa_nic - vDPA NIC data structure + * * @vdpa_dev: vdpa_device object which registers on the vDPA bus. - * @vdpa_state: NIC state machine governed by ef100_vdpa_nic_state + * @vdpa_state: ensures correct device status transitions via set_status cb * @mcdi_mode: MCDI mode at the time of unmapping VF mcdi buffer * @efx: pointer to the VF's efx_nic object * @lock: Managing access to vdpa config operations @@ -134,6 +135,7 @@ struct ef100_vdpa_vring_info { * @vf_index: VF index of the vDPA VF * @status: device status as per VIRTIO spec * @features: negotiated feature bits + * @max_queue_pairs: maximum number of queue pairs supported * @net_config: virtio_net_config data * @vring: vring information of the vDPA device. * @mac_address: mac address of interface associated with this vdpa device @@ -146,6 +148,7 @@ struct ef100_vdpa_nic { enum ef100_vdpa_nic_state vdpa_state; enum efx_mcdi_mode mcdi_mode; struct efx_nic *efx; + /* for synchronizing access to vdpa config operations */ struct mutex lock; u32 pf_index; u32 vf_index; @@ -183,6 +186,36 @@ bool ef100_vdpa_dev_in_use(struct efx_nic *efx); int ef100_vdpa_init_vring(struct ef100_vdpa_nic *vdpa_nic, u16 idx); int ef100_vdpa_map_mcdi_buffer(struct efx_nic *efx); +static inline bool efx_vdpa_is_little_endian(struct ef100_vdpa_nic *vdpa_nic) +{ + return virtio_legacy_is_little_endian() || + (vdpa_nic->features & (1ULL << VIRTIO_F_VERSION_1)); +} + +static inline u16 efx_vdpa16_to_cpu(struct ef100_vdpa_nic *vdpa_nic, + __virtio16 val) +{ + return __virtio16_to_cpu(efx_vdpa_is_little_endian(vdpa_nic), val); +} + +static inline __virtio16 cpu_to_efx_vdpa16(struct ef100_vdpa_nic *vdpa_nic, + u16 val) +{ + return __cpu_to_virtio16(efx_vdpa_is_little_endian(vdpa_nic), val); +} + +static inline u32 efx_vdpa32_to_cpu(struct ef100_vdpa_nic *vdpa_nic, + __virtio32 val) +{ + return __virtio32_to_cpu(efx_vdpa_is_little_endian(vdpa_nic), val); +} + +static inline __virtio32 cpu_to_efx_vdpa32(struct ef100_vdpa_nic *vdpa_nic, + u32 val) +{ + return __cpu_to_virtio32(efx_vdpa_is_little_endian(vdpa_nic), val); +} + extern const struct vdpa_config_ops ef100_vdpa_config_ops; #endif /* CONFIG_SFC_VDPA */ diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_dbg.c b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_dbg.c new file mode 100644 index 000000000..df497ba12 --- /dev/null +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_dbg.c @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Driver for AMD network controllers and boards + * Copyright(C) 2023, Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation, incorporated herein by reference. + */ + +#include "ef100_vdpa.h" +#include "ef100_vdpa_dbg.h" + +#define SIZE 100 + +struct bit_label { + u8 bit; + char *str; +}; + +static const struct bit_label virtio_net_features[] = { + {VIRTIO_F_NOTIFY_ON_EMPTY, "VIRTIO_F_NOTIFY_ON_EMPTY"}, + {VIRTIO_F_ANY_LAYOUT, "VIRTIO_F_ANY_LAYOUT"}, + {VIRTIO_F_VERSION_1, "VIRTIO_F_VERSION_1"}, + {VIRTIO_F_ACCESS_PLATFORM, "VIRTIO_F_ACCESS_PLATFORM"}, + {VIRTIO_F_RING_PACKED, "VIRTIO_F_RING_PACKED"}, + {VIRTIO_F_ORDER_PLATFORM, "VIRTIO_F_ORDER_PLATFORM"}, + {VIRTIO_F_IN_ORDER, "VIRTIO_F_IN_ORDER"}, + {VIRTIO_F_SR_IOV, "VIRTIO_F_SR_IOV"}, + {VIRTIO_NET_F_CSUM, "VIRTIO_NET_F_CSUM"}, + {VIRTIO_NET_F_GUEST_CSUM, "VIRTIO_NET_F_GUEST_CSUM"}, + {VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, "VIRTIO_NET_F_CTRL_GUEST_OFFLOADS"}, + {VIRTIO_NET_F_MTU, "VIRTIO_NET_F_MTU"}, + {VIRTIO_NET_F_MAC, "VIRTIO_NET_F_MAC"}, + {VIRTIO_NET_F_GUEST_TSO4, "VIRTIO_NET_F_GUEST_TSO4"}, + {VIRTIO_NET_F_GUEST_TSO6, "VIRTIO_NET_F_GUEST_TSO6"}, + {VIRTIO_NET_F_GUEST_ECN, "VIRTIO_NET_F_GUEST_ECN"}, + {VIRTIO_NET_F_GUEST_UFO, "VIRTIO_NET_F_GUEST_UFO"}, + {VIRTIO_NET_F_HOST_TSO4, "VIRTIO_NET_F_HOST_TSO4"}, + {VIRTIO_NET_F_HOST_TSO6, "VIRTIO_NET_F_HOST_TSO6"}, + {VIRTIO_NET_F_HOST_ECN, "VIRTIO_NET_F_HOST_ECN"}, + {VIRTIO_NET_F_HOST_UFO, "VIRTIO_NET_F_HOST_UFO"}, + {VIRTIO_NET_F_MRG_RXBUF, "VIRTIO_NET_F_MRG_RXBUF"}, + {VIRTIO_NET_F_STATUS, "VIRTIO_NET_F_STATUS"}, + {VIRTIO_NET_F_CTRL_VQ, "VIRTIO_NET_F_CTRL_VQ"}, + {VIRTIO_NET_F_CTRL_RX, "VIRTIO_NET_F_CTRL_RX"}, + {VIRTIO_NET_F_CTRL_VLAN, "VIRTIO_NET_F_CTRL_VLAN"}, + {VIRTIO_NET_F_CTRL_RX_EXTRA, "VIRTIO_NET_F_CTRL_RX_EXTRA"}, + {VIRTIO_NET_F_GUEST_ANNOUNCE, "VIRTIO_NET_F_GUEST_ANNOUNCE"}, + {VIRTIO_NET_F_MQ, "VIRTIO_NET_F_MQ"}, + {VIRTIO_NET_F_CTRL_MAC_ADDR, "VIRTIO_NET_F_CTRL_MAC_ADDR"}, + {VIRTIO_NET_F_HASH_REPORT, "VIRTIO_NET_F_HASH_REPORT"}, + {VIRTIO_NET_F_RSS, "VIRTIO_NET_F_RSS"}, + {VIRTIO_NET_F_RSC_EXT, "VIRTIO_NET_F_RSC_EXT"}, + {VIRTIO_NET_F_STANDBY, "VIRTIO_NET_F_STANDBY"}, + {VIRTIO_NET_F_SPEED_DUPLEX, "VIRTIO_NET_F_SPEED_DUPLEX"}, + {VIRTIO_NET_F_GSO, "VIRTIO_NET_F_GSO"}, +}; + +static const struct bit_label virtio_net_status[] = { + {VIRTIO_CONFIG_S_ACKNOWLEDGE, "ACKNOWLEDGE"}, + {VIRTIO_CONFIG_S_DRIVER, "DRIVER"}, + {VIRTIO_CONFIG_S_FEATURES_OK, "FEATURES_OK"}, + {VIRTIO_CONFIG_S_DRIVER_OK, "DRIVER_OK"}, + {VIRTIO_CONFIG_S_FAILED, "FAILED"} +}; + +void print_status_str(u8 status, struct vdpa_device *vdev) +{ + u16 table_len = ARRAY_SIZE(virtio_net_status); + char concat_str[] = ", "; + char buf[SIZE] = {0}; + u16 i; + + if (status == 0) { + dev_info(&vdev->dev, "RESET\n"); + return; + } + for (i = 0; (i < table_len) && status; i++) { + if (status & virtio_net_status[i].bit) { + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + "%s", virtio_net_status[i].str); + status &= ~virtio_net_status[i].bit; + snprintf(buf + strlen(buf), + sizeof(buf) - strlen(buf), "%s", concat_str); + } + } + dev_info(&vdev->dev, "%s\n", buf); + if (status) + dev_info(&vdev->dev, "Unknown status:0x%x\n", status); +} + +void print_features_str(u64 features, struct vdpa_device *vdev) +{ + int table_len = ARRAY_SIZE(virtio_net_features); + int i; + + for (i = 0; (i < table_len) && features; i++) { + if (features & BIT_ULL(virtio_net_features[i].bit)) { + dev_info(&vdev->dev, "%s: %s\n", __func__, + virtio_net_features[i].str); + features &= ~BIT_ULL(virtio_net_features[i].bit); + } + } + if (features) { + dev_info(&vdev->dev, + "%s: Unknown Features:0x%llx\n", + __func__, features); + } +} + +void print_vring_state(u16 state, struct vdpa_device *vdev) +{ + bool addr_conf = state & EF100_VRING_ADDRESS_CONFIGURED; + bool size_conf = state & EF100_VRING_SIZE_CONFIGURED; + bool ready_conf = state & EF100_VRING_READY_CONFIGURED; + bool vring_created = state & EF100_VRING_CREATED; + + dev_info(&vdev->dev, + "%s: addr_conf: %u, sz_conf: %u, rdy_conf: %u, created: %u\n", + __func__, addr_conf, size_conf, ready_conf, vring_created); +} diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_dbg.h b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_dbg.h new file mode 100644 index 000000000..1dd5b7de7 --- /dev/null +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_dbg.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Driver for AMD network controllers and boards + * Copyright(C) 2023, Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation, incorporated herein by reference. + */ + +#ifndef EFX_EF100_VDPA_DBG_H +#define EFX_EF100_VDPA_DBG_H + +void print_status_str(u8 status, struct vdpa_device *vdev); +void print_vring_state(u16 state, struct vdpa_device *vdev); +void print_features_str(u64 features, struct vdpa_device *vdev); + +#endif /* EFX_EF100_VDPA_DBG_H */ diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_ops.c b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_ops.c index 4dd437033..a0f5f639f 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_ops.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ef100_vdpa_ops.c @@ -8,18 +8,15 @@ */ #include -#include -#include -#include -#include -#include -#include #include "ef100_nic.h" #include "io.h" #include "ef100_vdpa.h" #include "mcdi_vdpa.h" #include "mcdi_filters.h" #include "debugfs.h" +#ifdef EFX_NOT_UPSTREAM +#include "ef100_vdpa_dbg.h" +#endif #if defined(CONFIG_SFC_VDPA) @@ -28,141 +25,19 @@ */ #define EFX_GET_VI_INDEX(vq_num) (((vq_num) / 2) + 1) -#if defined(EFX_USE_KCOMPAT) && !defined(VIRTIO_F_IN_ORDER) -/* Virtio feature bit number 35 is not defined in - * include/uapi/linux/virtio_config.h, make it available for the - * out-of-tree builds. VIRTIO_F_IN_ORDER is defined in section 6 - * (Reserved Feature Bits) of the VirtIO v1.1 spec - */ -#define VIRTIO_F_IN_ORDER 35 -#endif - - -struct feature_bit { - u8 bit; - char *str; -}; - -static const struct feature_bit feature_table[] = { - {VIRTIO_F_NOTIFY_ON_EMPTY, "VIRTIO_F_NOTIFY_ON_EMPTY"}, - {VIRTIO_F_ANY_LAYOUT, "VIRTIO_F_ANY_LAYOUT"}, - {VIRTIO_F_VERSION_1, "VIRTIO_F_VERSION_1"}, - {VIRTIO_F_ACCESS_PLATFORM, "VIRTIO_F_ACCESS_PLATFORM"}, - {VIRTIO_F_RING_PACKED, "VIRTIO_F_RING_PACKED"}, - {VIRTIO_F_ORDER_PLATFORM, "VIRTIO_F_ORDER_PLATFORM"}, -#if defined(EFX_USE_KCOMPAT) - {VIRTIO_F_IN_ORDER, "VIRTIO_F_IN_ORDER"}, -#endif - {VIRTIO_F_SR_IOV, "VIRTIO_F_SR_IOV"}, - {VIRTIO_NET_F_CSUM, "VIRTIO_NET_F_CSUM"}, - {VIRTIO_NET_F_GUEST_CSUM, "VIRTIO_NET_F_GUEST_CSUM"}, - {VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, "VIRTIO_NET_F_CTRL_GUEST_OFFLOADS"}, - {VIRTIO_NET_F_MTU, "VIRTIO_NET_F_MTU"}, - {VIRTIO_NET_F_MAC, "VIRTIO_NET_F_MAC"}, - {VIRTIO_NET_F_GUEST_TSO4, "VIRTIO_NET_F_GUEST_TSO4"}, - {VIRTIO_NET_F_GUEST_TSO6, "VIRTIO_NET_F_GUEST_TSO6"}, - {VIRTIO_NET_F_GUEST_ECN, "VIRTIO_NET_F_GUEST_ECN"}, - {VIRTIO_NET_F_GUEST_UFO, "VIRTIO_NET_F_GUEST_UFO"}, - {VIRTIO_NET_F_HOST_TSO4, "VIRTIO_NET_F_HOST_TSO4"}, - {VIRTIO_NET_F_HOST_TSO6, "VIRTIO_NET_F_HOST_TSO6"}, - {VIRTIO_NET_F_HOST_ECN, "VIRTIO_NET_F_HOST_ECN"}, - {VIRTIO_NET_F_HOST_UFO, "VIRTIO_NET_F_HOST_UFO"}, - {VIRTIO_NET_F_MRG_RXBUF, "VIRTIO_NET_F_MRG_RXBUF"}, - {VIRTIO_NET_F_STATUS, "VIRTIO_NET_F_STATUS"}, - {VIRTIO_NET_F_CTRL_VQ, "VIRTIO_NET_F_CTRL_VQ"}, - {VIRTIO_NET_F_CTRL_RX, "VIRTIO_NET_F_CTRL_RX"}, - {VIRTIO_NET_F_CTRL_VLAN, "VIRTIO_NET_F_CTRL_VLAN"}, - {VIRTIO_NET_F_CTRL_RX_EXTRA, "VIRTIO_NET_F_CTRL_RX_EXTRA"}, - {VIRTIO_NET_F_GUEST_ANNOUNCE, "VIRTIO_NET_F_GUEST_ANNOUNCE"}, - {VIRTIO_NET_F_MQ, "VIRTIO_NET_F_MQ"}, - {VIRTIO_NET_F_CTRL_MAC_ADDR, "VIRTIO_NET_F_CTRL_MAC_ADDR"}, - {VIRTIO_NET_F_HASH_REPORT, "VIRTIO_NET_F_HASH_REPORT"}, - {VIRTIO_NET_F_RSS, "VIRTIO_NET_F_RSS"}, - {VIRTIO_NET_F_RSC_EXT, "VIRTIO_NET_F_RSC_EXT"}, - {VIRTIO_NET_F_STANDBY, "VIRTIO_NET_F_STANDBY"}, - {VIRTIO_NET_F_SPEED_DUPLEX, "VIRTIO_NET_F_SPEED_DUPLEX"}, - {VIRTIO_NET_F_GSO, "VIRTIO_NET_F_GSO"}, -}; - -struct status_val { - u8 bit; - char *str; -}; - -static const struct status_val status_val_table[] = { - {VIRTIO_CONFIG_S_ACKNOWLEDGE, "ACKNOWLEDGE"}, - {VIRTIO_CONFIG_S_DRIVER, "DRIVER"}, - {VIRTIO_CONFIG_S_FEATURES_OK, "FEATURES_OK"}, - {VIRTIO_CONFIG_S_DRIVER_OK, "DRIVER_OK"}, - {VIRTIO_CONFIG_S_FAILED, "FAILED"} -}; - -static struct ef100_vdpa_nic *get_vdpa_nic(struct vdpa_device *vdev) +static const char *get_vdpa_state_str(enum ef100_vdpa_nic_state state) { - return container_of(vdev, struct ef100_vdpa_nic, vdpa_dev); -} + const char *vdpa_state_str[] = {"INITIALIZED", "NEGOTIATED", + "STARTED", "SUSPENDED"}; -static void print_status_str(u8 status, struct vdpa_device *vdev) -{ - u16 table_len = sizeof(status_val_table) / sizeof(struct status_val); - char concat_str[] = ", "; - char buf[100]; - u16 i = 0; - - buf[0] = '\0'; - if (status == 0) { - dev_info(&vdev->dev, "RESET\n"); - return; - } - for ( ; (i < table_len) && status; i++) { - if (status & status_val_table[i].bit) { - snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "%s", status_val_table[i].str); - status &= ~status_val_table[i].bit; - if (status > 0) - snprintf(buf + strlen(buf), - sizeof(buf) - strlen(buf), "%s", - concat_str); - } - } - dev_info(&vdev->dev, "%s\n", buf); - if (status) - dev_info(&vdev->dev, "Unknown status:0x%x\n", status); + if (state < EF100_VDPA_STATE_NSTATES) + return vdpa_state_str[state]; + return "UNKNOWN"; } -#ifdef EFX_NOT_UPSTREAM -static void print_features_str(u64 features, struct vdpa_device *vdev) -{ - int table_len = sizeof(feature_table) / sizeof(struct feature_bit); - int i = 0; - - for (; (i < table_len) && features; i++) { - if (features & (1ULL << feature_table[i].bit)) { - dev_info(&vdev->dev, "%s: %s\n", __func__, - feature_table[i].str); - features &= ~(1ULL << feature_table[i].bit); - } - } - if (features) { - dev_info(&vdev->dev, - "%s: Unknown Features:0x%llx\n", - __func__, features); - } -} -#endif - -static char *get_vdpa_state_str(enum ef100_vdpa_nic_state state) +static struct ef100_vdpa_nic *get_vdpa_nic(struct vdpa_device *vdev) { - switch (state) { - case EF100_VDPA_STATE_INITIALIZED: - return "INITIALIZED"; - case EF100_VDPA_STATE_NEGOTIATED: - return "NEGOTIATED"; - case EF100_VDPA_STATE_STARTED: - return "STARTED"; - default: - return "UNKNOWN"; - } + return container_of(vdev, struct ef100_vdpa_nic, vdpa_dev); } static irqreturn_t vring_intr_handler(int irq, void *arg) @@ -175,21 +50,6 @@ static irqreturn_t vring_intr_handler(int irq, void *arg) return IRQ_NONE; } -#ifdef EFX_NOT_UPSTREAM -static void print_vring_state(u16 state, struct vdpa_device *vdev) -{ - dev_info(&vdev->dev, "%s: Vring state:\n", __func__); - dev_info(&vdev->dev, "%s: Address Configured:%s\n", __func__, - (state & EF100_VRING_ADDRESS_CONFIGURED) ? "true" : "false"); - dev_info(&vdev->dev, "%s: Size Configured:%s\n", __func__, - (state & EF100_VRING_SIZE_CONFIGURED) ? "true" : "false"); - dev_info(&vdev->dev, "%s: Ready Configured:%s\n", __func__, - (state & EF100_VRING_READY_CONFIGURED) ? "true" : "false"); - dev_info(&vdev->dev, "%s: Vring Created:%s\n", __func__, - (state & EF100_VRING_CREATED) ? "true" : "false"); -} -#endif - static int ef100_vdpa_irq_vectors_alloc(struct pci_dev *pci_dev, u16 nvqs) { int rc; @@ -420,8 +280,10 @@ static void ef100_vdpa_kick_vq(struct vdpa_device *vdev, u16 idx) return; } idx_val = idx; +#ifdef EFX_NOT_UPSTREAM dev_vdbg(&vdev->dev, "%s: Writing value:%u in offset register:%u\n", __func__, idx_val, vdpa_nic->vring[idx].doorbell_offset); +#endif _efx_writed(vdpa_nic->efx, cpu_to_le32(idx_val), vdpa_nic->vring[idx].doorbell_offset); } @@ -828,8 +690,9 @@ static int ef100_get_vq_irq(struct vdpa_device *vdev, u16 idx) mutex_lock(&vdpa_nic->lock); irq = vdpa_nic->vring[idx].irq; mutex_unlock(&vdpa_nic->lock); - +#ifdef EFX_NOT_UPSTREAM dev_info(&vdev->dev, "%s: Queue Id %u, irq: %d\n", __func__, idx, irq); +#endif return irq; } @@ -861,11 +724,8 @@ static u64 ef100_vdpa_get_device_features(struct vdpa_device *vdev) */ return 0; } - -#if defined(EFX_USE_KCOMPAT) if (!vdpa_nic->in_order) - features &= ~(1ULL << VIRTIO_F_IN_ORDER); -#endif + features &= ~BIT_ULL(VIRTIO_F_IN_ORDER); features |= (1ULL << VIRTIO_NET_F_MAC); /* TODO: QEMU Shadow VirtQueue (SVQ) doesn't support * VIRTIO_F_ORDER_PLATFORM, so masking it off to allow Live Migration @@ -893,8 +753,7 @@ static int ef100_vdpa_set_driver_features(struct vdpa_device *vdev, mutex_lock(&vdpa_nic->lock); if (vdpa_nic->vdpa_state != EF100_VDPA_STATE_INITIALIZED) { dev_err(&vdev->dev, "%s: Invalid current state %s\n", - __func__, - get_vdpa_state_str(vdpa_nic->vdpa_state)); + __func__, get_vdpa_state_str(vdpa_nic->vdpa_state)); rc = -EINVAL; goto err; } @@ -959,9 +818,9 @@ static u32 ef100_vdpa_get_vendor_id(struct vdpa_device *vdev) { #ifdef EFX_NOT_UPSTREAM dev_info(&vdev->dev, "%s: Returning value:0x%x\n", __func__, - EF100_VDPA_XNX_VENDOR_ID); + EF100_VDPA_VENDOR_ID); #endif - return EF100_VDPA_XNX_VENDOR_ID; + return EF100_VDPA_VENDOR_ID; } static u8 ef100_vdpa_get_status(struct vdpa_device *vdev) @@ -973,9 +832,9 @@ static u8 ef100_vdpa_get_status(struct vdpa_device *vdev) status = vdpa_nic->status; mutex_unlock(&vdpa_nic->lock); #ifdef EFX_NOT_UPSTREAM - dev_info(&vdev->dev, "%s: Returning current status bit(s):\n", - __func__); - print_status_str(status, vdev); + dev_info(&vdev->dev, "%s: Returning current status bit(s):\n", + __func__); + print_status_str(status, vdev); #endif return status; } @@ -1000,9 +859,11 @@ static void ef100_vdpa_set_status(struct vdpa_device *vdev, u8 status) "%s: New status equal/subset of existing status:\n", __func__); dev_info(&vdev->dev, "%s: New status bits:\n", __func__); +#ifdef EFX_NOT_UPSTREAM print_status_str(status, vdev); dev_info(&vdev->dev, "%s: Existing status bits:\n", __func__); print_status_str(vdpa_nic->status, vdev); +#endif goto unlock_return; } if (new_status & VIRTIO_CONFIG_S_FAILED) { @@ -1047,7 +908,9 @@ static void ef100_vdpa_set_status(struct vdpa_device *vdev, u8 status) dev_warn(&vdev->dev, "%s: Mismatch Status & State\n", __func__); dev_warn(&vdev->dev, "%s: New status Bits:\n", __func__); +#ifdef EFX_NOT_UPSTREAM print_status_str(new_status, &vdpa_nic->vdpa_dev); +#endif dev_warn(&vdev->dev, "%s: Current vDPA State: %s\n", __func__, get_vdpa_state_str(vdpa_nic->vdpa_state)); @@ -1092,6 +955,11 @@ static void ef100_vdpa_set_config(struct vdpa_device *vdev, unsigned int offset, { struct ef100_vdpa_nic *vdpa_nic = get_vdpa_nic(vdev); + if (vdpa_nic->vdpa_state == EF100_VDPA_STATE_SUSPENDED) { + dev_err(&vdev->dev, + "config update not allowed in suspended state\n"); + return; + } #ifdef EFX_NOT_UPSTREAM dev_info(&vdev->dev, "%s: offset:%u len:%u config size:%lu\n", __func__, offset, len, sizeof(vdpa_nic->net_config)); @@ -1106,12 +974,14 @@ static void ef100_vdpa_set_config(struct vdpa_device *vdev, unsigned int offset, memcpy((u8 *)&vdpa_nic->net_config + offset, buf, len); ef100_vdpa_insert_filter(vdpa_nic->efx); +#ifdef EFX_NOT_UPSTREAM dev_dbg(&vdpa_nic->vdpa_dev.dev, "%s: Status:%u MAC:%pM max_qps:%u MTU:%u\n", __func__, vdpa_nic->net_config.status, vdpa_nic->net_config.mac, vdpa_nic->net_config.max_virtqueue_pairs, vdpa_nic->net_config.mtu); +#endif } static void ef100_vdpa_free(struct vdpa_device *vdev) @@ -1155,6 +1025,7 @@ static int ef100_vdpa_suspend(struct vdpa_device *vdev) if (rc) break; } + vdpa_nic->vdpa_state = EF100_VDPA_STATE_SUSPENDED; mutex_unlock(&vdpa_nic->lock); return rc; } diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/efx.c b/src/driver/linux_net/drivers/net/ethernet/sfc/efx.c index 2fae66735..0ed527ba8 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/efx.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/efx.c @@ -1863,7 +1863,7 @@ static int __init efx_init_module(void) printk(KERN_INFO "Solarflare NET driver\n"); #endif - rc = efx_init_debugfs("sfc"); + rc = efx_init_debugfs(); if (rc) goto err_debugfs; diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.c b/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.c index f2ed07525..15a159fd1 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.c @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef EFX_HAVE_STRUCT_SIZE #include #endif @@ -738,3 +739,20 @@ int devlink_info_version_running_put(struct devlink_info_req *req, } #endif /* !EFX_USE_DEVLINK */ + +#ifdef CONFIG_DEBUG_FS +void debugfs_lookup_and_remove(const char *name, struct dentry *dir) +{ + struct qstr child_name = QSTR_INIT(name, strlen(name)); + struct dentry *child; + + child = d_hash_and_lookup(dir, &child_name); + if (!IS_ERR_OR_NULL(child)) { + /* If it's a "regular" file, free its parameter binding */ + if (S_ISREG(child->d_inode->i_mode)) + kfree(child->d_inode->i_private); + debugfs_remove(child); + dput(child); + } +} +#endif /* CONFIG_DEBUGFS */ diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.h b/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.h index e29c3a925..1adeff660 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.h +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.h @@ -1293,6 +1293,16 @@ static inline void netdev_put(struct net_device *dev, #endif #endif +#ifdef EFX_NEED_DEBUGFS_LOOKUP_AND_REMOVE +#ifdef CONFIG_DEBUG_FS +void debugfs_lookup_and_remove(const char *name, struct dentry *parent); +#else +static inline void debugfs_lookup_and_remove(const char *name, + struct dentry *parent) +{ } +#endif +#endif + /************************************************************************** * * Missing functions provided by kernel_compat.c @@ -2518,6 +2528,15 @@ int pci_find_next_ext_capability(struct pci_dev *dev, int pos, int cap); #define VIRTIO_NET_F_RSC_EXT 61 #endif +#ifndef VIRTIO_F_IN_ORDER +/* Virtio feature bit number 35 is not defined in + * include/uapi/linux/virtio_config.h for kernel versions < 5.18. + * So make it available for the out-of-tree builds. VIRTIO_F_IN_ORDER + * is defined in section 6 (Reserved Feature Bits) of the VirtIO v1.1 spec + */ +#define VIRTIO_F_IN_ORDER 35 +#endif + #if defined(EFX_HAVE_NET_DEVLINK_H) && defined(EFX_HAVE_DEVLINK_INFO) && defined(CONFIG_NET_DEVLINK) /* Minimum requirements met to use the kernel's devlink suppport */ #include diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.sh b/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.sh index 0b02f61f2..795f0fce7 100755 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.sh +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/kernel_compat.sh @@ -93,8 +93,8 @@ EFX_NEED_ETH_ZERO_ADDR nsymbol eth_zero_addr include/linux/etherdevice.h EFX_NEED_ETH_BROADCAST_ADDR nsymbol eth_broadcast_addr include/linux/etherdevice.h EFX_NEED_ETH_RANDOM_ADDR nsymbol eth_random_addr include/linux/etherdevice.h EFX_NEED_ETH_HW_ADDR_SET nsymbol eth_hw_addr_set include/linux/etherdevice.h -EFX_NEED_MAC_PTON nsymbol mac_pton include/linux/kernel.h include/linux/if_ether.h -EFX_HAVE_HEX_TO_BIN symbol hex_to_bin include/linux/kernel.h +EFX_NEED_MAC_PTON nsymbol mac_pton include/linux/kernel.h include/linux/hex.h include/linux/if_ether.h +EFX_HAVE_HEX_TO_BIN symbol hex_to_bin include/linux/kernel.h include/linux/hex.h EFX_NEED_NS_TO_TIMESPEC nexport ns_to_timespec include/linux/time.h kernel/time.c EFX_HAVE_TIMESPEC64 symbol timespec64 include/linux/time64.h include/linux/time.h EFX_NEED_KTIME_GET_REAL_TS64 nsymbol ktime_get_real_ts64 include/linux/timekeeping.h include/linux/ktime.h @@ -163,8 +163,6 @@ EFX_HAVE_IOREMAP_WC symbol ioremap_wc arch/$SRCARCH/include/asm/io.h include/ EFX_HAVE_IOREMAP_NOCACHE symbol ioremap_nocache include/asm-generic/io.h EFX_NEED_SKB_TRANSPORT_HEADER_WAS_SET nsymbol skb_transport_header_was_set include/linux/skbuff.h EFX_HAVE_OLD_KMAP_ATOMIC custom -EFX_HAVE_DEBUGFS_CREATE_SYMLINK symbol debugfs_create_symlink include/linux/debugfs.h -EFX_HAVE_INODE_U_GENERIC_IP symbol generic_ip include/linux/fs.h EFX_HAVE_NAPI_STRUCT symbol napi_struct include/linux/netdevice.h EFX_HAVE_NAPI_STRUCT_NAPI_ID member struct_napi_struct napi_id include/linux/netdevice.h EFX_HAVE_NAPI_HASH_ADD symbol napi_hash_add include/linux/netdevice.h @@ -388,6 +386,7 @@ EFX_HAVE_VDPA_MAX_SUPPORTED_VQS member struct_vdpa_mgmt_dev max_supported_vqs i EFX_NEED_TIMESPEC64_TO_NS_SIGNED custom EFX_HAVE_KOBJECT_DEFAULT_GROUPS member struct_kobj_type default_groups include/linux/kobject.h EFX_NEED_REFCOUNT_T nsymbol refcount_t include/linux/refcount.h +EFX_NEED_DEBUGFS_LOOKUP_AND_REMOVE nsymbol debugfs_lookup_and_remove include/linux/debugfs.h " | egrep -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g' } diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.c b/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.c index 48390420b..12df1960e 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.c @@ -94,7 +94,6 @@ struct efx_mcdi_filter_table { bool must_restore_rss_contexts; bool rss_context_exclusive; bool additional_rss_modes; - bool rss_limited; #ifdef EFX_NOT_UPSTREAM #ifdef CONFIG_SFC_DRIVERLINK bool kernel_blocked[EFX_DL_FILTER_BLOCK_KERNEL_MAX]; @@ -2175,8 +2174,7 @@ int efx_mcdi_filter_probe_supported_filters(struct efx_nic *efx) return rc; } -int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool rss_limited, - bool additional_rss_modes) +int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool additional_rss_modes) { struct efx_mcdi_filter_table *table; @@ -2189,7 +2187,6 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool rss_limited, efx->filter_state = table; - table->rss_limited = rss_limited; table->additional_rss_modes = additional_rss_modes; table->mc_promisc_last = false; @@ -2920,9 +2917,6 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive return 0; } - if (table->rss_limited) - return -EOPNOTSUPP; - MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID, efx->vport.vport_id); MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_TYPE, alloc_type); @@ -3026,13 +3020,12 @@ void efx_mcdi_rx_free_indir_table(struct efx_nic *efx) efx->rss_context.context_id = EFX_MCDI_RSS_CONTEXT_INVALID; } -static int efx_mcdi_filter_rx_push_shared_rss_config(struct efx_nic *efx, - unsigned int *context_size) +int efx_mcdi_rx_push_shared_rss_config(struct efx_nic *efx, + unsigned int *context_size) { struct efx_mcdi_filter_table *table = efx->filter_state; int rc = efx_mcdi_filter_alloc_rss_context(efx, false, &efx->rss_context, context_size); - if (rc != 0) return rc; @@ -3229,9 +3222,9 @@ void efx_mcdi_rx_restore_rss_contexts(struct efx_nic *efx) table->must_restore_rss_contexts = false; } -int efx_mcdi_pf_rx_push_rss_config(struct efx_nic *efx, bool user, - const u32 *rx_indir_table, - const u8 *key) +int efx_mcdi_rx_push_rss_config(struct efx_nic *efx, bool user, + const u32 *rx_indir_table, + const u8 *key) { u32 flags = efx->rss_context.flags; int rc; @@ -3255,7 +3248,7 @@ int efx_mcdi_pf_rx_push_rss_config(struct efx_nic *efx, bool user, mismatch = rx_indir_table[i] != ethtool_rxfh_indir_default(i, efx->rss_spread); - rc = efx_mcdi_filter_rx_push_shared_rss_config(efx, &context_size); + rc = efx_mcdi_rx_push_shared_rss_config(efx, &context_size); if (rc == 0) { if (context_size != efx->rss_spread) netif_warn(efx, probe, efx->net_dev, @@ -3284,21 +3277,6 @@ int efx_mcdi_pf_rx_push_rss_config(struct efx_nic *efx, bool user, return rc; } -#ifdef CONFIG_SFC_SRIOV -int efx_mcdi_vf_rx_push_rss_config(struct efx_nic *efx, bool user, - const u32 *rx_indir_table - __attribute__ ((unused)), - const u8 *key - __attribute__ ((unused))) -{ - if (user) - return -EOPNOTSUPP; - if (efx->rss_context.context_id != EFX_MCDI_RSS_CONTEXT_INVALID) - return 0; - return efx_mcdi_filter_rx_push_shared_rss_config(efx, NULL); -} -#endif - int efx_mcdi_push_default_indir_table(struct efx_nic *efx, unsigned int rss_spread) { diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.h b/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.h index 3f86b6c34..40984fe37 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.h +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_filters.h @@ -13,8 +13,7 @@ #include "net_driver.h" /* set up basic operations required for all net devices */ -int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool rss_limited, - bool additional_rss); +int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool additional_rss); /* enable operations we can do once we know the number of queues we have */ int efx_mcdi_filter_table_init(struct efx_nic *efx, bool mc_chaining, bool encap); @@ -125,14 +124,11 @@ int efx_mcdi_rx_push_rss_context_config(struct efx_nic *efx, struct efx_rss_context *ctx, const u32 *rx_indir_table, const u8 *key); -int efx_mcdi_pf_rx_push_rss_config(struct efx_nic *efx, bool user, - const u32 *rx_indir_table, - const u8 *key); -int efx_mcdi_vf_rx_push_rss_config(struct efx_nic *efx, bool user, - const u32 *rx_indir_table - __attribute__ ((unused)), - const u8 *key - __attribute__ ((unused))); +int efx_mcdi_rx_push_rss_config(struct efx_nic *efx, bool user, + const u32 *rx_indir_table, + const u8 *key); +int efx_mcdi_rx_push_shared_rss_config(struct efx_nic *efx, + unsigned int *context_size); int efx_mcdi_push_default_indir_table(struct efx_nic *efx, unsigned int rss_spread); int efx_mcdi_rx_pull_rss_config(struct efx_nic *efx); diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_vdpa.h b/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_vdpa.h index 56ace33ad..3c6fa8043 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_vdpa.h +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/mcdi_vdpa.h @@ -15,7 +15,9 @@ /* MAE Port selector value*/ #define MAE_MPORT_SELECTOR_ASSIGNED 0x1000000 -/* struct efx_vring_ctx: Store the vring context +/** + * struct efx_vring_ctx: The vring context + * * @nic: pointer of the VF's efx_nic object * @vf_index: VF index of the vDPA VF * @vi_index: vi index to be used for queue creation @@ -28,7 +30,9 @@ struct efx_vring_ctx { u32 mcdi_vring_type; }; -/* struct efx_vring_cfg: Configuration for vring creation +/** + * struct efx_vring_cfg: Configuration for vring creation + * * @desc: Descriptor area address of the vring * @avail: Available area address of the vring * @used: Device area address of the vring @@ -49,7 +53,9 @@ struct efx_vring_cfg { u64 features; }; -/* struct efx_vring_dyn_cfg: +/** + * struct efx_vring_dyn_cfg - dynamic vring configuration + * * @avail_idx: last available index of the vring * @used_idx: last used index of the vring */ diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/net_driver.h b/src/driver/linux_net/drivers/net/ethernet/sfc/net_driver.h index 155a1e3a6..6f47d82fa 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/net_driver.h +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/net_driver.h @@ -97,7 +97,7 @@ **************************************************************************/ #ifdef EFX_NOT_UPSTREAM -#define EFX_DRIVER_VERSION "5.3.14.1013" +#define EFX_DRIVER_VERSION "5.3.14.1016" #endif #ifdef DEBUG diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/ptp.c b/src/driver/linux_net/drivers/net/ethernet/sfc/ptp.c index fbdb0a89f..e34d29b90 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/ptp.c +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/ptp.c @@ -2370,16 +2370,14 @@ int efx_ptp_pps_get_event(struct efx_nic *efx, struct efx_ts_get_pps *event) static bool efx_is_pps_possible(struct efx_nic *efx) { - MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_PPS_ENABLE_LEN); + MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_RESET_STATS_LEN); int rc; - MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_PPS_ENABLE); + MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_RESET_STATS); MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0); - MCDI_SET_DWORD(inbuf, PTP_IN_PPS_ENABLE_OP, MC_CMD_PTP_DISABLE_PPS); - MCDI_SET_DWORD(inbuf, PTP_IN_PPS_ENABLE_QUEUE_ID, 0); rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), - NULL, 0, NULL); + NULL, 0, NULL); return rc != -EPERM; } @@ -3514,16 +3512,12 @@ static void ptp_event_pps(struct efx_nic *efx, struct efx_ptp_data *ptp) struct ptp_clock_event ptp_evt; if (ptp->usr_evt_enabled & (1 << PTP_CLK_REQ_EXTTS)) { - struct efx_pps_data *pps = ptp->pps_data; - - pps->n_assert = ptp->nic_to_kernel_time( - EFX_QWORD_FIELD(ptp->evt_frags[0], MCDI_EVENT_DATA), - EFX_QWORD_FIELD(ptp->evt_frags[1], MCDI_EVENT_DATA), - ptp->ts_corrections.pps_in); - ptp_evt.type = PTP_CLOCK_EXTTS; ptp_evt.index = 0; - ptp_evt.timestamp = ktime_to_ns(pps->n_assert); + ptp_evt.timestamp = ktime_to_ns(ptp->nic_to_kernel_time( + EFX_QWORD_FIELD(ptp->evt_frags[0], MCDI_EVENT_DATA), + EFX_QWORD_FIELD(ptp->evt_frags[1], MCDI_EVENT_DATA), + ptp->ts_corrections.pps_in)); ptp_clock_event(ptp->phc_clock, &ptp_evt); } #endif diff --git a/src/driver/linux_net/drivers/net/ethernet/sfc/siena/Makefile b/src/driver/linux_net/drivers/net/ethernet/sfc/siena/Makefile index 098658f37..24b197f86 100644 --- a/src/driver/linux_net/drivers/net/ethernet/sfc/siena/Makefile +++ b/src/driver/linux_net/drivers/net/ethernet/sfc/siena/Makefile @@ -22,6 +22,9 @@ override CONFIG_SFC_DRIVERLINK := override CONFIG_SFC_AOE := override CONFIG_SFC_VDPA := +# For CONFIG_SFC_TRACING includes via linux +EXTRA_CFLAGS += -I$(src) + ifdef EFX_FOR_UPSTREAM # match UNIFDEF_DEFINES in export.sh override CONFIG_SFC_DEBUGFS :=