From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net 2/2] net/sched: cls_flower: Use masked key when calling HW offloads Date: Thu, 15 Dec 2016 15:59:31 +0100 Message-ID: <20161215145931.GA1807@nanopsycho.orion> References: <1481734858-37474-1-git-send-email-paulb@mellanox.com> <1481734858-37474-3-git-send-email-paulb@mellanox.com> <20161215135043.GA7104@penelope.horms.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paul Blakey , "David S. Miller" , netdev@vger.kernel.org, Jiri Pirko , Or Gerlitz , Roi Dayan , Shahar Klein , Hadar Hen Zion To: Simon Horman Return-path: Received: from mail-wj0-f195.google.com ([209.85.210.195]:33513 "EHLO mail-wj0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094AbcLOO7f (ORCPT ); Thu, 15 Dec 2016 09:59:35 -0500 Received: by mail-wj0-f195.google.com with SMTP id kp2so10204359wjc.0 for ; Thu, 15 Dec 2016 06:59:34 -0800 (PST) Content-Disposition: inline In-Reply-To: <20161215135043.GA7104@penelope.horms.nl> Sender: netdev-owner@vger.kernel.org List-ID: Thu, Dec 15, 2016 at 02:50:44PM CET, simon.horman@netronome.com wrote: >Hi Paul, > >On Wed, Dec 14, 2016 at 07:00:58PM +0200, Paul Blakey wrote: >> Zero bits on the mask signify a "don't care" on the corresponding bits >> in key. Some HWs require those bits on the key to be zero. Since these >> bits are masked anyway, it's okay to provide the masked key to all >> drivers. >> >> Fixes: 5b33f48842fa ('net/flower: Introduce hardware offload support') >> Signed-off-by: Paul Blakey >> Reviewed-by: Roi Dayan >> Acked-by: Jiri Pirko > >While I don't have a specific use case in mind that this change would break >it seems to me that it would be better to handle hardware requirements >at the driver level. Even though, makes no sense to pass unmasked key down. Is is only confusing. This patch fixes it. > >> --- >> net/sched/cls_flower.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c >> index 9758f5a..35ac28d 100644 >> --- a/net/sched/cls_flower.c >> +++ b/net/sched/cls_flower.c >> @@ -252,7 +252,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, >> offload.cookie = (unsigned long)f; >> offload.dissector = dissector; >> offload.mask = mask; >> - offload.key = &f->key; >> + offload.key = &f->mkey; >> offload.exts = &f->exts; >> >> tc->type = TC_SETUP_CLSFLOWER; >> -- >> 1.8.3.1 >>