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
efa230f2
Commit
efa230f2
authored
Dec 01, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
niu: Add support for byte queue limits.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
63ec3c83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
drivers/net/ethernet/sun/niu.c
drivers/net/ethernet/sun/niu.c
+11
-1
No files found.
drivers/net/ethernet/sun/niu.c
View file @
efa230f2
...
@@ -3598,6 +3598,7 @@ static int release_tx_packet(struct niu *np, struct tx_ring_info *rp, int idx)
...
@@ -3598,6 +3598,7 @@ static int release_tx_packet(struct niu *np, struct tx_ring_info *rp, int idx)
static
void
niu_tx_work
(
struct
niu
*
np
,
struct
tx_ring_info
*
rp
)
static
void
niu_tx_work
(
struct
niu
*
np
,
struct
tx_ring_info
*
rp
)
{
{
struct
netdev_queue
*
txq
;
struct
netdev_queue
*
txq
;
unsigned
int
tx_bytes
;
u16
pkt_cnt
,
tmp
;
u16
pkt_cnt
,
tmp
;
int
cons
,
index
;
int
cons
,
index
;
u64
cs
;
u64
cs
;
...
@@ -3620,12 +3621,18 @@ static void niu_tx_work(struct niu *np, struct tx_ring_info *rp)
...
@@ -3620,12 +3621,18 @@ static void niu_tx_work(struct niu *np, struct tx_ring_info *rp)
netif_printk
(
np
,
tx_done
,
KERN_DEBUG
,
np
->
dev
,
netif_printk
(
np
,
tx_done
,
KERN_DEBUG
,
np
->
dev
,
"%s() pkt_cnt[%u] cons[%d]
\n
"
,
__func__
,
pkt_cnt
,
cons
);
"%s() pkt_cnt[%u] cons[%d]
\n
"
,
__func__
,
pkt_cnt
,
cons
);
while
(
pkt_cnt
--
)
tx_bytes
=
0
;
tmp
=
pkt_cnt
;
while
(
tmp
--
)
{
tx_bytes
+=
rp
->
tx_buffs
[
cons
].
skb
->
len
;
cons
=
release_tx_packet
(
np
,
rp
,
cons
);
cons
=
release_tx_packet
(
np
,
rp
,
cons
);
}
rp
->
cons
=
cons
;
rp
->
cons
=
cons
;
smp_mb
();
smp_mb
();
netdev_tx_completed_queue
(
txq
,
pkt_cnt
,
tx_bytes
);
out:
out:
if
(
unlikely
(
netif_tx_queue_stopped
(
txq
)
&&
if
(
unlikely
(
netif_tx_queue_stopped
(
txq
)
&&
(
niu_tx_avail
(
rp
)
>
NIU_TX_WAKEUP_THRESH
(
rp
))))
{
(
niu_tx_avail
(
rp
)
>
NIU_TX_WAKEUP_THRESH
(
rp
))))
{
...
@@ -4326,6 +4333,7 @@ static void niu_free_channels(struct niu *np)
...
@@ -4326,6 +4333,7 @@ static void niu_free_channels(struct niu *np)
struct
tx_ring_info
*
rp
=
&
np
->
tx_rings
[
i
];
struct
tx_ring_info
*
rp
=
&
np
->
tx_rings
[
i
];
niu_free_tx_ring_info
(
np
,
rp
);
niu_free_tx_ring_info
(
np
,
rp
);
netdev_tx_reset_queue
(
netdev_get_tx_queue
(
np
->
dev
,
i
));
}
}
kfree
(
np
->
tx_rings
);
kfree
(
np
->
tx_rings
);
np
->
tx_rings
=
NULL
;
np
->
tx_rings
=
NULL
;
...
@@ -6731,6 +6739,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
...
@@ -6731,6 +6739,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
prod
=
NEXT_TX
(
rp
,
prod
);
prod
=
NEXT_TX
(
rp
,
prod
);
}
}
netdev_tx_sent_queue
(
txq
,
skb
->
len
);
if
(
prod
<
rp
->
prod
)
if
(
prod
<
rp
->
prod
)
rp
->
wrap_bit
^=
TX_RING_KICK_WRAP
;
rp
->
wrap_bit
^=
TX_RING_KICK_WRAP
;
rp
->
prod
=
prod
;
rp
->
prod
=
prod
;
...
...
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