Thread (20 messages) 20 messages, 6 authors, 2024-01-18

Re: [RFC PATCH net-next v5 2/2] net: add netmem to skb_frag_t

From: Yunsheng Lin <hidden>
Date: 2024-01-11 12:44:54
Also in: lkml

On 2024/1/9 9:14, Mina Almasry wrote:

...
 
+		if (WARN_ON_ONCE(!skb_frag_page(&skb_shinfo(skb)->frags[0]))) {
I am really hate to bring it up again.
If you are not willing to introduce a new helper, do you care to use some
existing API like skb_frag_address_safe()?
+			ret = -EINVAL;
+			goto out;
+		}
+
 		iov_iter_bvec(&msg.msg_iter, ITER_SOURCE,
-			      skb_shinfo(skb)->frags, skb_shinfo(skb)->nr_frags,
-			      msize);
+			      (const struct bio_vec *)skb_shinfo(skb)->frags,
+			      skb_shinfo(skb)->nr_frags, msize);
I think we need to use some built-time checking to ensure some consistency
between skb_frag_t and bio_vec.
 		iov_iter_advance(&msg.msg_iter, txm->frag_offset);
 
 		do {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help