Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752495AbdLLTrN (ORCPT ); Tue, 12 Dec 2017 14:47:13 -0500 Received: from smtprelay0163.hostedemail.com ([216.40.44.163]:50776 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752218AbdLLTrJ (ORCPT ); Tue, 12 Dec 2017 14:47:09 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3867:3870:3871:4250:4321:5007:6117:6119:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12438:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:21434:21627:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: river57_3e3053a59c48 X-Filterd-Recvd-Size: 2500 Message-ID: <1513108024.3036.63.camel@perches.com> Subject: Re: [PATCH net-next v5 2/2] net: thunderx: add timestamping support From: Joe Perches To: Richard Cochran , Aleksey Makarov Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Goutham, Sunil" , Radoslaw Biernacki , Robert Richter , David Daney , Philippe Ombredanne , Sunil Goutham Date: Tue, 12 Dec 2017 11:47:04 -0800 In-Reply-To: <20171211233641.cs7zdw34qkngicmj@localhost> References: <20171211141435.2915-1-aleksey.makarov@cavium.com> <20171211141435.2915-3-aleksey.makarov@cavium.com> <20171211233641.cs7zdw34qkngicmj@localhost> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1271 Lines: 33 On Mon, 2017-12-11 at 15:36 -0800, Richard Cochran wrote: > On Mon, Dec 11, 2017 at 05:14:31PM +0300, Aleksey Makarov wrote: > > @@ -880,6 +889,46 @@ static void nic_pause_frame(struct nicpf *nic, int vf, struct pfc *cfg) > > } > > } > > > > +/* Enable or disable HW timestamping by BGX for pkts received on a LMAC */ > > +static void nic_config_timestamp(struct nicpf *nic, int vf, struct set_ptp *ptp) > > +{ > > + struct pkind_cfg *pkind; > > + u8 lmac, bgx_idx; > > + u64 pkind_val, pkind_idx; > > + > > + if (vf >= nic->num_vf_en) > > + return; > > + > > + bgx_idx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]); > > + lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]); > > + > > + pkind_idx = lmac + bgx_idx * MAX_LMAC_PER_BGX; > > + pkind_val = nic_reg_read(nic, NIC_PF_PKIND_0_15_CFG | (pkind_idx << 3)); > > + pkind = (struct pkind_cfg *)&pkind_val; > > + > > + if (ptp->enable && !pkind->hdr_sl) { > > + /* Skiplen to exclude 8byte timestamp while parsing pkt > > + * If not configured, will result in L2 errors. > > + */ > > + pkind->hdr_sl = 4; > > + /* Adjust max packet length allowed */ > > + pkind->maxlen += (pkind->hdr_sl * 2); Are all compilers smart enough to set this to 8? I rather doubt a compiler is even allowed to.