Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
59da45c4
Commit
59da45c4
authored
Sep 20, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
git://github.com/Jkirsher/net-next
parents
b53d63ec
1cc3bd87
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
311 additions
and
345 deletions
+311
-345
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb.h
+59
-58
drivers/net/ethernet/intel/igb/igb_ethtool.c
drivers/net/ethernet/intel/igb/igb_ethtool.c
+7
-8
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/igb/igb_main.c
+245
-279
No files found.
drivers/net/ethernet/intel/igb/igb.h
View file @
59da45c4
...
...
@@ -63,8 +63,7 @@ struct igb_adapter;
/* Transmit and receive queues */
#define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? 2 : \
(hw->mac.type > e1000_82575 ? 8 : 4))
#define IGB_ABS_MAX_TX_QUEUES 8
#define IGB_MAX_TX_QUEUES IGB_MAX_RX_QUEUES
#define IGB_MAX_TX_QUEUES 16
#define IGB_MAX_VF_MC_ENTRIES 30
#define IGB_MAX_VF_FUNCTIONS 8
...
...
@@ -100,23 +99,20 @@ struct vf_data_storage {
*/
#define IGB_RX_PTHRESH 8
#define IGB_RX_HTHRESH 8
#define IGB_RX_WTHRESH 1
#define IGB_TX_PTHRESH 8
#define IGB_TX_HTHRESH 1
#define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
adapter->msix_entries) ? 1 : 4)
#define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
adapter->msix_entries) ? 1 : 16)
adapter->msix_entries) ? 1 : 16)
/* this is the size past which hardware will drop packets when setting LPE=0 */
#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
/* Supported Rx Buffer Sizes */
#define IGB_RXBUFFER_64 64
/* Used for packet split */
#define IGB_RXBUFFER_128 128
/* Used for packet split */
#define IGB_RXBUFFER_1024 1024
#define IGB_RXBUFFER_2048 2048
#define IGB_RXBUFFER_512 512
#define IGB_RXBUFFER_16384 16384
#define MAX_STD_JUMBO_FRAME_SIZE 9234
#define IGB_RX_HDR_LEN IGB_RXBUFFER_512
/* How many Tx Descriptors do we need to call netif_wake_queue ? */
#define IGB_TX_QUEUE_WAKE 16
...
...
@@ -190,26 +186,26 @@ struct igb_q_vector {
};
struct
igb_ring
{
struct
igb_q_vector
*
q_vector
;
/* backlink to q_vector */
struct
net_device
*
netdev
;
/* back pointer to net_device */
struct
device
*
dev
;
/* device pointer for dma mapping */
dma_addr_t
dma
;
/* phys address of the ring */
void
*
desc
;
/* descriptor ring memory */
unsigned
int
size
;
/* length of desc. ring in bytes */
u16
count
;
/* number of desc. in the ring */
struct
igb_q_vector
*
q_vector
;
/* backlink to q_vector */
struct
net_device
*
netdev
;
/* back pointer to net_device */
struct
device
*
dev
;
/* device pointer for dma mapping */
struct
igb_buffer
*
buffer_info
;
/* array of buffer info structs */
void
*
desc
;
/* descriptor ring memory */
unsigned
long
flags
;
/* ring specific flags */
void
__iomem
*
tail
;
/* pointer to ring tail register */
u16
count
;
/* number of desc. in the ring */
u8
queue_index
;
/* logical index of the ring*/
u8
reg_idx
;
/* physical index of the ring */
u32
size
;
/* length of desc. ring in bytes */
/* everything past this point are written often */
u16
next_to_clean
____cacheline_aligned_in_smp
;
u16
next_to_use
;
u16
next_to_clean
;
u8
queue_index
;
u8
reg_idx
;
void
__iomem
*
head
;
void
__iomem
*
tail
;
struct
igb_buffer
*
buffer_info
;
/* array of buffer info structs */
unsigned
int
total_bytes
;
unsigned
int
total_packets
;
u32
flags
;
union
{
/* TX */
struct
{
...
...
@@ -222,9 +218,10 @@ struct igb_ring {
struct
{
struct
igb_rx_queue_stats
rx_stats
;
struct
u64_stats_sync
rx_syncp
;
u32
rx_buffer_len
;
};
};
/* Items past this point are only used during ring alloc / free */
dma_addr_t
dma
;
/* phys address of the ring */
};
#define IGB_RING_FLAG_RX_CSUM 0x00000001
/* RX CSUM enabled */
...
...
@@ -234,12 +231,12 @@ struct igb_ring {
#define IGB_ADVTXD_DCMD (E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS)
#define
E1000_RX_DESC_ADV
(R, i) \
(&(((union e1000_adv_rx_desc *)((R)
.
desc))[i]))
#define
E1000_TX_DESC_ADV
(R, i) \
(&(((union e1000_adv_tx_desc *)((R)
.
desc))[i]))
#define
E1000_TX_CTXTDESC_ADV
(R, i) \
(&(((struct e1000_adv_tx_context_desc *)((R)
.
desc))[i]))
#define
IGB_RX_DESC
(R, i) \
(&(((union e1000_adv_rx_desc *)((R)
->
desc))[i]))
#define
IGB_TX_DESC
(R, i) \
(&(((union e1000_adv_tx_desc *)((R)
->
desc))[i]))
#define
IGB_TX_CTXTDESC
(R, i) \
(&(((struct e1000_adv_tx_context_desc *)((R)
->
desc))[i]))
/* igb_desc_unused - calculate if we have unused descriptors */
static
inline
int
igb_desc_unused
(
struct
igb_ring
*
ring
)
...
...
@@ -252,15 +249,15 @@ static inline int igb_desc_unused(struct igb_ring *ring)
/* board specific private data structure */
struct
igb_adapter
{
struct
timer_list
watchdog_timer
;
struct
timer_list
phy_info_timer
;
unsigned
long
active_vlans
[
BITS_TO_LONGS
(
VLAN_N_VID
)];
u16
mng_vlan_id
;
u32
bd_number
;
u32
wol
;
u32
en_mng_pt
;
u16
link_speed
;
u16
link_duplex
;
struct
net_device
*
netdev
;
unsigned
long
state
;
unsigned
int
flags
;
unsigned
int
num_q_vectors
;
struct
msix_entry
*
msix_entries
;
/* Interrupt Throttle Rate */
u32
rx_itr_setting
;
...
...
@@ -268,27 +265,36 @@ struct igb_adapter {
u16
tx_itr
;
u16
rx_itr
;
struct
work_struct
reset_task
;
struct
work_struct
watchdog_task
;
bool
fc_autoneg
;
u8
tx_timeout_factor
;
struct
timer_list
blink_timer
;
unsigned
long
led_status
;
/* TX */
struct
igb_ring
*
tx_ring
[
16
];
u32
tx_timeout_count
;
int
num_tx_queues
;
struct
igb_ring
*
tx_ring
[
16
];
/* RX */
struct
igb_ring
*
rx_ring
[
16
];
int
num_tx_queues
;
int
num_rx_queues
;
struct
igb_ring
*
rx_ring
[
16
];
u32
max_frame_size
;
u32
min_frame_size
;
struct
timer_list
watchdog_timer
;
struct
timer_list
phy_info_timer
;
u16
mng_vlan_id
;
u32
bd_number
;
u32
wol
;
u32
en_mng_pt
;
u16
link_speed
;
u16
link_duplex
;
struct
work_struct
reset_task
;
struct
work_struct
watchdog_task
;
bool
fc_autoneg
;
u8
tx_timeout_factor
;
struct
timer_list
blink_timer
;
unsigned
long
led_status
;
/* OS defined structs */
struct
net_device
*
netdev
;
struct
pci_dev
*
pdev
;
struct
cyclecounter
cycles
;
struct
timecounter
clock
;
...
...
@@ -310,18 +316,13 @@ struct igb_adapter {
int
msg_enable
;
unsigned
int
num_q_vectors
;
struct
igb_q_vector
*
q_vector
[
MAX_Q_VECTORS
];
struct
msix_entry
*
msix_entries
;
u32
eims_enable_mask
;
u32
eims_other
;
/* to not mess up cache alignment, always add to the bottom */
unsigned
long
state
;
unsigned
int
flags
;
u32
eeprom_wol
;
struct
igb_ring
*
multi_tx_table
[
IGB_ABS_MAX_TX_QUEUES
];
u16
tx_ring_count
;
u16
rx_ring_count
;
unsigned
int
vfs_allocated_count
;
...
...
@@ -371,10 +372,10 @@ extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
extern
void
igb_configure_rx_ring
(
struct
igb_adapter
*
,
struct
igb_ring
*
);
extern
void
igb_setup_tctl
(
struct
igb_adapter
*
);
extern
void
igb_setup_rctl
(
struct
igb_adapter
*
);
extern
netdev_tx_t
igb_xmit_frame_ring
_adv
(
struct
sk_buff
*
,
struct
igb_ring
*
);
extern
netdev_tx_t
igb_xmit_frame_ring
(
struct
sk_buff
*
,
struct
igb_ring
*
);
extern
void
igb_unmap_and_free_tx_resource
(
struct
igb_ring
*
,
struct
igb_buffer
*
);
extern
void
igb_alloc_rx_buffers
_adv
(
struct
igb_ring
*
,
int
);
extern
void
igb_alloc_rx_buffers
(
struct
igb_ring
*
,
u16
);
extern
void
igb_update_stats
(
struct
igb_adapter
*
,
struct
rtnl_link_stats64
*
);
extern
bool
igb_has_link
(
struct
igb_adapter
*
adapter
);
extern
void
igb_set_ethtool_ops
(
struct
net_device
*
);
...
...
drivers/net/ethernet/intel/igb/igb_ethtool.c
View file @
59da45c4
...
...
@@ -1368,7 +1368,6 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
rx_ring
->
count
=
IGB_DEFAULT_RXD
;
rx_ring
->
dev
=
&
adapter
->
pdev
->
dev
;
rx_ring
->
netdev
=
adapter
->
netdev
;
rx_ring
->
rx_buffer_len
=
IGB_RXBUFFER_2048
;
rx_ring
->
reg_idx
=
adapter
->
vfs_allocated_count
;
if
(
igb_setup_rx_resources
(
rx_ring
))
{
...
...
@@ -1383,7 +1382,7 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
igb_setup_rctl
(
adapter
);
igb_configure_rx_ring
(
adapter
,
rx_ring
);
igb_alloc_rx_buffers
_adv
(
rx_ring
,
igb_desc_unused
(
rx_ring
));
igb_alloc_rx_buffers
(
rx_ring
,
igb_desc_unused
(
rx_ring
));
return
0
;
...
...
@@ -1587,7 +1586,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
/* initialize next to clean and descriptor values */
rx_ntc
=
rx_ring
->
next_to_clean
;
tx_ntc
=
tx_ring
->
next_to_clean
;
rx_desc
=
E1000_RX_DESC_ADV
(
*
rx_ring
,
rx_ntc
);
rx_desc
=
IGB_RX_DESC
(
rx_ring
,
rx_ntc
);
staterr
=
le32_to_cpu
(
rx_desc
->
wb
.
upper
.
status_error
);
while
(
staterr
&
E1000_RXD_STAT_DD
)
{
...
...
@@ -1597,7 +1596,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
/* unmap rx buffer, will be remapped by alloc_rx_buffers */
dma_unmap_single
(
rx_ring
->
dev
,
buffer_info
->
dma
,
rx_ring
->
rx_buffer_len
,
IGB_RX_HDR_LEN
,
DMA_FROM_DEVICE
);
buffer_info
->
dma
=
0
;
...
...
@@ -1618,12 +1617,12 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
tx_ntc
=
0
;
/* fetch next descriptor */
rx_desc
=
E1000_RX_DESC_ADV
(
*
rx_ring
,
rx_ntc
);
rx_desc
=
IGB_RX_DESC
(
rx_ring
,
rx_ntc
);
staterr
=
le32_to_cpu
(
rx_desc
->
wb
.
upper
.
status_error
);
}
/* re-map buffers to ring, store next to clean values */
igb_alloc_rx_buffers
_adv
(
rx_ring
,
count
);
igb_alloc_rx_buffers
(
rx_ring
,
count
);
rx_ring
->
next_to_clean
=
rx_ntc
;
tx_ring
->
next_to_clean
=
tx_ntc
;
...
...
@@ -1635,7 +1634,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
struct
igb_ring
*
tx_ring
=
&
adapter
->
test_tx_ring
;
struct
igb_ring
*
rx_ring
=
&
adapter
->
test_rx_ring
;
int
i
,
j
,
lc
,
good_cnt
,
ret_val
=
0
;
unsigned
int
size
=
1024
;
unsigned
int
size
=
IGB_RX_HDR_LEN
;
netdev_tx_t
tx_ret_val
;
struct
sk_buff
*
skb
;
...
...
@@ -1666,7 +1665,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
/* place 64 packets on the transmit queue*/
for
(
i
=
0
;
i
<
64
;
i
++
)
{
skb_get
(
skb
);
tx_ret_val
=
igb_xmit_frame_ring
_adv
(
skb
,
tx_ring
);
tx_ret_val
=
igb_xmit_frame_ring
(
skb
,
tx_ring
);
if
(
tx_ret_val
==
NETDEV_TX_OK
)
good_cnt
++
;
}
...
...
drivers/net/ethernet/intel/igb/igb_main.c
View file @
59da45c4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment