From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Leandro Lucarella <luca@llucax.com.ar>
Cc: Jon Maloy <jon.maloy@ericsson.com>,
davem@redhat.com,
"tipc-discussion@lists.sourceforge.net"
<tipc-discussion@lists.sourceforge.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: Linux 2.6.35/TIPC 2.0 ABI breaking changes [was: TIPC 2.0 and TIPC_SUB_SERVICE]
Date: Mon, 18 Oct 2010 16:42:33 -0400 [thread overview]
Message-ID: <AANLkTimKbOreV4Fuyw3TbCrk9aa5yBZQSuRbo3Vdx=Q1@mail.gmail.com> (raw)
In-Reply-To: <20101018184628.GX8781@llucax.com.ar>
On Mon, Oct 18, 2010 at 2:46 PM, Leandro Lucarella <luca@llucax.com.ar> wrote:
> Leandro Lucarella, el 18 de octubre a las 12:04 me escribiste:
>> This means D can't be used to write code that uses TIPC if you target
>> kernels >= 2.6.35 (unless they write their own bindings, or at least use
>> a custom TIPC_SUB_SERVICE constant). I could change the TIPC_SUB_SERVICE
>> value, but then people using older kernels will be screwed. Another
>> option is to use the version statement (kind of like C's #ifdef):
>>
>> version (TIPC_2_0)
>> const TIPC_SUB_SERVICE = 0x00;
>> else
>> const TIPC_SUB_SERVICE = 0x02;
>
> I keep finding problems with this change. Another, no D-related, problem
> with this change is old code could be silently (and very subtly) broken
> if they check for TIPC_SUB_SERVICE as a flag with something like:
>
> if (s.filter & TIPC_SUB_SERVICE)
> /* do something */
>
> Because TIPC_SUB_SERVICE has changed its semantics, not just its value,
> and the new value (0x00) will give you always 0 in that test. This one
> is really tricky, because the application code will fail silently, there
> will be no dmesg indication of a failure, nor the connection to the
> topology service be closed. You might get a compiler warning if you're
> lucky.
If you have access to the user space code in question, you can just
switch behaviour semantics based on the results of a uname call, knowing
that this change was included in versions since approx last Feb. There
is also /proc/version which can be parsed manually if you prefer.
If you have kernel code/modules, you can do the same/similar things with
the KERNEL_VERSION and its support macros.
In either case, you don't have to restrict yourself to information that is
specific to and/or exported just from TIPC itself.
Hope that helps,
Paul.
>
> --
> Leandro Lucarella (AKA luca) http://llucax.com.ar/
> ----------------------------------------------------------------------
> GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
> ----------------------------------------------------------------------
> Novocaine for the soul
> you better give me something
> to fill the hole
> before I sputter out
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2010-10-18 20:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100927163823.GD2834@integratech.com.ar>
[not found] ` <29C1DC0826876849BDD9F1C67ABA2943090B67EC@ala-mail09.corp.ad.wrs.com>
[not found] ` <20100929153805.GG2834@integratech.com.ar>
[not found] ` <29C1DC0826876849BDD9F1C67ABA29430914AC18@ala-mail09.corp.ad.wrs.com>
[not found] ` <20101001150034.GS8781@llucax.com.ar>
[not found] ` <0434463FDA60A94FA978ACA44617682DEE843EDD79@EUSAACMS0702.eamcs.ericsson.se>
[not found] ` <20101001162346.GV8781@llucax.com.ar>
[not found] ` <4CA69F18.7000005@amln.net>
[not found] ` <0434463FDA60A94FA978ACA44617682DEE8446A03B@EUSAACMS0702.eamcs.ericsson.se>
2010-10-18 15:04 ` Linux 2.6.35/TIPC 2.0 ABI breaking changes [was: TIPC 2.0 and TIPC_SUB_SERVICE] Leandro Lucarella
[not found] ` <20101018150422.GV8781@llucax.com.ar>
2010-10-18 18:46 ` Leandro Lucarella
2010-10-18 20:42 ` Paul Gortmaker [this message]
2010-10-18 22:17 ` Linux 2.6.35/TIPC 2.0 ABI breaking changes David Miller
2010-10-18 23:11 ` Paul Gortmaker
2010-10-18 23:38 ` Leandro Lucarella
2010-10-18 23:45 ` Neil Horman
2010-10-19 2:16 ` Leandro Lucarella
2010-10-19 8:16 ` David Miller
2010-10-19 11:04 ` Neil Horman
2010-10-19 11:06 ` David Miller
2010-10-19 13:19 ` Leandro Lucarella
2010-10-19 13:28 ` Neil Horman
2010-10-19 20:18 ` Neil Horman
2010-10-19 20:43 ` Leandro Lucarella
2010-10-19 22:03 ` Leandro Lucarella
2010-10-20 17:20 ` Leandro Lucarella
2010-10-20 17:57 ` Jon Maloy
2010-10-20 18:04 ` Neil Horman
2010-10-20 18:10 ` Jon Maloy
2010-10-20 18:28 ` Leandro Lucarella
2010-10-20 19:23 ` Leandro Lucarella
2010-10-20 22:59 ` Leandro Lucarella
2010-10-20 18:24 ` Leandro Lucarella
2010-10-20 18:37 ` Jon Maloy
2010-10-20 18:44 ` Leandro Lucarella
2010-10-20 17:57 ` Neil Horman
2010-10-18 23:58 ` Alan Cox
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='AANLkTimKbOreV4Fuyw3TbCrk9aa5yBZQSuRbo3Vdx=Q1@mail.gmail.com' \
--to=paul.gortmaker@windriver.com \
--cc=davem@redhat.com \
--cc=jon.maloy@ericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca@llucax.com.ar \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).