Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
08338475
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
08338475
编写于
12月 08, 2010
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sfc-2.6.37' of
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-2.6
上级
35d9b0c9
e8f14992
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
14 deletion
+37
-14
drivers/net/sfc/efx.c
drivers/net/sfc/efx.c
+29
-14
drivers/net/sfc/net_driver.h
drivers/net/sfc/net_driver.h
+2
-0
drivers/net/sfc/nic.c
drivers/net/sfc/nic.c
+6
-0
未找到文件。
drivers/net/sfc/efx.c
浏览文件 @
08338475
...
@@ -197,7 +197,9 @@ MODULE_PARM_DESC(debug, "Bitmapped debugging message enable value");
...
@@ -197,7 +197,9 @@ MODULE_PARM_DESC(debug, "Bitmapped debugging message enable value");
static
void
efx_remove_channels
(
struct
efx_nic
*
efx
);
static
void
efx_remove_channels
(
struct
efx_nic
*
efx
);
static
void
efx_remove_port
(
struct
efx_nic
*
efx
);
static
void
efx_remove_port
(
struct
efx_nic
*
efx
);
static
void
efx_init_napi
(
struct
efx_nic
*
efx
);
static
void
efx_fini_napi
(
struct
efx_nic
*
efx
);
static
void
efx_fini_napi
(
struct
efx_nic
*
efx
);
static
void
efx_fini_napi_channel
(
struct
efx_channel
*
channel
);
static
void
efx_fini_struct
(
struct
efx_nic
*
efx
);
static
void
efx_fini_struct
(
struct
efx_nic
*
efx
);
static
void
efx_start_all
(
struct
efx_nic
*
efx
);
static
void
efx_start_all
(
struct
efx_nic
*
efx
);
static
void
efx_stop_all
(
struct
efx_nic
*
efx
);
static
void
efx_stop_all
(
struct
efx_nic
*
efx
);
...
@@ -335,8 +337,10 @@ void efx_process_channel_now(struct efx_channel *channel)
...
@@ -335,8 +337,10 @@ void efx_process_channel_now(struct efx_channel *channel)
/* Disable interrupts and wait for ISRs to complete */
/* Disable interrupts and wait for ISRs to complete */
efx_nic_disable_interrupts
(
efx
);
efx_nic_disable_interrupts
(
efx
);
if
(
efx
->
legacy_irq
)
if
(
efx
->
legacy_irq
)
{
synchronize_irq
(
efx
->
legacy_irq
);
synchronize_irq
(
efx
->
legacy_irq
);
efx
->
legacy_irq_enabled
=
false
;
}
if
(
channel
->
irq
)
if
(
channel
->
irq
)
synchronize_irq
(
channel
->
irq
);
synchronize_irq
(
channel
->
irq
);
...
@@ -351,6 +355,8 @@ void efx_process_channel_now(struct efx_channel *channel)
...
@@ -351,6 +355,8 @@ void efx_process_channel_now(struct efx_channel *channel)
efx_channel_processed
(
channel
);
efx_channel_processed
(
channel
);
napi_enable
(
&
channel
->
napi_str
);
napi_enable
(
&
channel
->
napi_str
);
if
(
efx
->
legacy_irq
)
efx
->
legacy_irq_enabled
=
true
;
efx_nic_enable_interrupts
(
efx
);
efx_nic_enable_interrupts
(
efx
);
}
}
...
@@ -426,6 +432,7 @@ efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel)
...
@@ -426,6 +432,7 @@ efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel)
*
channel
=
*
old_channel
;
*
channel
=
*
old_channel
;
channel
->
napi_dev
=
NULL
;
memset
(
&
channel
->
eventq
,
0
,
sizeof
(
channel
->
eventq
));
memset
(
&
channel
->
eventq
,
0
,
sizeof
(
channel
->
eventq
));
rx_queue
=
&
channel
->
rx_queue
;
rx_queue
=
&
channel
->
rx_queue
;
...
@@ -736,9 +743,13 @@ efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries)
...
@@ -736,9 +743,13 @@ efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries)
if
(
rc
)
if
(
rc
)
goto
rollback
;
goto
rollback
;
efx_init_napi
(
efx
);
/* Destroy old channels */
/* Destroy old channels */
for
(
i
=
0
;
i
<
efx
->
n_channels
;
i
++
)
for
(
i
=
0
;
i
<
efx
->
n_channels
;
i
++
)
{
efx_fini_napi_channel
(
other_channel
[
i
]);
efx_remove_channel
(
other_channel
[
i
]);
efx_remove_channel
(
other_channel
[
i
]);
}
out:
out:
/* Free unused channel structures */
/* Free unused channel structures */
for
(
i
=
0
;
i
<
efx
->
n_channels
;
i
++
)
for
(
i
=
0
;
i
<
efx
->
n_channels
;
i
++
)
...
@@ -1400,6 +1411,8 @@ static void efx_start_all(struct efx_nic *efx)
...
@@ -1400,6 +1411,8 @@ static void efx_start_all(struct efx_nic *efx)
efx_start_channel
(
channel
);
efx_start_channel
(
channel
);
}
}
if
(
efx
->
legacy_irq
)
efx
->
legacy_irq_enabled
=
true
;
efx_nic_enable_interrupts
(
efx
);
efx_nic_enable_interrupts
(
efx
);
/* Switch to event based MCDI completions after enabling interrupts.
/* Switch to event based MCDI completions after enabling interrupts.
...
@@ -1460,8 +1473,10 @@ static void efx_stop_all(struct efx_nic *efx)
...
@@ -1460,8 +1473,10 @@ static void efx_stop_all(struct efx_nic *efx)
/* Disable interrupts and wait for ISR to complete */
/* Disable interrupts and wait for ISR to complete */
efx_nic_disable_interrupts
(
efx
);
efx_nic_disable_interrupts
(
efx
);
if
(
efx
->
legacy_irq
)
if
(
efx
->
legacy_irq
)
{
synchronize_irq
(
efx
->
legacy_irq
);
synchronize_irq
(
efx
->
legacy_irq
);
efx
->
legacy_irq_enabled
=
false
;
}
efx_for_each_channel
(
channel
,
efx
)
{
efx_for_each_channel
(
channel
,
efx
)
{
if
(
channel
->
irq
)
if
(
channel
->
irq
)
synchronize_irq
(
channel
->
irq
);
synchronize_irq
(
channel
->
irq
);
...
@@ -1593,7 +1608,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
...
@@ -1593,7 +1608,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
*
*
**************************************************************************/
**************************************************************************/
static
int
efx_init_napi
(
struct
efx_nic
*
efx
)
static
void
efx_init_napi
(
struct
efx_nic
*
efx
)
{
{
struct
efx_channel
*
channel
;
struct
efx_channel
*
channel
;
...
@@ -1602,18 +1617,21 @@ static int efx_init_napi(struct efx_nic *efx)
...
@@ -1602,18 +1617,21 @@ static int efx_init_napi(struct efx_nic *efx)
netif_napi_add
(
channel
->
napi_dev
,
&
channel
->
napi_str
,
netif_napi_add
(
channel
->
napi_dev
,
&
channel
->
napi_str
,
efx_poll
,
napi_weight
);
efx_poll
,
napi_weight
);
}
}
return
0
;
}
static
void
efx_fini_napi_channel
(
struct
efx_channel
*
channel
)
{
if
(
channel
->
napi_dev
)
netif_napi_del
(
&
channel
->
napi_str
);
channel
->
napi_dev
=
NULL
;
}
}
static
void
efx_fini_napi
(
struct
efx_nic
*
efx
)
static
void
efx_fini_napi
(
struct
efx_nic
*
efx
)
{
{
struct
efx_channel
*
channel
;
struct
efx_channel
*
channel
;
efx_for_each_channel
(
channel
,
efx
)
{
efx_for_each_channel
(
channel
,
efx
)
if
(
channel
->
napi_dev
)
efx_fini_napi_channel
(
channel
);
netif_napi_del
(
&
channel
->
napi_str
);
channel
->
napi_dev
=
NULL
;
}
}
}
/**************************************************************************
/**************************************************************************
...
@@ -2335,9 +2353,7 @@ static int efx_pci_probe_main(struct efx_nic *efx)
...
@@ -2335,9 +2353,7 @@ static int efx_pci_probe_main(struct efx_nic *efx)
if
(
rc
)
if
(
rc
)
goto
fail1
;
goto
fail1
;
rc
=
efx_init_napi
(
efx
);
efx_init_napi
(
efx
);
if
(
rc
)
goto
fail2
;
rc
=
efx
->
type
->
init
(
efx
);
rc
=
efx
->
type
->
init
(
efx
);
if
(
rc
)
{
if
(
rc
)
{
...
@@ -2368,7 +2384,6 @@ static int efx_pci_probe_main(struct efx_nic *efx)
...
@@ -2368,7 +2384,6 @@ static int efx_pci_probe_main(struct efx_nic *efx)
efx
->
type
->
fini
(
efx
);
efx
->
type
->
fini
(
efx
);
fail3:
fail3:
efx_fini_napi
(
efx
);
efx_fini_napi
(
efx
);
fail2:
efx_remove_all
(
efx
);
efx_remove_all
(
efx
);
fail1:
fail1:
return
rc
;
return
rc
;
...
...
drivers/net/sfc/net_driver.h
浏览文件 @
08338475
...
@@ -621,6 +621,7 @@ struct efx_filter_state;
...
@@ -621,6 +621,7 @@ struct efx_filter_state;
* @pci_dev: The PCI device
* @pci_dev: The PCI device
* @type: Controller type attributes
* @type: Controller type attributes
* @legacy_irq: IRQ number
* @legacy_irq: IRQ number
* @legacy_irq_enabled: Are IRQs enabled on NIC (INT_EN_KER register)?
* @workqueue: Workqueue for port reconfigures and the HW monitor.
* @workqueue: Workqueue for port reconfigures and the HW monitor.
* Work items do not hold and must not acquire RTNL.
* Work items do not hold and must not acquire RTNL.
* @workqueue_name: Name of workqueue
* @workqueue_name: Name of workqueue
...
@@ -709,6 +710,7 @@ struct efx_nic {
...
@@ -709,6 +710,7 @@ struct efx_nic {
struct
pci_dev
*
pci_dev
;
struct
pci_dev
*
pci_dev
;
const
struct
efx_nic_type
*
type
;
const
struct
efx_nic_type
*
type
;
int
legacy_irq
;
int
legacy_irq
;
bool
legacy_irq_enabled
;
struct
workqueue_struct
*
workqueue
;
struct
workqueue_struct
*
workqueue
;
char
workqueue_name
[
16
];
char
workqueue_name
[
16
];
struct
work_struct
reset_work
;
struct
work_struct
reset_work
;
...
...
drivers/net/sfc/nic.c
浏览文件 @
08338475
...
@@ -1418,6 +1418,12 @@ static irqreturn_t efx_legacy_interrupt(int irq, void *dev_id)
...
@@ -1418,6 +1418,12 @@ static irqreturn_t efx_legacy_interrupt(int irq, void *dev_id)
u32
queues
;
u32
queues
;
int
syserr
;
int
syserr
;
/* Could this be ours? If interrupts are disabled then the
* channel state may not be valid.
*/
if
(
!
efx
->
legacy_irq_enabled
)
return
result
;
/* Read the ISR which also ACKs the interrupts */
/* Read the ISR which also ACKs the interrupts */
efx_readd
(
efx
,
&
reg
,
FR_BZ_INT_ISR0
);
efx_readd
(
efx
,
&
reg
,
FR_BZ_INT_ISR0
);
queues
=
EFX_EXTRACT_DWORD
(
reg
,
0
,
31
);
queues
=
EFX_EXTRACT_DWORD
(
reg
,
0
,
31
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录