]> www.infradead.org Git - users/willy/linux.git/commitdiff
chtls: Convert to skb_dst_reset
authorStanislav Fomichev <sdf@fomichev.me>
Mon, 18 Aug 2025 15:40:31 +0000 (08:40 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 00:54:41 +0000 (17:54 -0700)
Going forward skb_dst_set will assert that skb dst_entry
is empty during skb_dst_set. skb_dstref_steal 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_dstref_steal.

Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250818154032.3173645-7-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c

index 6f6525983130e7701e9c6530afbecb9ae374d7ee..2e7c2691a1933e5c8d9dc71ec99a5d92970ad7cd 100644 (file)
@@ -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_dstref_steal(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_dstref_steal(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_dstref_steal(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_dstref_steal(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_dstref_steal(skb);
        process_cpl_msg(chtls_rx_hdr, sk, skb);
 
        return 0;
index f61ca657601caeb3c0e5533e4fcf5819988cc3f7..2285cf2df251db9ec84d305d5ffa012279f6c43f 100644 (file)
@@ -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_dstref_steal(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_dstref_steal(skb);
        __skb_unlink(skb, &sk->sk_receive_queue);
        kfree_skb(skb);
 }
index 465fa807796439b90c949f54e203a798f06acf1f..4036db466e188cb5494617f6a1e0564ed2ad5a34 100644 (file)
@@ -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_dstref_steal(skb);
                        __skb_unlink(skb, &sk->sk_receive_queue);
                        kfree_skb(skb);