#include "socklnd.h"
-# if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
+# if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
static cfs_sysctl_table_t ksocknal_ctl_table[21];
cfs_sysctl_table_t ksocknal_top_ctl_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec
};
-#if CPU_AFFINITY
+#ifdef CPU_AFFINITY
ksocknal_ctl_table[i++] = (cfs_sysctl_table_t) {
.ctl_name = j++,
.procname = "irq_affinity",
.proc_handler = &proc_dointvec
};
#endif
- LASSERT (j == i+1);
- LASSERT (i < sizeof(ksocknal_ctl_table)/sizeof(ksocknal_ctl_table[0]));
+ ksocknal_ctl_table[i++] = (cfs_sysctl_table_t) { 0 };
+
+ LASSERT (j == i);
+ LASSERT (i <= sizeof(ksocknal_ctl_table)/sizeof(ksocknal_ctl_table[0]));
ksocknal_tunables.ksnd_sysctl =
cfs_register_sysctl_table(ksocknal_top_ctl_table, 0);
void
ksocknal_lib_bind_irq (unsigned int irq)
{
-#if (defined(CONFIG_SMP) && CPU_AFFINITY)
+#if (defined(CONFIG_SMP) && defined(CPU_AFFINITY))
int bind;
int cpu;
char cmdline[64];
ksocknal_lib_sock_irq (struct socket *sock)
{
int irq = 0;
-#if CPU_AFFINITY
+#ifdef CPU_AFFINITY
struct dst_entry *dst;
if (!*ksocknal_tunables.ksnd_irq_affinity)
if (kiov->kiov_len >= *ksocknal_tunables.ksnd_zc_min_frag &&
tx->tx_msg.ksm_zc_req_cookie != 0) {
/* Zero copy is enabled */
+ struct sock *sk = sock->sk;
struct page *page = kiov->kiov_page;
int offset = kiov->kiov_offset;
int fragsize = kiov->kiov_len;
fragsize < tx->tx_resid)
msgflg |= MSG_MORE;
- rc = tcp_sendpage(sock, page, offset, fragsize, msgflg);
+ if (sk->sk_prot->sendpage != NULL) {
+ rc = sk->sk_prot->sendpage(sk, page,
+ offset, fragsize, msgflg);
+ } else {
+ rc = tcp_sendpage(sock, page, offset, fragsize, msgflg);
+ }
} else {
#if SOCKNAL_SINGLE_FRAG_TX || !SOCKNAL_RISK_KMAP_DEADLOCK
struct iovec scratch;
return (rc);
}
-void ksocknal_lib_csum_tx(ksock_tx_t *tx)
+void
+ksocknal_lib_csum_tx(ksock_tx_t *tx)
{
int i;
__u32 csum;