Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1564269 > unrolled thread
| Started by | James Simmons <jsimmons@infradead.org> |
|---|---|
| First post | 2017-01-22 01:50 +0100 |
| Last post | 2017-01-30 07:50 +0100 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure James Simmons <jsimmons@infradead.org> - 2017-01-22 01:50 +0100
[PATCH 4/8] staging: lustre: lnet: change lnet_process_id_packed_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-01-22 01:50 +0100
Re: [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure Joe Perches <joe@perches.com> - 2017-01-23 22:10 +0100
Re: [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure James Simmons <jsimmons@infradead.org> - 2017-01-30 01:00 +0100
Re: [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-30 07:50 +0100
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-01-22 01:50 +0100 |
| Subject | [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure |
| Message-ID | <t2ew1-2cj-3@gated-at.bofh.it> |
The upstream kernel requires proper structures so convert nearly all the LNet wire protocols typedefs in the LNet core. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> James Simmons (8): staging: lustre: lnet: change lnet_handle_wire_t to proper structure staging: lustre: lnet: change lnet_ping_info_t to proper structure staging: lustre: lnet: change lnet_ni_status_t to proper structure staging: lustre: lnet: change lnet_process_id_packed_t to proper structure staging: lustre: lnet: change lnet_acceptor_connreq_t to proper structure staging: lustre: lnet: change lnet_magicversion_t to proper structure staging: lustre: lnet: change lnet_hdr_t to proper structure staging: lustre: lnet: change msg union in struct lnet_hdr to proper structure .../staging/lustre/include/linux/lnet/lib-lnet.h | 14 +- .../staging/lustre/include/linux/lnet/lib-types.h | 10 +- .../staging/lustre/include/linux/lnet/socklnd.h | 2 +- drivers/staging/lustre/include/linux/lnet/types.h | 70 ++++----- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 6 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 2 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.h | 2 +- .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 14 +- .../lustre/lnet/klnds/socklnd/socklnd_proto.c | 26 ++-- drivers/staging/lustre/lnet/lnet/acceptor.c | 6 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 170 ++++++++++----------- drivers/staging/lustre/lnet/lnet/lib-move.c | 20 +-- drivers/staging/lustre/lnet/lnet/lib-msg.c | 4 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- drivers/staging/lustre/lnet/lnet/net_fault.c | 4 +- drivers/staging/lustre/lnet/lnet/router.c | 10 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 10 +- drivers/staging/lustre/lnet/selftest/framework.c | 8 +- drivers/staging/lustre/lnet/selftest/selftest.h | 2 +- 19 files changed, 191 insertions(+), 191 deletions(-) -- 1.8.3.1
[toc] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-01-22 01:50 +0100 |
| Subject | [PATCH 4/8] staging: lustre: lnet: change lnet_process_id_packed_t to proper structure |
| Message-ID | <t2ew2-2cj-23@gated-at.bofh.it> |
| In reply to | #1564269 |
Change lnet_process_id_packed_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/types.h | 4 ++--
drivers/staging/lustre/lnet/selftest/conrpc.c | 10 +++++-----
drivers/staging/lustre/lnet/selftest/framework.c | 8 ++++----
drivers/staging/lustre/lnet/selftest/selftest.h | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index 405bbc6..3c3b6676 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -115,11 +115,11 @@ static inline __u32 LNET_MKNET(__u32 type, __u32 num)
#define WIRE_ATTR __packed
/* Packed version of lnet_process_id_t to transfer via network */
-typedef struct {
+struct lnet_process_id_packed {
/* node id / process id */
lnet_nid_t nid;
lnet_pid_t pid;
-} WIRE_ATTR lnet_process_id_packed_t;
+} WIRE_ATTR;
/*
* The wire handle's interface cookie only matches one network interface in
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 3d325ea..c6a683b 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -698,17 +698,17 @@ void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *, struct srpc_msg *,
return 0;
}
-static lnet_process_id_packed_t *
+static struct lnet_process_id_packed *
lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov)
{
- lnet_process_id_packed_t *pid;
+ struct lnet_process_id_packed *pid;
int i;
i = idx / SFW_ID_PER_PAGE;
LASSERT(i < nkiov);
- pid = (lnet_process_id_packed_t *)page_address(kiov[i].bv_page);
+ pid = (struct lnet_process_id_packed *)page_address(kiov[i].bv_page);
return &pid[idx % SFW_ID_PER_PAGE];
}
@@ -717,7 +717,7 @@ void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *, struct srpc_msg *,
lstcon_dstnodes_prep(struct lstcon_group *grp, int idx,
int dist, int span, int nkiov, lnet_kiov_t *kiov)
{
- lnet_process_id_packed_t *pid;
+ struct lnet_process_id_packed *pid;
struct lstcon_ndlink *ndl;
struct lstcon_node *nd;
int start;
@@ -823,7 +823,7 @@ void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *, struct srpc_msg *,
npg = sfw_id_pages(test->tes_span);
nob = !(feats & LST_FEAT_BULK_LEN) ?
npg * PAGE_SIZE :
- sizeof(lnet_process_id_packed_t) * test->tes_span;
+ sizeof(struct lnet_process_id_packed) * test->tes_span;
}
rc = lstcon_rpc_prep(nd, SRPC_SERVICE_TEST, feats, npg, nob, crpc);
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 436aef3..9dd4e1a 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -777,14 +777,14 @@
LASSERT(bk);
LASSERT(bk->bk_niov * SFW_ID_PER_PAGE >= (unsigned int)ndest);
LASSERT((unsigned int)bk->bk_len >=
- sizeof(lnet_process_id_packed_t) * ndest);
+ sizeof(struct lnet_process_id_packed) * ndest);
sfw_unpack_addtest_req(msg);
memcpy(&tsi->tsi_u, &req->tsr_u, sizeof(tsi->tsi_u));
for (i = 0; i < ndest; i++) {
- lnet_process_id_packed_t *dests;
- lnet_process_id_packed_t id;
+ struct lnet_process_id_packed *dests;
+ struct lnet_process_id_packed id;
int j;
dests = page_address(bk->bk_iovs[i / SFW_ID_PER_PAGE].bv_page);
@@ -1164,7 +1164,7 @@
len = npg * PAGE_SIZE;
} else {
- len = sizeof(lnet_process_id_packed_t) *
+ len = sizeof(struct lnet_process_id_packed) *
request->tsr_ndest;
}
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 1e5526c..f259480 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -396,7 +396,7 @@ struct sfw_test_instance {
* pages are not used
*/
#define SFW_MAX_CONCUR LST_MAX_CONCUR
-#define SFW_ID_PER_PAGE (PAGE_SIZE / sizeof(lnet_process_id_packed_t))
+#define SFW_ID_PER_PAGE (PAGE_SIZE / sizeof(struct lnet_process_id_packed))
#define SFW_MAX_NDESTS (LNET_MAX_IOV * SFW_ID_PER_PAGE)
#define sfw_id_pages(n) (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE)
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-01-23 22:10 +0100 |
| Subject | Re: [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure |
| Message-ID | <t2U2e-36U-31@gated-at.bofh.it> |
| In reply to | #1564269 |
On Sat, 2017-01-21 at 19:40 -0500, James Simmons wrote: > The upstream kernel requires proper structures so > convert nearly all the LNet wire protocols typedefs in > the LNet core. Thanks. Perhaps s/\bWIRE_ATTR\b/__packed/g one day too
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-01-30 01:00 +0100 |
| Subject | Re: [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure |
| Message-ID | <t57y2-58j-11@gated-at.bofh.it> |
| In reply to | #1565307 |
> On Sat, 2017-01-21 at 19:40 -0500, James Simmons wrote: > > The upstream kernel requires proper structures so > > convert nearly all the LNet wire protocols typedefs in > > the LNet core. > > Thanks. > > Perhaps s/\bWIRE_ATTR\b/__packed/g one day too I liked to keep that one. The point of WIRE_ATTR isn't to be some abstraction but to label that struct as something that goes over the wire. This lets people know that it would break something if you change that structure. Looks like I need to send a patch that adds a comment explaning the meaning of WIRE_ATTR.
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-01-30 07:50 +0100 |
| Subject | Re: [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure |
| Message-ID | <t5dWN-EH-1@gated-at.bofh.it> |
| In reply to | #1569322 |
On Sun, Jan 29, 2017 at 11:56:38PM +0000, James Simmons wrote: > > > On Sat, 2017-01-21 at 19:40 -0500, James Simmons wrote: > > > The upstream kernel requires proper structures so > > > convert nearly all the LNet wire protocols typedefs in > > > the LNet core. > > > > Thanks. > > > > Perhaps s/\bWIRE_ATTR\b/__packed/g one day too > > I liked to keep that one. Sorry, but no. > The point of WIRE_ATTR isn't to be some abstraction but to label that > struct as something that goes over the wire. This lets people know > that it would break something if you change that structure. Looks like > I need to send a patch that adds a comment explaning the meaning of > WIRE_ATTR. No, please remove it, it's not anything that any other kernel subsystem uses. It's easy to know if you will break something, anything that crosses the user/kernel boundry falls into that category, so if it is in a uapi .h file, that's going to be the case. thanks, greg k-h
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web