Netdev List
 help / color / mirror / Atom feed
* [patch net-next 2/3] net: devlink: split reload op into two
From: Jiri Pirko @ 2019-09-06 18:44 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, dsahern, jakub.kicinski, tariqt, mlxsw
In-Reply-To: <20190906184419.5101-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

In order to properly implement failure indication during reload,
split the reload op into two ops, one for down phase and one for
up phase.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c  | 19 +++++++++++++++----
 drivers/net/ethernet/mellanox/mlxsw/core.c | 19 +++++++++++++++----
 drivers/net/netdevsim/dev.c                | 13 ++++++++++---
 include/net/devlink.h                      |  5 ++++-
 net/core/devlink.c                         | 16 ++++++++++++----
 5 files changed, 56 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index a39c647c12dc..ef3f3d06ff1e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -3935,17 +3935,27 @@ static void mlx4_restart_one_down(struct pci_dev *pdev);
 static int mlx4_restart_one_up(struct pci_dev *pdev, bool reload,
 			       struct devlink *devlink);
 
-static int mlx4_devlink_reload(struct devlink *devlink,
-			       struct netlink_ext_ack *extack)
+static int mlx4_devlink_reload_down(struct devlink *devlink,
+				    struct netlink_ext_ack *extack)
 {
 	struct mlx4_priv *priv = devlink_priv(devlink);
 	struct mlx4_dev *dev = &priv->dev;
 	struct mlx4_dev_persistent *persist = dev->persist;
-	int err;
 
 	if (persist->num_vfs)
 		mlx4_warn(persist->dev, "Reload performed on PF, will cause reset on operating Virtual Functions\n");
 	mlx4_restart_one_down(persist->pdev);
+	return 0;
+}
+
+static int mlx4_devlink_reload_up(struct devlink *devlink,
+				  struct netlink_ext_ack *extack)
+{
+	struct mlx4_priv *priv = devlink_priv(devlink);
+	struct mlx4_dev *dev = &priv->dev;
+	struct mlx4_dev_persistent *persist = dev->persist;
+	int err;
+
 	err = mlx4_restart_one_up(persist->pdev, true, devlink);
 	if (err)
 		mlx4_err(persist->dev, "mlx4_restart_one_up failed, ret=%d\n",
@@ -3956,7 +3966,8 @@ static int mlx4_devlink_reload(struct devlink *devlink,
 
 static const struct devlink_ops mlx4_devlink_ops = {
 	.port_type_set	= mlx4_devlink_port_type_set,
-	.reload		= mlx4_devlink_reload,
+	.reload_down	= mlx4_devlink_reload_down,
+	.reload_up	= mlx4_devlink_reload_up,
 };
 
 static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index 963a2b4b61b1..c71a1d9ea17b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -984,16 +984,26 @@ mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,
 	return 0;
 }
 
-static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink,
-						struct netlink_ext_ack *extack)
+static int
+mlxsw_devlink_core_bus_device_reload_down(struct devlink *devlink,
+					  struct netlink_ext_ack *extack)
 {
 	struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
-	int err;
 
 	if (!(mlxsw_core->bus->features & MLXSW_BUS_F_RESET))
 		return -EOPNOTSUPP;
 
 	mlxsw_core_bus_device_unregister(mlxsw_core, true);
+	return 0;
+}
+
+static int
+mlxsw_devlink_core_bus_device_reload_up(struct devlink *devlink,
+					struct netlink_ext_ack *extack)
+{
+	struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
+	int err;
+
 	err = mlxsw_core_bus_device_register(mlxsw_core->bus_info,
 					     mlxsw_core->bus,
 					     mlxsw_core->bus_priv, true,
@@ -1066,7 +1076,8 @@ mlxsw_devlink_trap_group_init(struct devlink *devlink,
 }
 
 static const struct devlink_ops mlxsw_devlink_ops = {
-	.reload				= mlxsw_devlink_core_bus_device_reload,
+	.reload_down		= mlxsw_devlink_core_bus_device_reload_down,
+	.reload_up		= mlxsw_devlink_core_bus_device_reload_up,
 	.port_type_set			= mlxsw_devlink_port_type_set,
 	.port_split			= mlxsw_devlink_port_split,
 	.port_unsplit			= mlxsw_devlink_port_unsplit,
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index 39cdb6c18ec0..7fba7b271a57 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -521,8 +521,14 @@ static void nsim_dev_traps_exit(struct devlink *devlink)
 	kfree(nsim_dev->trap_data);
 }
 
-static int nsim_dev_reload(struct devlink *devlink,
-			   struct netlink_ext_ack *extack)
+static int nsim_dev_reload_down(struct devlink *devlink,
+				struct netlink_ext_ack *extack)
+{
+	return 0;
+}
+
+static int nsim_dev_reload_up(struct devlink *devlink,
+			      struct netlink_ext_ack *extack)
 {
 	enum nsim_resource_id res_ids[] = {
 		NSIM_RESOURCE_IPV4_FIB, NSIM_RESOURCE_IPV4_FIB_RULES,
@@ -638,7 +644,8 @@ nsim_dev_devlink_trap_action_set(struct devlink *devlink,
 }
 
 static const struct devlink_ops nsim_dev_devlink_ops = {
-	.reload = nsim_dev_reload,
+	.reload_down = nsim_dev_reload_down,
+	.reload_up = nsim_dev_reload_up,
 	.flash_update = nsim_dev_flash_update,
 	.trap_init = nsim_dev_devlink_trap_init,
 	.trap_action_set = nsim_dev_devlink_trap_action_set,
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 460bc629d1a4..c17709c0d0ec 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -637,7 +637,10 @@ enum devlink_trap_group_generic_id {
 	}
 
 struct devlink_ops {
-	int (*reload)(struct devlink *devlink, struct netlink_ext_ack *extack);
+	int (*reload_down)(struct devlink *devlink,
+			   struct netlink_ext_ack *extack);
+	int (*reload_up)(struct devlink *devlink,
+			 struct netlink_ext_ack *extack);
 	int (*port_type_set)(struct devlink_port *devlink_port,
 			     enum devlink_port_type port_type);
 	int (*port_split)(struct devlink *devlink, unsigned int port_index,
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 6e52d639dac6..1e3a2288b0b2 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -2672,12 +2672,17 @@ devlink_resources_validate(struct devlink *devlink,
 	return err;
 }
 
+static bool devlink_reload_supported(struct devlink *devlink)
+{
+	return devlink->ops->reload_down && devlink->ops->reload_up;
+}
+
 static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
 {
 	struct devlink *devlink = info->user_ptr[0];
 	int err;
 
-	if (!devlink->ops->reload)
+	if (!devlink_reload_supported(devlink))
 		return -EOPNOTSUPP;
 
 	err = devlink_resources_validate(devlink, NULL, info);
@@ -2685,7 +2690,10 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
 		NL_SET_ERR_MSG_MOD(info->extack, "resources size validation failed");
 		return err;
 	}
-	return devlink->ops->reload(devlink, info->extack);
+	err = devlink->ops->reload_down(devlink, info->extack);
+	if (err)
+		return err;
+	return devlink->ops->reload_up(devlink, info->extack);
 }
 
 static int devlink_nl_flash_update_fill(struct sk_buff *msg,
@@ -7145,7 +7153,7 @@ __devlink_param_driverinit_value_set(struct devlink *devlink,
 int devlink_param_driverinit_value_get(struct devlink *devlink, u32 param_id,
 				       union devlink_param_value *init_val)
 {
-	if (!devlink->ops->reload)
+	if (!devlink_reload_supported(devlink))
 		return -EOPNOTSUPP;
 
 	return __devlink_param_driverinit_value_get(&devlink->param_list,
@@ -7192,7 +7200,7 @@ int devlink_port_param_driverinit_value_get(struct devlink_port *devlink_port,
 {
 	struct devlink *devlink = devlink_port->devlink;
 
-	if (!devlink->ops->reload)
+	if (!devlink_reload_supported(devlink))
 		return -EOPNOTSUPP;
 
 	return __devlink_param_driverinit_value_get(&devlink_port->param_list,
-- 
2.21.0


^ permalink raw reply related

* [patch net-next 1/3] mlx4: Split restart_one into two functions
From: Jiri Pirko @ 2019-09-06 18:44 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, dsahern, jakub.kicinski, tariqt, mlxsw
In-Reply-To: <20190906184419.5101-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

Split the function restart_one into two functions and separate teardown
and buildup.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/catas.c |  2 +-
 drivers/net/ethernet/mellanox/mlx4/main.c  | 25 ++++++++++++++++++----
 drivers/net/ethernet/mellanox/mlx4/mlx4.h  |  3 +--
 3 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/catas.c b/drivers/net/ethernet/mellanox/mlx4/catas.c
index 87e90b5d4d7d..5b11557f1ae4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/catas.c
+++ b/drivers/net/ethernet/mellanox/mlx4/catas.c
@@ -210,7 +210,7 @@ static void mlx4_handle_error_state(struct mlx4_dev_persistent *persist)
 	mutex_lock(&persist->interface_state_mutex);
 	if (persist->interface_state & MLX4_INTERFACE_STATE_UP &&
 	    !(persist->interface_state & MLX4_INTERFACE_STATE_DELETION)) {
-		err = mlx4_restart_one(persist->pdev, false, NULL);
+		err = mlx4_restart_one(persist->pdev);
 		mlx4_info(persist->dev, "mlx4_restart_one was ended, ret=%d\n",
 			  err);
 	}
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 07c204bd3fc4..a39c647c12dc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -3931,6 +3931,10 @@ static void mlx4_devlink_param_load_driverinit_values(struct devlink *devlink)
 	}
 }
 
+static void mlx4_restart_one_down(struct pci_dev *pdev);
+static int mlx4_restart_one_up(struct pci_dev *pdev, bool reload,
+			       struct devlink *devlink);
+
 static int mlx4_devlink_reload(struct devlink *devlink,
 			       struct netlink_ext_ack *extack)
 {
@@ -3941,9 +3945,11 @@ static int mlx4_devlink_reload(struct devlink *devlink,
 
 	if (persist->num_vfs)
 		mlx4_warn(persist->dev, "Reload performed on PF, will cause reset on operating Virtual Functions\n");
-	err = mlx4_restart_one(persist->pdev, true, devlink);
+	mlx4_restart_one_down(persist->pdev);
+	err = mlx4_restart_one_up(persist->pdev, true, devlink);
 	if (err)
-		mlx4_err(persist->dev, "mlx4_restart_one failed, ret=%d\n", err);
+		mlx4_err(persist->dev, "mlx4_restart_one_up failed, ret=%d\n",
+			 err);
 
 	return err;
 }
@@ -4163,7 +4169,13 @@ static int restore_current_port_types(struct mlx4_dev *dev,
 	return err;
 }
 
-int mlx4_restart_one(struct pci_dev *pdev, bool reload, struct devlink *devlink)
+static void mlx4_restart_one_down(struct pci_dev *pdev)
+{
+	mlx4_unload_one(pdev);
+}
+
+static int mlx4_restart_one_up(struct pci_dev *pdev, bool reload,
+			       struct devlink *devlink)
 {
 	struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev);
 	struct mlx4_dev	 *dev  = persist->dev;
@@ -4175,7 +4187,6 @@ int mlx4_restart_one(struct pci_dev *pdev, bool reload, struct devlink *devlink)
 	total_vfs = dev->persist->num_vfs;
 	memcpy(nvfs, dev->persist->nvfs, sizeof(dev->persist->nvfs));
 
-	mlx4_unload_one(pdev);
 	if (reload)
 		mlx4_devlink_param_load_driverinit_values(devlink);
 	err = mlx4_load_one(pdev, pci_dev_data, total_vfs, nvfs, priv, 1);
@@ -4194,6 +4205,12 @@ int mlx4_restart_one(struct pci_dev *pdev, bool reload, struct devlink *devlink)
 	return err;
 }
 
+int mlx4_restart_one(struct pci_dev *pdev)
+{
+	mlx4_restart_one_down(pdev);
+	return mlx4_restart_one_up(pdev, false, NULL);
+}
+
 #define MLX_SP(id) { PCI_VDEVICE(MELLANOX, id), MLX4_PCI_DEV_FORCE_SENSE_PORT }
 #define MLX_VF(id) { PCI_VDEVICE(MELLANOX, id), MLX4_PCI_DEV_IS_VF }
 #define MLX_GN(id) { PCI_VDEVICE(MELLANOX, id), 0 }
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 23f1b5b512c2..527b52e48276 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -1043,8 +1043,7 @@ int mlx4_catas_init(struct mlx4_dev *dev);
 void mlx4_catas_end(struct mlx4_dev *dev);
 int mlx4_crdump_init(struct mlx4_dev *dev);
 void mlx4_crdump_end(struct mlx4_dev *dev);
-int mlx4_restart_one(struct pci_dev *pdev, bool reload,
-		     struct devlink *devlink);
+int mlx4_restart_one(struct pci_dev *pdev);
 int mlx4_register_device(struct mlx4_dev *dev);
 void mlx4_unregister_device(struct mlx4_dev *dev);
 void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_dev_event type,
-- 
2.21.0


^ permalink raw reply related

* [patch net-next 0/3] net: devlink: move reload fail indication to devlink core and expose to user
From: Jiri Pirko @ 2019-09-06 18:44 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, dsahern, jakub.kicinski, tariqt, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

First two patches are dependencies of the last one. That moves devlink
reload failure indication to the devlink code, so the drivers do not
have to track it themselves. Currently it is only mlxsw, but I will send
a follow-up patchset that introduces this in netdevsim too.

Jiri Pirko (3):
  mlx4: Split restart_one into two functions
  net: devlink: split reload op into two
  net: devlink: move reload fail indication to devlink core and expose
    to user

 drivers/net/ethernet/mellanox/mlx4/catas.c |  2 +-
 drivers/net/ethernet/mellanox/mlx4/main.c  | 44 ++++++++++++++++++----
 drivers/net/ethernet/mellanox/mlx4/mlx4.h  |  3 +-
 drivers/net/ethernet/mellanox/mlxsw/core.c | 30 +++++++++------
 drivers/net/netdevsim/dev.c                | 13 +++++--
 include/net/devlink.h                      |  8 +++-
 include/uapi/linux/devlink.h               |  2 +
 net/core/devlink.c                         | 35 +++++++++++++++--
 8 files changed, 106 insertions(+), 31 deletions(-)

-- 
2.21.0


^ permalink raw reply

* Re: [net-next 02/11] devlink: add 'reset_dev_on_drv_probe' param
From: Dirk van der Merwe @ 2019-09-06 18:40 UTC (permalink / raw)
  To: Jiri Pirko, Simon Horman
  Cc: David Miller, Jakub Kicinski, netdev, oss-drivers
In-Reply-To: <20190906183106.GA3223@nanopsycho.orion>


On 9/6/19 11:31 AM, Jiri Pirko wrote:
> Fri, Sep 06, 2019 at 06:00:52PM CEST, simon.horman@netronome.com wrote:
>> From: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
>>
>> Add the 'reset_dev_on_drv_probe' devlink parameter, controlling the
>> device reset policy on driver probe.
>>
>> This parameter is useful in conjunction with the existing
>> 'fw_load_policy' parameter.
>>
>> Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
>> Signed-off-by: Simon Horman <simon.horman@netronome.com>
>> ---
>> Documentation/networking/devlink-params.txt | 14 ++++++++++++++
>> include/net/devlink.h                       |  4 ++++
>> include/uapi/linux/devlink.h                |  7 +++++++
>> net/core/devlink.c                          |  5 +++++
>> 4 files changed, 30 insertions(+)
>>
>> diff --git a/Documentation/networking/devlink-params.txt b/Documentation/networking/devlink-params.txt
>> index fadb5436188d..f9e30d686243 100644
>> --- a/Documentation/networking/devlink-params.txt
>> +++ b/Documentation/networking/devlink-params.txt
>> @@ -51,3 +51,17 @@ fw_load_policy		[DEVICE, GENERIC]
>> 			* DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK (2)
>> 			  Load firmware currently available on host's disk.
>> 			Type: u8
>> +
>> +reset_dev_on_drv_probe	[DEVICE, GENERIC]
>> +			Controls the device's reset policy on driver probe.
>> +			Valid values:
>> +			* DEVLINK_PARAM_RESET_DEV_VALUE_UNKNOWN (0)
>> +			  Unknown or invalid value.
> Why do you need this? Do you have usecase for this value?


I added this in to avoid having the entire netlink dump fail when there 
are invalid values read from hardware.

This way, it can report an unknown or invalid value instead of failing 
the operation.


>
>
>> +			* DEVLINK_PARAM_RESET_DEV_VALUE_ALWAYS (1)
>> +			  Always reset device on driver probe.
>> +			* DEVLINK_PARAM_RESET_DEV_VALUE_NEVER (2)
>> +			  Never reset device on driver probe.
>> +			* DEVLINK_PARAM_RESET_DEV_VALUE_DISK (3)
>> +			  Reset only if device firmware can be found in the
>> +			  filesystem.
>> +			Type: u8
>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>> index 460bc629d1a4..d880de5b8d3a 100644
>> --- a/include/net/devlink.h
>> +++ b/include/net/devlink.h
>> @@ -398,6 +398,7 @@ enum devlink_param_generic_id {
>> 	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
>> 	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
>> 	DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,
>> +	DEVLINK_PARAM_GENERIC_ID_RESET_DEV,
>>
>> 	/* add new param generic ids above here*/
>> 	__DEVLINK_PARAM_GENERIC_ID_MAX,
>> @@ -428,6 +429,9 @@ enum devlink_param_generic_id {
>> #define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_NAME "fw_load_policy"
>> #define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_TYPE DEVLINK_PARAM_TYPE_U8
>>
>> +#define DEVLINK_PARAM_GENERIC_RESET_DEV_NAME "reset_dev_on_drv_probe"
> The name of the define and name of the string should be the same. Please
> adjust.


Sure, I will make the change.

Thanks for the review.


^ permalink raw reply

* Re: [PATCH] net: enable wireless core features with WIRELESS_ALLCONFIG
From: Marcel Holtmann @ 2019-09-06 18:31 UTC (permalink / raw)
  To: Mark Salyzyn
  Cc: linux-kernel, kernel-team, Johannes Berg, David S. Miller,
	linux-wireless, netdev, stable
In-Reply-To: <20190906180551.163714-1-salyzyn@android.com>

Hi Mark,

> In embedded environments the requirements are to be able to pick and
> chose which features one requires built into the kernel.  If an
> embedded environment wants to supports loading modules that have been
> kbuilt out of tree, there is a need to enable hidden configurations
> for core features to provide the API surface for them to load.
> 
> Introduce CONFIG_WIRELESS_ALLCONFIG to select all wireless core
> features by activating all the hidden configuration options, without
> having to specifically select any wireless module(s).
> 
> Signed-off-by: Mark Salyzyn <salyzyn@android.com>
> Cc: kernel-team@android.com
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: stable@vger.kernel.org # 4.19
> ---
> net/wireless/Kconfig | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> 
> diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
> index 67f8360dfcee..0d32350e1729 100644
> --- a/net/wireless/Kconfig
> +++ b/net/wireless/Kconfig
> @@ -17,6 +17,20 @@ config WEXT_SPY
> config WEXT_PRIV
> 	bool
> 
> +config WIRELESS_ALLCONFIG
> +	bool "allconfig for wireless core"
> +	select WIRELESS_EXT
> +	select WEXT_CORE
> +	select WEXT_PROC
> +	select WEXT_SPY
> +	select WEXT_PRIV
> +	help
> +	  Config option used to enable all the wireless core functionality
> +	  used by modules.
> +
> +	  If you are not building a kernel to be used for a variety of
> +	  out-of-kernel built wireless modules, say N here.
> +

this looks rather legacy Wireless Extension (wext) specific. So it might be better to clearly name the option “legacy” and “wext” to not confuse anybody running an actual modern driver and userspace.

Regards

Marcel


^ permalink raw reply

* Re: [net-next 02/11] devlink: add 'reset_dev_on_drv_probe' param
From: Jiri Pirko @ 2019-09-06 18:31 UTC (permalink / raw)
  To: Simon Horman
  Cc: David Miller, Jakub Kicinski, netdev, oss-drivers,
	Dirk van der Merwe
In-Reply-To: <20190906160101.14866-3-simon.horman@netronome.com>

Fri, Sep 06, 2019 at 06:00:52PM CEST, simon.horman@netronome.com wrote:
>From: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
>
>Add the 'reset_dev_on_drv_probe' devlink parameter, controlling the
>device reset policy on driver probe.
>
>This parameter is useful in conjunction with the existing
>'fw_load_policy' parameter.
>
>Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
>Signed-off-by: Simon Horman <simon.horman@netronome.com>
>---
> Documentation/networking/devlink-params.txt | 14 ++++++++++++++
> include/net/devlink.h                       |  4 ++++
> include/uapi/linux/devlink.h                |  7 +++++++
> net/core/devlink.c                          |  5 +++++
> 4 files changed, 30 insertions(+)
>
>diff --git a/Documentation/networking/devlink-params.txt b/Documentation/networking/devlink-params.txt
>index fadb5436188d..f9e30d686243 100644
>--- a/Documentation/networking/devlink-params.txt
>+++ b/Documentation/networking/devlink-params.txt
>@@ -51,3 +51,17 @@ fw_load_policy		[DEVICE, GENERIC]
> 			* DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK (2)
> 			  Load firmware currently available on host's disk.
> 			Type: u8
>+
>+reset_dev_on_drv_probe	[DEVICE, GENERIC]
>+			Controls the device's reset policy on driver probe.
>+			Valid values:
>+			* DEVLINK_PARAM_RESET_DEV_VALUE_UNKNOWN (0)
>+			  Unknown or invalid value.

Why do you need this? Do you have usecase for this value?


>+			* DEVLINK_PARAM_RESET_DEV_VALUE_ALWAYS (1)
>+			  Always reset device on driver probe.
>+			* DEVLINK_PARAM_RESET_DEV_VALUE_NEVER (2)
>+			  Never reset device on driver probe.
>+			* DEVLINK_PARAM_RESET_DEV_VALUE_DISK (3)
>+			  Reset only if device firmware can be found in the
>+			  filesystem.
>+			Type: u8
>diff --git a/include/net/devlink.h b/include/net/devlink.h
>index 460bc629d1a4..d880de5b8d3a 100644
>--- a/include/net/devlink.h
>+++ b/include/net/devlink.h
>@@ -398,6 +398,7 @@ enum devlink_param_generic_id {
> 	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
> 	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
> 	DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,
>+	DEVLINK_PARAM_GENERIC_ID_RESET_DEV,
> 
> 	/* add new param generic ids above here*/
> 	__DEVLINK_PARAM_GENERIC_ID_MAX,
>@@ -428,6 +429,9 @@ enum devlink_param_generic_id {
> #define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_NAME "fw_load_policy"
> #define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_TYPE DEVLINK_PARAM_TYPE_U8
> 
>+#define DEVLINK_PARAM_GENERIC_RESET_DEV_NAME "reset_dev_on_drv_probe"

The name of the define and name of the string should be the same. Please
adjust.


>+#define DEVLINK_PARAM_GENERIC_RESET_DEV_TYPE DEVLINK_PARAM_TYPE_U8
>+
> #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
> {									\
> 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
>diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
>index c25cc29a6647..3172d1b3329f 100644
>--- a/include/uapi/linux/devlink.h
>+++ b/include/uapi/linux/devlink.h
>@@ -205,6 +205,13 @@ enum devlink_param_fw_load_policy_value {
> 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK,
> };
> 
>+enum devlink_param_reset_dev_value {
>+	DEVLINK_PARAM_RESET_DEV_VALUE_UNKNOWN,
>+	DEVLINK_PARAM_RESET_DEV_VALUE_ALWAYS,
>+	DEVLINK_PARAM_RESET_DEV_VALUE_NEVER,
>+	DEVLINK_PARAM_RESET_DEV_VALUE_DISK,
>+};
>+
> enum {
> 	DEVLINK_ATTR_STATS_RX_PACKETS,		/* u64 */
> 	DEVLINK_ATTR_STATS_RX_BYTES,		/* u64 */
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 6e52d639dac6..e8bc96f104a7 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -2852,6 +2852,11 @@ static const struct devlink_param devlink_param_generic[] = {
> 		.name = DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_NAME,
> 		.type = DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_TYPE,
> 	},
>+	{
>+		.id = DEVLINK_PARAM_GENERIC_ID_RESET_DEV,
>+		.name = DEVLINK_PARAM_GENERIC_RESET_DEV_NAME,
>+		.type = DEVLINK_PARAM_GENERIC_RESET_DEV_TYPE,
>+	},
> };
> 
> static int devlink_param_generic_verify(const struct devlink_param *param)
>-- 
>2.11.0
>

^ permalink raw reply

* [vhost:linux-next 13/15] arch/ia64/include/asm/page.h:51:23: warning: "hpage_shift" is not defined, evaluates to 0
From: kbuild test robot @ 2019-09-06 18:28 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: kbuild-all, kvm, virtualization, netdev, Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 15735 bytes --]

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/mst/vhost.git linux-next
head:   c5db5a8d998da36ada7287aa53b4ed501a0a2b2b
commit: b1b0d638e6f93b91cf34585350bb00035d066989 [13/15] mm: Introduce Reported pages
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout b1b0d638e6f93b91cf34585350bb00035d066989
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/asm/ptrace.h:46:0,
                    from arch/ia64/include/asm/processor.h:20,
                    from arch/ia64/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:38,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/ia64/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/rcupdate.h:27,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from arch/ia64/kernel/asm-offsets.c:10:
>> arch/ia64/include/asm/page.h:51:23: warning: "hpage_shift" is not defined, evaluates to 0 [-Wundef]
    # define HPAGE_SHIFT  hpage_shift
                          ^
>> arch/ia64/include/asm/page.h:153:30: note: in expansion of macro 'HPAGE_SHIFT'
    # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
                                 ^~~~~~~~~~~
   include/linux/page_reporting.h:9:37: note: in expansion of macro 'HUGETLB_PAGE_ORDER'
    #if defined(CONFIG_HUGETLB_PAGE) && HUGETLB_PAGE_ORDER < MAX_ORDER
                                        ^~~~~~~~~~~~~~~~~~
--
   In file included from arch/ia64/include/asm/ptrace.h:46:0,
                    from arch/ia64/include/asm/processor.h:20,
                    from arch/ia64/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:38,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/ia64/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/rcupdate.h:27,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from arch/ia64/kernel/asm-offsets.c:10:
>> arch/ia64/include/asm/page.h:51:23: warning: "hpage_shift" is not defined, evaluates to 0 [-Wundef]
    # define HPAGE_SHIFT  hpage_shift
                          ^
>> arch/ia64/include/asm/page.h:153:30: note: in expansion of macro 'HPAGE_SHIFT'
    # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
                                 ^~~~~~~~~~~
   include/linux/page_reporting.h:9:37: note: in expansion of macro 'HUGETLB_PAGE_ORDER'
    #if defined(CONFIG_HUGETLB_PAGE) && HUGETLB_PAGE_ORDER < MAX_ORDER
                                        ^~~~~~~~~~~~~~~~~~
   <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
   4 real  3 user  1 sys  120.83% cpu 	make prepare

vim +/hpage_shift +51 arch/ia64/include/asm/page.h

^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   47  
0a41e250116058 include/asm-ia64/page.h      Peter Chubb       2005-08-16   48  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   49  #ifdef CONFIG_HUGETLB_PAGE
0a41e250116058 include/asm-ia64/page.h      Peter Chubb       2005-08-16   50  # define HPAGE_REGION_BASE	RGN_BASE(RGN_HPAGE)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  @51  # define HPAGE_SHIFT		hpage_shift
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   52  # define HPAGE_SHIFT_DEFAULT	28	/* check ia64 SDM for architecture supported size */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   53  # define HPAGE_SIZE		(__IA64_UL_CONST(1) << HPAGE_SHIFT)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   54  # define HPAGE_MASK		(~(HPAGE_SIZE - 1))
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   55  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   56  # define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   57  #endif /* CONFIG_HUGETLB_PAGE */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   58  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   59  #ifdef __ASSEMBLY__
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   60  # define __pa(x)		((x) - PAGE_OFFSET)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   61  # define __va(x)		((x) + PAGE_OFFSET)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   62  #else /* !__ASSEMBLY */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   63  #  define STRICT_MM_TYPECHECKS
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   64  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   65  extern void clear_page (void *page);
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   66  extern void copy_page (void *to, void *from);
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   67  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   68  /*
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   69   * clear_user_page() and copy_user_page() can't be inline functions because
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   70   * flush_dcache_page() can't be defined until later...
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   71   */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   72  #define clear_user_page(addr, vaddr, page)	\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   73  do {						\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   74  	clear_page(addr);			\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   75  	flush_dcache_page(page);		\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   76  } while (0)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   77  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   78  #define copy_user_page(to, from, vaddr, page)	\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   79  do {						\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   80  	copy_page((to), (from));		\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   81  	flush_dcache_page(page);		\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   82  } while (0)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   83  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   84  
769848c03895b6 include/asm-ia64/page.h      Mel Gorman        2007-07-17   85  #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr)		\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   86  ({									\
769848c03895b6 include/asm-ia64/page.h      Mel Gorman        2007-07-17   87  	struct page *page = alloc_page_vma(				\
769848c03895b6 include/asm-ia64/page.h      Mel Gorman        2007-07-17   88  		GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr);	\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   89  	if (page)							\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   90   		flush_dcache_page(page);				\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   91  	page;								\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   92  })
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   93  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   94  #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   95  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   96  #define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   97  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   98  #ifdef CONFIG_VIRTUAL_MEM_MAP
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16   99  extern int ia64_pfn_valid (unsigned long pfn);
b0f40ea04a85b0 include/asm-ia64/page.h      Matthew Wilcox    2006-11-16  100  #else
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  101  # define ia64_pfn_valid(pfn) 1
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  102  #endif
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  103  
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  104  #ifdef CONFIG_VIRTUAL_MEM_MAP
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  105  extern struct page *vmem_map;
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  106  #ifdef CONFIG_DISCONTIGMEM
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  107  # define page_to_pfn(page)	((unsigned long) (page - vmem_map))
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  108  # define pfn_to_page(pfn)	(vmem_map + (pfn))
d2c0f041e1bb12 arch/ia64/include/asm/page.h Dan Williams      2016-01-15  109  # define __pfn_to_phys(pfn)	PFN_PHYS(pfn)
b0f40ea04a85b0 include/asm-ia64/page.h      Matthew Wilcox    2006-11-16  110  #else
b0f40ea04a85b0 include/asm-ia64/page.h      Matthew Wilcox    2006-11-16  111  # include <asm-generic/memory_model.h>
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  112  #endif
b0f40ea04a85b0 include/asm-ia64/page.h      Matthew Wilcox    2006-11-16  113  #else
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  114  # include <asm-generic/memory_model.h>
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  115  #endif
0ecd702bcb924d include/asm-ia64/page.h      KAMEZAWA Hiroyuki 2006-03-27  116  
1be7d9935b9c7f include/asm-ia64/page.h      Bob Picco         2005-10-04  117  #ifdef CONFIG_FLATMEM
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  118  # define pfn_valid(pfn)		(((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
1be7d9935b9c7f include/asm-ia64/page.h      Bob Picco         2005-10-04  119  #elif defined(CONFIG_DISCONTIGMEM)
b77dae5293efba include/asm-ia64/page.h      Dean Roe          2005-11-09  120  extern unsigned long min_low_pfn;
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  121  extern unsigned long max_low_pfn;
b77dae5293efba include/asm-ia64/page.h      Dean Roe          2005-11-09  122  # define pfn_valid(pfn)		(((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  123  #endif
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  124  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  125  #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  126  #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
631bb0e74e811e include/asm-ia64/page.h      Bob Picco         2005-10-31  127  #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  128  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  129  typedef union ia64_va {
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  130  	struct {
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  131  		unsigned long off : 61;		/* intra-region offset */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  132  		unsigned long reg :  3;		/* region number */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  133  	} f;
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  134  	unsigned long l;
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  135  	void *p;
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  136  } ia64_va;
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  137  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  138  /*
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  139   * Note: These macros depend on the fact that PAGE_OFFSET has all
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  140   * region bits set to 1 and all other bits set to zero.  They are
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  141   * expressed in this way to ensure they result in a single "dep"
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  142   * instruction.
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  143   */
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  144  #define __pa(x)		({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  145  #define __va(x)		({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  146  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  147  #define REGION_NUMBER(x)	({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  148  #define REGION_OFFSET(x)	({ia64_va _v; _v.l = (long) (x); _v.f.off;})
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  149  
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  150  #ifdef CONFIG_HUGETLB_PAGE
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  151  # define htlbpage_to_page(x)	(((unsigned long) REGION_NUMBER(x) << 61)			\
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  152  				 | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16 @153  # define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  154  extern unsigned int hpage_shift;
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  155  #endif
^1da177e4c3f41 include/asm-ia64/page.h      Linus Torvalds    2005-04-16  156  

:::::: The code at line 51 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 19192 bytes --]

^ permalink raw reply

* [PATCH] ath9k_htc: release allocated buffer if timed out
From: Navid Emamdoost @ 2019-09-06 18:26 UTC (permalink / raw)
  Cc: emamd001, smccaman, kjlu, Navid Emamdoost, QCA ath9k Development,
	Kalle Valo, David S. Miller, linux-wireless, netdev, linux-kernel

In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service
if time out happens, the allocated buffer needs to be released.
Otherwise there will be memory leak.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/net/wireless/ath/ath9k/htc_hst.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 1bf63a4efb4c..d091c8ebdcf0 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -170,6 +170,7 @@ static int htc_config_pipe_credits(struct htc_target *target)
 	time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
 	if (!time_left) {
 		dev_err(target->dev, "HTC credit config timeout\n");
+		kfree_skb(skb);
 		return -ETIMEDOUT;
 	}
 
@@ -205,6 +206,7 @@ static int htc_setup_complete(struct htc_target *target)
 	time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
 	if (!time_left) {
 		dev_err(target->dev, "HTC start timeout\n");
+		kfree_skb(skb);
 		return -ETIMEDOUT;
 	}
 
@@ -277,6 +279,7 @@ int htc_connect_service(struct htc_target *target,
 	if (!time_left) {
 		dev_err(target->dev, "Service connection timeout for: %d\n",
 			service_connreq->service_id);
+		kfree_skb(skb);
 		return -ETIMEDOUT;
 	}
 
-- 
2.17.1


^ permalink raw reply related

* ixgbe: driver drops packets routed from an IPSec interface with a "bad sa_idx" error
From: Michael Marley @ 2019-09-06 18:13 UTC (permalink / raw)
  To: netdev

(This is also reported at 
https://bugzilla.kernel.org/show_bug.cgi?id=204551, but it was 
recommended that I send it to this list as well.)

I have a put together a router that routes traffic from several local 
subnets from a switch attached to an i82599ES card through an IPSec VPN 
interface set up with StrongSwan.  (The VPN is running on an unrelated 
second interface with a different driver.)  Traffic from the local 
interfaces to the VPN works as it should and eventually makes it through 
the VPN server and out to the Internet.  The return traffic makes it 
back to the router and tcpdump shows it leaving by the i82599, but the 
traffic never actually makes it onto the wire and I instead get one of

enp1s0: ixgbe_ipsec_tx: bad sa_idx=64512 handle=0

for each packet that should be transmitted.  (The sa_idx and handle 
values are always the same.)

I realized this was probably related to ixgbe's IPSec offloading 
feature, so I tried with the motherboard's integrated e1000e device and 
didn't have the problem.  I tried using ethtool to disable all the 
IPSec-related offloads (tx-esp-segmentation, esp-hw-offload, 
esp-tx-csum-hw-offload), but the problem persisted.  I then tried 
recompiling the kernel with CONFIG_IXGBE_IPSEC=n and that worked around 
the problem.

I was also able to find another instance of the same problem reported in 
Debian at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930443.  
That person seems to be having exactly the same issue as me, down to the 
sa_idx and handle values being the same.

If there are any more details I can provide to make this easier to track 
down, please let me know.

Thanks,

Michael Marley

^ permalink raw reply

* Re: [PATCH net-next,v3 0/4] flow_offload: update mangle action representation
From: Pablo Neira Ayuso @ 2019-09-06 18:15 UTC (permalink / raw)
  To: Edward Cree
  Cc: netfilter-devel, davem, netdev, jakub.kicinski, jiri, saeedm,
	vishal, vladbu
In-Reply-To: <1637ec50-daae-65df-fcaa-bfd763dbb1d9@solarflare.com>

On Fri, Sep 06, 2019 at 05:49:07PM +0100, Edward Cree wrote:
> On 06/09/2019 16:58, Pablo Neira Ayuso wrote:
> > In tc pedit ex, those are _indeed_ two separated actions: 
>
>  I read the code again and I get it now, there's double iteration
>  already over tcf_exts_for_each_action and tcf_pedit_nkeys, and
>  it's only within the latter that you coalesce.

Exactly.

>  However, have you considered that iproute2 (i.e. tc tool) isn't
>  guaranteed to be the only userland consumer of the TC uAPI?
>  For all we know there could be another user out there producing things like
>  a single pedit action with two keys, same offset but different
>  masks, to mangle sport & dport separately, which your code now
>  _would_ coalesce into a single mangle. I don't know if that would
>  lead to any problems, but I want to be sure you've thought about it ;)

tc pedit only supports for the "extended mode". So the hardware
offloads only support for a subset of the tc pedit uAPI already.

Userland may decide not to use the "extended mode", however, it will
not work for hardware offloads.

> >> Proper thing to do is have helper functions available to drivers to test
> >> the pedit, and not just switch on the offset.  Why do I say that?
> >>
> >> Well, consider a pedit on UDP dport, with mask 0x00ff (network endian).
> >> Now as a u32 pedit that's 0x000000ff offset 0, so field-blind offset
> >> calculation (ffs in flow_action_mangle_entry()) will turn that into
> >> offset 3 mask 0xff.  Now driver does
> >>     switch(offset) { /* 3 */
> >>     case offsetof(struct udphdr, dest): /* 2 */
> >>         /* Whoops, we never get here! */
> >>     }
> >>
> >> Do you see the problem?
> >
> > This scenario you describe cannot _work_ right now, with the existing
> > code. Without my patchset, this scenario you describe does _not_ work,
> >
> > The drivers in the tree need a mask of 0xffff to infer that this is
> > UDP dport.
> >
> > The 'tc pedit ex' infrastructure does not allow for the scenario that
> > you describe above.
> >
> > No driver in the tree allow for what you describe already.
>
>  Looks to me like existing nfp_fl_set_tport() handles just fine any
>  arbitrary mask across the u32 that contains UDP sport & dport.
>  And the uAPI we have to maintain is the uAPI we expose, not the subset
>  that iproute2 uses. I could write a patched tc tool *today* that does
>  a pedit of 'UDP header, offset 0, mask 0xff0000ff' and the nfp driver
>  would accept that fine (no idea what the fw / chip would do with it,
>  but presumably it works or Netronome folks would have put checks in),
>  whereas with your patch it'll complain "invalid pedit L4 action"
>  because the mask isn't all-1s.

'UDP header, offset 0, mask 0xff0000ff': Mangle one byte of the UDP
sport, and only one mangle of the dport via uAPI.

I get your point: If you think that supporting for this is reasonable
usecase, I'll fix this patchset and send a v4 so the nfp still works
for this.

>  And if I made it produce my example from above, mask 0x000000ff, you'd
>  calculate an offset of 3 and hit the other error, "unsupported section
>  of L4 header", which again would have worked before.

'mask 0x000000ff' mangle only one byte of a UDP port.

I'm sorry for this, I assumed in this case that the reasonable (sane)
uAPI subset in this case to be supported for the hardware offloads is
what tc tool via pedit ex generates.

I'll restore the nfp driver so it works for these scenarios via uAPI
that you describe.

^ permalink raw reply

* [PATCH] net: enable wireless core features with WIRELESS_ALLCONFIG
From: Mark Salyzyn @ 2019-09-06 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-team, Mark Salyzyn, Johannes Berg, David S. Miller,
	linux-wireless, netdev, stable

In embedded environments the requirements are to be able to pick and
chose which features one requires built into the kernel.  If an
embedded environment wants to supports loading modules that have been
kbuilt out of tree, there is a need to enable hidden configurations
for core features to provide the API surface for them to load.

Introduce CONFIG_WIRELESS_ALLCONFIG to select all wireless core
features by activating all the hidden configuration options, without
having to specifically select any wireless module(s).

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: kernel-team@android.com
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # 4.19
---
 net/wireless/Kconfig | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index 67f8360dfcee..0d32350e1729 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -17,6 +17,20 @@ config WEXT_SPY
 config WEXT_PRIV
 	bool
 
+config WIRELESS_ALLCONFIG
+	bool "allconfig for wireless core"
+	select WIRELESS_EXT
+	select WEXT_CORE
+	select WEXT_PROC
+	select WEXT_SPY
+	select WEXT_PRIV
+	help
+	  Config option used to enable all the wireless core functionality
+	  used by modules.
+
+	  If you are not building a kernel to be used for a variety of
+	  out-of-kernel built wireless modules, say N here.
+
 config CFG80211
 	tristate "cfg80211 - wireless configuration API"
 	depends on RFKILL || !RFKILL
-- 
2.23.0.187.g17f5b7556c-goog


^ permalink raw reply related

* [vhost:linux-next 13/15] htmldocs: mm/page_alloc.c:2207: warning: Function parameter or member 'order' not described in 'free_reported_page'
From: kbuild test robot @ 2019-09-06 17:56 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: kbuild-all, kvm, virtualization, netdev, Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 19833 bytes --]

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/mst/vhost.git linux-next
head:   c5db5a8d998da36ada7287aa53b4ed501a0a2b2b
commit: b1b0d638e6f93b91cf34585350bb00035d066989 [13/15] mm: Introduce Reported pages
reproduce: make htmldocs

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   Warning: The Sphinx 'sphinx_rtd_theme' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.
   WARNING: dot(1) not found, for better output quality install graphviz from http://www.graphviz.org
   WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
   drivers/usb/typec/bus.c:1: warning: 'typec_altmode_register_driver' not found
   drivers/usb/typec/bus.c:1: warning: 'typec_altmode_unregister_driver' not found
   drivers/usb/typec/class.c:1: warning: 'typec_altmode_unregister_notifier' not found
   drivers/usb/typec/class.c:1: warning: 'typec_altmode_register_notifier' not found
   include/linux/w1.h:272: warning: Function parameter or member 'of_match_table' not described in 'w1_family'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quotactl' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quota_on' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'getprocattr' not described in 'security_list_options'
   include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'setprocattr' not described in 'security_list_options'
   lib/genalloc.c:1: warning: 'gen_pool_add_virt' not found
   lib/genalloc.c:1: warning: 'gen_pool_alloc' not found
   lib/genalloc.c:1: warning: 'gen_pool_free' not found
   lib/genalloc.c:1: warning: 'gen_pool_alloc_algo' not found
   include/linux/regulator/machine.h:196: warning: Function parameter or member 'max_uV_step' not described in 'regulation_constraints'
   include/linux/regulator/driver.h:223: warning: Function parameter or member 'resume' not described in 'regulator_ops'
   include/linux/spi/spi.h:190: warning: Function parameter or member 'driver_override' not described in 'spi_device'
   fs/direct-io.c:258: warning: Excess function parameter 'offset' description in 'dio_complete'
   fs/libfs.c:496: warning: Excess function parameter 'available' description in 'simple_write_end'
   fs/posix_acl.c:647: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode'
   fs/posix_acl.c:647: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode'
   fs/posix_acl.c:647: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode'
   include/linux/i2c.h:337: warning: Function parameter or member 'init_irq' not described in 'i2c_client'
   include/linux/input/sparse-keymap.h:43: warning: Function parameter or member 'sw' not described in 'key_entry'
   include/linux/skbuff.h:893: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'list' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'vlan_present' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
   include/linux/skbuff.h:893: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
   include/net/sock.h:233: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
   include/net/sock.h:233: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
   include/net/sock.h:515: warning: Function parameter or member 'sk_rx_skb_cache' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'sk_tx_skb_cache' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock'
   include/net/sock.h:515: warning: Function parameter or member 'sk_bpf_storage' not described in 'sock'
   include/net/sock.h:2439: warning: Function parameter or member 'tcp_rx_skb_cache_key' not described in 'DECLARE_STATIC_KEY_FALSE'
   include/net/sock.h:2439: warning: Excess function parameter 'sk' description in 'DECLARE_STATIC_KEY_FALSE'
   include/net/sock.h:2439: warning: Excess function parameter 'skb' description in 'DECLARE_STATIC_KEY_FALSE'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
   include/linux/netdevice.h:2040: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
   include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state'
   include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state'
   drivers/net/phy/phylink.c:595: warning: Function parameter or member 'config' not described in 'phylink_create'
   drivers/net/phy/phylink.c:595: warning: Excess function parameter 'ndev' description in 'phylink_create'
   mm/util.c:1: warning: 'get_user_pages_fast' not found
   mm/slab.c:4215: warning: Function parameter or member 'objp' not described in '__ksize'
>> mm/page_alloc.c:2207: warning: Function parameter or member 'order' not described in 'free_reported_page'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:142: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:347: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:348: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:494: warning: Function parameter or member 'start' not described in 'amdgpu_vm_pt_first_dfs'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:823: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_flags'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:2822: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute'
   drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:378: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch'
   drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:379: warning: Function parameter or member 'ih' not described in 'amdgpu_irq_dispatch'
   drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:379: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch'
   drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:1: warning: no structured comments found
   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1: warning: no structured comments found
   drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1: warning: 'pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie' not found
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:131: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source @atomic_obj
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:237: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source gpu_info FW provided soc bounding box struct or 0 if not
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'atomic_obj' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'backlight_link' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'backlight_caps' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'freesync_module' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'fw_dmcu' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'dmcu_fw_version' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'soc_bounding_box' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'register_hpd_handlers' not found
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'dm_crtc_high_irq' not found
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'dm_pflip_high_irq' not found
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver'
   include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
   include/drm/drm_modeset_helper_vtables.h:1053: warning: Function parameter or member 'prepare_writeback_job' not described in 'drm_connector_helper_funcs'
   include/drm/drm_modeset_helper_vtables.h:1053: warning: Function parameter or member 'cleanup_writeback_job' not described in 'drm_connector_helper_funcs'
   include/drm/drm_atomic_state_helper.h:1: warning: no structured comments found
   drivers/gpu/drm/mcde/mcde_drv.c:1: warning: 'ST-Ericsson MCDE DRM Driver' not found
   include/net/cfg80211.h:1092: warning: Function parameter or member 'txpwr' not described in 'station_parameters'
   include/net/mac80211.h:4043: warning: Function parameter or member 'sta_set_txpwr' not described in 'ieee80211_ops'
   include/net/mac80211.h:2006: warning: Function parameter or member 'txpwr' not described in 'ieee80211_sta'
   Documentation/admin-guide/xfs.rst:257: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/trace/kprobetrace.rst:99: WARNING: Explicit markup ends without a blank line; unexpected unindent.
   Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:458: WARNING: Unknown target name: "nitrokey pro".
   include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string.
   drivers/firewire/core-transaction.c:606: WARNING: Inline strong start-string without end-string.
   Documentation/process/embargoed-hardware-issues.rst:215: WARNING: Malformed table.
   Bottom/header table border does not match top border.

vim +2207 mm/page_alloc.c

  2195	
  2196	#ifdef CONFIG_PAGE_REPORTING
  2197	/**
  2198	 * free_reported_page - Return a now-reported page back where we got it
  2199	 * @page: Page that was reported
  2200	 *
  2201	 * This function will pull the migratetype and order information out
  2202	 * of the page and attempt to return it where it found it. If the page
  2203	 * is added to the free list without changes we will mark it as being
  2204	 * reported.
  2205	 */
  2206	void free_reported_page(struct page *page, unsigned int order)
> 2207	{
  2208		struct zone *zone = page_zone(page);
  2209		unsigned long pfn;
  2210		unsigned int mt;
  2211	
  2212		/* zone lock should be held when this function is called */
  2213		lockdep_assert_held(&zone->lock);
  2214	
  2215		pfn = page_to_pfn(page);
  2216		mt = get_pfnblock_migratetype(page, pfn);
  2217		__free_one_page(page, pfn, zone, order, mt, true);
  2218	
  2219		/*
  2220		 * If page was not comingled with another page we can consider
  2221		 * the result to be "reported" since part of the page hasn't been
  2222		 * modified, otherwise we would need to report on the new larger
  2223		 * page.
  2224		 */
  2225		if (PageBuddy(page) && page_order(page) == order)
  2226			add_page_to_reported_list(page, zone, order, mt);
  2227	}
  2228	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7254 bytes --]

^ permalink raw reply

* [PATCH net] nfp: flower: cmsg rtnl locks can timeout reify messages
From: Simon Horman @ 2019-09-06 17:29 UTC (permalink / raw)
  To: David Miller
  Cc: Jakub Kicinski, netdev, oss-drivers, Fred Lotter, Simon Horman

From: Fred Lotter <frederik.lotter@netronome.com>

Flower control message replies are handled in different locations. The truly
high priority replies are handled in the BH (tasklet) context, while the
remaining replies are handled in a predefined Linux work queue. The work
queue handler orders replies into high and low priority groups, and always
start servicing the high priority replies within the received batch first.

Reply Type:			Rtnl Lock:	Handler:

CMSG_TYPE_PORT_MOD		no		BH tasklet (mtu)
CMSG_TYPE_TUN_NEIGH		no		BH tasklet
CMSG_TYPE_FLOW_STATS		no		BH tasklet
CMSG_TYPE_PORT_REIFY		no		WQ high
CMSG_TYPE_PORT_MOD		yes		WQ high (link/mtu)
CMSG_TYPE_MERGE_HINT		yes		WQ low
CMSG_TYPE_NO_NEIGH		no		WQ low
CMSG_TYPE_ACTIVE_TUNS		no		WQ low
CMSG_TYPE_QOS_STATS		no		WQ low
CMSG_TYPE_LAG_CONFIG		no		WQ low

A subset of control messages can block waiting for an rtnl lock (from both
work queue priority groups). The rtnl lock is heavily contended for by
external processes such as systemd-udevd, systemd-network and libvirtd,
especially during netdev creation, such as when flower VFs and representors
are instantiated.

Kernel netlink instrumentation shows that external processes (such as
systemd-udevd) often use successive rtnl_trylock() sequences, which can result
in an rtnl_lock() blocked control message to starve for longer periods of time
during rtnl lock contention, i.e. netdev creation.

In the current design a single blocked control message will block the entire
work queue (both priorities), and introduce a latency which is
nondeterministic and dependent on system wide rtnl lock usage.

In some extreme cases, one blocked control message at exactly the wrong time,
just before the maximum number of VFs are instantiated, can block the work
queue for long enough to prevent VF representor REIFY replies from getting
handled in time for the 40ms timeout.

The firmware will deliver the total maximum number of REIFY message replies in
around 300us.

Only REIFY and MTU update messages require replies within a timeout period (of
40ms). The MTU-only updates are already done directly in the BH (tasklet)
handler.

Move the REIFY handler down into the BH (tasklet) in order to resolve timeouts
caused by a blocked work queue waiting on rtnl locks.

Signed-off-by: Fred Lotter <frederik.lotter@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 drivers/net/ethernet/netronome/nfp/flower/cmsg.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

 Hi Dave,

 I am handling maintenance of the nfp diver in Jakub's absence while he is
 on vacation this week and next, and I am sending this patchset in that
 capacity.

diff --git a/drivers/net/ethernet/netronome/nfp/flower/cmsg.c b/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
index d5bbe3d6048b..05981b54eaab 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
@@ -260,9 +260,6 @@ nfp_flower_cmsg_process_one_rx(struct nfp_app *app, struct sk_buff *skb)
 
 	type = cmsg_hdr->type;
 	switch (type) {
-	case NFP_FLOWER_CMSG_TYPE_PORT_REIFY:
-		nfp_flower_cmsg_portreify_rx(app, skb);
-		break;
 	case NFP_FLOWER_CMSG_TYPE_PORT_MOD:
 		nfp_flower_cmsg_portmod_rx(app, skb);
 		break;
@@ -328,8 +325,7 @@ nfp_flower_queue_ctl_msg(struct nfp_app *app, struct sk_buff *skb, int type)
 	struct nfp_flower_priv *priv = app->priv;
 	struct sk_buff_head *skb_head;
 
-	if (type == NFP_FLOWER_CMSG_TYPE_PORT_REIFY ||
-	    type == NFP_FLOWER_CMSG_TYPE_PORT_MOD)
+	if (type == NFP_FLOWER_CMSG_TYPE_PORT_MOD)
 		skb_head = &priv->cmsg_skbs_high;
 	else
 		skb_head = &priv->cmsg_skbs_low;
@@ -368,6 +364,10 @@ void nfp_flower_cmsg_rx(struct nfp_app *app, struct sk_buff *skb)
 	} else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_TUN_NEIGH) {
 		/* Acks from the NFP that the route is added - ignore. */
 		dev_consume_skb_any(skb);
+	} else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_PORT_REIFY) {
+		/* Handle REIFY acks outside wq to prevent RTNL conflict. */
+		nfp_flower_cmsg_portreify_rx(app, skb);
+		dev_consume_skb_any(skb);
 	} else {
 		nfp_flower_queue_ctl_msg(app, skb, cmsg_hdr->type);
 	}
-- 
2.11.0


^ permalink raw reply related

* pull request: bluetooth-next 2019-09-06
From: Johan Hedberg @ 2019-09-06 17:23 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 3391 bytes --]

Hi Dave,

Here's the main bluetooth-next pull request for the 5.4 kernel.

 - Cleanups & fixes to btrtl driver
 - Fixes for Realtek devices in btusb, e.g. for suspend handling
 - Firmware loading support for BCM4345C5
 - hidp_send_message() return value handling fixes
 - Added support for utilizing Fast Advertising Interval
 - Various other minor cleanups & fixes

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 0e5b36bc4c1fccfc18dd851d960781589c16dae8:

  r8152: adjust the settings of ups flags (2019-09-05 12:41:11 +0200)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git for-upstream

for you to fetch changes up to 8bb3537095f107ed55ad51f6241165b397aaafac:

  Bluetooth: hidp: Fix assumptions on the return value of hidp_send_message (2019-09-06 15:55:40 +0200)

----------------------------------------------------------------
Alex Lu (6):
      Bluetooth: btusb: Fix suspend issue for Realtek devices
      Bluetooth: btrtl: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY
      Bluetooth: btrtl: Add firmware version print
      Bluetooth: btrtl: Remove redundant prefix from calls to rtl_dev macros
      Bluetooth: btrtl: Remove trailing newline from calls to rtl_dev macros
      Bluetooth: btusb: Use cmd_timeout to reset Realtek device

Dan Elkouby (1):
      Bluetooth: hidp: Fix assumptions on the return value of hidp_send_message

Gustavo A. R. Silva (1):
      Bluetooth: mgmt: Use struct_size() helper

Harish Bandi (1):
      Bluetooth: hci_qca: wait for Pre shutdown complete event before sending the Power off pulse

Matthias Kaehlcke (1):
      Bluetooth: hci_qca: Remove redundant initializations to zero

Max Chou (1):
      Bluetooth: btrtl: Fix an issue that failing to download the FW which size is over 32K bytes

Nishka Dasgupta (2):
      Bluetooth: 6lowpan: Make variable header_ops constant
      Bluetooth: hci_qca: Make structure qca_proto constant

Ondrej Jirman (3):
      dt-bindings: net: Add compatible for BCM4345C5 bluetooth device
      bluetooth: bcm: Add support for loading firmware for BCM4345C5
      bluetooth: hci_bcm: Give more time to come out of reset

Rocky Liao (1):
      Bluetooth: hci_qca: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for QCA UART Radio

Spoorthi Ravishankar Koppad (1):
      Bluetooth: Add support for utilizing Fast Advertising Interval

YueHaibing (1):
      Bluetooth: hci_bcm: Fix -Wunused-const-variable warnings

 .../devicetree/bindings/net/broadcom-bluetooth.txt |   1 +
 drivers/bluetooth/btbcm.c                          |   3 +
 drivers/bluetooth/btqca.c                          |   5 +-
 drivers/bluetooth/btrtl.c                          | 125 ++++++++++++---------
 drivers/bluetooth/btusb.c                          |  65 ++++++++++-
 drivers/bluetooth/hci_bcm.c                        |  33 +++---
 drivers/bluetooth/hci_qca.c                        |  28 ++---
 drivers/hid/hid-microsoft.c                        |   2 +-
 include/net/bluetooth/hci_core.h                   |   2 +
 net/bluetooth/6lowpan.c                            |   2 +-
 net/bluetooth/hci_request.c                        |  29 +++--
 net/bluetooth/hidp/core.c                          |   4 +-
 net/bluetooth/mgmt.c                               |   8 +-
 13 files changed, 197 insertions(+), 110 deletions(-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH v3 bpf-next 2/3] bpf: implement CAP_BPF
From: Alexei Starovoitov @ 2019-09-06 17:22 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Alexei Starovoitov, kbuild-all, David S. Miller, Daniel Borkmann,
	Peter Zijlstra, Andy Lutomirski, Network Development, bpf,
	Kernel Team, Linux API
In-Reply-To: <201909070002.v6gbdPOK%lkp@intel.com>

On Fri, Sep 6, 2019 at 9:21 AM kbuild test robot <lkp@intel.com> wrote:
>
> Hi Alexei,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on bpf-next/master]
>
> url:    https://github.com/0day-ci/linux/commits/Alexei-Starovoitov/capability-introduce-CAP_BPF-and-CAP_TRACING/20190906-215814
> base:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> config: x86_64-allmodconfig (attached as .config)
> compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
>    kernel//bpf/syscall.c: In function 'bpf_prog_test_run':
> >> kernel//bpf/syscall.c:2087:6: warning: the address of 'capable_bpf_net_admin' will always evaluate as 'true' [-Waddress]
>      if (!capable_bpf_net_admin)
>          ^

argh. fixing and rebasing.

^ permalink raw reply

* WARNING in xfrm_policy_insert_list (2)
From: syzbot @ 2019-09-06 17:08 UTC (permalink / raw)
  To: davem, herbert, linux-kernel, netdev, steffen.klassert,
	syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    0e5b36bc r8152: adjust the settings of ups flags
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17932ec6600000
kernel config:  https://syzkaller.appspot.com/x/.config?x=67b69b427c3b2dbf
dashboard link: https://syzkaller.appspot.com/bug?extid=2714fa4a72156aa7e18a
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17e5cb2a600000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=14eba03e600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+2714fa4a72156aa7e18a@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 0 PID: 8725 at net/xfrm/xfrm_policy.c:1541  
xfrm_policy_insert_list.cold+0x11/0x90 net/xfrm/xfrm_policy.c:1541
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 8725 Comm: syz-executor575 Not tainted 5.3.0-rc7+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x172/0x1f0 lib/dump_stack.c:113
  panic+0x2dc/0x755 kernel/panic.c:219
  __warn.cold+0x20/0x4c kernel/panic.c:576
  report_bug+0x263/0x2b0 lib/bug.c:186
  fixup_bug arch/x86/kernel/traps.c:179 [inline]
  fixup_bug arch/x86/kernel/traps.c:174 [inline]
  do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:272
  do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:291
  invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1028
RIP: 0010:xfrm_policy_insert_list.cold+0x11/0x90 net/xfrm/xfrm_policy.c:1541
Code: f0 79 fb e9 67 fa ff ff 88 55 c0 e8 e9 f0 79 fb 0f b6 55 c0 e9 83 fa  
ff ff e8 9b cc 3f fb 48 c7 c7 a0 20 52 88 e8 e3 6b 29 fb <0f> 0b 48 8b 45  
b8 42 0f b6 14 20 48 8b 45 d0 83 e0 07 83 c0 03 38
RSP: 0018:ffff88808f7ff3a0 EFLAGS: 00010282
RAX: 0000000000000024 RBX: ffff8880a1ac0040 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815c26f6 RDI: ffffed1011effe66
RBP: ffff88808f7ff420 R08: 0000000000000024 R09: ffffed1015d060d1
R10: ffffed1015d060d0 R11: ffff8880ae830687 R12: dffffc0000000000
R13: 0000000000000000 R14: 0000000000000000 R15: ffff8880a410b240
  xfrm_policy_inexact_insert+0xec/0x1000 net/xfrm/xfrm_policy.c:1188
  xfrm_policy_insert+0x530/0x750 net/xfrm/xfrm_policy.c:1574
  xfrm_add_policy+0x28f/0x530 net/xfrm/xfrm_user.c:1670
  xfrm_user_rcv_msg+0x459/0x770 net/xfrm/xfrm_user.c:2676
  netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477
  xfrm_netlink_rcv+0x70/0x90 net/xfrm/xfrm_user.c:2684
  netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
  netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328
  netlink_sendmsg+0x8a5/0xd60 net/netlink/af_netlink.c:1917
  sock_sendmsg_nosec net/socket.c:637 [inline]
  sock_sendmsg+0xd7/0x130 net/socket.c:657
  ___sys_sendmsg+0x803/0x920 net/socket.c:2311
  __sys_sendmsg+0x105/0x1d0 net/socket.c:2356
  __do_sys_sendmsg net/socket.c:2365 [inline]
  __se_sys_sendmsg net/socket.c:2363 [inline]
  __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2363
  do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x442209
Code: e8 fc ab 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7  
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff  
ff 0f 83 9b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffceda47ad8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004a3298 RCX: 0000000000442209
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000005
RBP: 000000000000f970 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000403030
R13: 00000000004030c0 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply

* Re: [PATCH] kcm: use BPF_PROG_RUN
From: Alexei Starovoitov @ 2019-09-06 17:06 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Sami Tolvanen, David S. Miller, Tom Herbert,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <0f77cc31-4df5-a74f-5b64-a1e3fc439c6d@fb.com>

On Fri, Sep 6, 2019 at 3:03 AM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 9/5/19 2:15 PM, Sami Tolvanen wrote:
> > Instead of invoking struct bpf_prog::bpf_func directly, use the
> > BPF_PROG_RUN macro.
> >
> > Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
>
> Acked-by: Yonghong Song <yhs@fb.com>

Applied. Thanks

^ permalink raw reply

* Re: [PATCH bpf-next] kbuild: replace BASH-specific ${@:2} with shift and ${@}
From: Alexei Starovoitov @ 2019-09-06 17:03 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Andrii Nakryiko, bpf, Network Development, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Kernel Team, Stephen Rothwell
In-Reply-To: <0b39dab4fdbe4c678902657c71364abd@SOC-EX01V.e01.socionext.com>

On Fri, Sep 6, 2019 at 3:34 AM <yamada.masahiro@socionext.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Andrii Nakryiko <andriin@fb.com>
> > Sent: Friday, September 06, 2019 3:00 AM
> > To: bpf@vger.kernel.org; netdev@vger.kernel.org; ast@fb.com;
> > daniel@iogearbox.net
> > Cc: andrii.nakryiko@gmail.com; kernel-team@fb.com; Andrii Nakryiko
> > <andriin@fb.com>; Stephen Rothwell <sfr@canb.auug.org.au>; Yamada,
> > Masahiro/山田 真弘 <yamada.masahiro@socionext.com>
> > Subject: [PATCH bpf-next] kbuild: replace BASH-specific ${@:2} with shift
> > and ${@}
> >
> > ${@:2} is BASH-specific extension, which makes link-vmlinux.sh rely on
> > BASH. Use shift and ${@} instead to fix this issue.
> >
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Fixes: 341dfcf8d78e ("btf: expose BTF info through sysfs")
> > Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
>
> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied. Thanks

^ permalink raw reply

* Re: [PATCH 0/7] libbpf: Fix cast away const qualifiers in btf.h
From: Alexei Starovoitov @ 2019-09-06 17:03 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann,
	netdev@vger.kernel.org, bpf@vger.kernel.org, Yonghong Song,
	Martin Lau
In-Reply-To: <62e760de-e746-c512-350a-c2188a2bb3ed@fb.com>

On Fri, Sep 6, 2019 at 2:09 AM Andrii Nakryiko <andriin@fb.com> wrote:
>
> On 9/6/19 8:31 AM, Jiri Olsa wrote:
> > hi,
> > when including btf.h in bpftrace, I'm getting -Wcast-qual warnings like:
> >
> >    bpf/btf.h: In function ‘btf_var_secinfo* btf_var_secinfos(const btf_type*)’:
> >    bpf/btf.h:302:41: warning: cast from type ‘const btf_type*’ to type
> >    ‘btf_var_secinfo*’ casts away qualifiers [-Wcast-qual]
> >      302 |  return (struct btf_var_secinfo *)(t + 1);
> >          |                                         ^
> >
> > I changed the btf.h header to comply with -Wcast-qual checks
> > and used const cast away casting in libbpf objects, where it's
>
> Hey Jiri,
>
> We made all those helper funcs return non-const structs intentionally to
> improve their usability and avoid all those casts that you added back.
>
> Also, those helpers are now part of public API, so we can't just change
> them to const, as it can break existing users easily.
>
> If there is a need to run with -Wcast-qual, we should probably disable
> those checks where appropriate in libbpf code.
>
> So this will be a NACK from me, sorry.

Same opinion. This gcc warning is bogus.

^ permalink raw reply

* Re: [PATCH bpf-next 0/6] selftests/bpf: move sockopt tests under test_progs
From: Alexei Starovoitov @ 2019-09-06 17:02 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: Andrii Nakryiko, Stanislav Fomichev, Networking, bpf,
	David S. Miller, Alexei Starovoitov, Daniel Borkmann
In-Reply-To: <20190906164233.npuhtaeoezpp2dol@ast-mbp.dhcp.thefacebook.com>

On Fri, Sep 6, 2019 at 9:42 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Fri, Sep 06, 2019 at 08:18:08AM -0700, Stanislav Fomichev wrote:
> > On 09/06, Andrii Nakryiko wrote:
> > > On Wed, Sep 4, 2019 at 4:03 PM Alexei Starovoitov
> > > <alexei.starovoitov@gmail.com> wrote:
> > > >
> > > > On Wed, Sep 04, 2019 at 09:25:03AM -0700, Stanislav Fomichev wrote:
> > > > > Now that test_progs is shaping into more generic test framework,
> > > > > let's convert sockopt tests to it. This requires adding
> > > > > a helper to create and join a cgroup first (test__join_cgroup).
> > > > > Since we already hijack stdout/stderr that shouldn't be
> > > > > a problem (cgroup helpers log to stderr).
> > > > >
> > > > > The rest of the patches just move sockopt tests files under prog_tests/
> > > > > and do the required small adjustments.
> > > >
> > > > Looks good. Thank you for working on it.
> > > > Could you de-verbose setsockopt test a bit?
> > > > #23/32 setsockopt: deny write ctx->retval:OK
> > > > #23/33 setsockopt: deny read ctx->retval:OK
> > > > #23/34 setsockopt: deny writing to ctx->optval:OK
> > > > #23/35 setsockopt: deny writing to ctx->optval_end:OK
> > > > #23/36 setsockopt: allow IP_TOS <= 128:OK
> > > > #23/37 setsockopt: deny IP_TOS > 128:OK
> > > > 37 subtests is a bit too much spam.
> > >
> > > If we merged test_btf into test_progs, we'd have >150 subtests, which
> > > would be pretty verbose as well. But the benefit of subtest is that
> > > you can run just that sub-test and debug/verify just it, without all
> > > the rest stuff.
> > >
> > > So I'm wondering, if too many lines of default output is the only
> > > problem, should we just not output per-subtest line by default?
> > Ack, we can output per-subtest line if it fails so it's easy to re-run;
> > otherwise, hiding by default sounds good. I'll prepare a v3 sometime
> > today; Alexei, let us know if you disagree.
>
> If the subtests are runnable and useful individually it's good to have
> them as subtests.
> I think in the above I misread them as a sequence of sub-checks that needs
> to happen before actual test result.
> Looking at test_sockopt.c I see that they're separate tests,
> so yeah keep them.
> No need to hide by default or extra flags.
> Let me look at v1 and v2 again...

I applied v1 set. Thanks!

^ permalink raw reply

* Re: [PATCH net-next,v3 0/4] flow_offload: update mangle action representation
From: Edward Cree @ 2019-09-06 16:49 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: netfilter-devel, davem, netdev, jakub.kicinski, jiri, saeedm,
	vishal, vladbu
In-Reply-To: <20190906155804.v4lviltxs72a45tq@salvia>

On 06/09/2019 16:58, Pablo Neira Ayuso wrote:
> In tc pedit ex, those are _indeed_ two separated actions: 
I read the code again and I get it now, there's double iteration
 already over tcf_exts_for_each_action and tcf_pedit_nkeys, and
 it's only within the latter that you coalesce.

However, have you considered that iproute2 (i.e. tc tool) isn't
 guaranteed to be the only userland consumer of the TC uAPI?  For all
 we know there could be another user out there producing things like
 a single pedit action with two keys, same offset but different
 masks, to mangle sport & dport separately, which your code now
 _would_ coalesce into a single mangle.  I don't know if that would
 lead to any problems, but I want to be sure you've thought about it ;)

>> Proper thing to do is have helper functions available to drivers to test
>> the pedit, and not just switch on the offset.  Why do I say that?
>>
>> Well, consider a pedit on UDP dport, with mask 0x00ff (network endian).
>> Now as a u32 pedit that's 0x000000ff offset 0, so field-blind offset
>> calculation (ffs in flow_action_mangle_entry()) will turn that into
>>  offset 3 mask 0xff.  Now driver does
>>     switch(offset) { /* 3 */
>>     case offsetof(struct udphdr, dest): /* 2 */
>>         /* Whoops, we never get here! */
>>     }
>>
>> Do you see the problem?
> This scenario you describe cannot _work_ right now, with the existing
> code. Without my patchset, this scenario you describe does _not_ work,
>
> The drivers in the tree need a mask of 0xffff to infer that this is
> UDP dport.
>
> The 'tc pedit ex' infrastructure does not allow for the scenario that
> you describe above.
>
> No driver in the tree allow for what you describe already.
Looks to me like existing nfp_fl_set_tport() handles just fine any
 arbitrary mask across the u32 that contains UDP sport & dport.
And the uAPI we have to maintain is the uAPI we expose, not the subset
 that iproute2 uses.  I could write a patched tc tool *today* that does
 a pedit of 'UDP header, offset 0, mask 0xff0000ff' and the nfp driver
 would accept that fine (no idea what the fw / chip would do with it,
 but presumably it works or Netronome folks would have put checks in),
 whereas with your patch it'll complain "invalid pedit L4 action"
 because the mask isn't all-1s.
And if I made it produce my example from above, mask 0x000000ff, you'd
 calculate an offset of 3 and hit the other error, "unsupported section
 of L4 header", which again would have worked before.

^ permalink raw reply

* Re: [PATCH net] net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list
From: Willem de Bruijn @ 2019-09-06 16:44 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Shmulik Ladkani, Willem de Bruijn, Eric Dumazet, Daniel Borkmann,
	eyal, netdev, Shmulik Ladkani
In-Reply-To: <CAKgT0Ufd40gmaW7eLu3sRHd=4CeY9WNmgRBUzNt5_+0tEKEMvA@mail.gmail.com>

On Fri, Sep 6, 2019 at 11:44 AM Alexander Duyck
<alexander.duyck@gmail.com> wrote:
>
> On Fri, Sep 6, 2019 at 8:37 AM Shmulik Ladkani <shmulik@metanetworks.com> wrote:
> >
> > On Fri, 6 Sep 2019 10:49:55 -0400
> > Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
> >
> > > But I wonder whether it is a given that head_skb has headlen.
> >
> > This is what I observed for GRO packets that do have headlen frag_list
> > members: the 'head_skb' itself had a headlen too, and its head was
> > built using the original gso_size (similar to the frag_list members).

That makes sense.

I was thinking of, say, a driver that combines napi_gro_frags with a
copy break optimization. But given that gso_size is the same for all
segments expect perhaps the last, all those segments will have taken
the same path.

And if we're wrong we'll find out soon enough and can return to this
topic yet again. skb_segment really puts the fun in function.

> >
> > Maybe Eric can comment better.
> >
> > > Btw, it seems slightly odd to me tot test head_frag before testing
> > > headlen in the v2 patch.
> >
> > Requested by Alexander. I'm fine either way.
>
> Yeah, my thought on that was "do we care about the length if the data
> is stored in a head_frag?". I suppose you could flip the logic and
> make it "do we care about it being a head_frag if there is no data
> there?". The reason I had suggested the head_frag test first was
> because it was a single test bit whereas the length requires reading
> two fields and doing a comparison.
>
> For either ordering it is fine by me. So if we need to feel free to
> swap those two tests for a v3.

Got it. I don't feel strongly either. No need for a v3 for that.

> Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>

^ permalink raw reply

* Re: [PATCH bpf-next 0/6] selftests/bpf: move sockopt tests under test_progs
From: Alexei Starovoitov @ 2019-09-06 16:42 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: Andrii Nakryiko, Stanislav Fomichev, Networking, bpf,
	David S. Miller, Alexei Starovoitov, Daniel Borkmann
In-Reply-To: <20190906151808.GD2101@mini-arch>

On Fri, Sep 06, 2019 at 08:18:08AM -0700, Stanislav Fomichev wrote:
> On 09/06, Andrii Nakryiko wrote:
> > On Wed, Sep 4, 2019 at 4:03 PM Alexei Starovoitov
> > <alexei.starovoitov@gmail.com> wrote:
> > >
> > > On Wed, Sep 04, 2019 at 09:25:03AM -0700, Stanislav Fomichev wrote:
> > > > Now that test_progs is shaping into more generic test framework,
> > > > let's convert sockopt tests to it. This requires adding
> > > > a helper to create and join a cgroup first (test__join_cgroup).
> > > > Since we already hijack stdout/stderr that shouldn't be
> > > > a problem (cgroup helpers log to stderr).
> > > >
> > > > The rest of the patches just move sockopt tests files under prog_tests/
> > > > and do the required small adjustments.
> > >
> > > Looks good. Thank you for working on it.
> > > Could you de-verbose setsockopt test a bit?
> > > #23/32 setsockopt: deny write ctx->retval:OK
> > > #23/33 setsockopt: deny read ctx->retval:OK
> > > #23/34 setsockopt: deny writing to ctx->optval:OK
> > > #23/35 setsockopt: deny writing to ctx->optval_end:OK
> > > #23/36 setsockopt: allow IP_TOS <= 128:OK
> > > #23/37 setsockopt: deny IP_TOS > 128:OK
> > > 37 subtests is a bit too much spam.
> > 
> > If we merged test_btf into test_progs, we'd have >150 subtests, which
> > would be pretty verbose as well. But the benefit of subtest is that
> > you can run just that sub-test and debug/verify just it, without all
> > the rest stuff.
> > 
> > So I'm wondering, if too many lines of default output is the only
> > problem, should we just not output per-subtest line by default?
> Ack, we can output per-subtest line if it fails so it's easy to re-run;
> otherwise, hiding by default sounds good. I'll prepare a v3 sometime
> today; Alexei, let us know if you disagree.

If the subtests are runnable and useful individually it's good to have
them as subtests.
I think in the above I misread them as a sequence of sub-checks that needs
to happen before actual test result.
Looking at test_sockopt.c I see that they're separate tests,
so yeah keep them.
No need to hide by default or extra flags.
Let me look at v1 and v2 again...


^ permalink raw reply

* Re: Need more information on "ifi_change" in "struct ifinfomsg"
From: dhan lin @ 2019-09-06 16:39 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netdev
In-Reply-To: <16579c2d-d0b7-179f-5381-3803118a8972@6wind.com>

Nicolas,
Thanks a lot, for the clarification.

On Fri, 6 Sep 2019 at 20:26, Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
>
> Le 06/09/2019 à 07:08, dhan lin a écrit :
> > Hi All,
> >
> > There is a field called ifi_change in "struct ifinfomsg". man page for
> > rtnetlink says its for future use and should be always set to
> > 0xFFFFFFFF.
> >
> > But ive run some sample tests, to confirm the value is not as per man
> > pages explanation.
> > Its 0 most of the times and non-zero sometimes.
> >
> > I've the following question,
> >
> > Is ifi_change set only when there is a state change in interface values?
> ifi_change indicates which flags (ifi_flags) have changed.
> It does not cover other changes.
>
>
> Regards,
> Nicolas

^ permalink raw reply

* Re: [PATCH v3 bpf-next 2/3] bpf: implement CAP_BPF
From: kbuild test robot @ 2019-09-06 16:20 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: kbuild-all, davem, daniel, peterz, luto, netdev, bpf, kernel-team,
	linux-api
In-Reply-To: <20190904184335.360074-2-ast@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2159 bytes --]

Hi Alexei,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Alexei-Starovoitov/capability-introduce-CAP_BPF-and-CAP_TRACING/20190906-215814
base:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel//bpf/syscall.c: In function 'bpf_prog_test_run':
>> kernel//bpf/syscall.c:2087:6: warning: the address of 'capable_bpf_net_admin' will always evaluate as 'true' [-Waddress]
     if (!capable_bpf_net_admin)
         ^

vim +2087 kernel//bpf/syscall.c

  2080	
  2081	static int bpf_prog_test_run(const union bpf_attr *attr,
  2082				     union bpf_attr __user *uattr)
  2083	{
  2084		struct bpf_prog *prog;
  2085		int ret = -ENOTSUPP;
  2086	
> 2087		if (!capable_bpf_net_admin)
  2088			/* test_run callback is available for networking progs only.
  2089			 * Add capable_bpf_tracing() above when tracing progs become runable.
  2090			 */
  2091			return -EPERM;
  2092		if (CHECK_ATTR(BPF_PROG_TEST_RUN))
  2093			return -EINVAL;
  2094	
  2095		if ((attr->test.ctx_size_in && !attr->test.ctx_in) ||
  2096		    (!attr->test.ctx_size_in && attr->test.ctx_in))
  2097			return -EINVAL;
  2098	
  2099		if ((attr->test.ctx_size_out && !attr->test.ctx_out) ||
  2100		    (!attr->test.ctx_size_out && attr->test.ctx_out))
  2101			return -EINVAL;
  2102	
  2103		prog = bpf_prog_get(attr->test.prog_fd);
  2104		if (IS_ERR(prog))
  2105			return PTR_ERR(prog);
  2106	
  2107		if (prog->aux->ops->test_run)
  2108			ret = prog->aux->ops->test_run(prog, attr, uattr);
  2109	
  2110		bpf_prog_put(prog);
  2111		return ret;
  2112	}
  2113	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 70222 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox