Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2329864pja; Thu, 26 Mar 2020 13:22:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsPYYchhS8PSM8qA6W7LU0eBboJ+vp0um+w5aiZT+itqRpiN3jaLLwpbmK36c37rEvUZvzh X-Received: by 2002:a9d:bf7:: with SMTP id 110mr8220323oth.259.1585254162723; Thu, 26 Mar 2020 13:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585254162; cv=none; d=google.com; s=arc-20160816; b=zYkNRj0PrLNrDQ2Z1NPzvlzscf5nFVE6leZcfK7J7alSsBOgBRJ2LCQod0/mgz0yMj UIjSwers7IGJJbjEtiDzsTLaw7o0v/nYW0TiTnRseiJzgAnWf3pcpSDBK74K+7ptPL5K iQpIc5IQa3BN9w9GXbAEPnUVWw0A4RYaE8v5+EsO/dJYrvl8roBLMl6b/Uwc6FiN8+kc O3R02gV2LZR6iCb8ceOLS4rlA1mdTft8Z8hh0D4DQUKHgAMIHMionGB/fOD7ONeHwC/V exyKVLRfXxqrqHTdXK3pVM5WQTMUsE6kE95YHzwz1J0NWEpZJ3xbt2lDJ2oWBL8pmkgb S7Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ve/X6nHv2D9AeZXHvnlLIPat8X+ApJ24OWPwiA11jpg=; b=TI1WnM0xrS09Zk408e/lYz8kSUvh1lY1j9OhmOM7uhVUT9N7hFdNjqlzK9aJuK2rfO X1InfVS0ZAHI4Y0rMC2/xIBLMbOiF5yEPTLVDF23bLThxJVV09Sn8adV4ifOnqGMUgD3 ft2GPo/UAL0T9fl/hQD+qt0njUEy9jv1HrPC4BRvajar1Jh3/1vyfOhnbXEUqkczKSLj Fn+5Rq+b02ByCVKg/Opi59rRPzu7D4dNg4HLryrdbiSFFQUMV1SXjwY7dKneIKDvUlhy NNyYI26CE7lfmyHMj/Kf9Yit9vlwN1NBmt4oi/hS1XBMxTJ3KmjcahvLOlRkeTF987s0 e8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eTMbaAy1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p126si1508005oib.73.2020.03.26.13.22.29; Thu, 26 Mar 2020 13:22:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eTMbaAy1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727879AbgCZUWD (ORCPT + 99 others); Thu, 26 Mar 2020 16:22:03 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:38080 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbgCZUWD (ORCPT ); Thu, 26 Mar 2020 16:22:03 -0400 Received: by mail-io1-f66.google.com with SMTP id m15so7541946iob.5 for ; Thu, 26 Mar 2020 13:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ve/X6nHv2D9AeZXHvnlLIPat8X+ApJ24OWPwiA11jpg=; b=eTMbaAy1ljXYsDh1ZmCCkUFh2WC7cuyf1r/HQ4XcoH5XIXxgjWcj8fiGwrpaPWQsPO Qg5ks7UOdihafX2mNEKfYyoH/uMfHXDwvOreiDYiBcm5inEw/6Ec4qFbUWHjRr3rg7ko 2DmPAxoedazshDdluWxYv/5V+QV5qa8sawJiSm7NJFgQE+dkUGR9JhA0qETScS+sam7E eztiXVUs00b93SomNzbbtJpNS5qgR/dlsN6KLWpx2WOLQntljV/lR+36hJERuI7Ukcb+ uN15b6H7s+Dun+rTOG3KuU/bgDNgh8GEKp/2/6ejdCCHhbKdeu7WGxxB0p8uqsOcv7Ko kX6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ve/X6nHv2D9AeZXHvnlLIPat8X+ApJ24OWPwiA11jpg=; b=C4J5lHIxaE/nXfzkDgQ/D1vcFsjOXbR0E6eOqVjmWEtiHMJI9ouED6BurU2KH0Ca7Y n8IRhoLLLYRobpe9HjUb9nVZ92dJmEpEW5yGI407u6tSHEnF78UYbpvgFrjndZNA6E25 d0bkVL/1mCKbeqmqow7OXQvsou5yAiHt/stY4xO8yMw9MC14nu2JEiI5MjO1/AWLziU/ 4eiKTNXzjiuhljJDt/UEo+Z+tRmokhokA9HUCHxmkE8whlCnbNvnOYr1v2pl8UjehaFK 3TpVRfDG1hD8losbX4pKXnUxq9DDYBgpuMLYK4QLC4ddKQ6kmD0G3K+w11FYwZsjVaP+ NkwQ== X-Gm-Message-State: ANhLgQ35LnU1yM1kAyzp/a0QhWGXvUP+p0f9+AeU4IsdQElMGncQfAPh STYgYKpXZpKDMnzy0F2vBi+rYZXfRQBTenH4cjrRmw== X-Received: by 2002:a6b:8ed7:: with SMTP id q206mr9378070iod.148.1585254122300; Thu, 26 Mar 2020 13:22:02 -0700 (PDT) MIME-Version: 1.0 References: <20200310155058.1607-1-mathieu.poirier@linaro.org> <591bd727-32af-9ea2-8c46-98f46ee3711e@ti.com> In-Reply-To: <591bd727-32af-9ea2-8c46-98f46ee3711e@ti.com> From: Mathieu Poirier Date: Thu, 26 Mar 2020 14:21:51 -0600 Message-ID: Subject: Re: [PATCH v2] rpmsg: core: Add wildcard match for name service To: Suman Anna Cc: Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Mar 2020 at 09:06, Suman Anna wrote: > > Hi Mathieu, > > On 3/10/20 10:50 AM, Mathieu Poirier wrote: > > Adding the capability to supplement the base definition published > > by an rpmsg_driver with a postfix description so that it is possible > > for several entity to use the same service. > > > > Signed-off-by: Mathieu Poirier > > Acked-by: Arnaud Pouliquen > > So, the concern I have here is that we are retrofitting this into the > existing 32-byte name field, and the question is if it is going to be > enough in general. That's the reason I went with the additional 32-byte > field with the "rpmsg: add a description field" patch. > That's a valid concern. Did you consider increasing the size of RPMSG_NAME_SIZE to 64? Have you found cases where that wouldn't work? I did a survey of all the places the #define is used and all destination buffers are also using the same #define in their definition. It would also be backward compatible with firmware implementations that use 32 byte. Thanks, Mathieu > regards > Suman > > > --- > > Changes for V2: > > - Added Arnaud's Acked-by. > > - Rebased to latest rproc-next. > > > > drivers/rpmsg/rpmsg_core.c | 20 +++++++++++++++++++- > > 1 file changed, 19 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c > > index e330ec4dfc33..bfd25978fa35 100644 > > --- a/drivers/rpmsg/rpmsg_core.c > > +++ b/drivers/rpmsg/rpmsg_core.c > > @@ -399,7 +399,25 @@ ATTRIBUTE_GROUPS(rpmsg_dev); > > static inline int rpmsg_id_match(const struct rpmsg_device *rpdev, > > const struct rpmsg_device_id *id) > > { > > - return strncmp(id->name, rpdev->id.name, RPMSG_NAME_SIZE) == 0; > > + size_t len = min_t(size_t, strlen(id->name), RPMSG_NAME_SIZE); > > + > > + /* > > + * Allow for wildcard matches. For example if rpmsg_driver::id_table > > + * is: > > + * > > + * static struct rpmsg_device_id rpmsg_driver_sample_id_table[] = { > > + * { .name = "rpmsg-client-sample" }, > > + * { }, > > + * } > > + * > > + * Then it is possible to support "rpmsg-client-sample*", i.e: > > + * rpmsg-client-sample > > + * rpmsg-client-sample_instance0 > > + * rpmsg-client-sample_instance1 > > + * ... > > + * rpmsg-client-sample_instanceX > > + */ > > + return strncmp(id->name, rpdev->id.name, len) == 0; > > } > > > > /* match rpmsg channel and rpmsg driver */ > > >