FreeBSD Bugzilla – Attachment 223924 Details for
Bug 254884
[if_smsc] Add ability to disable "turbo_mode" (RX frames batching) similar to linux driver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to add ability to disable "turbo mode" in if_smsc
sys_dev_usb_net_if_smsc.c.diff (text/plain), 1.54 KB, created by
Oleg Sidorkin
on 2021-04-08 12:15:04 UTC
(
hide
)
Description:
Patch to add ability to disable "turbo mode" in if_smsc
Filename:
MIME Type:
Creator:
Oleg Sidorkin
Created:
2021-04-08 12:15:04 UTC
Size:
1.54 KB
patch
obsolete
>diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c >index 84610c894f4d..e90b7dc0e9d5 100644 >--- a/sys/dev/usb/net/if_smsc.c >+++ b/sys/dev/usb/net/if_smsc.c >@@ -119,11 +119,18 @@ __FBSDID("$FreeBSD$"); > > #include "miibus_if.h" > >+SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >+ "USB smsc"); >+ >+static bool smsc_rx_packet_batching = 1; >+ >+SYSCTL_BOOL(_hw_usb_smsc, OID_AUTO, smsc_rx_packet_batching, CTLFLAG_RDTUN, >+ &smsc_rx_packet_batching, 0, >+ "Multiple frames per RX transaction. Increases throughput and latency"); >+ > #ifdef USB_DEBUG > static int smsc_debug = 0; > >-SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >- "USB smsc"); > SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug, CTLFLAG_RWTUN, &smsc_debug, 0, > "Debug level"); > #endif >@@ -1377,7 +1384,9 @@ smsc_chip_init(struct smsc_softc *sc) > * Burst capability is the number of URBs that can be in a burst of data/ > * ethernet frames. > */ >- if (usbd_get_speed(sc->sc_ue.ue_udev) == USB_SPEED_HIGH) >+ if (!smsc_rx_packet_batching) >+ burst_cap = 0; >+ else if (usbd_get_speed(sc->sc_ue.ue_udev) == USB_SPEED_HIGH) > burst_cap = 37; > else > burst_cap = 128; >@@ -1404,7 +1413,8 @@ smsc_chip_init(struct smsc_softc *sc) > /* The following setings are used for 'turbo mode', a.k.a multiple frames > * per Rx transaction (again info taken form Linux driver). > */ >- reg_val |= (SMSC_HW_CFG_MEF | SMSC_HW_CFG_BCE); >+ if (smsc_rx_packet_batching) >+ reg_val |= (SMSC_HW_CFG_MEF | SMSC_HW_CFG_BCE); > > smsc_write_reg(sc, SMSC_HW_CFG, reg_val); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 254884
: 223924