search for: hash_v1_hdr

Displaying 8 results from an estimated 8 matches for "hash_v1_hdr".

2023 Aug 21
3
[PATCH net-next v3] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...4bc8cfe68 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -303,6 +303,14 @@ struct padded_vnet_hdr { char padding[12]; }; +struct virtio_net_common_hdr { + union { + struct virtio_net_hdr hdr; + struct virtio_net_hdr_mrg_rxbuf mrg_hdr; + struct virtio_net_hdr_v1_hash hash_v1_hdr; + }; +}; + static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf); static void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf); @@ -344,9 +352,10 @@ static int rxq2vq(int rxq) return rxq * 2; } -static inline struct virtio_net_hdr_mrg_rxbuf *skb_vnet_hdr(struc...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
..._net.c index 1270c8d23463..03cf744de512 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -303,6 +303,13 @@ struct padded_vnet_hdr { char padding[12]; }; +struct virtio_net_common_hdr { + union { + struct virtio_net_hdr_mrg_rxbuf mrg_hdr; + struct virtio_net_hdr_v1_hash hash_v1_hdr; + }; +}; + static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf); static void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf); @@ -344,9 +351,10 @@ static int rxq2vq(int rxq) return rxq * 2; } -static inline struct virtio_net_hdr_mrg_rxbuf *skb_vnet_hdr(struc...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...padded_vnet_hdr { > >> char padding[12]; > >> }; > >> > >> +struct virtio_net_common_hdr { > >> + union { > >> + struct virtio_net_hdr_mrg_rxbuf mrg_hdr; > >> + struct virtio_net_hdr_v1_hash hash_v1_hdr; > >> + }; > >> +}; > > > > Perhaps even add in struct virtio_net_hdr. As that is the original of > > the three structs, and all the initial fields overlap. > > > > But I didn't use virtio_net_hdr in this patch, is it redundant to put it &gt...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...; +++ b/drivers/net/virtio_net.c > @@ -303,6 +303,13 @@ struct padded_vnet_hdr { > char padding[12]; > }; > > +struct virtio_net_common_hdr { > + union { > + struct virtio_net_hdr_mrg_rxbuf mrg_hdr; > + struct virtio_net_hdr_v1_hash hash_v1_hdr; > + }; > +}; Perhaps even add in struct virtio_net_hdr. As that is the original of the three structs, and all the initial fields overlap. > + > static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf); > static void virtnet_sq_free_unused_buf(struct virtqueu...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...gt;> @@ -303,6 +303,13 @@ struct padded_vnet_hdr { >> char padding[12]; >> }; >> >> +struct virtio_net_common_hdr { >> + union { >> + struct virtio_net_hdr_mrg_rxbuf mrg_hdr; >> + struct virtio_net_hdr_v1_hash hash_v1_hdr; >> + }; >> +}; > > Perhaps even add in struct virtio_net_hdr. As that is the original of > the three structs, and all the initial fields overlap. > But I didn't use virtio_net_hdr in this patch, is it redundant to put it here? what do you think? >> + &g...
2023 Aug 15
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...mon_hdr(skb); > > > > if (dev->features & NETIF_F_RXHASH && vi->has_rss_hash_report) > > > > - virtio_skb_set_hash((const struct virtio_net_hdr_v1_hash *)hdr, skb); > > > > + virtio_skb_set_hash(&common_hdr->hash_v1_hdr, skb); > > > > > > > > - if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > > > > + mrg_hdr = &common_hdr->mrg_hdr; > > > > + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > > > > sk...
2023 Aug 15
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...mon_hdr(skb); > > > > if (dev->features & NETIF_F_RXHASH && vi->has_rss_hash_report) > > > > - virtio_skb_set_hash((const struct virtio_net_hdr_v1_hash *)hdr, skb); > > > > + virtio_skb_set_hash(&common_hdr->hash_v1_hdr, skb); > > > > > > > > - if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > > > > + mrg_hdr = &common_hdr->mrg_hdr; > > > > + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > > > > sk...
2023 Aug 16
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...merged rx buffers */ >>>>> }; >>>>> + >>>>> +struct virtio_net_common_hdr { >>>>> + union { >>>>> + struct virtio_net_hdr_mrg_rxbuf mrg_hdr; >>>>> + struct virtio_net_hdr_v1_hash hash_v1_hdr; >>>>> + }; >>>>> +}; >>>> >>>> Does this belong in the UAPI? >>>> I would have assumed it's a Kernel implementation detail. >>>> >>> The existing codes, virtio_net.h is in uapi/linux/, I added the new &g...