Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xcap
xcap-capability-linux
Commits
2e30249f
Commit
2e30249f
authored
Jun 28, 2017
by
Vikram Narayanan
Browse files
lcd/ixgbe: Add another channel for ksoftirq context
Signed-off-by:
Vikram Narayanan
<
vikram186@gmail.com
>
parent
c56d7905
Changes
2
Hide whitespace changes
Inline
Side-by-side
lcd-domains/test_mods/ixgbe/ixgbe_lcd/glue/ixgbe_caller.c
View file @
2e30249f
...
...
@@ -251,10 +251,13 @@ int create_async_channel(void)
int
ret
;
cptr_t
tx
,
rx
;
cptr_t
tx_xmit
,
rx_xmit
;
cptr_t
txirq_xmit
,
rxirq_xmit
;
struct
thc_channel
*
chnl
;
struct
thc_channel
*
xmit_chnl
;
struct
thc_channel
*
xmit_irq_chnl
;
struct
thc_channel_group_item
*
ch_item
;
struct
thc_channel_group_item
*
xmit_ch_item
;
struct
thc_channel_group_item
*
xmit_chirq_item
;
/*
* Set up async and sync channels
...
...
@@ -288,11 +291,29 @@ int create_async_channel(void)
thc_channel_group_item_add
(
&
ch_grp
,
xmit_ch_item
);
ret
=
setup_async_channel
(
&
txirq_xmit
,
&
rxirq_xmit
,
&
xmit_irq_chnl
);
if
(
ret
)
{
LIBLCD_ERR
(
"async xmit chnl setup failed"
);
goto
fail2
;
}
xmit_chirq_item
=
kzalloc
(
sizeof
(
*
xmit_chirq_item
),
GFP_KERNEL
);
thc_channel_group_item_init
(
xmit_chirq_item
,
xmit_irq_chnl
,
NULL
);
thc_channel_group_item_add
(
&
ch_grp
,
xmit_chirq_item
);
lcd_set_cr0
(
ixgbe_sync_endpoint
);
lcd_set_cr1
(
rx
);
lcd_set_cr2
(
tx
);
lcd_set_cr3
(
rx_xmit
);
lcd_set_cr4
(
tx_xmit
);
lcd_set_cr5
(
rxirq_xmit
);
lcd_set_cr6
(
txirq_xmit
);
LIBLCD_MSG
(
"sync call %s"
,
__func__
);
ret
=
lcd_sync_call
(
ixgbe_register_channel
);
...
...
@@ -307,6 +328,8 @@ int create_async_channel(void)
lcd_set_cr2
(
CAP_CPTR_NULL
);
lcd_set_cr3
(
CAP_CPTR_NULL
);
lcd_set_cr4
(
CAP_CPTR_NULL
);
lcd_set_cr5
(
CAP_CPTR_NULL
);
lcd_set_cr6
(
CAP_CPTR_NULL
);
if
(
ret
)
{
LIBLCD_ERR
(
"lcd_call"
);
...
...
lcd-domains/test_mods/ixgbe/net_klcd/main.c
View file @
2e30249f
...
...
@@ -22,6 +22,8 @@ struct net_info {
};
static
LIST_HEAD
(
net_infos
);
struct
thc_channel
*
xmit_chnl
;
struct
thc_channel
*
xmit_irq_chnl
;
struct
thc_channel
*
klcd_chnl
;
extern
int
setup_async_net_ring_channel
(
cptr_t
tx
,
cptr_t
rx
,
struct
thc_channel
**
chnl_out
);
...
...
@@ -152,6 +154,7 @@ static int do_one_register(cptr_t register_chnl)
int
ret
;
cptr_t
sync_endpoint
,
tx
,
rx
;
cptr_t
tx_xmit
,
rx_xmit
;
cptr_t
txirq_xmit
,
rxirq_xmit
;
struct
thc_channel
*
chnl
;
struct
net_info
*
net_info
;
...
...
@@ -184,6 +187,17 @@ static int do_one_register(cptr_t register_chnl)
goto
fail3
;
}
ret
=
lcd_cptr_alloc
(
&
txirq_xmit
);
if
(
ret
)
{
LIBLCD_ERR
(
"cptr alloc failed"
);
goto
fail2
;
}
ret
=
lcd_cptr_alloc
(
&
rxirq_xmit
);
if
(
ret
)
{
LIBLCD_ERR
(
"cptr alloc failed"
);
goto
fail3
;
}
/*
* Set up regs and poll
*/
...
...
@@ -192,6 +206,9 @@ static int do_one_register(cptr_t register_chnl)
lcd_set_cr2
(
rx
);
lcd_set_cr3
(
tx_xmit
);
lcd_set_cr4
(
rx_xmit
);
lcd_set_cr5
(
txirq_xmit
);
lcd_set_cr6
(
rxirq_xmit
);
ret
=
lcd_sync_poll_recv
(
register_chnl
);
if
(
ret
)
{
if
(
ret
==
-
EWOULDBLOCK
)
...
...
@@ -216,6 +233,8 @@ static int do_one_register(cptr_t register_chnl)
goto
fail6
;
}
klcd_chnl
=
chnl
;
LIBLCD_MSG
(
"settingup xmit channel"
);
/*
* Set up async ring channel
...
...
@@ -227,6 +246,16 @@ static int do_one_register(cptr_t register_chnl)
goto
fail6
;
}
/*
* Set up async ring channel
*/
ret
=
setup_async_net_ring_channel
(
txirq_xmit
,
rxirq_xmit
,
&
xmit_irq_chnl
);
if
(
ret
)
{
LIBLCD_ERR
(
"error setting up ring channel"
);
goto
fail6
;
}
/*
* Add to dispatch loop
*/
...
...
@@ -238,18 +267,14 @@ static int do_one_register(cptr_t register_chnl)
goto
fail7
;
}
net_info
=
add_net
(
xmit_chnl
,
c_cspace
,
sync_endpoint
);
if
(
!
net_info
)
{
LIBLCD_ERR
(
"error adding to dispatch loop"
);
goto
fail7
;
}
LIBLCD_MSG
(
"Returning from %s"
,
__func__
);
lcd_set_cr0
(
CAP_CPTR_NULL
);
lcd_set_cr1
(
CAP_CPTR_NULL
);
lcd_set_cr2
(
CAP_CPTR_NULL
);
lcd_set_cr3
(
CAP_CPTR_NULL
);
lcd_set_cr4
(
CAP_CPTR_NULL
);
lcd_set_cr5
(
CAP_CPTR_NULL
);
lcd_set_cr6
(
CAP_CPTR_NULL
);
if
(
lcd_sync_reply
())
LIBLCD_ERR
(
"Error reply"
);
...
...
@@ -264,13 +289,16 @@ free_cptrs:
lcd_set_cr2
(
CAP_CPTR_NULL
);
lcd_set_cr3
(
CAP_CPTR_NULL
);
lcd_set_cr4
(
CAP_CPTR_NULL
);
lcd_set_cr5
(
CAP_CPTR_NULL
);
lcd_set_cr6
(
CAP_CPTR_NULL
);
lcd_cptr_free
(
sync_endpoint
);
fail3:
lcd_cptr_free
(
tx
);
lcd_cptr_free
(
tx_xmit
);
lcd_cptr_free
(
txirq_xmit
);
fail2:
lcd_cptr_free
(
rx
);
lcd_cptr_free
(
rx_xmit
);
lcd_cptr_free
(
rx
irq
_xmit
);
fail1:
return
ret
;
}
...
...
Write
Preview
Supports
Markdown
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