search for: vlan_hlen

Displaying 20 results from an estimated 92 matches for "vlan_hlen".

2007 Apr 18
4
[Bridge] [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I, AR}P packets
...EROUTING mask, to make sure the iptables PREROUTING chain isn't traversed twice. The old mechanism isn't satisfactory when the bridge port is a VLAN tagged device. - add some code in vlan_dev.c::vlan_dev_hard_start_xmit(): skb->protocol = __constant_htons(ETH_P_8021Q); skb->mac.raw -= VLAN_HLEN; skb->nh.raw -= VLAN_HLEN; When the logical VLAN device adds its VLAN header to the packet, I think it should update the skb. The protocol then becomes VLAN, the Ethernet header pointer should be updated correctly. Also, the network header pointer should now point to the VLAN header. This code i...
2007 Apr 18
5
[Bridge] RFC: [PATCH] bridge vlan integration
...)->h_proto == htons(ETH_P_8021Q)) { + /* remove VLAN tag */ + if (skb_cloned(skb) || skb_shared(skb)) { + struct sk_buff *new_skb; + + new_skb = skb_copy(skb, GFP_ATOMIC); + kfree_skb(skb); + if (!new_skb) + return 1; + *pskb = skb = new_skb; + } + + skb->mac.raw += VLAN_HLEN; + memmove(skb->mac.raw, skb->data, ETH_ALEN * 2); + skb_pull(skb, VLAN_HLEN); + } + } else { + /* frame should be tagged */ + if (eth_hdr(skb)->h_proto != htons(ETH_P_8021Q)) { + /* add VLAN tag */ + struct vlan_ethhdr *vhdr; + if (skb_cloned(skb) || skb_shared(skb)) { + s...
2012 Dec 26
5
[RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug
...> static int napi_weight = 128; module_param(napi_weight, int, 0444); @@ -34,6 +35,8 @@ static bool csum = true, gso = true; module_param(csum, bool, 0444); module_param(gso, bool, 0444); +static bool cpu_hotplug = false; + /* FIXME: MTU in config. */ #define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) #define GOOD_COPY_LEN 128 @@ -1041,6 +1044,26 @@ static void virtnet_set_affinity(struct virtnet_info *vi, bool set) vi->affinity_hint_set = false; } +static int virtnet_cpu_callback(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + switch(actio...
2012 Dec 26
5
[RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug
...> static int napi_weight = 128; module_param(napi_weight, int, 0444); @@ -34,6 +35,8 @@ static bool csum = true, gso = true; module_param(csum, bool, 0444); module_param(gso, bool, 0444); +static bool cpu_hotplug = false; + /* FIXME: MTU in config. */ #define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) #define GOOD_COPY_LEN 128 @@ -1041,6 +1044,26 @@ static void virtnet_set_affinity(struct virtnet_info *vi, bool set) vi->affinity_hint_set = false; } +static int virtnet_cpu_callback(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + switch(actio...
2017 Jun 01
4
[PATCH] virtio_net: lower limit on buffer size
...en), - rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len); + rq->min_buf_len, PAGE_SIZE - hdr_len); return ALIGN(len, L1_CACHE_BYTES); } @@ -2039,7 +2039,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size); - return max(min_buf_len, hdr_len); + return max(max(min_buf_len, hdr_len) - hdr_len, + (unsigned int)GOOD_PACKET_LEN); } static int virtnet_find_vqs(struct virtnet_info *vi) -- MST
2017 Jun 01
4
[PATCH] virtio_net: lower limit on buffer size
...en), - rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len); + rq->min_buf_len, PAGE_SIZE - hdr_len); return ALIGN(len, L1_CACHE_BYTES); } @@ -2039,7 +2039,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size); - return max(min_buf_len, hdr_len); + return max(max(min_buf_len, hdr_len) - hdr_len, + (unsigned int)GOOD_PACKET_LEN); } static int virtnet_find_vqs(struct virtnet_info *vi) -- MST
2007 Apr 18
1
[Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets
...;Subject: [VLAN] Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN >tagged{I,AR}P packets > > >Bart De Schuymer wrote: >> - add some code in vlan_dev.c::vlan_dev_hard_start_xmit(): >> skb->protocol = __constant_htons(ETH_P_8021Q); >> skb->mac.raw -= VLAN_HLEN; >> skb->nh.raw -= VLAN_HLEN; > >I wonder if this is what was messing up the tcpdump packet capture >as well? Hi Ben and all others, Just to clarify for other who hasn't been a part of this discussion before. ---- 8< ---- When trying to grab a packet with pcap when usi...
2013 Nov 12
12
[PATCH net-next 1/4] virtio-net: mergeable buffer size should include virtio-net header
...git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 01f4eb5..69fb225 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -36,7 +36,10 @@ module_param(csum, bool, 0444); module_param(gso, bool, 0444); /* FIXME: MTU in config. */ -#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define GOOD_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define MERGE_BUFFER_LEN (ALIGN(GOOD_PACKET_LEN + \ + sizeof(struct virtio_net_hdr_mrg_rxbuf), \ + L1_CACHE_BYTES)) #define GOOD_COPY_LEN 128 #define VIR...
2013 Nov 12
12
[PATCH net-next 1/4] virtio-net: mergeable buffer size should include virtio-net header
...git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 01f4eb5..69fb225 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -36,7 +36,10 @@ module_param(csum, bool, 0444); module_param(gso, bool, 0444); /* FIXME: MTU in config. */ -#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define GOOD_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define MERGE_BUFFER_LEN (ALIGN(GOOD_PACKET_LEN + \ + sizeof(struct virtio_net_hdr_mrg_rxbuf), \ + L1_CACHE_BYTES)) #define GOOD_COPY_LEN 128 #define VIR...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...rtnet_info *vi, struct virtqueue *vq) +{ + const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf); + unsigned int rq_size = virtqueue_get_vring_size(vq); + unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu; + unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; + unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size); + + return max(min_buf_len, hdr_len); +} + static int virtnet_find_vqs(struct virtnet_info *vi) { vq_callback_t **callbacks; @@ -2151,6 +2170,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) for (i = 0; i &l...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...rtnet_info *vi, struct virtqueue *vq) +{ + const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf); + unsigned int rq_size = virtqueue_get_vring_size(vq); + unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu; + unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; + unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size); + + return max(min_buf_len, hdr_len); +} + static int virtnet_find_vqs(struct virtnet_info *vi) { vq_callback_t **callbacks; @@ -2151,6 +2170,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) for (i = 0; i &l...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...rtnet_info *vi, struct virtqueue *vq) +{ + const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf); + unsigned int rq_size = virtqueue_get_vring_size(vq); + unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu; + unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; + unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size); + + return max(min_buf_len, hdr_len); +} + static int virtnet_find_vqs(struct virtnet_info *vi) { vq_callback_t **callbacks; @@ -2151,6 +2171,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) for (i = 0; i &l...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...rtnet_info *vi, struct virtqueue *vq) +{ + const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf); + unsigned int rq_size = virtqueue_get_vring_size(vq); + unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu; + unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; + unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size); + + return max(min_buf_len, hdr_len); +} + static int virtnet_find_vqs(struct virtnet_info *vi) { vq_callback_t **callbacks; @@ -2151,6 +2171,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) for (i = 0; i &l...
2017 Apr 02
1
[PATCH net-next 2/3] virtio-net: transmit napi
...odule_param(napi_weight, int, 0444); -static bool csum = true, gso = true; +static bool csum = true, gso = true, napi_tx = true; module_param(csum, bool, 0444); module_param(gso, bool, 0444); +module_param(napi_tx, bool, 0644); /* FIXME: MTU in config. */ #define GOOD_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) @@ -86,6 +87,8 @@ struct send_queue { /* Name of the send queue: output.$index */ char name[40]; + + struct napi_struct napi; }; /* Internal representation of a receive virtqueue */ @@ -262,12 +265,16 @@ static void virtqueue_napi_complete(struct napi_struct *napi, static...
2016 Jun 08
7
[PATCH 0/6] virtio_net: use common code for virtio_net_hdr and skb GSO conversion
Hi, This patches introduce virtio_net_hdr_{from,to}_skb functions for conversion of GSO information between skb and virtio_net_hdr. Mike Rapoport (6): virtio_net: add _UAPI prefix to virtio_net header guards virtio_net: introduce virtio_net_hdr_{from,to}_skb macvtap: use common code for virtio_net_hdr and skb GSO conversion tuntap: use common code for virtio_net_hdr and skb GSO
2016 Jun 08
7
[PATCH 0/6] virtio_net: use common code for virtio_net_hdr and skb GSO conversion
Hi, This patches introduce virtio_net_hdr_{from,to}_skb functions for conversion of GSO information between skb and virtio_net_hdr. Mike Rapoport (6): virtio_net: add _UAPI prefix to virtio_net header guards virtio_net: introduce virtio_net_hdr_{from,to}_skb macvtap: use common code for virtio_net_hdr and skb GSO conversion tuntap: use common code for virtio_net_hdr and skb GSO
2013 Nov 14
2
[PATCH] virtio-net: mergeable buffer size should include virtio-net header
...git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 01f4eb5..69fb225 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -36,7 +36,10 @@ module_param(csum, bool, 0444); module_param(gso, bool, 0444); /* FIXME: MTU in config. */ -#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define GOOD_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define MERGE_BUFFER_LEN (ALIGN(GOOD_PACKET_LEN + \ + sizeof(struct virtio_net_hdr_mrg_rxbuf), \ + L1_CACHE_BYTES)) #define GOOD_COPY_LEN 128 #define VIR...
2013 Nov 14
2
[PATCH] virtio-net: mergeable buffer size should include virtio-net header
...git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 01f4eb5..69fb225 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -36,7 +36,10 @@ module_param(csum, bool, 0444); module_param(gso, bool, 0444); /* FIXME: MTU in config. */ -#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define GOOD_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) +#define MERGE_BUFFER_LEN (ALIGN(GOOD_PACKET_LEN + \ + sizeof(struct virtio_net_hdr_mrg_rxbuf), \ + L1_CACHE_BYTES)) #define GOOD_COPY_LEN 128 #define VIR...
2019 Feb 28
2
[virtio-dev] Re: net_failover slave udev renaming (was Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework)
...7 @@ static bool csum = true, gso = true, napi_tx; > module_param(csum, bool, 0444); > module_param(gso, bool, 0444); > module_param(napi_tx, bool, 0644); > +module_param(disable_failover, bool, 0644); > > /* FIXME: MTU in config. */ > #define GOOD_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) > @@ -3163,6 +3164,7 @@ static int virtnet_probe(struct virtio_device *vdev) > virtnet_init_settings(dev); > > - if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY)) { > + if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY) && > + !disable_failover) { &g...
2019 Feb 28
2
[virtio-dev] Re: net_failover slave udev renaming (was Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework)
On Wed, 27 Feb 2019 20:26:02 -0500, Michael S. Tsirkin wrote: > On Wed, Feb 27, 2019 at 04:52:05PM -0800, Jakub Kicinski wrote: > > On Wed, 27 Feb 2019 19:41:32 -0500, Michael S. Tsirkin wrote: > > > > As this scheme adds much complexity to the kernel naming convention > > > > (currently it's just ethX names) that no userspace can understand. > >