Skip to content

Commit

Permalink
Merge pull request #1 from SystemFabricWorks/master
Browse files Browse the repository at this point in the history
Changed tcp->xmit_size_goal_segs to tcp->gso_segs when kernel >= 3.19…
  • Loading branch information
BernardMetzler committed Aug 4, 2015
2 parents b3bc509 + eaaa446 commit b2f98c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 7 additions & 2 deletions kernel/siw_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,17 @@ extern void siw_cm_exit(void);
static inline unsigned int get_tcp_mss(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
if (tp->xmit_size_goal_segs)
return tp->xmit_size_goal_segs * tp->mss_cache;

#else
if (tp->gso_segs)
return tp->gso_segs * tp->mss_cache;
#endif
else
return tp->mss_cache;

return 0;
}

#endif
12 changes: 9 additions & 3 deletions kernel/siw_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@
#include "siw_cm.h"
#include "siw_obj.h"

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
#define FDENTRY(f) (f->f_dentry)
#else
#define FDENTRY(f) (f->f_path.dentry)
#endif


static struct dentry *siw_debugfs;

static ssize_t siw_show_qps(struct file *f, char __user *buf, size_t space,
loff_t *ppos)
{
struct siw_dev *sdev = f->f_dentry->d_inode->i_private;
struct siw_dev *sdev = FDENTRY(f)->d_inode->i_private;
struct list_head *pos, *tmp;
char *kbuf = NULL;
int len = 0, n, num_qp;
Expand Down Expand Up @@ -128,7 +134,7 @@ static ssize_t siw_show_qps(struct file *f, char __user *buf, size_t space,
static ssize_t siw_show_ceps(struct file *f, char __user *buf, size_t space,
loff_t *ppos)
{
struct siw_dev *sdev = f->f_dentry->d_inode->i_private;
struct siw_dev *sdev = FDENTRY(f)->d_inode->i_private;
struct list_head *pos, *tmp;
char *kbuf = NULL;
int len = 0, n, num_cep;
Expand Down Expand Up @@ -198,7 +204,7 @@ static ssize_t siw_show_ceps(struct file *f, char __user *buf, size_t space,
static ssize_t siw_show_stats(struct file *f, char __user *buf, size_t space,
loff_t *ppos)
{
struct siw_dev *sdev = f->f_dentry->d_inode->i_private;
struct siw_dev *sdev = FDENTRY(f)->d_inode->i_private;
char *kbuf = NULL;
int len = 0;

Expand Down

0 comments on commit b2f98c0

Please sign in to comment.