mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Amir Hanania <amir.hanania@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [80/87] ixgbe: work around for DDP last buffer size
Date: Mon, 21 Mar 2011 16:07:19 -0700	[thread overview]
Message-ID: <20110321230717.434097447@clark.kroah.org> (raw)
In-Reply-To: <20110321230732.GA26510@kroah.com>

2.6.37-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Amir Hanania <amir.hanania@intel.com>

commit c600636bd560b04973174caa5e349a72bce51637 upstream.

A HW limitation was recently discovered where the last buffer in a DDP offload
cannot be a full buffer size in length. Fix the issue with a work around by
adding another buffer with size = 1.

Signed-off-by: Amir Hanania <amir.hanania@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/ixgbe/ixgbe_fcoe.c |   51 ++++++++++++++++++++++++++++++++++++++++-
 drivers/net/ixgbe/ixgbe_fcoe.h |    2 +
 2 files changed, 52 insertions(+), 1 deletion(-)

--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -151,7 +151,7 @@ int ixgbe_fcoe_ddp_get(struct net_device
 	struct scatterlist *sg;
 	unsigned int i, j, dmacount;
 	unsigned int len;
-	static const unsigned int bufflen = 4096;
+	static const unsigned int bufflen = IXGBE_FCBUFF_MIN;
 	unsigned int firstoff = 0;
 	unsigned int lastsize;
 	unsigned int thisoff = 0;
@@ -241,6 +241,24 @@ int ixgbe_fcoe_ddp_get(struct net_device
 	/* only the last buffer may have non-full bufflen */
 	lastsize = thisoff + thislen;
 
+	/*
+	 * lastsize can not be buffer len.
+	 * If it is then adding another buffer with lastsize = 1.
+	 */
+	if (lastsize == bufflen) {
+		if (j >= IXGBE_BUFFCNT_MAX) {
+			e_err(drv, "xid=%x:%d,%d,%d:addr=%llx "
+				"not enough user buffers. We need an extra "
+				"buffer because lastsize is bufflen.\n",
+				xid, i, j, dmacount, (u64)addr);
+			goto out_noddp_free;
+		}
+
+		ddp->udl[j] = (u64)(fcoe->extra_ddp_buffer_dma);
+		j++;
+		lastsize = 1;
+	}
+
 	fcbuff = (IXGBE_FCBUFF_4KB << IXGBE_FCBUFF_BUFFSIZE_SHIFT);
 	fcbuff |= ((j & 0xff) << IXGBE_FCBUFF_BUFFCNT_SHIFT);
 	fcbuff |= (firstoff << IXGBE_FCBUFF_OFFSET_SHIFT);
@@ -519,6 +537,24 @@ void ixgbe_configure_fcoe(struct ixgbe_a
 			e_err(drv, "failed to allocated FCoE DDP pool\n");
 
 		spin_lock_init(&fcoe->lock);
+
+		/* Extra buffer to be shared by all DDPs for HW work around */
+		fcoe->extra_ddp_buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_ATOMIC);
+		if (fcoe->extra_ddp_buffer == NULL) {
+			e_err(drv, "failed to allocated extra DDP buffer\n");
+			goto out_extra_ddp_buffer_alloc;
+		}
+
+		fcoe->extra_ddp_buffer_dma =
+			dma_map_single(&adapter->pdev->dev,
+				       fcoe->extra_ddp_buffer,
+				       IXGBE_FCBUFF_MIN,
+				       DMA_FROM_DEVICE);
+		if (dma_mapping_error(&adapter->pdev->dev,
+				      fcoe->extra_ddp_buffer_dma)) {
+			e_err(drv, "failed to map extra DDP buffer\n");
+			goto out_extra_ddp_buffer_dma;
+		}
 	}
 
 	/* Enable L2 eth type filter for FCoE */
@@ -568,6 +604,14 @@ void ixgbe_configure_fcoe(struct ixgbe_a
 		}
 	}
 #endif
+
+	return;
+
+out_extra_ddp_buffer_dma:
+	kfree(fcoe->extra_ddp_buffer);
+out_extra_ddp_buffer_alloc:
+	pci_pool_destroy(fcoe->pool);
+	fcoe->pool = NULL;
 }
 
 /**
@@ -587,6 +631,11 @@ void ixgbe_cleanup_fcoe(struct ixgbe_ada
 	if (fcoe->pool) {
 		for (i = 0; i < IXGBE_FCOE_DDP_MAX; i++)
 			ixgbe_fcoe_ddp_put(adapter->netdev, i);
+		dma_unmap_single(&adapter->pdev->dev,
+				 fcoe->extra_ddp_buffer_dma,
+				 IXGBE_FCBUFF_MIN,
+				 DMA_FROM_DEVICE);
+		kfree(fcoe->extra_ddp_buffer);
 		pci_pool_destroy(fcoe->pool);
 		fcoe->pool = NULL;
 	}
--- a/drivers/net/ixgbe/ixgbe_fcoe.h
+++ b/drivers/net/ixgbe/ixgbe_fcoe.h
@@ -70,6 +70,8 @@ struct ixgbe_fcoe {
 	spinlock_t lock;
 	struct pci_pool *pool;
 	struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
+	unsigned char *extra_ddp_buffer;
+	dma_addr_t extra_ddp_buffer_dma;
 };
 
 #endif /* _IXGBE_FCOE_H */



  parent reply	other threads:[~2011-03-21 23:36 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 23:07 [00/87] 2.6.37.5-stable review Greg KH
2011-03-21 23:06 ` [01/87] hwmon/f71882fg: Set platform drvdata to NULL later Greg KH
2011-03-21 23:06 ` [02/87] mtd: jedec_probe: Change variable name from cfi_p to cfi Greg KH
2011-03-21 23:06 ` [03/87] mtd: jedec_probe: initialise make sector erase command variable Greg KH
2011-03-21 23:06 ` [04/87] mtd: add "platform:" prefix for platform modalias Greg KH
2011-03-21 23:06 ` [05/87] mtd: mtd_blkdevs: fix double free on error path Greg KH
2011-03-21 23:06 ` [06/87] mtd: fix race in cfi_cmdset_0001 driver Greg KH
2011-03-21 23:06 ` [07/87] ASoC: Fix broken bitfield definitions in WM8978 Greg KH
2011-03-21 23:06 ` [08/87] sunrpc: Propagate errors from xs_bind() through xs_create_sock() Greg KH
2011-03-21 23:06 ` [09/87] NFS: NFSROOT should default to "proto=udp" Greg KH
2011-03-21 23:06 ` [10/87] Fix corrupted OSF partition table parsing Greg KH
2011-03-21 23:22   ` Linus Torvalds
2011-03-21 23:38     ` Greg KH
2011-03-21 23:06 ` [11/87] Btrfs: deal with short returns from copy_from_user Greg KH
2011-03-21 23:06 ` [12/87] netfilter: fix export secctx error handling Greg KH
2011-03-21 23:06 ` [13/87] rt2x00: Fix crash on USB unplug Greg KH
2011-03-21 23:06 ` [14/87] rt2x00: fix hang when unplugging USB device in use Greg KH
2011-03-21 23:06 ` [15/87] drm/i915: Fix calculation of backlight value in combined mode Greg KH
2011-03-21 23:06 ` [16/87] block: fix mis-synchronisation in blkdev_issue_zeroout() Greg KH
2011-03-21 23:06 ` [17/87] nfs: fix compilation warning Greg KH
2011-03-21 23:06 ` [18/87] MIPS: MTX-1: Make au1000_eth probe all PHY addresses Greg KH
2011-03-21 23:06 ` [19/87] x86/mm: Fix pgd_lock deadlock Greg KH
2011-03-21 23:06 ` [20/87] x86: Dont check for BIOS corruption in first 64K when theres no need to Greg KH
2011-03-21 23:06 ` [21/87] x86/mm: Handle mm_fault_error() in kernel space Greg KH
2011-03-21 23:06 ` [22/87] ftrace: Fix memory leak with function graph and cpu hotplug Greg KH
2011-03-21 23:06 ` [23/87] x86: Fix panic when handling "mem={invalid}" param Greg KH
2011-03-21 23:06 ` [24/87] x86: Emit "mem=nopentium ignored" warning when not supported Greg KH
2011-03-21 23:06 ` [25/87] ahci: recognize Marvell 88se9125 PCIe SATA 6.0 Gb/s controller Greg KH
2011-03-21 23:06 ` [26/87] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Greg KH
2011-03-21 23:06 ` [27/87] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Greg KH
2011-03-21 23:06 ` [28/87] libata: fix hotplug for drivers which dont implement LPM Greg KH
2011-03-21 23:06 ` [29/87] RDMA/cma: Fix crash in request handlers Greg KH
2011-03-21 23:06 ` [30/87] Increase OSF partition limit from 8 to 18 Greg KH
2011-03-21 23:06 ` [31/87] IB/cm: Bump reference count on cm_id before invoking callback Greg KH
2011-03-21 23:06 ` [32/87] x86, quirk: Fix SB600 revision check Greg KH
2011-03-21 23:06 ` [33/87] microblaze: Fix /dev/zero corruption from __clear_user() Greg KH
2011-03-21 23:06 ` [34/87] x86: stop_machine_text_poke() should issue sync_core() Greg KH
2011-03-21 23:06 ` [35/87] TOMOYO: Fix memory leak upon file open Greg KH
2011-03-21 23:06 ` [36/87] drm: Hold the mode mutex whilst probing for sysfs status Greg KH
2011-03-21 23:06 ` [37/87] ath9k_hw: read and backup AR_WA register value even before chip reset on Greg KH
2011-03-21 23:06 ` [38/87] ath9k_hw: Fix incorrect macversion and macrev checks Greg KH
2011-03-21 23:06 ` [39/87] ath9k: remove support for the FIF_PROMISC_IN_BSS filter flag Greg KH
2011-03-21 23:06 ` [40/87] USB: serial drivers need to use larger bulk-in buffers Greg KH
2011-03-21 23:06 ` [41/87] USB: serial/kobil_sct, fix potential tty NULL dereference Greg KH
2011-03-21 23:06 ` [42/87] USB: serial: option: Apply OPTION_BLACKLIST_SENDSETUP also for ZTE MF626 Greg KH
2011-03-21 23:06 ` [43/87] USB: serial: ch341: add new id Greg KH
2011-03-21 23:06 ` [44/87] staging: winbond: needs <linux/delay.h> for msleep and friends Greg KH
2011-03-21 23:06 ` [45/87] staging: tidspbridge: protect dmm_map properly Greg KH
2011-03-21 23:06 ` [46/87] USB: isp1760: Implement solution for erratum 2 Greg KH
2011-03-21 23:06 ` [47/87] ehci: Check individual port status registers on resume Greg KH
2011-03-21 23:06 ` [48/87] USB: move usbcore away from hcd->state Greg KH
2011-03-21 23:06 ` [49/87] xhci: Update internal dequeue pointers after stalls Greg KH
2011-03-21 23:06 ` [50/87] xhci: Fix cycle bit calculation during stall handling Greg KH
2011-03-21 23:06 ` [51/87] USB: Add support for SuperSpeed isoc endpoints Greg KH
2011-03-21 23:06 ` [52/87] NFS: Fix a decoding problem in nfs3_decode_dirent Greg KH
2011-03-21 23:06 ` [53/87] ALSA: HDA: Realtek ALC88x: Do not over-initialize speakers and hp that are primary outputs Greg KH
2011-03-21 23:06 ` [54/87] ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs Greg KH
2011-03-21 23:06 ` [55/87] ALSA: hda - Initialize special cases for input src in init phase Greg KH
2011-03-21 23:06 ` [56/87] HID: hid-magicmouse: Correct touch orientation direction Greg KH
2011-03-21 23:06 ` [57/87] HID: add support for Ortek PKB-1700 Greg KH
2011-03-21 23:06 ` [58/87] PCI: remove quirk for pre-production systems Greg KH
2011-03-21 23:06 ` [59/87] PCI: add more checking to ICH region quirks Greg KH
2011-03-21 23:06 ` [60/87] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Greg KH
2011-03-21 23:07 ` [61/87] PCI: sysfs: Fix failure path for addition of "vpd" attribute Greg KH
2011-03-21 23:07 ` [62/87] ALSA: sound/pci/asihpi: check adapter index in hpi_ioctl Greg KH
2011-03-21 23:07 ` [63/87] ALSA: aloop - Fix possible IRQ lock inversion Greg KH
2011-03-21 23:07 ` [64/87] ALSA: ctxfi - Fix incorrect SPDIF status bit mask Greg KH
2011-03-21 23:07 ` [65/87] ALSA: ctxfi - Fix SPDIF status retrieval Greg KH
2011-03-21 23:07 ` [66/87] ALSA: ctxfi - Clear input settings before initialization Greg KH
2011-03-21 23:07 ` [67/87] [SCSI] scsi_dh_alua: fix deadlock in stpg_endio Greg KH
2011-03-21 23:07 ` [68/87] SUNRPC: Ensure we always run the tk_callback before tk_action Greg KH
2011-03-21 23:07 ` [69/87] RPC: killing RPC tasks races fixed Greg KH
2011-03-21 23:07 ` [70/87] perf: Fix the software events state check Greg KH
2011-03-21 23:07 ` [71/87] perf: Handle stopped state with tracepoints Greg KH
2011-03-21 23:07 ` [72/87] perf, powerpc: Handle events that raise an exception without overflowing Greg KH
2011-03-21 23:07 ` [73/87] perf tools: Version incorrect with some versions of grep Greg KH
2011-03-21 23:07 ` [74/87] ext3: Always set dx_nodes fake_dirent explicitly Greg KH
2011-03-21 23:07 ` [75/87] call_function_many: fix list delete vs add race Greg KH
2011-03-21 23:07 ` [76/87] call_function_many: add missing ordering Greg KH
2011-03-21 23:07 ` [77/87] smp_call_function_many: handle concurrent clearing of mask Greg KH
2011-03-21 23:07 ` [78/87] x86: Flush TLB if PGD entry is changed in i386 PAE mode Greg KH
2011-03-21 23:07 ` [79/87] ixgbe: limit VF access to network traffic Greg KH
2011-03-21 23:07 ` Greg KH [this message]
2011-03-21 23:07 ` [81/87] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Greg KH
2011-03-21 23:07 ` [82/87] i2c: Fix typo in instantiating-devices document Greg KH
2011-03-21 23:07 ` [83/87] mmc: sdhci: Add Ricoh e823 PCI ID Greg KH
2011-03-21 23:07 ` [84/87] mmc: sdio: remember new card RCA when redetecting card Greg KH
2011-03-21 23:07 ` [85/87] x86, binutils, xen: Fix another wrong size directive Greg KH
2011-03-21 23:07 ` [86/87] davinci: DM644x EVM: register MUSB device earlier Greg KH
2011-03-21 23:07 ` [87/87] hwmon: (sht15) Fix integer overflow in humidity calculation Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110321230717.434097447@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=amir.hanania@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®