lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 26 Jun 2013 11:09:20 +0100
From:	Jim Baxter <jim_baxter@...tor.com>
To:	Duan Fugang-B38611 <B38611@...escale.com>
CC:	"David S. Miller" <davem@...emloft.net>,
	Li Frank-B20596 <B20596@...escale.com>,
	Estevam Fabio-R49496 <r49496@...escale.com>,
	Lucas Stach <l.stach@...gutronix.de>,
	Shawn Guo <shawn.guo@...aro.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Ben Hutchings <bhutchings@...arflare.com>
Subject: Re: [PATCH net-next v1 1/1] net: fec: Add VLAN receive HW support.

On 26/06/13 03:31, Duan Fugang-B38611 wrote:
> In addition,
> 	1.	enet IP support hw VLAN detect such as imx28-fec, imx6q-fec and mvf600-fec, so you can add the "BD_ENET_RX_VLAN " to those platform driver_data.
I have only tested it on the i.MX6, if someone wants to check it on the
imx28 later they can add it to that option.

> 	2.	Enable the VLAN tag extraction with "NETIF_F_HW_VLAN_CTAG_RX" feature in .ndo_fix_features, which is configured by user.
What do you mean by this, I am only enabling the VLAN code if
(ndev->features & NETIF_F_HW_VLAN_CTAG_RX) is set. I am pretty sure this
is set by

>   */
> -#define PKT_MAXBUF_SIZE		1518
> +#define PKT_MAXBUF_SIZE		1522
>  #define PKT_MINBUF_SIZE		64
> -#define PKT_MAXBLR_SIZE		1520
> +#define PKT_MAXBLR_SIZE		1540
> [Andy]Pls define the MAXBLR size to 1536, which is multiplied by 64
> 	 #define PKT_MAXBLR_SIZE         1536
I will change this.


> +			int payload_offset = (2 * ETH_ALEN);
>  			skb_reserve(skb, NET_IP_ALIGN);
>  			skb_put(skb, pkt_len - 4);	/* Make room */
> -			skb_copy_to_linear_data(skb, data, pkt_len - 4);
> +
> +			/* Extract the frame data without the VLAN header. */
> +			skb_copy_to_linear_data(skb, data, (2 * ETH_ALEN));
> +			if (vlan_packet_rcvd)
> +				payload_offset = (2 * ETH_ALEN) + VLAN_HLEN;
> +			skb_copy_to_linear_data_offset(skb, (2 * ETH_ALEN),
> +					data + payload_offset,
> +					pkt_len - 4 - (2 * ETH_ALEN));
> +
> [Andy] because the IP don't support HW VLAN tag extraction, it need sw to do it. It is ok for me. 
Yes it needs to be done in software as the Ethernet card only detects
the VLAN packet, doing it here is more efficient then the kernel doing it.


Thank you,
Jim
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ