lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 19 Jul 2007 12:08:32 -0400 From: Ragner Magalhaes <ragner.magalhaes@...t.org.br> To: ext Brian King <brking@...ux.vnet.ibm.com> CC: santil@...ux.vnet.ibm.com, rcjenn@...ux.vnet.ibm.com, netdev@...r.kernel.org, linuxppc-dev@...abs.org Subject: Re: [PATCH 2/4] ibmveth: Implement ethtool hooks to enable/disable checksum offload ext Brian King wrote: > + > +static int ibmveth_set_rx_csum(struct net_device *dev, u32 data) > +{ > + struct ibmveth_adapter *adapter = dev->priv; > + Why do not to do if ((data && adapter->rx_csum) || (!data && !adapter->rx_csum)) return 0; less two lines. > + if (data && adapter->rx_csum) > + return 0; > + if (!data && !adapter->rx_csum) > + return 0; > + > + return ibmveth_set_csum_offload(dev, data, ibmveth_set_rx_csum_flags); > +} > + > +static int ibmveth_set_tx_csum(struct net_device *dev, u32 data) > +{ > + struct ibmveth_adapter *adapter = dev->priv; > + int rc = 0; > + here also, as above ... > + if (data && (dev->features & NETIF_F_IP_CSUM)) > + return 0; > + if (!data && !(dev->features & NETIF_F_IP_CSUM)) > + return 0; > + > + if (data && !adapter->rx_csum) > + rc = ibmveth_set_csum_offload(dev, data, ibmveth_set_tx_csum_flags); > + else > + ibmveth_set_tx_csum_flags(dev, data); > + > + return rc; > +} > + Best regards, Ragner - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists