From: Stanislav Fomichev <sdf@fomichev.me>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, ayush.sawal@chelsio.com,
andrew+netdev@lunn.ch, gregkh@linuxfoundation.org,
horms@kernel.org, dsahern@kernel.org, pablo@netfilter.org,
kadlec@netfilter.org, steffen.klassert@secunet.com,
sdf@fomichev.me, mhal@rbox.co, abhishektamboli9@gmail.com,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
herbert@gondor.apana.org.au
Subject: [PATCH net-next 6/7] chtls: Convert to skb_dst_reset
Date: Tue, 12 Aug 2025 08:52:44 -0700 [thread overview]
Message-ID: <20250812155245.507012-7-sdf@fomichev.me> (raw)
In-Reply-To: <20250812155245.507012-1-sdf@fomichev.me>
Going forward skb_dst_set will assert that skb dst_entry
is empty during skb_dst_set. skb_dst_reset is added to reset
existing entry without doing refcnt. Chelsio driver is
doing extra dst management via skb_dst_set(NULL). Replace
these calls with skb_dst_reset.
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
.../ethernet/chelsio/inline_crypto/chtls/chtls_cm.c | 10 +++++-----
.../ethernet/chelsio/inline_crypto/chtls/chtls_cm.h | 4 ++--
.../ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
index 6f6525983130..b333da3b21bf 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
@@ -171,7 +171,7 @@ static void chtls_purge_receive_queue(struct sock *sk)
struct sk_buff *skb;
while ((skb = __skb_dequeue(&sk->sk_receive_queue)) != NULL) {
- skb_dst_set(skb, (void *)NULL);
+ skb_dst_reset(skb);
kfree_skb(skb);
}
}
@@ -194,7 +194,7 @@ static void chtls_purge_recv_queue(struct sock *sk)
struct sk_buff *skb;
while ((skb = __skb_dequeue(&tlsk->sk_recv_queue)) != NULL) {
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
kfree_skb(skb);
}
}
@@ -1734,7 +1734,7 @@ static int chtls_rx_data(struct chtls_dev *cdev, struct sk_buff *skb)
pr_err("can't find conn. for hwtid %u.\n", hwtid);
return -EINVAL;
}
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
process_cpl_msg(chtls_recv_data, sk, skb);
return 0;
}
@@ -1786,7 +1786,7 @@ static int chtls_rx_pdu(struct chtls_dev *cdev, struct sk_buff *skb)
pr_err("can't find conn. for hwtid %u.\n", hwtid);
return -EINVAL;
}
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
process_cpl_msg(chtls_recv_pdu, sk, skb);
return 0;
}
@@ -1855,7 +1855,7 @@ static int chtls_rx_cmp(struct chtls_dev *cdev, struct sk_buff *skb)
pr_err("can't find conn. for hwtid %u.\n", hwtid);
return -EINVAL;
}
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
process_cpl_msg(chtls_rx_hdr, sk, skb);
return 0;
diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h
index f61ca657601c..4ca919925455 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h
@@ -171,14 +171,14 @@ static inline void chtls_set_req_addr(struct request_sock *oreq,
static inline void chtls_free_skb(struct sock *sk, struct sk_buff *skb)
{
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
__skb_unlink(skb, &sk->sk_receive_queue);
__kfree_skb(skb);
}
static inline void chtls_kfree_skb(struct sock *sk, struct sk_buff *skb)
{
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
__skb_unlink(skb, &sk->sk_receive_queue);
kfree_skb(skb);
}
diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
index 465fa8077964..85e4d90efd5b 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
@@ -1434,7 +1434,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
continue;
found_ok_skb:
if (!skb->len) {
- skb_dst_set(skb, NULL);
+ skb_dst_reset(skb);
__skb_unlink(skb, &sk->sk_receive_queue);
kfree_skb(skb);
--
2.50.1
next prev parent reply other threads:[~2025-08-12 15:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 15:52 [PATCH net-next 0/7] net: Convert to skb_dst_reset and skb_dst_restore Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 1/7] net: Add " Stanislav Fomichev
2025-08-14 0:57 ` Jakub Kicinski
2025-08-14 1:03 ` Jakub Kicinski
2025-08-14 15:45 ` Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 2/7] xfrm: Switch to skb_dst_reset to clear dst_entry Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 3/7] netfilter: " Stanislav Fomichev
2025-08-13 6:43 ` Florian Westphal
2025-08-12 15:52 ` [PATCH net-next 4/7] net: Switch to skb_dst_reset/skb_dst_restore for ip_route_input callers Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 5/7] staging: octeon: Convert to skb_dst_drop Stanislav Fomichev
2025-08-13 14:20 ` Greg KH
2025-08-12 15:52 ` Stanislav Fomichev [this message]
2025-08-12 15:52 ` [PATCH net-next 7/7] net: Add skb_dst_check_unset Stanislav Fomichev
2025-08-13 7:57 ` [syzbot ci] Re: net: Convert to skb_dst_reset and skb_dst_restore syzbot ci
2025-08-13 10:01 ` Florian Westphal
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=20250812155245.507012-7-sdf@fomichev.me \
--to=sdf@fomichev.me \
--cc=abhishektamboli9@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=ayush.sawal@chelsio.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mhal@rbox.co \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=steffen.klassert@secunet.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
all inboxes | Powered by JetHome®