All of lore.kernel.org
 help / color / mirror / Atom feed
* VLAN driver question
@ 2013-06-17 19:12 Jim Baxter
  2013-06-18 14:41 ` Ben Hutchings
  0 siblings, 1 reply; 7+ messages in thread
From: Jim Baxter @ 2013-06-17 19:12 UTC (permalink / raw)
  To: netdev

I have a network card that has a single flag to indicate if a received
packet contains a vlan packet.

Can I use this to accelerate the kernels handling of the packet with
something like the following?

/* Handle received VLAN packets */
if ((ndev->features & NETIF_F_HW_VLAN_CTAG_RX) && ebdp &&
					(ebdp->cbd_esc &
					BD_ENET_RX_VLAN)) {
	/* Push and remove the vlan tag */
	struct vlan_hdr *vlan_header;
	u16 vlan_tag;
	vlan_header = (struct vlan_hdr *) skb->data;
	vlan_tag = ntohs(vlan_header->h_vlan_TCI);
	__vlan_hwaccel_put_tag(skb, vlan_tag);
	skb->len -= VLAN_HLEN;
	skb->data += VLAN_HLEN;
	vlan_set_encap_proto(skb, vlan_header);
}

napi_gro_receive(&fep->napi, skb);



Also I cannot find any documentation stating what the difference is
between NETIF_F_HW_VLAN_CTAG_RX and NETIF_F_HW_VLAN_CTAG_FILTER, can
anyone define it?
The FILTER word on NETIF_F_HW_VLAN_CTAG_FILTER suggests it may be
applicable to received packets.

Thank you for your help and comments.
Jim Baxter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-21 17:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17 19:12 VLAN driver question Jim Baxter
2013-06-18 14:41 ` Ben Hutchings
2013-06-19 15:57   ` Jim Baxter
2013-06-19 16:33     ` Ben Hutchings
2013-06-20 19:05       ` Jim Baxter
2013-06-21 15:42         ` Ben Hutchings
2013-06-21 17:02           ` Jim Baxter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.