mirror of https://gitee.com/openkylin/linux.git
via-velocity: Set tx checksum from ethtool instead of module parameter
Defaults to on (as before). Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c79992fdde
commit
b06f78f4d0
|
@ -297,14 +297,6 @@ VELOCITY_PARAM(DMA_length, "DMA length");
|
||||||
*/
|
*/
|
||||||
VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned");
|
VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned");
|
||||||
|
|
||||||
#define TX_CSUM_DEF 1
|
|
||||||
/* txcsum_offload[] is used for setting the checksum offload ability of NIC.
|
|
||||||
(We only support RX checksum offload now)
|
|
||||||
0: disable csum_offload[checksum offload
|
|
||||||
1: enable checksum offload. (Default)
|
|
||||||
*/
|
|
||||||
VELOCITY_PARAM(txcsum_offload, "Enable transmit packet checksum offload");
|
|
||||||
|
|
||||||
#define FLOW_CNTL_DEF 1
|
#define FLOW_CNTL_DEF 1
|
||||||
#define FLOW_CNTL_MIN 1
|
#define FLOW_CNTL_MIN 1
|
||||||
#define FLOW_CNTL_MAX 5
|
#define FLOW_CNTL_MAX 5
|
||||||
|
@ -490,7 +482,6 @@ static void __devinit velocity_get_options(struct velocity_opt *opts, int index,
|
||||||
velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
|
velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
|
||||||
velocity_set_int_opt(&opts->numtx, TxDescriptors[index], TX_DESC_MIN, TX_DESC_MAX, TX_DESC_DEF, "TxDescriptors", devname);
|
velocity_set_int_opt(&opts->numtx, TxDescriptors[index], TX_DESC_MIN, TX_DESC_MAX, TX_DESC_DEF, "TxDescriptors", devname);
|
||||||
|
|
||||||
velocity_set_bool_opt(&opts->flags, txcsum_offload[index], TX_CSUM_DEF, VELOCITY_FLAGS_TX_CSUM, "txcsum_offload", devname);
|
|
||||||
velocity_set_int_opt(&opts->flow_cntl, flow_control[index], FLOW_CNTL_MIN, FLOW_CNTL_MAX, FLOW_CNTL_DEF, "flow_control", devname);
|
velocity_set_int_opt(&opts->flow_cntl, flow_control[index], FLOW_CNTL_MIN, FLOW_CNTL_MAX, FLOW_CNTL_DEF, "flow_control", devname);
|
||||||
velocity_set_bool_opt(&opts->flags, IP_byte_align[index], IP_ALIG_DEF, VELOCITY_FLAGS_IP_ALIGN, "IP_byte_align", devname);
|
velocity_set_bool_opt(&opts->flags, IP_byte_align[index], IP_ALIG_DEF, VELOCITY_FLAGS_IP_ALIGN, "IP_byte_align", devname);
|
||||||
velocity_set_bool_opt(&opts->flags, ValPktLen[index], VAL_PKT_LEN_DEF, VELOCITY_FLAGS_VAL_PKT_LEN, "ValPktLen", devname);
|
velocity_set_bool_opt(&opts->flags, ValPktLen[index], VAL_PKT_LEN_DEF, VELOCITY_FLAGS_VAL_PKT_LEN, "ValPktLen", devname);
|
||||||
|
@ -2593,7 +2584,7 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
|
||||||
/*
|
/*
|
||||||
* Handle hardware checksum
|
* Handle hardware checksum
|
||||||
*/
|
*/
|
||||||
if ((vptr->flags & VELOCITY_FLAGS_TX_CSUM)
|
if ( (dev->features & NETIF_F_IP_CSUM)
|
||||||
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
|
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
|
||||||
const struct iphdr *ip = ip_hdr(skb);
|
const struct iphdr *ip = ip_hdr(skb);
|
||||||
if (ip->protocol == IPPROTO_TCP)
|
if (ip->protocol == IPPROTO_TCP)
|
||||||
|
@ -2838,10 +2829,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
|
||||||
netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT);
|
netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT);
|
||||||
|
|
||||||
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER |
|
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER |
|
||||||
NETIF_F_HW_VLAN_RX;
|
NETIF_F_HW_VLAN_RX | NETIF_F_IP_CSUM;
|
||||||
|
|
||||||
if (vptr->flags & VELOCITY_FLAGS_TX_CSUM)
|
|
||||||
dev->features |= NETIF_F_IP_CSUM;
|
|
||||||
|
|
||||||
ret = register_netdev(dev);
|
ret = register_netdev(dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -3392,6 +3380,8 @@ static const struct ethtool_ops velocity_ethtool_ops = {
|
||||||
.get_settings = velocity_get_settings,
|
.get_settings = velocity_get_settings,
|
||||||
.set_settings = velocity_set_settings,
|
.set_settings = velocity_set_settings,
|
||||||
.get_drvinfo = velocity_get_drvinfo,
|
.get_drvinfo = velocity_get_drvinfo,
|
||||||
|
.set_tx_csum = ethtool_op_set_tx_csum,
|
||||||
|
.get_tx_csum = ethtool_op_get_tx_csum,
|
||||||
.get_wol = velocity_ethtool_get_wol,
|
.get_wol = velocity_ethtool_get_wol,
|
||||||
.set_wol = velocity_ethtool_set_wol,
|
.set_wol = velocity_ethtool_set_wol,
|
||||||
.get_msglevel = velocity_get_msglevel,
|
.get_msglevel = velocity_get_msglevel,
|
||||||
|
|
|
@ -1423,7 +1423,6 @@ enum velocity_msg_level {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VELOCITY_FLAGS_TAGGING 0x00000001UL
|
#define VELOCITY_FLAGS_TAGGING 0x00000001UL
|
||||||
#define VELOCITY_FLAGS_TX_CSUM 0x00000002UL
|
|
||||||
#define VELOCITY_FLAGS_RX_CSUM 0x00000004UL
|
#define VELOCITY_FLAGS_RX_CSUM 0x00000004UL
|
||||||
#define VELOCITY_FLAGS_IP_ALIGN 0x00000008UL
|
#define VELOCITY_FLAGS_IP_ALIGN 0x00000008UL
|
||||||
#define VELOCITY_FLAGS_VAL_PKT_LEN 0x00000010UL
|
#define VELOCITY_FLAGS_VAL_PKT_LEN 0x00000010UL
|
||||||
|
|
Loading…
Reference in New Issue