Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
59da45c4
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
162
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
59da45c4
编写于
13年前
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge
git://github.com/Jkirsher/net-next
上级
b53d63ec
1cc3bd87
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
311 addition
and
345 deletion
+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
未找到文件。
drivers/net/ethernet/intel/igb/igb.h
浏览文件 @
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
*
);
...
...
This diff is collapsed.
Click to expand it.
drivers/net/ethernet/intel/igb/igb_ethtool.c
浏览文件 @
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
++
;
}
...
...
This diff is collapsed.
Click to expand it.
drivers/net/ethernet/intel/igb/igb_main.c
浏览文件 @
59da45c4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部