Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1831374ybb; Thu, 26 Mar 2020 08:07:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvXWRKj32tYYr3NuZ64wnZuzTUMDT/uyInSYk1gaWxFPTkmWRlXjGkblSyCQfEzWaaBmFtJ X-Received: by 2002:a9d:5cc8:: with SMTP id r8mr5532466oti.18.1585235249274; Thu, 26 Mar 2020 08:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585235249; cv=none; d=google.com; s=arc-20160816; b=t5Uc2VxBBwXHpJGd+JNXWyIc51dwOSxS1dJ7y6zVh1uEP/s3f/ZzI/4sMX69+HCioW ZHUz+Ltk6azVm4+/GXEezrhspHZ/6Iq1SzN5oIPEHkjIMtEoIQi4kOEfHw3YxNvEZHSo Svq5SWf2conyi3da6ZlJKcOeD51TS7PVFQpYLYq+p9cVPd+Nyy4YXvaGwTdwg2k2I4cB ZYPzGH0jl84SohcCJoCVD80nn+AWYi3vqtKOODhkHgbgxXH0tUsm9nPtZFCMc0/s8zFz whZ+Dh5lpqIA2z5vp4QZjvRsN8PNAKo0GEyhsnZva6jlt4DPhUi8bygVX3YYfsoRZ54x 3jbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=MmFd+DXKFRMpZ1XzlUCpSBRoS7PDwSRJ43e7v69uh0s=; b=QKZP4DczDLuAAGl74M03qruPwgmMHQwfInLyxTSyX2OOzd8oQ/4gXIwJy5oYYRsPY4 RvDN70p5/P5JbpfCROFLsCI5NB2LnCHy8QhN5pkQn8B9vlnDWXFqI236aJGG0C4caFdJ gUjXgPgqBuEKjC2H7sG7CLtMSKXuQTODOSxhMHlAGLfpolwTic1piIQVx8VhdYIE/Hx6 cZfOzlFZ2JIszk2tEBSc6LNgjI06+YATmSItT4E0Vq2vRokrhJX3A2rB9Cs6q2kxu94X 0uDilfFgdJJY4voiM8rh/perQJz6I+CvfrK0jYTnrpAWx/5BnfIFDdch2klNYQg/fz2I Lblg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="bDJG/vp2"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g144si1024363oib.40.2020.03.26.08.06.59; Thu, 26 Mar 2020 08:07:29 -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=@ti.com header.s=ti-com-17Q1 header.b="bDJG/vp2"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727560AbgCZPGM (ORCPT + 99 others); Thu, 26 Mar 2020 11:06:12 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:43332 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbgCZPGM (ORCPT ); Thu, 26 Mar 2020 11:06:12 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 02QF6ATD023766; Thu, 26 Mar 2020 10:06:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1585235170; bh=MmFd+DXKFRMpZ1XzlUCpSBRoS7PDwSRJ43e7v69uh0s=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=bDJG/vp2MI5bO0O9tgpi+P/jrYhVI/1caHK++/s+MdlUO+J7gcZEEVk8C5lWv2nze 9u3mLzLWgY+6R/BTEAAIcjSgIqqTC4Ovf+Rwf9JUmk5zhPZzrDaZAGa1njZiVxXqRX Xxa8FxufLqTj4ZEnCa+hmg7mRmqfFO2Wz5CLWwA8= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 02QF6AMQ105313 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 26 Mar 2020 10:06:10 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 26 Mar 2020 10:06:10 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 26 Mar 2020 10:06:10 -0500 Received: from [10.250.86.212] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 02QF690R128137; Thu, 26 Mar 2020 10:06:09 -0500 Subject: Re: [PATCH v2] rpmsg: core: Add wildcard match for name service To: Mathieu Poirier , , CC: , References: <20200310155058.1607-1-mathieu.poirier@linaro.org> From: Suman Anna Message-ID: <591bd727-32af-9ea2-8c46-98f46ee3711e@ti.com> Date: Thu, 26 Mar 2020 10:06:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20200310155058.1607-1-mathieu.poirier@linaro.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 */ >