[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4] public/io/netif.h: add a new extra type for XDP


  • To: Denis Kirjanov <kda@xxxxxxxxxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Fri, 22 May 2020 10:10:13 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z81P0w2E9rPDUXDKcF8PG7ztBVmG5KoTvDdoezk8nW0=; b=Z31QwQIqLm4yG2JZT7MRfrdRV1ZTzgpPf+0UV2dJzGpcU1NfiwWtn1VCfatzNYPLuS7PJKKSTuaHEbCyq7/6WO5cM2ry818qeuG5oChfbmd7c3XC7kJeNyCHKWOAqrWWbwxISmQ4aZifP8E1X09HovhBhz4h1zuCIoeODgTxbcEVqfcSnU3fPgMLZvgFhYRdQkXETA7VVP8Kev5LXXflmql8gExggnkc4+CZEIvgsOa8xx1S+aYyIJcd0kFzAPZDatkQOPKd7SPcfK8TNt/tccrhJ9fuEarrcRMEYWgjlPQ+Flvzj6J0g4g7pbgsSPauztv6hJ5ZbwGvQ0MjVAFWHQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QisDxXEcjL0FLe4iwHsxNprKObQa3cQg+djV5J9gyQIVjErRWJxG2ORnjnFP+LsfepebskpmrB0x9Wfs20MMhbJ5twFJWMFwTk1mogFEW3ac/gDN09XEeT/0P3xD5BVGaoBAiPPnq8eHIc7nRYZpR6VHSZuRxDihGOIfYeVU7yNsyDEl+9OWnmQhFM/xS4RMRWHVpmToW4hv1yzwyDCI79Br9dZcjgQ8CNAVp/yt80Qo94ccsZVB8FHErCKFHc4Dqeu1GCmDtMPCHTfZD0aw2azWyLh8AWsPQxvDkxUf0PB8oqTq00oVuTFZ20yVq9bhYvGsvKbchgdOoXNnJHsEhw==
  • Authentication-results: linux-powerpc.org; dkim=none (message not signed) header.d=none; linux-powerpc.org; dmarc=none action=none header.from=epam.com;
  • Cc: "jgross@xxxxxxxx" <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>
  • Delivery-date: Fri, 22 May 2020 10:10:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWMBiqME7497+04E6+8Omw+GVY7aiz01kAgAACZQCAAAIYAIAAClQA
  • Thread-topic: [PATCH v4] public/io/netif.h: add a new extra type for XDP

On 5/22/20 12:33 PM, Denis Kirjanov wrote:
> On 5/22/20, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx> wrote:
>> On 5/22/20 12:17 PM, Denis Kirjanov wrote:
>>> On 5/22/20, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
>>> wrote:
>>>> On 5/18/20 6:04 PM, Denis Kirjanov wrote:
>>>>> The patch adds a new extra type to be able to diffirentiate
>>>>> between RX responses on xen-netfront side with the adjusted offset
>>>>> required for XDP processing.
>>>>>
>>>>> The offset value from a guest is passed via xenstore.
>>>>>
>>>>> Signed-off-by: Denis Kirjanov <denis.kirjanov@xxxxxxxx>
>>>>> ---
>>>>> v4:
>>>>> - updated the commit and documenation
>>>>>
>>>>> v3:
>>>>> - updated the commit message
>>>>>
>>>>> v2:
>>>>> - added documentation
>>>>> - fixed padding for netif_extra_info
>>>>> ---
>>>>> ---
>>>>>     xen/include/public/io/netif.h | 18 +++++++++++++++++-
>>>>>     1 file changed, 17 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/xen/include/public/io/netif.h
>>>>> b/xen/include/public/io/netif.h
>>>>> index 9fcf91a..a92bf04 100644
>>>>> --- a/xen/include/public/io/netif.h
>>>>> +++ b/xen/include/public/io/netif.h
>>>>> @@ -161,6 +161,17 @@
>>>>>      */
>>>>>
>>>>>     /*
>>>>> + * "xdp-headroom" is used to request that extra space is added
>>>>> + * for XDP processing.  The value is measured in bytes and passed by
>>>> not sure that we should use word "bytes" here as the rest of the
>>>> protocol (mostly)
>>>>
>>>> talks about octets. It is somewhat mixed here, no strong opinion
>>> sure, but since the public header mixes it I've decided to use that word.
>>>
>>>
>>>>> + * the frontend to be consistent between both ends.
>>>>> + * If the value is greater than zero that means that
>>>>> + * an RX response is going to be passed to an XDP program for
>>>>> processing.
>>>>> + *
>>>>> + * "feature-xdp-headroom" is set to "1" by the netback side like other
>>>>> features
>>>>> + * so a guest can check if an XDP program can be processed.
>>>>> + */
>>>>> +
>>>>> +/*
>>>>>      * Control ring
>>>>>      * ============
>>>>>      *
>>>>> @@ -985,7 +996,8 @@ typedef struct netif_tx_request netif_tx_request_t;
>>>>>     #define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2)  /* u.mcast */
>>>>>     #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)  /* u.mcast */
>>>>>     #define XEN_NETIF_EXTRA_TYPE_HASH      (4)  /* u.hash */
>>>>> -#define XEN_NETIF_EXTRA_TYPE_MAX       (5)
>>>>> +#define XEN_NETIF_EXTRA_TYPE_XDP       (5)  /* u.xdp */
>>>>> +#define XEN_NETIF_EXTRA_TYPE_MAX       (6)
>>>>>
>>>>>     /* netif_extra_info_t flags. */
>>>>>     #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
>>>>> @@ -1018,6 +1030,10 @@ struct netif_extra_info {
>>>>>                 uint8_t algorithm;
>>>>>                 uint8_t value[4];
>>>>>             } hash;
>>>>> +        struct {
>>>>> +            uint16_t headroom;
>>>> why do you need "pad" field here?
>>> To state that we have a fixed size available.
>> Well, I would expect "reserved" or something in that case and "pad" in case
>>
>> there are other fields following (see gso above).
> it can be consistent with other names like pad at then end of the structure.
>
> If it really matters I can change it, no problem.
My point is that IMO it is not required at all, but this is up to 
maintainers to decide
>
>> But here I think "pad" is not required, just like mcast doesn't add any
> because it's already 6-bytes long
you are right
>
>>>>> +            uint16_t pad[2]
>>>>> +        } xdp;
>>>>>             uint16_t pad[3];
>>>>>         } u;
>>>>>     };

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.