Skip to content

Commit 852e42c

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents ba88b47 + 1712c9e commit 852e42c

File tree

24 files changed

+167
-50
lines changed

24 files changed

+167
-50
lines changed

Documentation/networking/devlink/ice.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Parameters
1111
==========
1212

1313
.. list-table:: Generic parameters implemented
14+
:widths: 5 5 90
1415

1516
* - Name
1617
- Mode
@@ -68,6 +69,30 @@ Parameters
6869

6970
To verify that value has been set:
7071
$ devlink dev param show pci/0000:16:00.0 name tx_scheduling_layers
72+
.. list-table:: Driver specific parameters implemented
73+
:widths: 5 5 90
74+
75+
* - Name
76+
- Mode
77+
- Description
78+
* - ``local_forwarding``
79+
- runtime
80+
- Controls loopback behavior by tuning scheduler bandwidth.
81+
It impacts all kinds of functions: physical, virtual and
82+
subfunctions.
83+
Supported values are:
84+
85+
``enabled`` - loopback traffic is allowed on port
86+
87+
``disabled`` - loopback traffic is not allowed on this port
88+
89+
``prioritized`` - loopback traffic is prioritized on this port
90+
91+
Default value of ``local_forwarding`` parameter is ``enabled``.
92+
``prioritized`` provides ability to adjust loopback traffic rate to increase
93+
one port capacity at cost of the another. User needs to disable
94+
local forwarding on one of the ports in order have increased capacity
95+
on the ``prioritized`` port.
7196

7297
Info versions
7398
=============

drivers/net/ethernet/intel/e100.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
#define FIRMWARE_D102E "e100/d102e_ucode.bin"
162162

163163
MODULE_DESCRIPTION(DRV_DESCRIPTION);
164-
MODULE_AUTHOR(DRV_COPYRIGHT);
165164
MODULE_LICENSE("GPL v2");
166165
MODULE_FIRMWARE(FIRMWARE_D101M);
167166
MODULE_FIRMWARE(FIRMWARE_D101S);

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ static struct pci_driver e1000_driver = {
187187
.err_handler = &e1000_err_handler
188188
};
189189

190-
MODULE_AUTHOR("Intel Corporation, <[email protected]>");
191190
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
192191
MODULE_LICENSE("GPL v2");
193192

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7969,7 +7969,6 @@ static void __exit e1000_exit_module(void)
79697969
}
79707970
module_exit(e1000_exit_module);
79717971

7972-
MODULE_AUTHOR("Intel Corporation, <[email protected]>");
79737972
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
79747973
MODULE_LICENSE("GPL v2");
79757974

drivers/net/ethernet/intel/fm10k/fm10k_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ static const char fm10k_driver_string[] = DRV_SUMMARY;
1717
static const char fm10k_copyright[] =
1818
"Copyright(c) 2013 - 2019 Intel Corporation.";
1919

20-
MODULE_AUTHOR("Intel Corporation, <[email protected]>");
2120
MODULE_DESCRIPTION(DRV_SUMMARY);
2221
MODULE_LICENSE("GPL v2");
2322

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ __i40e_pf_next_veb(struct i40e_pf *pf, int *idx)
735735
_i++, _veb = __i40e_pf_next_veb(_pf, &_i))
736736

737737
/**
738-
* i40e_mac_to_hkey - Convert a 6-byte MAC Address to a u64 hash key
738+
* i40e_addr_to_hkey - Convert a 6-byte MAC Address to a u64 hash key
739739
* @macaddr: the MAC Address as the base key
740740
*
741741
* Simply copies the address and returns it as a u64 for hashing

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ static int debug = -1;
9898
module_param(debug, uint, 0);
9999
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all), Debug mask (0x8XXXXXXX)");
100100

101-
MODULE_AUTHOR("Intel Corporation, <[email protected]>");
102101
MODULE_DESCRIPTION("Intel(R) Ethernet Connection XL710 Network Driver");
103102
MODULE_IMPORT_NS(LIBIE);
104103
MODULE_LICENSE("GPL v2");

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static const struct pci_device_id iavf_pci_tbl[] = {
4545
MODULE_DEVICE_TABLE(pci, iavf_pci_tbl);
4646

4747
MODULE_ALIAS("i40evf");
48-
MODULE_AUTHOR("Intel Corporation, <[email protected]>");
4948
MODULE_DESCRIPTION("Intel(R) Ethernet Adaptive Virtual Function Network Driver");
5049
MODULE_IMPORT_NS(LIBETH);
5150
MODULE_IMPORT_NS(LIBIE);

drivers/net/ethernet/intel/ice/devlink/devlink.c

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,9 +1381,129 @@ ice_devlink_enable_iw_validate(struct devlink *devlink, u32 id,
13811381
return 0;
13821382
}
13831383

1384+
#define DEVLINK_LOCAL_FWD_DISABLED_STR "disabled"
1385+
#define DEVLINK_LOCAL_FWD_ENABLED_STR "enabled"
1386+
#define DEVLINK_LOCAL_FWD_PRIORITIZED_STR "prioritized"
1387+
1388+
/**
1389+
* ice_devlink_local_fwd_mode_to_str - Get string for local_fwd mode.
1390+
* @mode: local forwarding for mode used in port_info struct.
1391+
*
1392+
* Return: Mode respective string or "Invalid".
1393+
*/
1394+
static const char *
1395+
ice_devlink_local_fwd_mode_to_str(enum ice_local_fwd_mode mode)
1396+
{
1397+
switch (mode) {
1398+
case ICE_LOCAL_FWD_MODE_ENABLED:
1399+
return DEVLINK_LOCAL_FWD_ENABLED_STR;
1400+
case ICE_LOCAL_FWD_MODE_PRIORITIZED:
1401+
return DEVLINK_LOCAL_FWD_PRIORITIZED_STR;
1402+
case ICE_LOCAL_FWD_MODE_DISABLED:
1403+
return DEVLINK_LOCAL_FWD_DISABLED_STR;
1404+
}
1405+
1406+
return "Invalid";
1407+
}
1408+
1409+
/**
1410+
* ice_devlink_local_fwd_str_to_mode - Get local_fwd mode from string name.
1411+
* @mode_str: local forwarding mode string.
1412+
*
1413+
* Return: Mode value or negative number if invalid.
1414+
*/
1415+
static int ice_devlink_local_fwd_str_to_mode(const char *mode_str)
1416+
{
1417+
if (!strcmp(mode_str, DEVLINK_LOCAL_FWD_ENABLED_STR))
1418+
return ICE_LOCAL_FWD_MODE_ENABLED;
1419+
else if (!strcmp(mode_str, DEVLINK_LOCAL_FWD_PRIORITIZED_STR))
1420+
return ICE_LOCAL_FWD_MODE_PRIORITIZED;
1421+
else if (!strcmp(mode_str, DEVLINK_LOCAL_FWD_DISABLED_STR))
1422+
return ICE_LOCAL_FWD_MODE_DISABLED;
1423+
1424+
return -EINVAL;
1425+
}
1426+
1427+
/**
1428+
* ice_devlink_local_fwd_get - Get local_fwd parameter.
1429+
* @devlink: Pointer to the devlink instance.
1430+
* @id: The parameter ID to set.
1431+
* @ctx: Context to store the parameter value.
1432+
*
1433+
* Return: Zero.
1434+
*/
1435+
static int ice_devlink_local_fwd_get(struct devlink *devlink, u32 id,
1436+
struct devlink_param_gset_ctx *ctx)
1437+
{
1438+
struct ice_pf *pf = devlink_priv(devlink);
1439+
struct ice_port_info *pi;
1440+
const char *mode_str;
1441+
1442+
pi = pf->hw.port_info;
1443+
mode_str = ice_devlink_local_fwd_mode_to_str(pi->local_fwd_mode);
1444+
snprintf(ctx->val.vstr, sizeof(ctx->val.vstr), "%s", mode_str);
1445+
1446+
return 0;
1447+
}
1448+
1449+
/**
1450+
* ice_devlink_local_fwd_set - Set local_fwd parameter.
1451+
* @devlink: Pointer to the devlink instance.
1452+
* @id: The parameter ID to set.
1453+
* @ctx: Context to get the parameter value.
1454+
* @extack: Netlink extended ACK structure.
1455+
*
1456+
* Return: Zero.
1457+
*/
1458+
static int ice_devlink_local_fwd_set(struct devlink *devlink, u32 id,
1459+
struct devlink_param_gset_ctx *ctx,
1460+
struct netlink_ext_ack *extack)
1461+
{
1462+
int new_local_fwd_mode = ice_devlink_local_fwd_str_to_mode(ctx->val.vstr);
1463+
struct ice_pf *pf = devlink_priv(devlink);
1464+
struct device *dev = ice_pf_to_dev(pf);
1465+
struct ice_port_info *pi;
1466+
1467+
pi = pf->hw.port_info;
1468+
if (pi->local_fwd_mode != new_local_fwd_mode) {
1469+
pi->local_fwd_mode = new_local_fwd_mode;
1470+
dev_info(dev, "Setting local_fwd to %s\n", ctx->val.vstr);
1471+
ice_schedule_reset(pf, ICE_RESET_CORER);
1472+
}
1473+
1474+
return 0;
1475+
}
1476+
1477+
/**
1478+
* ice_devlink_local_fwd_validate - Validate passed local_fwd parameter value.
1479+
* @devlink: Unused pointer to devlink instance.
1480+
* @id: The parameter ID to validate.
1481+
* @val: Value to validate.
1482+
* @extack: Netlink extended ACK structure.
1483+
*
1484+
* Supported values are:
1485+
* "enabled" - local_fwd is enabled, "disabled" - local_fwd is disabled
1486+
* "prioritized" - local_fwd traffic is prioritized in scheduling.
1487+
*
1488+
* Return: Zero when passed parameter value is supported. Negative value on
1489+
* error.
1490+
*/
1491+
static int ice_devlink_local_fwd_validate(struct devlink *devlink, u32 id,
1492+
union devlink_param_value val,
1493+
struct netlink_ext_ack *extack)
1494+
{
1495+
if (ice_devlink_local_fwd_str_to_mode(val.vstr) < 0) {
1496+
NL_SET_ERR_MSG_MOD(extack, "Error: Requested value is not supported.");
1497+
return -EINVAL;
1498+
}
1499+
1500+
return 0;
1501+
}
1502+
13841503
enum ice_param_id {
13851504
ICE_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
13861505
ICE_DEVLINK_PARAM_ID_TX_SCHED_LAYERS,
1506+
ICE_DEVLINK_PARAM_ID_LOCAL_FWD,
13871507
};
13881508

13891509
static const struct devlink_param ice_dvl_rdma_params[] = {
@@ -1405,6 +1525,12 @@ static const struct devlink_param ice_dvl_sched_params[] = {
14051525
ice_devlink_tx_sched_layers_get,
14061526
ice_devlink_tx_sched_layers_set,
14071527
ice_devlink_tx_sched_layers_validate),
1528+
DEVLINK_PARAM_DRIVER(ICE_DEVLINK_PARAM_ID_LOCAL_FWD,
1529+
"local_forwarding", DEVLINK_PARAM_TYPE_STRING,
1530+
BIT(DEVLINK_PARAM_CMODE_RUNTIME),
1531+
ice_devlink_local_fwd_get,
1532+
ice_devlink_local_fwd_set,
1533+
ice_devlink_local_fwd_validate),
14081534
};
14091535

14101536
static void ice_devlink_free(void *devlink_ptr)

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ struct ice_aqc_get_sw_cfg_resp_elem {
232232
#define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15)
233233
};
234234

235+
/* Loopback port parameter mode values. */
236+
enum ice_local_fwd_mode {
237+
ICE_LOCAL_FWD_MODE_ENABLED = 0,
238+
ICE_LOCAL_FWD_MODE_DISABLED = 1,
239+
ICE_LOCAL_FWD_MODE_PRIORITIZED = 2,
240+
};
241+
235242
/* Set Port parameters, (direct, 0x0203) */
236243
struct ice_aqc_set_port_params {
237244
__le16 cmd_flags;
@@ -240,7 +247,9 @@ struct ice_aqc_set_port_params {
240247
__le16 swid;
241248
#define ICE_AQC_PORT_SWID_VALID BIT(15)
242249
#define ICE_AQC_PORT_SWID_M 0xFF
243-
u8 reserved[10];
250+
u8 local_fwd_mode;
251+
#define ICE_AQC_SET_P_PARAMS_LOCAL_FWD_MODE_VALID BIT(2)
252+
u8 reserved[9];
244253
};
245254

246255
/* These resource type defines are used for all switch resource

0 commit comments

Comments
 (0)