Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938834AbcKDSfc (ORCPT ); Fri, 4 Nov 2016 14:35:32 -0400 Received: from mail-db5eur01on0050.outbound.protection.outlook.com ([104.47.2.50]:44731 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932546AbcKDSfa (ORCPT ); Fri, 4 Nov 2016 14:35:30 -0400 X-Greylist: delayed 13724 seconds by postgrey-1.27 at vger.kernel.org; Fri, 04 Nov 2016 14:35:29 EDT From: Ruxandra Ioana Radulescu To: Stuart Yoder , "gregkh@linuxfoundation.org" CC: German Rivera , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "agraf@suse.de" , "arnd@arndb.de" , Leo Li , Roy Pledge Subject: RE: [PATCH 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs Thread-Topic: [PATCH 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs Thread-Index: AQHSK6SN4/+Ke5I0NUCA2JGfVVceUKDHaFjggAF7e3CAABQcsIAABu6Q Date: Fri, 4 Nov 2016 15:04:04 +0000 Message-ID: References: <1477058509-12547-1-git-send-email-stuart.yoder@nxp.com> <1477058509-12547-5-git-send-email-stuart.yoder@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ruxandra.radulescu@nxp.com; x-originating-ip: [192.88.146.1] x-ms-office365-filtering-correlation-id: aa89d9a6-57ac-47dc-f18f-08d404c3d198 x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2639;7:GlAUgNcy0RPCjbrWHjjR1DFT+7pWTT0/KK/qigfDvxLAmokQKsqC+2z5ezb68zZPZoNCUKeldLsUk8+HbbEYo0C0GrOnXigtR07NWN6V995pYzXrXCmVC3zRN1LS1iBqKuHZ5td9DRCfhK7FKFR0syzg6LJ5HxfBo1NaO+0Gahqv6TTCxcSJmO48ARVv8l0Ayu+1ktU62HfQYeFCosx/7O/4V3o1xkkhNtrUIpWdQOQ3UfmeSzyPyw5EgAZPMH++zAoPcRy6r8uEO8Q5vS4BpIjyKnbEwVUyARgHGp3gCyJIrwgAFmCH7BpZHw0ivd4kRHlvdoiMHWNfW9B5Qdnye09f8LEGF7nLH6CmT98rnmQ= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2639; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6060226)(6045074)(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6046074)(6061223);SRVR:VI1PR0401MB2639;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2639; x-forefront-prvs: 01165471DB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(377454003)(189002)(199003)(13464003)(92566002)(81156014)(19580405001)(81166006)(2906002)(87936001)(122556002)(50986999)(3900700001)(76176999)(54356999)(4326007)(8936002)(86362001)(9686002)(19580395003)(11100500001)(2501003)(97736004)(8676002)(5001770100001)(189998001)(3280700002)(76576001)(7736002)(33656002)(2950100002)(7696004)(10400500002)(7846002)(66066001)(6116002)(102836003)(586003)(5660300001)(68736007)(3846002)(77096005)(5002640100001)(3660700001)(106116001)(106356001)(74316002)(2900100001)(105586002)(93886004)(305945005)(101416001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2639;H:VI1PR0402MB2847.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2016 15:04:04.4915 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2639 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uA4IZaZ8023261 Content-Length: 2344 Lines: 70 > -----Original Message----- > From: Stuart Yoder > Sent: Friday, November 04, 2016 4:32 PM > To: Ruxandra Ioana Radulescu ; > gregkh@linuxfoundation.org > Cc: German Rivera ; devel@driverdev.osuosl.org; > linux-kernel@vger.kernel.org; agraf@suse.de; arnd@arndb.de; Leo Li > ; Roy Pledge > Subject: RE: [PATCH 4/9] bus: fsl-mc: dpio: add frame descriptor and > scatter/gather APIs > > > +/** > > > + * dpaa2_fd_set_bpid() - Set the bpid field of frame descriptor > > > + * @fd: the given frame descriptor > > > + * @bpid: buffer pool id to be set > > > + */ > > > +static inline void dpaa2_fd_set_bpid(struct dpaa2_fd *fd, uint16_t bpid) > > > +{ > > > + fd->simple.bpid = bpid; > > > +} > > > > The setter/getter functions for fd.ctrl are missing. > > Ok, will add those. Does the ethernet driver use that field? Yes. > > > > + > > > +/** > > > + * struct dpaa2_sg_entry - the scatter-gathering structure > > > + * @addr: address of the sg entry > > > + * @len: length in this sg entry > > > + * @bpid: buffer pool id > > > + * @format_offset: offset in the MS 16 bits, BPID in the LS 16 bits > > > > Description of the format_offset field is incorrect, it shouldn't > > contain the reference to BPID. > > Thanks, will fix. > > > > +/** > > > + * dpaa2_sg_get_len() - Get the length in SG entry > > > + * @sg: the given scatter-gathering object > > > + * > > > + * Return the length. > > > + */ > > > +static inline u32 dpaa2_sg_get_len(const struct dpaa2_sg_entry *sg) > > > +{ > > > + if (dpaa2_sg_short_len(sg)) > > > + return le32_to_cpu(sg->len) & SG_SHORT_LEN_MASK; > > > + > > > + return le32_to_cpu(sg->len); > > > +} > > > > We should do this in dpaa2_fd_get_len() as well. Hardware is capable of > > generating FDs with SL bit set for single frame format too, although in > > practice I've never actually seen it. > > Any suggestion on how to test this case? Actually, I stand corrected. Apparently WRIOP _always_ generates short len frames, it just happens that, for the current default settings, the rest of the bits in the 32bit word that contains the short length field are always zero. For FDs generated on the core both formats are accepted, and we use long length format for the Ethernet driver TX frames. Thanks, Ioana