public inbox for linux-x25@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Martin Schiller' <ms@dev.tdt.de>,
	"andrew.hendry@gmail.com" <andrew.hendry@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"xie.he.0141@gmail.com" <xie.he.0141@gmail.com>
Cc: "linux-x25@vger.kernel.org" <linux-x25@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH net-next v2 2/6] net/x25: make neighbour params configurable
Date: Mon, 16 Nov 2020 17:05:22 +0000	[thread overview]
Message-ID: <5d4faa10de734ba0af7a471b0eadd782@AcuMS.aculab.com> (raw)
In-Reply-To: <20201116135522.21791-3-ms@dev.tdt.de>

From: Martin Schiller
> Sent: 16 November 2020 13:55
> Extended struct x25_neigh and x25_subscrip_struct to configure following
> params through SIOCX25SSUBSCRIP:
>   o mode (DTE/DCE)
>   o number of channels
>   o facilities (packet size, window size)
>   o timer T20
> 
> Based on this configuration options the following changes/extensions
> where made:
>   o DTE/DCE handling to select the next lc (DCE=from bottom / DTE=from
>     top)
>   o DTE/DCE handling to set correct clear/reset/restart cause
>   o take default facilities from neighbour settings
> 
...
> +/*
> + *	DTE/DCE subscription options.
> + *
> + *      As this is missing lots of options, user should expect major
> + *	changes of this structure in 2.5.x which might break compatibility.

A little out of date!

> + *      The somewhat ugly dimension 200-sizeof() is needed to maintain
> + *	backward compatibility.
> + */
> +struct x25_subscrip_struct {
> +	char device[200 - ((2 * sizeof(unsigned long)) +
> +		    sizeof(struct x25_facilities) +
> +		    (2 * sizeof(unsigned int)))];
> +	unsigned int		dce;
> +	unsigned int		lc;
> +	struct x25_facilities	facilities;
> +	unsigned long		t20;
> +	unsigned long		global_facil_mask;	/* 0 to disable negotiation */
> +	unsigned int		extended;
> +};

Would it be better to used fixed size integer types to avoid
'compat_32' issues?

It might even be worth adding padding after the existing
32bit layout to align any additional fields at the same offset
in both 64bit and 32bit systems.

I was also wondering if you can use an anonymous structure
member for the actual fields and then use 200 - sizeof (struct foo)
for the pad?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-11-16 17:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 13:55 [PATCH net-next v2 0/6] netdev event handling + neighbour config Martin Schiller
2020-11-16 13:55 ` [PATCH net-next v2 1/6] net/x25: handle additional netdev events Martin Schiller
2020-11-16 13:55 ` [PATCH net-next v2 2/6] net/x25: make neighbour params configurable Martin Schiller
2020-11-16 17:05   ` David Laight [this message]
2020-11-16 13:55 ` [PATCH net-next v2 3/6] net/x25: replace x25_kill_by_device with x25_kill_by_neigh Martin Schiller
2020-11-17 19:50   ` Xie He
2020-11-18  8:28     ` Martin Schiller
2020-11-16 13:55 ` [PATCH net-next v2 4/6] net/x25: support NETDEV_CHANGE notifier Martin Schiller
2020-11-17 11:41   ` Xie He
2020-11-17 12:30     ` Martin Schiller
2020-11-16 13:55 ` [PATCH net-next v2 5/6] net/lapb: support netdev events Martin Schiller
2020-11-16 20:16   ` Xie He
2020-11-17  9:52     ` Martin Schiller
2020-11-17 11:32       ` Xie He
2020-11-17 13:26         ` Martin Schiller
2020-11-17 18:28           ` Xie He
2020-11-18  8:49             ` Martin Schiller
2020-11-18 13:03               ` Xie He
2020-11-18 13:46                 ` Xie He
2020-11-18 13:57                   ` Martin Schiller
2020-11-16 13:55 ` [PATCH net-next v2 6/6] net/lapb: fix t1 timer handling Martin Schiller

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=5d4faa10de734ba0af7a471b0eadd782@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=andrew.hendry@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-x25@vger.kernel.org \
    --cc=ms@dev.tdt.de \
    --cc=netdev@vger.kernel.org \
    --cc=xie.he.0141@gmail.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