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]
Message-ID: <20110715114128.GC2250@minipsycho.brq.redhat.com>
Date:	Fri, 15 Jul 2011 13:41:29 +0200
From:	Jiri Pirko <jpirko@...hat.com>
To:	Sebastian Pöhn 
	<sebastian.belden@...glemail.com>
Cc:	Linux Netdev <netdev@...r.kernel.org>, sandeep.kumar@...escale.com
Subject: Re: [PATCH] gianfar: rx parser

Fri, Jul 15, 2011 at 01:09:01PM CEST, sebastian.belden@...glemail.com wrote:
>Only let the rx parser be enabled if it is necessary (if VLAN extracrtion, IP or TCP checksumming or the rx queue filer are enabled). Otherwise disable it.
>
>The new routine gfar_check_rx_parser_mode should be runt after every change on this features and will enable/disable the parser as necessary.
>
>I will send a patch for the rx queue filer the next days.

Looks good to me.

Reviewed-by: Jiri Pirko <jpirko@...hat.com>


>
>
>
>Signed-off-by: Sebastian Poehn <sebastian.poehn@...den.com>
>---
>
> drivers/net/gianfar.c |   25 ++++++++++++++++++++-----
> drivers/net/gianfar.h |    3 ++-
> 2 files changed, 22 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
>index 3321d71..6da3712 100644
>--- a/drivers/net/gianfar.c
>+++ b/drivers/net/gianfar.c
>@@ -2287,6 +2287,23 @@ static int gfar_set_mac_address(struct net_device *dev)
> 	return 0;
> }
> 
>+/* Check if rx parser should be activated */
>+void gfar_check_rx_parser_mode(struct gfar_private *priv)
>+{
>+	struct gfar __iomem *regs = NULL;
>+	u32 tempval = 0;
>+	
>+	regs = priv->gfargrp[0].regs;
>+	
>+	tempval = gfar_read(&regs->rctrl);
>+	/* If parse is no longer required, then disable parser */
>+	if (tempval & RCTRL_REQ_PARSER)
>+		tempval |= RCTRL_PRSDEP_INIT;
>+	else
>+		tempval &= ~RCTRL_PRSDEP_INIT;
>+	gfar_write(&regs->rctrl, tempval);
>+}
>+
> 
> /* Enables and disables VLAN insertion/extraction */
> static void gfar_vlan_rx_register(struct net_device *dev,
>@@ -2323,12 +2340,10 @@ static void gfar_vlan_rx_register(struct net_device *dev,
> 		/* Disable VLAN tag extraction */
> 		tempval = gfar_read(&regs->rctrl);
> 		tempval &= ~RCTRL_VLEX;
>-		/* If parse is no longer required, then disable parser */
>-		if (tempval & RCTRL_REQ_PARSER)
>-			tempval |= RCTRL_PRSDEP_INIT;
>-		else
>-			tempval &= ~RCTRL_PRSDEP_INIT;
> 		gfar_write(&regs->rctrl, tempval);
>+
>+		gfar_check_rx_parser_mode(priv);
>+		
> 	}
> 
> 	gfar_change_mtu(dev, dev->mtu);
>diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
>index 27499c6..87c1d86 100644
>--- a/drivers/net/gianfar.h
>+++ b/drivers/net/gianfar.h
>@@ -286,7 +286,7 @@ extern const char gfar_driver_version[];
> #define RCTRL_PROM		0x00000008
> #define RCTRL_EMEN		0x00000002
> #define RCTRL_REQ_PARSER	(RCTRL_VLEX | RCTRL_IPCSEN | \
>-				 RCTRL_TUCSEN)
>+				 RCTRL_TUCSEN | RCTRL_FILREN)
> #define RCTRL_CHECKSUMMING	(RCTRL_IPCSEN | RCTRL_TUCSEN | \
> 				RCTRL_PRSDEP_INIT)
> #define RCTRL_EXTHASH		(RCTRL_GHTX)
>@@ -1182,6 +1182,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
> 		unsigned long tx_mask, unsigned long rx_mask);
> void gfar_init_sysfs(struct net_device *dev);
> int gfar_set_features(struct net_device *dev, u32 features);
>+extern void gfar_check_rx_parser_mode(struct gfar_private *priv);
> 
> extern const struct ethtool_ops gfar_ethtool_ops;
> 
>
> 
>
>
--
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