DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@ovn.org>
To: Shahaf Shuler <shahafs@mellanox.com>,
	Ilya Maximets <i.maximets@ovn.org>,
	 Thomas Monjalon <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob <jerinjacobk@gmail.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Roni Bar Yanai <roniba@mellanox.com>,
	Rony Efraim <ronye@mellanox.com>,
	"declan.doherty@intel.com" <declan.doherty@intel.com>,
	"bernard.iremonger@intel.com" <bernard.iremonger@intel.com>,
	"ajit.khaparde@broadcom.com" <ajit.khaparde@broadcom.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 0/3] ethdev: configure SR-IOV VF from host
Date: Mon, 4 Nov 2019 11:28:08 +0100	[thread overview]
Message-ID: <0fce7109-39da-1256-ba64-6b1291a8acbd@ovn.org> (raw)
In-Reply-To: <AM0PR0502MB379513980449E61C6C08A684C37C0@AM0PR0502MB3795.eurprd05.prod.outlook.com>

On 03.11.2019 7:48, Shahaf Shuler wrote:
> Friday, November 1, 2019 11:33 AM, Ilya Maximets:
>> Subject: Re: [dpdk-dev] [PATCH v2 0/3] ethdev: configure SR-IOV VF from
>> host
>>
>> On 30.10.2019 22:42, Thomas Monjalon wrote:
>>> 30/10/2019 17:09, Ilya Maximets:
>>>> On 30.10.2019 16:49, Thomas Monjalon wrote:
>>>>> 30/10/2019 16:07, Ilya Maximets:
>>>>>> On 29.10.2019 19:50, Thomas Monjalon wrote:
>>>>>>> In a virtual environment, the network controller may have to
>>>>>>> configure some SR-IOV VF parameters for security reasons.
>>>>>>>
> [...]
> 
>>> If we consider what Intel did, i.e. configure VF in place of
>>> representor for some operations, there are two drawbacks:
>>> - confusing that some ops apply to representor, others apply to VF
>>> - some ops are not possible on representor (because targetted to VF)
>>>
>>> I still feel that the addition of one single bit in the port ID is an
>>> elegant solution to target either the VF or its representor.
>>
>> Since we already have a confusion about what is configured when operations
>> are performed on a representor port we have 2 options:
> 
> I don't agree we have. I don't think there is any design note or API doc that says the ethdev configuration on representor should be applied on VF (please share if I missed it).
> The fact that there are some drivers that implemented it doesn't mean it is correct.
> 
>> 1. Have this proposed API to configure representor itself while
>>      setting config to representor and configuring VF if special
>>      bit enabled.
>> 2. Reverse the logic of current proposal, i.e. always apply
>>      configuration to VF while working with representor and apply
>>      configuration to representor itself if special bit is set.
>>
>> I'd probably prefer option #2, because:
>> - From the OVS and OpenStack point of view, I think, we don't
>>     really need to configure representor itself in most cases.
>>     And OVS really should not know if it works with representor
>>     or some real port.
> 
> I don't thinks OVS can be really agnostic to the fact it runs on top of representors:
> 1. probing of representor has different command line -w <bdf>,representor=XXX

OVS doesn't care about content of devargs. It just passes them to hotplug
engine without any parsing (except a single case that must be eliminated
with a proper device iterators, not an OVS issue).

> 2. the whole acceleration framework based on insertion of flow rules for direct forward from the VF to target entity. Rules are applied on the representor and would not work if port is not such.

OVS tries to offload rules to the netdev from which packet was received.
That's it.  If it succeeds - OK.  If not, OVS doesn't care.

> 3. some multi-port devices cannot do direct fwd between its different port. This is why rep has switch_id and application should query it and act upon.

This is part of offloading engine that doesn't affect the generic code.
If needed, OVS could request switch_id for netdev it tries to offload rules on.
OVS should not know if it representor port or not. If this operation will not
succeed for non-representors, OVS should not care because we can't offload
anything for non-representors anyway.

> 4. representor carry the VF port id. This is how application know to which VF (or vport) they associated with on their other side.

This is just part of devargs, i.e. part of device unique identifier.
Once again, OVS doesn't parse devargs and should not do that.

> 
>> - It seems that most of the existing code in DPDK already works
>>     like this, i.e. applying configs to VF itself.  Intel drivers
>>     works like this and  Mellanox drivers, as Thomas said, doesn't
>>     have this functionality at all.
> 
> As I said above, I don't think we need to refer to specific driver behavior, rather the API guidelines.
> To me, it is a bit strange and not natural that ethdev configuration is applied to different port w/o any explicit request from the application.
> This is why I would prefer #1 above.

IMHO, the whole concept of representors is that representor is a
way of attaching same port both to VM and vSwitch/hypervisor.

If you're looking at representors as a separate ports on a switch, well..
In this case, for me VF configuration looks like something that
vSwitch should not do at all, because it should not configure ports
that doesn't attached to it.  It's like configuring the other
side of veth pair, which is nonsense.


BTW, I don't know a way to find out if port is a representor of something
or not in Linux kernel.

> 
>>
>>>
>>>
>>>>>> The this is that this new API will produce conceptual fragmentation
>>>>>> between DPDK and the Linux kernel, because to do the same thing
>>>>>> you'll have to use different ways. I mean, to change mac of VF in
>>>>>> kernel you need to set mac to the representor, but in DPDK changing
>>>>>> setting mac to representor will lead to changing the mac of the
>>>>>> representor itself, not the VF. This will be really confusing for users.
>>>>>
>>>>> I am not responsible of the choices in Linux.
>>>>> But I agree it would be interesting to check the reason of such decision.
>>>>> Rony, please could you explain?
>>>
>>> I looked at few Linux drivers:
>>>
>>> 	bnxt_vf_rep_netdev_ops has no op to set MAC
>>> 	bnxt_netdev_ops.ndo_set_vf_mac = set VF MAC from PF
>>>
>>> 	lio_vf_rep_ndev_ops has no op to set MAC
>>> 	lionetdevops.ndo_set_vf_mac = set VF MAC from PF
>>>
>>> 	mlx5e_netdev_ops_rep has no op to set MAC
>>> 	mlx5e_netdev_ops.ndo_set_vf_mac = set VF MAC from PF
>>> 	mlx5e_netdev_ops_uplink_rep.ndo_set_vf_mac = set VF MAC from
>> PF
>>>
>>> 	nfp_repr_netdev_ops.ndo_set_mac_address = set representor
>> MAC
>>> 	nfp_repr_netdev_ops.ndo_set_vf_mac = set VF MAC from
>> representor
>>> 	nfp_net_netdev_ops.ndo_set_vf_mac = set VF MAC from PF
>>>
>>> There is a big chance that the behaviour is not standardized in Linux
>>> (as usual). So it is already confusing for users of Linux.
>>>
>>>

  parent reply	other threads:[~2019-11-04 10:28 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 15:06 [dpdk-dev] [RFC] " Thomas Monjalon
2019-08-15 15:34 ` Jerin Jacob Kollanukkaran
2019-08-15 17:59   ` Thomas Monjalon
2019-08-29 15:02 ` Iremonger, Bernard
2019-09-04  8:23   ` Thomas Monjalon
2019-10-29 18:50 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
2019-10-29 18:50   ` [dpdk-dev] [PATCH v2 1/3] ethdev: identify " Thomas Monjalon
2019-10-29 18:50   ` [dpdk-dev] [PATCH v2 2/3] ethdev: set VF MAC address " Thomas Monjalon
2019-11-01  0:18     ` [dpdk-dev] [RFC PATCH] net/i[xgb|40]e: " Thomas Monjalon
2019-10-29 18:50   ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: " Thomas Monjalon
2019-10-30  4:08   ` [dpdk-dev] [PATCH v2 0/3] ethdev: configure SR-IOV VF " Jerin Jacob
2019-10-30  7:22     ` Shahaf Shuler
2019-10-30  9:24       ` Jerin Jacob
2019-11-01  0:24         ` Thomas Monjalon
2019-11-01  9:06           ` Ilya Maximets
2019-11-01  9:56             ` Ilya Maximets
2019-10-30  8:56     ` Thomas Monjalon
2019-10-30  9:15       ` Jerin Jacob
2019-11-01  0:33         ` Thomas Monjalon
2019-11-01 11:01           ` Jerin Jacob
2019-11-01 13:25           ` Jerin Jacob
2019-11-03  6:31             ` Shahaf Shuler
2019-10-30 15:07   ` Ilya Maximets
2019-10-30 15:49     ` Thomas Monjalon
2019-10-30 16:09       ` Ilya Maximets
2019-10-30 21:42         ` Thomas Monjalon
2019-11-01  9:32           ` Ilya Maximets
2019-11-03  6:48             ` Shahaf Shuler
2019-11-03 15:27               ` Ananyev, Konstantin
2019-11-03 22:09                 ` Thomas Monjalon
2019-11-07 14:44                   ` Thomas Monjalon
2019-11-04 10:28               ` Ilya Maximets [this message]
2019-11-04 14:30                 ` Asaf Penso
2019-11-04 14:58                   ` Ilya Maximets
2019-11-04 20:33                 ` Shahaf Shuler
2019-11-05 12:15                   ` Ilya Maximets

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0fce7109-39da-1256-ba64-6b1291a8acbd@ovn.org \
    --to=i.maximets@ovn.org \
    --cc=ajit.khaparde@broadcom.com \
    --cc=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinjacobk@gmail.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=roniba@mellanox.com \
    --cc=ronye@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).