Commit bdb5c58e authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] sky2: copy threshold as module parameter

Make the copy threshold a module parameter for those who
may want to turn it off.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 6e23231b
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
#define RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le)) #define RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le))
#define RX_MAX_PENDING (RX_LE_SIZE/2 - 2) #define RX_MAX_PENDING (RX_LE_SIZE/2 - 2)
#define RX_DEF_PENDING RX_MAX_PENDING #define RX_DEF_PENDING RX_MAX_PENDING
#define RX_COPY_THRESHOLD 256
#define TX_RING_SIZE 512 #define TX_RING_SIZE 512
#define TX_DEF_PENDING (TX_RING_SIZE - 1) #define TX_DEF_PENDING (TX_RING_SIZE - 1)
...@@ -99,6 +98,10 @@ static int debug = -1; /* defaults above */ ...@@ -99,6 +98,10 @@ static int debug = -1; /* defaults above */
module_param(debug, int, 0); module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
static int copybreak __read_mostly = 256;
module_param(copybreak, int, 0);
MODULE_PARM_DESC(copybreak, "Receive copy threshold");
static const struct pci_device_id sky2_id_table[] = { static const struct pci_device_id sky2_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
...@@ -1653,7 +1656,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2, ...@@ -1653,7 +1656,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2,
if (!(status & GMR_FS_RX_OK)) if (!(status & GMR_FS_RX_OK))
goto resubmit; goto resubmit;
if (length < RX_COPY_THRESHOLD) { if (length < copybreak) {
skb = alloc_skb(length + 2, GFP_ATOMIC); skb = alloc_skb(length + 2, GFP_ATOMIC);
if (!skb) if (!skb)
goto resubmit; goto resubmit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment