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
ea225c9f
Commit
ea225c9f
authored
Apr 13, 2004
by
Ganesh Venkatesan
Committed by
Jeff Garzik
Apr 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] e1000: ethtool set/get ring param support
parent
cd81ecfd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_ethtool.c
+23
-9
No files found.
drivers/net/e1000/e1000_ethtool.c
View file @
ea225c9f
...
@@ -488,12 +488,14 @@ e1000_ethtool_sring(struct e1000_adapter *adapter,
...
@@ -488,12 +488,14 @@ e1000_ethtool_sring(struct e1000_adapter *adapter,
e1000_mac_type
mac_type
=
adapter
->
hw
.
mac_type
;
e1000_mac_type
mac_type
=
adapter
->
hw
.
mac_type
;
struct
e1000_desc_ring
*
txdr
=
&
adapter
->
tx_ring
;
struct
e1000_desc_ring
*
txdr
=
&
adapter
->
tx_ring
;
struct
e1000_desc_ring
*
rxdr
=
&
adapter
->
rx_ring
;
struct
e1000_desc_ring
*
rxdr
=
&
adapter
->
rx_ring
;
struct
e1000_desc_ring
tx_old
,
tx_new
;
struct
e1000_desc_ring
rx_old
,
rx_new
;
if
(
netif_running
(
adapter
->
netdev
))
{
tx_old
=
adapter
->
tx_ring
;
rx_old
=
adapter
->
rx_ring
;
if
(
netif_running
(
adapter
->
netdev
))
e1000_down
(
adapter
);
e1000_down
(
adapter
);
e1000_free_rx_resources
(
adapter
);
e1000_free_tx_resources
(
adapter
);
}
rxdr
->
count
=
max
(
ring
->
rx_pending
,(
uint32_t
)
E1000_MIN_RXD
);
rxdr
->
count
=
max
(
ring
->
rx_pending
,(
uint32_t
)
E1000_MIN_RXD
);
rxdr
->
count
=
min
(
rxdr
->
count
,(
uint32_t
)(
mac_type
<
e1000_82544
?
rxdr
->
count
=
min
(
rxdr
->
count
,(
uint32_t
)(
mac_type
<
e1000_82544
?
...
@@ -506,21 +508,33 @@ e1000_ethtool_sring(struct e1000_adapter *adapter,
...
@@ -506,21 +508,33 @@ e1000_ethtool_sring(struct e1000_adapter *adapter,
E1000_ROUNDUP
(
txdr
->
count
,
REQ_TX_DESCRIPTOR_MULTIPLE
);
E1000_ROUNDUP
(
txdr
->
count
,
REQ_TX_DESCRIPTOR_MULTIPLE
);
if
(
netif_running
(
adapter
->
netdev
))
{
if
(
netif_running
(
adapter
->
netdev
))
{
/* try to get new resources before deleting old */
if
((
err
=
e1000_setup_rx_resources
(
adapter
)))
if
((
err
=
e1000_setup_rx_resources
(
adapter
)))
goto
err_setup_rx
;
goto
err_setup_rx
;
if
((
err
=
e1000_setup_tx_resources
(
adapter
)))
if
((
err
=
e1000_setup_tx_resources
(
adapter
)))
goto
err_setup_tx
;
goto
err_setup_tx
;
/* save the new, restore the old in order to free it,
* then restore the new back again */
rx_new
=
adapter
->
rx_ring
;
tx_new
=
adapter
->
tx_ring
;
adapter
->
rx_ring
=
rx_old
;
adapter
->
tx_ring
=
tx_old
;
e1000_free_rx_resources
(
adapter
);
e1000_free_tx_resources
(
adapter
);
adapter
->
rx_ring
=
rx_new
;
adapter
->
tx_ring
=
tx_new
;
if
((
err
=
e1000_up
(
adapter
)))
if
((
err
=
e1000_up
(
adapter
)))
goto
err_up
;
return
err
;
}
}
return
0
;
return
0
;
err_up:
e1000_free_tx_resources
(
adapter
);
err_setup_tx:
err_setup_tx:
e1000_free_rx_resources
(
adapter
);
e1000_free_rx_resources
(
adapter
);
err_setup_rx:
err_setup_rx:
e1000_reset
(
adapter
);
adapter
->
rx_ring
=
rx_old
;
adapter
->
tx_ring
=
tx_old
;
e1000_up
(
adapter
);
return
err
;
return
err
;
}
}
...
...
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