Patchwork [net-next,3/4] e1000: look in the page and not in skb->data for the last byte

login
register
mail settings
Submitter Jeff Kirsher
Date May 17, 2012, 11:27 a.m.
Message ID <1337254070-32500-4-git-send-email-jeffrey.t.kirsher@intel.com>
Download mbox | patch
Permalink /patch/159890/
State Superseded
Headers show

Comments

Jeff Kirsher - May 17, 2012, 11:27 a.m.
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The code seems to want to look at the last byte where the HW puts some
information. Since the skb->data area is never seen by the HW I guess it
does not work as expected. We pass the page address to the HW so I
*think* in order to get to the last byte where the information might be
one should use the page buffer and take a look.
This is of course not more than just compile tested.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Sebastian Siewior - May 17, 2012, 11:38 a.m.
On 05/17/2012 01:27 PM, Jeff Kirsher wrote:
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index fefbf4d..6ac80c8 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -4066,7 +4066,11 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
>   		/* errors is only valid for DD + EOP descriptors */
>   		if (unlikely((status&  E1000_RXD_STAT_EOP)&&
>   		(rx_desc->errors&  E1000_RXD_ERR_FRAME_ERR_MASK))) {
> -			u8 last_byte = *(skb->data + length - 1);
> +			u8 *mapped;
> +			u8 last_byte;
> +
> +			mapped = kmap_atomic(buffer_info->page);
> +			last_byte = *(mapped + length - 1);
>   			if (TBI_ACCEPT(hw, status, rx_desc->errors, length,
>   				       last_byte)) {
>   				spin_lock_irqsave(&adapter->stats_lock,

This is not what I've sent. My original patch [0] hat a unmap as well. 
One comment was, that kmap_atomic() is too much overhead because the 
page can never be highmem. So I changed it to page_address() [1].

[0] http://permalink.gmane.org/gmane.linux.drivers.e1000.devel/10008
[1] http://permalink.gmane.org/gmane.linux.drivers.e1000.devel/10012

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Kirsher - May 17, 2012, 11:50 a.m.
On Thu, 2012-05-17 at 13:38 +0200, Sebastian Andrzej Siewior wrote:
> On 05/17/2012 01:27 PM, Jeff Kirsher wrote:
> > diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> > index fefbf4d..6ac80c8 100644
> > --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> > +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> > @@ -4066,7 +4066,11 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
> >   		/* errors is only valid for DD + EOP descriptors */
> >   		if (unlikely((status&  E1000_RXD_STAT_EOP)&&
> >   		(rx_desc->errors&  E1000_RXD_ERR_FRAME_ERR_MASK))) {
> > -			u8 last_byte = *(skb->data + length - 1);
> > +			u8 *mapped;
> > +			u8 last_byte;
> > +
> > +			mapped = kmap_atomic(buffer_info->page);
> > +			last_byte = *(mapped + length - 1);
> >   			if (TBI_ACCEPT(hw, status, rx_desc->errors, length,
> >   				       last_byte)) {
> >   				spin_lock_irqsave(&adapter->stats_lock,
> 
> This is not what I've sent. My original patch [0] hat a unmap as well. 
> One comment was, that kmap_atomic() is too much overhead because the 
> page can never be highmem. So I changed it to page_address() [1].
> 
> [0] http://permalink.gmane.org/gmane.linux.drivers.e1000.devel/10008
> [1] http://permalink.gmane.org/gmane.linux.drivers.e1000.devel/10012
> 
> Sebastian

Your correct, I apologize.  This was my fault, I applied your v1 of the
patch and then realized there was a v2.

I will re-send the series with the correct patch.
Sebastian Siewior - May 17, 2012, 11:56 a.m.
On 05/17/2012 01:50 PM, Jeff Kirsher wrote:
>
> Your correct, I apologize.  This was my fault, I applied your v1 of the
> patch and then realized there was a v2.
>
> I will re-send the series with the correct patch.

Okay. I haven't seen [0] in the series. Did you merge it somewhere?

[0] http://thread.gmane.org/gmane.linux.drivers.e1000.devel/10019

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Kirsher - May 17, 2012, 12:02 p.m.
On Thu, 2012-05-17 at 13:56 +0200, Sebastian Andrzej Siewior wrote:
> On 05/17/2012 01:50 PM, Jeff Kirsher wrote:
> >
> > Your correct, I apologize.  This was my fault, I applied your v1 of the
> > patch and then realized there was a v2.
> >
> > I will re-send the series with the correct patch.
> 
> Okay. I haven't seen [0] in the series. Did you merge it somewhere?
> 
> [0] http://thread.gmane.org/gmane.linux.drivers.e1000.devel/10019
> 
> Sebastian

No, not yet.  Aaron is still validating that patch since it was actually
the last one you sent me.  I expect to be pushing it in the next day or
so with some ixgbe patches, once it finishes validation.

Patch

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index fefbf4d..6ac80c8 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -4066,7 +4066,11 @@  static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
 		/* errors is only valid for DD + EOP descriptors */
 		if (unlikely((status & E1000_RXD_STAT_EOP) &&
 		    (rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK))) {
-			u8 last_byte = *(skb->data + length - 1);
+			u8 *mapped;
+			u8 last_byte;
+
+			mapped = kmap_atomic(buffer_info->page);
+			last_byte = *(mapped + length - 1);
 			if (TBI_ACCEPT(hw, status, rx_desc->errors, length,
 				       last_byte)) {
 				spin_lock_irqsave(&adapter->stats_lock,