Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbcKHANF (ORCPT ); Mon, 7 Nov 2016 19:13:05 -0500 Received: from mail-db5eur01on0054.outbound.protection.outlook.com ([104.47.2.54]:45952 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752496AbcKHAND (ORCPT ); Mon, 7 Nov 2016 19:13:03 -0500 From: Stuart Yoder 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 Thread-Topic: [PATCH 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs Thread-Index: AQHSK6SN4/+Ke5I0NUCA2JGfVVceUKDHaFjggAF7e3CAABQcsIAABu6QgAVHWTA= Date: Mon, 7 Nov 2016 23:29:40 +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=stuart.yoder@nxp.com; x-originating-ip: [162.203.173.167] X-MS-Office365-Filtering-Correlation-Id: 46e8191b-007d-4ca2-c62c-08d40765f299 x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2640;7:bQ97c7nJZ1nVpi8kvkeGb1oq9e+0Wc2DxovGb0OFsslYf8Y37frMbZFXr8eqiifjm8wv/467CtfRsrZIisYjAw2J/SIQyJmee7Mxu6RcH2yRrDahDQulL+ktYlc6GaAHu5M/MHKNyCgb5i1jy5oySQ176Jk2+Ord6Ah+nGzWsifO38GGf4K2I9RVKhaI0pz3kOuKeMyhqjDkYbRJavWU3SOyEgsBnyzPFI9piY9ZJJoglb21VBIuDrYEGv/kXKnHh9e7qw+hB1eMzGBmojgiTP4cjajhd3gMHZ0HOaPp+KSQ3ruDVuMJL0Hw3bsJj4SHW8JrvVpR/rGCfy4KNWM6wGzK4lLaRJeYTrYx4nTfeIU= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2640; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6045074)(6060229)(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6061226)(6046074);SRVR:VI1PR0401MB2640;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2640; x-forefront-prvs: 0119DC3B5E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(13464003)(199003)(377454003)(3280700002)(87936001)(102836003)(11100500001)(50986999)(54356999)(76176999)(77096005)(5001770100001)(97736004)(2906002)(6116002)(2900100001)(7736002)(8676002)(305945005)(7696004)(122556002)(3900700001)(4326007)(81156014)(81166006)(74316002)(106356001)(106116001)(5002640100001)(66066001)(92566002)(19580405001)(2950100002)(5660300001)(7846002)(68736007)(33656002)(76576001)(8936002)(86362001)(101416001)(586003)(189998001)(2501003)(3846002)(3660700001)(9686002)(19580395003)(93886004)(10400500002)(105586002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2640;H:VI1PR0401MB2638.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-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2016 23:29:40.7646 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2640 X-Microsoft-Exchange-Diagnostics: 1;HE1PR0401MB2634;2:cfbmHyWzloqH4ZQgTnNrwQ4sjT2Abh4zj4Y/+Pg3hMvCnn4/QLLA5nHy+AM9G9U9+cfWFMG0uPdy3h667wFbgWCCXxjGIwN4CSfPIK1WZMTd5q5na+7EB5ZYgBnQCMD6QBijuXgQa4Jvj1d84zGqtZNRt8MMngmB6dTMkP7dF8q72PJ96dIVt1Rfkj2EjCariDrZ/l2Ve8g0OMJ5QQG/DQ==;23:AX7HTMXU+NjR/JnsGm2deOlWi7XTz9JMkXHH2flYtZ7IkvDSUDD/6CGNneD9tE87IgZ3Ygho/kmdgslfoIwT9+yLiB35iFL8kpm/03Yk9Enb8Jmkh1+FaTgtS0S97tCSmaveGf/Jpv1fGjPERni4c+cFMlqhWjj7LH29mfqZ+4PRyyoLnAFtca8b8lz5vya2 X-OriginatorOrg: nxp.com 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 uA80D9bF003679 Content-Length: 2879 Lines: 80 > -----Original Message----- > From: Ruxandra Ioana Radulescu > Sent: Friday, November 04, 2016 10:04 AM > 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 > > > -----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. Ok, so we were getting lucky. I'll fix that in the next respin. Thanks, Stuart