From: Ben Hutchings <bhutchings@solarflare.com>
To: Or Gerlitz <ogerlitz@mellanox.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
<oren@mellanox.com>, Amir Vadai <amirv@mellanox.com>
Subject: Re: [PATCH RESEND net] net/mlx4_en: Limit the RFS filter IDs to be < RPS_NO_FILTER
Date: Wed, 25 Jul 2012 15:57:10 +0100 [thread overview]
Message-ID: <1343228230.2694.12.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <1343226979-32004-1-git-send-email-ogerlitz@mellanox.com>
On Wed, 2012-07-25 at 17:36 +0300, Or Gerlitz wrote:
> From: Amir Vadai <amirv@mellanox.com>
>
> RFS filter id can't have the special value RPS_NO_FILTER,
> need to skip it when allocating id's.
>
> Also, changed an ifdef into a more elegant IS_DEFINED.
>
> CC: Ben Hutchings <bhutchings@solarflare.com>
> Signed-off-by: Amir Vadai <amirv@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
>
> Addressing feedback from Ben Hutchings
>
> resending as of typo in my signature... sorry
--signoff is so much easier than typing it every time :-)
> drivers/net/ethernet/mellanox/mlx4/en_cq.c | 8 ++------
> drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
> index aa9c2f6..866829b 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
> @@ -77,12 +77,8 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
> struct mlx4_en_dev *mdev = priv->mdev;
> int err = 0;
> char name[25];
> - struct cpu_rmap *rmap =
> -#ifdef CONFIG_RFS_ACCEL
> - priv->dev->rx_cpu_rmap;
> -#else
> - NULL;
> -#endif
> + struct cpu_rmap *rmap = IS_ENABLED(CONFIG_RFS_ACCEL) ?
> + priv->dev->rx_cpu_rmap : NULL;
This is a separate change.
> cq->dev = mdev->pndev[priv->port];
> cq->mcq.set_ci_db = cq->wqres.db.db;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 8864d8b..edd9cb8 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -201,7 +201,7 @@ mlx4_en_filter_alloc(struct mlx4_en_priv *priv, int rxq_index, __be32 src_ip,
>
> filter->flow_id = flow_id;
>
> - filter->id = priv->last_filter_id++;
> + filter->id = priv->last_filter_id++ % RPS_NO_FILTER;
This should do for now.
Ideally the filter ID would be based on the index used in hardware. We
would need to change the API to allow for devices where this cannot be
determined synchronously, as in this driver. (And the filter ID might
also need to be wider.)
Ben.
>
> list_add_tail(&filter->next, &priv->filters);
> hlist_add_head(&filter->filter_chain,
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2012-07-25 14:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 14:36 [PATCH RESEND net] net/mlx4_en: Limit the RFS filter IDs to be < RPS_NO_FILTER Or Gerlitz
2012-07-25 14:57 ` Ben Hutchings [this message]
2012-07-25 15:04 ` Or Gerlitz
2012-07-25 22:23 ` David Miller
2012-07-25 22:29 ` Ben Hutchings
2012-07-25 14:57 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343228230.2694.12.camel@bwh-desktop.uk.solarflarecom.com \
--to=bhutchings@solarflare.com \
--cc=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=oren@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox