From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f169.google.com ([209.85.192.169]:40282 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbeCWN2P (ORCPT ); Fri, 23 Mar 2018 09:28:15 -0400 Received: by mail-pf0-f169.google.com with SMTP id v66so2236075pfv.7 for ; Fri, 23 Mar 2018 06:28:15 -0700 (PDT) Subject: Re: [bpf-next V5 PATCH 11/15] page_pool: refurbish version of page_pool code To: Jesper Dangaard Brouer , netdev@vger.kernel.org, =?UTF-8?B?QmrDtnJuVMO2cGVs?= , magnus.karlsson@intel.com Cc: eugenia@mellanox.com, Jason Wang , John Fastabend , Eran Ben Elisha , Saeed Mahameed , galp@mellanox.com, Daniel Borkmann , Alexei Starovoitov , Tariq Toukan References: <152180742196.20167.5168801400337773178.stgit@firesoul> <152180753479.20167.856688163861554435.stgit@firesoul> From: Eric Dumazet Message-ID: <7c1a98ab-3bc3-d99a-9ad0-456911b5b54c@gmail.com> Date: Fri, 23 Mar 2018 06:28:13 -0700 MIME-Version: 1.0 In-Reply-To: <152180753479.20167.856688163861554435.stgit@firesoul> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 03/23/2018 05:18 AM, Jesper Dangaard Brouer wrote: > + > + /* Note, below struct compat code was primarily needed when > + * page_pool code lived under MM-tree control, given mmots and > + * net-next trees progress in very different rates. > + * > + * Allow kernel devel trees and driver to progress at different rates > + */ > + param_copy_sz = PAGE_POOL_PARAMS_SIZE; > + memset(&pool->p, 0, param_copy_sz); > + if (params->size < param_copy_sz) { > + /* Older module calling newer kernel, handled by only > + * copying supplied size, and keep remaining params zero > + */ > + param_copy_sz = params->size; > + } else if (params->size > param_copy_sz) { > + /* Newer module calling older kernel. Need to validate > + * no new features were requested. > + */ > + unsigned char *addr = (unsigned char *)params + param_copy_sz; > + unsigned char *end = (unsigned char *)params + params->size; > + > + for (; addr < end; addr++) { > + if (*addr != 0) > + return -E2BIG; > + } > + } I do not see the need for this part.