Re: [RFC PATCH net-next v5 2/2] net: add netmem to skb_frag_t
From: Yunsheng Lin
Date: Thu Jan 11 2024 - 07:45:12 EST
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 {
>