From: Joe Perches <joe@perches.com>
To: Richard Cochran <richardcochran@gmail.com>,
Aleksey Makarov <aleksey.makarov@cavium.com>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, "Goutham,
Sunil" <Sunil.Goutham@cavium.com>,
Radoslaw Biernacki <rad@semihalf.com>,
Robert Richter <rric@kernel.org>,
David Daney <ddaney@caviumnetworks.com>,
Philippe Ombredanne <pombredanne@nexb.com>,
Sunil Goutham <sgoutham@cavium.com>
Subject: Re: [PATCH net-next v5 2/2] net: thunderx: add timestamping support
Date: Tue, 12 Dec 2017 11:47:04 -0800 [thread overview]
Message-ID: <1513108024.3036.63.camel@perches.com> (raw)
In-Reply-To: <20171211233641.cs7zdw34qkngicmj@localhost>
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.
next prev parent reply other threads:[~2017-12-12 19:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 14:14 [PATCH net-next v5 0/2] net: thunderx: add support for PTP clock Aleksey Makarov
2017-12-11 14:14 ` [PATCH net-next v5 1/2] net: add support for Cavium PTP coprocessor Aleksey Makarov
2017-12-11 22:59 ` Richard Cochran
2017-12-12 9:41 ` Aleksey Makarov
2017-12-12 17:12 ` Richard Cochran
2017-12-11 14:14 ` [PATCH net-next v5 2/2] net: thunderx: add timestamping support Aleksey Makarov
2017-12-11 23:32 ` Richard Cochran
2018-01-08 17:12 ` Aleksey Makarov
2017-12-11 23:36 ` Richard Cochran
2017-12-12 19:47 ` Joe Perches [this message]
2017-12-11 14:33 ` [PATCH net-next v5 0/2] net: thunderx: add support for PTP clock Philippe Ombredanne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513108024.3036.63.camel@perches.com \
--to=joe@perches.com \
--cc=Sunil.Goutham@cavium.com \
--cc=aleksey.makarov@cavium.com \
--cc=ddaney@caviumnetworks.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=rad@semihalf.com \
--cc=richardcochran@gmail.com \
--cc=rric@kernel.org \
--cc=sgoutham@cavium.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).