Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148989692
D26996.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D26996.diff
View Options
Index: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
===================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
@@ -280,7 +280,7 @@
union if_snd_tag_alloc_params *params,
struct m_snd_tag **ppmt)
{
- struct if_snd_tag_alloc_rate_limit rl_params;
+ union if_snd_tag_alloc_params rl_params;
struct mlx5e_priv *priv;
struct mlx5e_tls_tag *ptag;
const struct tls_session_params *en;
@@ -377,29 +377,17 @@
goto failure;
}
+ memset(&rl_params, 0, sizeof(rl_params));
+ rl_params.hdr = params->hdr;
switch (params->hdr.type) {
#if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
- memset(&rl_params, 0, sizeof(rl_params));
- rl_params.hdr = params->tls_rate_limit.hdr;
rl_params.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT;
rl_params.max_rate = params->tls_rate_limit.max_rate;
-
- error = mlx5e_rl_snd_tag_alloc(ifp,
- container_of(&rl_params, union if_snd_tag_alloc_params, rate_limit),
- &ptag->rl_tag);
- if (error)
- goto failure;
break;
#endif
case IF_SND_TAG_TYPE_TLS:
- memset(&rl_params, 0, sizeof(rl_params));
- rl_params.hdr = params->tls.hdr;
rl_params.hdr.type = IF_SND_TAG_TYPE_UNLIMITED;
-
- error = mlx5e_ul_snd_tag_alloc(ifp,
- container_of(&rl_params, union if_snd_tag_alloc_params, unlimited),
- &ptag->rl_tag);
if (error)
goto failure;
break;
@@ -408,6 +396,10 @@
goto failure;
}
+ error = ifp->if_snd_tag_alloc(ifp, &rl_params, &ptag->rl_tag);
+ if (error)
+ goto failure;
+
/* store pointer to mbuf tag */
MPASS(ptag->tag.refcount == 0);
m_snd_tag_init(&ptag->tag, ifp, params->hdr.type);
@@ -427,7 +419,7 @@
mlx5e_tls_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params)
{
#if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
- struct if_snd_tag_rate_limit_params rl_params;
+ union if_snd_tag_modify_params rl_params;
struct mlx5e_tls_tag *ptag =
container_of(pmt, struct mlx5e_tls_tag, tag);
int error;
@@ -437,9 +429,9 @@
#if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
memset(&rl_params, 0, sizeof(rl_params));
- rl_params.max_rate = params->tls_rate_limit.max_rate;
- error = mlx5e_rl_snd_tag_modify(ptag->rl_tag,
- container_of(&rl_params, union if_snd_tag_modify_params, rate_limit));
+ rl_params.rate_limit.max_rate = params->tls_rate_limit.max_rate;
+ error = ptag->rl_tag->ifp->if_snd_tag_modify(ptag->rl_tag,
+ &rl_params);
return (error);
#endif
default:
@@ -457,11 +449,10 @@
switch (pmt->type) {
#if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
- error = mlx5e_rl_snd_tag_query(ptag->rl_tag, params);
- break;
#endif
case IF_SND_TAG_TYPE_TLS:
- error = mlx5e_ul_snd_tag_query(ptag->rl_tag, params);
+ error = ptag->rl_tag->ifp->if_snd_tag_query(ptag->rl_tag,
+ params);
break;
default:
error = EOPNOTSUPP;
@@ -477,18 +468,8 @@
container_of(pmt, struct mlx5e_tls_tag, tag);
struct mlx5e_priv *priv;
- switch (pmt->type) {
-#if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
- case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
- mlx5e_rl_snd_tag_free(ptag->rl_tag);
- break;
-#endif
- case IF_SND_TAG_TYPE_TLS:
- mlx5e_ul_snd_tag_free(ptag->rl_tag);
- break;
- default:
- break;
- }
+ MPASS(ptag->rl_tag->refcount == 1);
+ m_snd_tag_rele(ptag->rl_tag);
MLX5E_TLS_TAG_LOCK(ptag);
ptag->state = MLX5E_TLS_ST_FREED;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 22, 2:18 PM (17 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30085356
Default Alt Text
D26996.diff (3 KB)
Attached To
Mode
D26996: Use public interfaces to manage the nested rate limit send tag.
Attached
Detach File
Event Timeline
Log In to Comment