Displaying 8 results from an estimated 8 matches for "mrg_hdr".
Did you mean:
frag_hdr
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.
> >
>
> But I d...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...ivers/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;
>> + };
>> +};
>
> 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...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
....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;
> + };
> +};
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 *bu...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...vers/net/virtio_net.c b/drivers/net/virtio_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 struc...
2023 Aug 15
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...; > > > struct net_device *dev = vi->dev;
> > > > struct sk_buff *skb;
> > > > - struct virtio_net_hdr_mrg_rxbuf *hdr;
> > > > + struct virtio_net_common_hdr *common_hdr;
> > > > + struct virtio_net_hdr_mrg_rxbuf *mrg_hdr;
> > > >
> > > > if (unlikely(len < vi->hdr_len + ETH_HLEN)) {
> > > > pr_debug("%s: short packet %i\n", dev->name, len);
> > > > @@ -1597,18 +1599,19 @@ static void receive_buf(struct virtnet_info *vi, struct...
2023 Aug 15
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...; > > > struct net_device *dev = vi->dev;
> > > > struct sk_buff *skb;
> > > > - struct virtio_net_hdr_mrg_rxbuf *hdr;
> > > > + struct virtio_net_common_hdr *common_hdr;
> > > > + struct virtio_net_hdr_mrg_rxbuf *mrg_hdr;
> > > >
> > > > if (unlikely(len < vi->hdr_len + ETH_HLEN)) {
> > > > pr_debug("%s: short packet %i\n", dev->name, len);
> > > > @@ -1597,18 +1599,19 @@ static void receive_buf(struct virtnet_info *vi, struct...
2023 Aug 21
3
[PATCH net-next v3] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...s/net/virtio_net.c
index 8e9f4cfe941f..8c74bc8cfe68 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 struc...
2023 Aug 16
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...dr hdr;
>>>>> __virtio16 num_buffers; /* Number of 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.
>>>>
>&...