Subject: Re: [PATCH net-next 2/2] net/sched: act_csum: compute crc32c on SCTP packets

From: Davide Caratti <[email-masked]>
Date: Sun, 08 Jan 2017 17:43:43 +0100

On Fri, 2017-01-06 at 10:23 +0100, Nicolas Dichtel wrote:
> Le 05/01/2017 à 17:59, Davide Caratti a écrit :
> > @@ -21,7 +21,8 @@ enum {
> >  	TCA_CSUM_UPDATE_FLAG_IGMP    = 4,
> >  	TCA_CSUM_UPDATE_FLAG_TCP     = 8,
> >  	TCA_CSUM_UPDATE_FLAG_UDP     = 16,
> > -	TCA_CSUM_UPDATE_FLAG_UDPLITE = 32
> > +	TCA_CSUM_UPDATE_FLAG_UDPLITE = 32,
> > +	TCA_CSUM_UPDATE_FLAG_SCTP    = 64
> nit: please put a comma after the '64' so that the next person who adds
> a flag
> will not have to touch that line.
> 

ok,

> > @@ -365,6 +385,12 @@ static int tcf_csum_ipv4(struct sk_buff *skb, u32
> > update_flags)
> >  					       ntohs(iph->tot_len),
> > 1))
> >  				goto fail;
> >  		break;
> > +	case IPPROTO_SCTP:
> > +		if (update_flags & TCA_CSUM_UPDATE_FLAG_SCTP)
> > +			if (!tcf_csum_sctp(skb, iph->ihl * 4,
> > +					   ntohs(iph->tot_len)))
> nit: one 'if' only?
> 		if (update_flags & TCA_CSUM_UPDATE_FLAG_SCTP &&
> 		    !tcf_csum_sctp(skb, iph->ihl * 4, ntohs(iph->tot_len))
> 

ok,

> > @@ -481,6 +507,12 @@ static int tcf_csum_ipv6(struct sk_buff *skb, u32
> > update_flags)
> >  						       pl +
> > sizeof(*ip6h), 1))
> >  					goto fail;
> >  			goto done;
> > +		case IPPROTO_SCTP:
> > +			if (update_flags & TCA_CSUM_UPDATE_FLAG_SCTP)
> > +				if (!tcf_csum_sctp(skb, hl,
> > +						   pl +
> > sizeof(*ip6h)))
> Same here.
> 

ok,

> Regards,
> Nicolas

hello Nicolas,
thank you for the attention! I will apply the changes you suggested and
repost a v2.

regards,