Message ID | 1550715283-23579-1-git-send-email-xiangxia.m.yue@gmail.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | [net-next,1/5] net/mlx5e: Return -EOPNOTSUPP when modify header action zero | expand |
On Thu, Feb 21, 2019 at 3:42 PM <xiangxia.m.yue@gmail.com> wrote: > else /* namespace is MLX5_FLOW_NAMESPACE_KERNEL - NIC offloading */ > max_actions = MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, max_modify_header_actions); > > + if (!max_actions) { > + NL_SET_ERR_MSG_MOD(extack, > + "don't support pedit actions, can't offload"); > + netdev_warn(priv->netdev, "don't support pedit actions, can't offload\n"); it's not going to work if we keep filling the driver with duplicated error messages, stick to extack only Also, when you respin with comments provided on this submission, please send also cover letter which is going to be "[PATCH net-next 00/05] ... " use --cover-letter for git format-patch and edit it after creation
On Fri, Feb 22, 2019 at 12:27 AM Or Gerlitz <gerlitz.or@gmail.com> wrote: > > On Thu, Feb 21, 2019 at 3:42 PM <xiangxia.m.yue@gmail.com> wrote: > > else /* namespace is MLX5_FLOW_NAMESPACE_KERNEL - NIC offloading */ > > max_actions = MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, max_modify_header_actions); > > > > + if (!max_actions) { > > + NL_SET_ERR_MSG_MOD(extack, > > + "don't support pedit actions, can't offload"); > > + netdev_warn(priv->netdev, "don't support pedit actions, can't offload\n"); > > it's not going to work if we keep filling the driver with duplicated > error messages, stick to extack only v2 will be sent > Also, when you respin with comments provided on this submission, > please send also cover letter > which is going to be "[PATCH net-next 00/05] ... " use > --cover-letter for git format-patch and edit it after creation OK
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index b38986e..c4359f1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2002,7 +2002,8 @@ static int offload_pedit_fields(struct pedit_headers_action *hdrs, static int alloc_mod_hdr_actions(struct mlx5e_priv *priv, struct pedit_headers_action *hdrs, int namespace, - struct mlx5e_tc_flow_parse_attr *parse_attr) + struct mlx5e_tc_flow_parse_attr *parse_attr, + struct netlink_ext_ack *extack) { int nkeys, action_size, max_actions; @@ -2015,6 +2016,13 @@ static int alloc_mod_hdr_actions(struct mlx5e_priv *priv, else /* namespace is MLX5_FLOW_NAMESPACE_KERNEL - NIC offloading */ max_actions = MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, max_modify_header_actions); + if (!max_actions) { + NL_SET_ERR_MSG_MOD(extack, + "don't support pedit actions, can't offload"); + netdev_warn(priv->netdev, "don't support pedit actions, can't offload\n"); + return -EOPNOTSUPP; + } + /* can get up to crazingly 16 HW actions in 32 bits pedit SW key */ max_actions = min(max_actions, nkeys * 16); @@ -2072,7 +2080,8 @@ static int alloc_tc_pedit_action(struct mlx5e_priv *priv, int namespace, u8 cmd; if (!parse_attr->mod_hdr_actions) { - err = alloc_mod_hdr_actions(priv, hdrs, namespace, parse_attr); + err = alloc_mod_hdr_actions(priv, hdrs, + namespace, parse_attr, extack); if (err) goto out_err; }