Message ID | 20240610225729.2985343-1-joshwash@google.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 1b9f756344416e02b41439bf2324b26aa25e141c |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v3] gve: ignore nonrelevant GSO type bits when processing TSO headers | expand |
On Mon, 10 Jun 2024 15:57:18 -0700 joshwash@google.com wrote: > v2 - Remove unnecessary comments, remove line break between fixes tag > and signoffs. > > v3 - Add back unrelated empty line removal. Read the maintainer info again, please: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html we prefer no in-reply to postings.
My apologies. I'll send an updated patch tomorrow without --in-reply-to. On Mon, Jun 10, 2024 at 5:27 PM Jakub Kicinski <kuba@kernel.org> wrote: > > On Mon, 10 Jun 2024 15:57:18 -0700 joshwash@google.com wrote: > > v2 - Remove unnecessary comments, remove line break between fixes tag > > and signoffs. > > > > v3 - Add back unrelated empty line removal. > > Read the maintainer info again, please: > https://www.kernel.org/doc/html/next/process/maintainer-netdev.html > we prefer no in-reply to postings.
On Mon, 10 Jun 2024 19:26:32 -0700 Joshua Washington wrote:
> My apologies. I'll send an updated patch tomorrow without --in-reply-to.
No need, it's still in patchwork, it was just a note for the future.
I should have made that more clear, I realized that after hitting send.
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Mon, 10 Jun 2024 15:57:18 -0700 you wrote: > From: Joshua Washington <joshwash@google.com> > > TSO currently fails when the skb's gso_type field has more than one bit > set. > > TSO packets can be passed from userspace using PF_PACKET, TUNTAP and a > few others, using virtio_net_hdr (e.g., PACKET_VNET_HDR). This includes > virtualization, such as QEMU, a real use-case. > > [...] Here is the summary with links: - [net,v3] gve: ignore nonrelevant GSO type bits when processing TSO headers https://git.kernel.org/netdev/net/c/1b9f75634441 You are awesome, thank you!
diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c index fe1b26a4d736..0b3cca3fc792 100644 --- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c +++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c @@ -555,28 +555,18 @@ static int gve_prep_tso(struct sk_buff *skb) if (unlikely(skb_shinfo(skb)->gso_size < GVE_TX_MIN_TSO_MSS_DQO)) return -1; + if (!(skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) + return -EINVAL; + /* Needed because we will modify header. */ err = skb_cow_head(skb, 0); if (err < 0) return err; tcp = tcp_hdr(skb); - - /* Remove payload length from checksum. */ paylen = skb->len - skb_transport_offset(skb); - - switch (skb_shinfo(skb)->gso_type) { - case SKB_GSO_TCPV4: - case SKB_GSO_TCPV6: - csum_replace_by_diff(&tcp->check, - (__force __wsum)htonl(paylen)); - - /* Compute length of segmentation header. */ - header_len = skb_tcp_all_headers(skb); - break; - default: - return -EINVAL; - } + csum_replace_by_diff(&tcp->check, (__force __wsum)htonl(paylen)); + header_len = skb_tcp_all_headers(skb); if (unlikely(header_len > GVE_TX_MAX_HDR_SIZE_DQO)) return -EINVAL;