Skip to content

Commit

Permalink
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/tnguy/next-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2024-07-11 (net/intel)

This series contains updates to most Intel network drivers.

Tony removes MODULE_AUTHOR from drivers containing the entry.

Simon Horman corrects a kdoc entry for i40e.

Pawel adds implementation for devlink param "local_forwarding" on ice.

Michal removes unneeded call, and code, for eswitch rebuild for ice.

Sasha removed a no longer used field from igc.

* '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  igc: Remove the internal 'eee_advert' field
  ice: remove eswitch rebuild
  ice: Add support for devlink local_forwarding param
  i40e: correct i40e_addr_to_hkey() name in kdoc
  net: intel: Remove MODULE_AUTHORs
====================

Link: https://patch.msgid.link/20240711201932.2019925-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jul 13, 2024
2 parents ba88b47 + 1712c9e commit 852e42c
Show file tree
Hide file tree
Showing 24 changed files with 167 additions and 50 deletions.
25 changes: 25 additions & 0 deletions Documentation/networking/devlink/ice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Parameters
==========

.. list-table:: Generic parameters implemented
:widths: 5 5 90

* - Name
- Mode
Expand Down Expand Up @@ -68,6 +69,30 @@ Parameters

To verify that value has been set:
$ devlink dev param show pci/0000:16:00.0 name tx_scheduling_layers
.. list-table:: Driver specific parameters implemented
:widths: 5 5 90

* - Name
- Mode
- Description
* - ``local_forwarding``
- runtime
- Controls loopback behavior by tuning scheduler bandwidth.
It impacts all kinds of functions: physical, virtual and
subfunctions.
Supported values are:

``enabled`` - loopback traffic is allowed on port

``disabled`` - loopback traffic is not allowed on this port

``prioritized`` - loopback traffic is prioritized on this port

Default value of ``local_forwarding`` parameter is ``enabled``.
``prioritized`` provides ability to adjust loopback traffic rate to increase
one port capacity at cost of the another. User needs to disable
local forwarding on one of the ports in order have increased capacity
on the ``prioritized`` port.

Info versions
=============
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
#define FIRMWARE_D102E "e100/d102e_ucode.bin"

MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR(DRV_COPYRIGHT);
MODULE_LICENSE("GPL v2");
MODULE_FIRMWARE(FIRMWARE_D101M);
MODULE_FIRMWARE(FIRMWARE_D101S);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ static struct pci_driver e1000_driver = {
.err_handler = &e1000_err_handler
};

MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
MODULE_LICENSE("GPL v2");

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -7969,7 +7969,6 @@ static void __exit e1000_exit_module(void)
}
module_exit(e1000_exit_module);

MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
MODULE_LICENSE("GPL v2");

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/fm10k/fm10k_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ static const char fm10k_driver_string[] = DRV_SUMMARY;
static const char fm10k_copyright[] =
"Copyright(c) 2013 - 2019 Intel Corporation.";

MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION(DRV_SUMMARY);
MODULE_LICENSE("GPL v2");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/i40e/i40e.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ __i40e_pf_next_veb(struct i40e_pf *pf, int *idx)
_i++, _veb = __i40e_pf_next_veb(_pf, &_i))

/**
* i40e_mac_to_hkey - Convert a 6-byte MAC Address to a u64 hash key
* i40e_addr_to_hkey - Convert a 6-byte MAC Address to a u64 hash key
* @macaddr: the MAC Address as the base key
*
* Simply copies the address and returns it as a u64 for hashing
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static int debug = -1;
module_param(debug, uint, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all), Debug mask (0x8XXXXXXX)");

MODULE_AUTHOR("Intel Corporation, <e1000-devel@lists.sourceforge.net>");
MODULE_DESCRIPTION("Intel(R) Ethernet Connection XL710 Network Driver");
MODULE_IMPORT_NS(LIBIE);
MODULE_LICENSE("GPL v2");
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ static const struct pci_device_id iavf_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, iavf_pci_tbl);

MODULE_ALIAS("i40evf");
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) Ethernet Adaptive Virtual Function Network Driver");
MODULE_IMPORT_NS(LIBETH);
MODULE_IMPORT_NS(LIBIE);
Expand Down
126 changes: 126 additions & 0 deletions drivers/net/ethernet/intel/ice/devlink/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,129 @@ ice_devlink_enable_iw_validate(struct devlink *devlink, u32 id,
return 0;
}

#define DEVLINK_LOCAL_FWD_DISABLED_STR "disabled"
#define DEVLINK_LOCAL_FWD_ENABLED_STR "enabled"
#define DEVLINK_LOCAL_FWD_PRIORITIZED_STR "prioritized"

/**
* ice_devlink_local_fwd_mode_to_str - Get string for local_fwd mode.
* @mode: local forwarding for mode used in port_info struct.
*
* Return: Mode respective string or "Invalid".
*/
static const char *
ice_devlink_local_fwd_mode_to_str(enum ice_local_fwd_mode mode)
{
switch (mode) {
case ICE_LOCAL_FWD_MODE_ENABLED:
return DEVLINK_LOCAL_FWD_ENABLED_STR;
case ICE_LOCAL_FWD_MODE_PRIORITIZED:
return DEVLINK_LOCAL_FWD_PRIORITIZED_STR;
case ICE_LOCAL_FWD_MODE_DISABLED:
return DEVLINK_LOCAL_FWD_DISABLED_STR;
}

return "Invalid";
}

/**
* ice_devlink_local_fwd_str_to_mode - Get local_fwd mode from string name.
* @mode_str: local forwarding mode string.
*
* Return: Mode value or negative number if invalid.
*/
static int ice_devlink_local_fwd_str_to_mode(const char *mode_str)
{
if (!strcmp(mode_str, DEVLINK_LOCAL_FWD_ENABLED_STR))
return ICE_LOCAL_FWD_MODE_ENABLED;
else if (!strcmp(mode_str, DEVLINK_LOCAL_FWD_PRIORITIZED_STR))
return ICE_LOCAL_FWD_MODE_PRIORITIZED;
else if (!strcmp(mode_str, DEVLINK_LOCAL_FWD_DISABLED_STR))
return ICE_LOCAL_FWD_MODE_DISABLED;

return -EINVAL;
}

/**
* ice_devlink_local_fwd_get - Get local_fwd parameter.
* @devlink: Pointer to the devlink instance.
* @id: The parameter ID to set.
* @ctx: Context to store the parameter value.
*
* Return: Zero.
*/
static int ice_devlink_local_fwd_get(struct devlink *devlink, u32 id,
struct devlink_param_gset_ctx *ctx)
{
struct ice_pf *pf = devlink_priv(devlink);
struct ice_port_info *pi;
const char *mode_str;

pi = pf->hw.port_info;
mode_str = ice_devlink_local_fwd_mode_to_str(pi->local_fwd_mode);
snprintf(ctx->val.vstr, sizeof(ctx->val.vstr), "%s", mode_str);

return 0;
}

/**
* ice_devlink_local_fwd_set - Set local_fwd parameter.
* @devlink: Pointer to the devlink instance.
* @id: The parameter ID to set.
* @ctx: Context to get the parameter value.
* @extack: Netlink extended ACK structure.
*
* Return: Zero.
*/
static int ice_devlink_local_fwd_set(struct devlink *devlink, u32 id,
struct devlink_param_gset_ctx *ctx,
struct netlink_ext_ack *extack)
{
int new_local_fwd_mode = ice_devlink_local_fwd_str_to_mode(ctx->val.vstr);
struct ice_pf *pf = devlink_priv(devlink);
struct device *dev = ice_pf_to_dev(pf);
struct ice_port_info *pi;

pi = pf->hw.port_info;
if (pi->local_fwd_mode != new_local_fwd_mode) {
pi->local_fwd_mode = new_local_fwd_mode;
dev_info(dev, "Setting local_fwd to %s\n", ctx->val.vstr);
ice_schedule_reset(pf, ICE_RESET_CORER);
}

return 0;
}

/**
* ice_devlink_local_fwd_validate - Validate passed local_fwd parameter value.
* @devlink: Unused pointer to devlink instance.
* @id: The parameter ID to validate.
* @val: Value to validate.
* @extack: Netlink extended ACK structure.
*
* Supported values are:
* "enabled" - local_fwd is enabled, "disabled" - local_fwd is disabled
* "prioritized" - local_fwd traffic is prioritized in scheduling.
*
* Return: Zero when passed parameter value is supported. Negative value on
* error.
*/
static int ice_devlink_local_fwd_validate(struct devlink *devlink, u32 id,
union devlink_param_value val,
struct netlink_ext_ack *extack)
{
if (ice_devlink_local_fwd_str_to_mode(val.vstr) < 0) {
NL_SET_ERR_MSG_MOD(extack, "Error: Requested value is not supported.");
return -EINVAL;
}

return 0;
}

enum ice_param_id {
ICE_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
ICE_DEVLINK_PARAM_ID_TX_SCHED_LAYERS,
ICE_DEVLINK_PARAM_ID_LOCAL_FWD,
};

static const struct devlink_param ice_dvl_rdma_params[] = {
Expand All @@ -1405,6 +1525,12 @@ static const struct devlink_param ice_dvl_sched_params[] = {
ice_devlink_tx_sched_layers_get,
ice_devlink_tx_sched_layers_set,
ice_devlink_tx_sched_layers_validate),
DEVLINK_PARAM_DRIVER(ICE_DEVLINK_PARAM_ID_LOCAL_FWD,
"local_forwarding", DEVLINK_PARAM_TYPE_STRING,
BIT(DEVLINK_PARAM_CMODE_RUNTIME),
ice_devlink_local_fwd_get,
ice_devlink_local_fwd_set,
ice_devlink_local_fwd_validate),
};

static void ice_devlink_free(void *devlink_ptr)
Expand Down
11 changes: 10 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ struct ice_aqc_get_sw_cfg_resp_elem {
#define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15)
};

/* Loopback port parameter mode values. */
enum ice_local_fwd_mode {
ICE_LOCAL_FWD_MODE_ENABLED = 0,
ICE_LOCAL_FWD_MODE_DISABLED = 1,
ICE_LOCAL_FWD_MODE_PRIORITIZED = 2,
};

/* Set Port parameters, (direct, 0x0203) */
struct ice_aqc_set_port_params {
__le16 cmd_flags;
Expand All @@ -240,7 +247,9 @@ struct ice_aqc_set_port_params {
__le16 swid;
#define ICE_AQC_PORT_SWID_VALID BIT(15)
#define ICE_AQC_PORT_SWID_M 0xFF
u8 reserved[10];
u8 local_fwd_mode;
#define ICE_AQC_SET_P_PARAMS_LOCAL_FWD_MODE_VALID BIT(2)
u8 reserved[9];
};

/* These resource type defines are used for all switch resource
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/intel/ice/ice_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ int ice_init_hw(struct ice_hw *hw)
goto err_unroll_cqinit;
}

hw->port_info->local_fwd_mode = ICE_LOCAL_FWD_MODE_ENABLED;
/* set the back pointer to HW */
hw->port_info->hw = hw;

Expand Down Expand Up @@ -3071,6 +3072,9 @@ ice_aq_set_port_params(struct ice_port_info *pi, bool double_vlan,
cmd_flags |= ICE_AQC_SET_P_PARAMS_DOUBLE_VLAN_ENA;
cmd->cmd_flags = cpu_to_le16(cmd_flags);

cmd->local_fwd_mode = pi->local_fwd_mode |
ICE_AQC_SET_P_PARAMS_LOCAL_FWD_MODE_VALID;

return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
}

Expand Down
16 changes: 0 additions & 16 deletions drivers/net/ethernet/intel/ice/ice_eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,22 +536,6 @@ void ice_eswitch_detach(struct ice_pf *pf, struct ice_vf *vf)
devl_unlock(devlink);
}

/**
* ice_eswitch_rebuild - rebuild eswitch
* @pf: pointer to PF structure
*/
void ice_eswitch_rebuild(struct ice_pf *pf)
{
struct ice_repr *repr;
unsigned long id;

if (!ice_is_switchdev_running(pf))
return;

xa_for_each(&pf->eswitch.reprs, id, repr)
ice_eswitch_detach(pf, repr->vf);
}

/**
* ice_eswitch_get_target - get netdev based on src_vsi from descriptor
* @rx_ring: ring used to receive the packet
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/intel/ice/ice_eswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
void ice_eswitch_detach(struct ice_pf *pf, struct ice_vf *vf);
int
ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf);
void ice_eswitch_rebuild(struct ice_pf *pf);

int ice_eswitch_mode_get(struct devlink *devlink, u16 *mode);
int
Expand Down Expand Up @@ -54,11 +53,6 @@ static inline int ice_eswitch_configure(struct ice_pf *pf)
return 0;
}

static inline int ice_eswitch_rebuild(struct ice_pf *pf)
{
return -EOPNOTSUPP;
}

static inline int ice_eswitch_mode_get(struct devlink *devlink, u16 *mode)
{
return DEVLINK_ESWITCH_MODE_LEGACY;
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static const char ice_copyright[] = "Copyright (c) 2018, Intel Corporation.";
#define ICE_DDP_PKG_PATH "intel/ice/ddp/"
#define ICE_DDP_PKG_FILE ICE_DDP_PKG_PATH "ice.pkg"

MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION(DRV_SUMMARY);
MODULE_IMPORT_NS(LIBIE);
MODULE_LICENSE("GPL v2");
Expand Down Expand Up @@ -7703,8 +7702,6 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
goto err_vsi_rebuild;
}

ice_eswitch_rebuild(pf);

if (reset_type == ICE_RESET_PFR) {
err = ice_rebuild_channels(pf);
if (err) {
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/ice/ice_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ struct ice_port_info {
u16 sw_id; /* Initial switch ID belongs to port */
u16 pf_vf_num;
u8 port_state;
u8 local_fwd_mode;
#define ICE_SCHED_PORT_STATE_INIT 0x0
#define ICE_SCHED_PORT_STATE_READY 0x1
u8 lport;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ static const struct pci_error_handlers igb_err_handler = {

static void igb_init_dmac(struct igb_adapter *adapter, u32 pba);

MODULE_AUTHOR("Intel Corporation, <e1000-devel@lists.sourceforge.net>");
MODULE_DESCRIPTION("Intel(R) Gigabit Ethernet Network Driver");
MODULE_LICENSE("GPL v2");

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/igbvf/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3001,7 +3001,6 @@ static void __exit igbvf_exit_module(void)
}
module_exit(igbvf_exit_module);

MODULE_AUTHOR("Intel Corporation, <e1000-devel@lists.sourceforge.net>");
MODULE_DESCRIPTION("Intel(R) Gigabit Virtual Function Network Driver");
MODULE_LICENSE("GPL v2");

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/igc/igc.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ struct igc_adapter {
struct net_device *netdev;

struct ethtool_keee eee;
u16 eee_advert;

unsigned long state;
unsigned int flags;
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/intel/igc/igc_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,10 +1636,6 @@ static int igc_ethtool_get_eee(struct net_device *netdev,
linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
edata->supported);

if (hw->dev_spec._base.eee_enable)
mii_eee_cap1_mod_linkmode_t(edata->advertised,
adapter->eee_advert);

eeer = rd32(IGC_EEER);

/* EEE status on negotiated link */
Expand Down Expand Up @@ -1700,8 +1696,6 @@ static int igc_ethtool_set_eee(struct net_device *netdev,
return -EINVAL;
}

adapter->eee_advert = linkmode_to_mii_eee_cap1_t(edata->advertised);

if (hw->dev_spec._base.eee_enable != edata->eee_enabled) {
hw->dev_spec._base.eee_enable = edata->eee_enabled;
adapter->flags |= IGC_FLAG_EEE;
Expand Down
Loading

0 comments on commit 852e42c

Please sign in to comment.