Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935202AbcKDOqw (ORCPT ); Fri, 4 Nov 2016 10:46:52 -0400 Received: from mail-db5eur01on0049.outbound.protection.outlook.com ([104.47.2.49]:4355 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934432AbcKDOqv (ORCPT ); Fri, 4 Nov 2016 10:46:51 -0400 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/+Ke5I0NUCA2JGfVVceUKDHaFjggAF7e3CAABQcsA== Date: Fri, 4 Nov 2016 14:32:24 +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: [100.44.38.67] x-ms-office365-filtering-correlation-id: 19067a8a-8bb9-48b0-d83f-08d404bf64ce x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2640;7:BtdmGfLjXpOFwROFycwdqsLao5JvWloR/AuAuh9rhlLP6WRlp38auK4YkIhsuTm271zB2UZHcwFaweAnDJUsEcVn39N4pjykFkFxfnpvyUdwkf5HS/AoOmH1aUK8x4SFUBlDJwGP+eYPcWW7G05h5/OzPJBJxB5n1Th+zEPcOnaFpmBlqadPF+Fix1iAkPqWMnuRW2sp4OBXjoxN+mNqrhhuoDU9GTy4UWRf5No3jvfN9mrF0FKEoEYB0zRWfKatD0QeYwJq9o7mONLd0/Tuach+VqP8DTVGPmVwXukOSrr6vywfMceDgZ6xGqhV+gFsxWAem05c6zuskwhDkfzOkBK1Vo0VTu4j4PmXf7RDOSg= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2640; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(6060226)(6045074)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6061223)(6046074);SRVR:VI1PR0401MB2640;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2640; x-forefront-prvs: 01165471DB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(189002)(74316002)(66066001)(106116001)(106356001)(5660300001)(19580395003)(122556002)(4326007)(7696004)(81166006)(81156014)(9686002)(87936001)(93886004)(105586002)(10400500002)(76576001)(8936002)(2501003)(101416001)(3846002)(189998001)(86362001)(586003)(77096005)(54356999)(76176999)(3280700002)(50986999)(11100500001)(5001770100001)(97736004)(102836003)(6116002)(2950100002)(8676002)(7736002)(7846002)(68736007)(92566002)(5002640100001)(33656002)(2906002)(3660700001)(305945005)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2640;H:VI1PR0401MB2638.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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 14:32:24.1083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2640 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 uA4Ekv61021987 Content-Length: 1417 Lines: 49 > +/** > > + * 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? > > + > > +/** > > + * 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? Thanks, Stuart