Skip to contentSkip to conversation

igc: Add support for Tx/Rx rings

PATCH Superseded Sasha Neftin 2 participants 2 messages Jul 18, 2018 – Jul 19, 2018

Subsystems (2)

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 5/11 igc: Add support for Tx/Rx rings

This change adds the defines and structures necessary to support both Tx and Rx descriptor rings.

Sasha Neftin (v2):
fixed code indentation

Sasha Nedftin (v3):
minor code fixes

Sasha Nedftin (v4):
refactor of igc_clean_tx_ring method and resovle rmmod hang problem remove unused code
address comments
fix indent problem
fix xmas layout
fix header of igc_tx_buffer method
remove duplicate defines of IGC_TX_HTHRESH and IGC_TX_PTHRESH fix typo
replace e1000_ prefix with igc_prefix

---
 drivers/net/ethernet/intel/igc/Makefile      |   2 +-
 drivers/net/ethernet/intel/igc/igc.h         | 126 ++++
 drivers/net/ethernet/intel/igc/igc_base.c    |  83 +++
 drivers/net/ethernet/intel/igc/igc_base.h    |  89 +++
 drivers/net/ethernet/intel/igc/igc_defines.h |  67 ++-
 drivers/net/ethernet/intel/igc/igc_hw.h      |   1 +
 drivers/net/ethernet/intel/igc/igc_main.c    | 839 ++++++++++++++++++++++++++-
 drivers/net/ethernet/intel/igc/igc_regs.h    |   3 +
 8 files changed, 1198 insertions(+), 12 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/igc/igc_base.c
 create mode 100644 drivers/net/ethernet/intel/igc/igc_base.h
drivers/net/ethernet/intel/igc/Makefile +1 -1
index 06e0b9e23a8c..c32c45300692 100644
@@ -7,4 +7,4 @@
 
 obj-$(CONFIG_IGC) += igc.o
 
-igc-objs := igc_main.o igc_mac.o
+igc-objs := igc_main.o igc_mac.o igc_base.o
drivers/net/ethernet/intel/igc/igc.h +126 -0

142 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_base.c new file +83 -0

83 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_base.h new file +89 -0

89 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_defines.h +60 -7

85 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_hw.h +1 -0
index c668583f2910..ef9474b46704 100644
@@ -10,6 +10,7 @@
 #include "igc_defines.h"
 #include "igc_mac.h"
 #include "igc_i225.h"
+#include "igc_base.h"
 
 #define IGC_DEV_ID_I225_LM			0x15F2
 #define IGC_DEV_ID_I225_V			0x15F3
drivers/net/ethernet/intel/igc/igc_main.c +835 -4

949 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_regs.h +3 -0
index d390b5336cc7..753ac667c5a9 100644
@@ -168,6 +168,9 @@
 #define IGC_SCVPC	0x04228  /* SerDes/SGMII Code Violation Pkt Count */
 #define IGC_HRMPC	0x0A018  /* Header Redirection Missed Packet Count */
 
+/* Management registers */
+#define IGC_MANC	0x05820  /* Management Control - RW */
+
 /* forward declaration */
 struct igc_hw;
 u32 igc_rd32(struct igc_hw *hw, u32 reg);
Signature · 1 line
2.11.0
#1 lore raw
Thank you for the patch! Perhaps something to improve:

Hi Sasha,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jkirsher-next-queue/dev-queue]
[also build test WARNING on v4.18-rc5 next-20180718]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Sasha-Neftin/igc-Add-skeletal-frame-for-Intel-R-2-5G-Ethernet-Controller-support/20180719-055021
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> drivers/net/ethernet/intel/igc/igc_base.c:26:9: sparse: incorrect type in initializer (different address spaces) @@    expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@    got deref] [usertype] <asn:2>*hw_addr @@

drivers/net/ethernet/intel/igc/igc_base.c:26:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:26:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:34:17: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:34:17: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:34:17: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:54:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:54:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:54:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:57:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:57:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:57:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:63:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:63:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:63:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:64:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:64:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:64:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:72:17: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:72:17: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:72:17: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:73:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:73:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:73:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:76:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:76:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:76:9: got unsigned char [usertype] *__val
drivers/net/ethernet/intel/igc/igc_base.c:77:9: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char [noderef] [usertype] <asn:2>*hw_addr @@ got deref] [usertype] <asn:2>*hw_addr @@
drivers/net/ethernet/intel/igc/igc_base.c:77:9: expected unsigned char [noderef] [usertype] <asn:2>*hw_addr
drivers/net/ethernet/intel/igc/igc_base.c:77:9: got unsigned char [usertype] *__val

vim +26 drivers/net/ethernet/intel/igc/igc_base.c

     8	
     9	/**
    10	 *  igc_rx_fifo_flush_base - Clean rx fifo after Rx enable
    11	 *  @hw: pointer to the HW structure
    12	 *
    13	 *  After Rx enable, if manageability is enabled then there is likely some
    14	 *  bad data at the start of the fifo and possibly in the DMA fifo.  This
    15	 *  function clears the fifos and flushes any packets that came in as rx was
    16	 *  being enabled.
    17	 **/
    18	void igc_rx_fifo_flush_base(struct igc_hw *hw)
    19	{
    20		u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled;
    21		int i, ms_wait;
    22	
    23		/* disable IPv6 options as per hardware errata */
    24		rfctl = rd32(IGC_RFCTL);
    25		rfctl |= IGC_RFCTL_IPV6_EX_DIS;
  > 26		wr32(IGC_RFCTL, rfctl);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation