On 20/11/2026 18:19, David Marchand wrote:
External email: Use caution opening links or attachments
Hello Eli,
On Sun, 8 Nov 2026 at 17:24, Eli Britstein <[email protected]> wrote:
- any physical level informations (status, speed, duplex etc...) for
the representors should be the same as the ESW manager port.
This removes the need for a specialised watchdog thread (only
monitoring the ESW manager port in netdev-dpdk.c should be enough).
Representors must also start as they can have their own link status for
example.
Though not trivial in a standard configuration, there is another
configuration in which it's more natural to see it:
This configuration is MPESW (Multi-Port ESW). In such configuration, the
uplinks of the card (e.g. p0,p1) become part of the same ESW. In such
case, p0 is still the ESW port, while p1 is a representor of it.
Then, as it is a physical device, it's easy to see it can have its own
link status.
I am not familiar with such setups, but from what I understand, it is
problematic with my proposal.
Ok, so we must have a 1:1 relation.
It seems we may as well embed the eth port in the doca object directly:
struct netdev_doca {
PADDED_MEMBERS(CACHE_LINE_SIZE,
atomic_bool started;
struct netdev_doca_tx_stats *sw_tx_stats;
/* No datapath fields below for this block. */
struct doca_flow_port *port;
struct netdev_doca_esw_ctx *esw_ctx;
char *devargs;
bool is_representor;
);
struct netdev_dpdk_eth eth;
/* No datapath fields below for the rest of the structure. */
/* In doca_list. */
struct ovs_list list_node;
struct doca_flow_pipe_entry *rss_entries[NETDEV_DOCA_RSS_NUM_ENTRIES];
struct doca_flow_pipe_entry *egress_entry;
struct doca_dev_rep *dev_rep;
};
Ack. Yes, it makes it simpler and no need for the deferred netdev_close
anymore.
Note: op_state looks like a dead field in netdev_doca_esw_ctx, in your
current DOCA branch,
Correct. It's a leftover from live upgrade support we have in our
downstream version. Removed.
It can also happen for "regular" representors.
?
Not sure what "regular" means here.
I mean "standard" VF/SF, not p1 in MPESW mode.
I enhanced your approach with the shadow dpdk port for representors as
well. For that, I needed to allow zero-queues dpdk ports.
The doca code no longer handles the probe/close of the dpdk port. It
generates the devargs and handed over to the shadow dpdk port.
Regarding the closure of it, it cannot work as you wrote it. The issue
is that calling "netdev_close(shadow)" is not allowed inside
netdev_doca_destruct. The reason is that we are under netdev_mutex,
which is not recursive. If calling it there, we assert.
Ah yes, an oversight on my side... sorry about that.
This idea was an implementation detail, I am not stuck on the use of netdev API.
The only specific ops seem to be netdev_doca_class_init,
netdev_doca_alloc/dealloc, netdev_doca_construct/destruct,
netdev_doca_get_config/set_config/reconfigure,
netdev_doca_send/rxq_recv, netdev_doca_get_stats/get_custom_stats.
All the netdev_dpdk_eth ops can be exported in netdev-dpdk-eth.h, and
reused in netdev-doca.c.
This is simpler than adding the deferred start/stop framework.
Yes, with few exceptions.
- get_speed, get_link etc use port_id. when checking a stopped port (if
we remove the esw but reps still attached) it emits a dpdk error. with a
small guard in netdev-dpdk, it will be ok.
- reconfigure needs some extra small refactor in netdev-dpdk to query if
a real reconfigure is needed (value changed), otherwise, doca port may
re-start for nothing.
- some special handling of "no_queues".
The doca_list fate is not clear to me.
It seems like it could move as a per ESW manager list... (at least, it
would be manipulated under this device mutex?), but I did not
investigate more.
Yes, we can.
- Rx and Tx is just a matter of calling netdev-dpdk code with the ESW
manager DPDK netdev.
I tried the approach of exporting just those helpers in a new
netdev-dpdk-eth.h header, which seems enough.
After more digging with my AI colleague, I reached a point where I am
not sure the doca representors have to care about the DPDK mempool
reference at all.
You are right. I'll fix it.
With the "no_queue" concept, for a representor DPDK eth object, the
mempool setup and txq allocations are just wasted resources.
(I noticed common->buf_size field... which is dead code since day 0, I
could squash this in my preparation series).
Sure, please.
netdev_doca_send then calls both common_send (where the mempool is
needed for converting non DPDK dp-packets into mbufs) and eth_tx_burst
for the esw manager DPDK common/eth object.
And all that is left to netdev_doca_send is to maintain the sw stats after this.
- (based on some AI investigation on this branch code) statistics are
suspicious.
I spotted a few oddities around Rx/Tx packets/bytes at the ESW
manager / representor ring level, drop counters, and most of them are
not reported through netdev API (?).
Some stats look simply copied from netdev-dpdk without any code touching
them.
The (ESW manager port) HW xstats are not reported.
Ack. I reworked the stats area. All the NIC stats (also xstats) are
relevant only for the ESW. I removed them from representors and added
"hw_" prefix for them, shown only for the ESW port.
Yes, ok for me.
- usage of coverage counters in the Rx/Tx code will make this hard to
debug, I would turn them into interface OVS stats.
I assume you mean netdev_doca_rx_drop_xxx ones. Those coverage counters
should never increase. It is just a way to see if that "couldn't happen"
situation indeed doesn't happen. I prefer not to report them as regular
netdev statistics and leave them as coverage ones.
Ack.
- there is still one open question for me, should we make sure
netdev-doca.c and netdev-dpdk.c don't collide in mid air?
Like a developer switching from one configuration type to the other
(especially on the ESW manager topic).
I don't understand your meaning for this. How can they "collide"?
My concern is for developers, or during a live debugging session and
you want to switch from a netdev_dpdk to a netdev_doca configuration,
or vice versa.
Depending on your blood level of caffeine (or lack of), you may end up
with some netdev_doca port *and* some netdev_dpdk port accessing the
same DPDK port / hw resources.
This is where I suspect we need some guard.
Switching is OK. need to change all the ports (ESW and reps) to the same
target mode.
If we try to use both, netdev-dpdk already guards it by "already in use by".
What is the next step? do you want to send an updated version of your
series for me to rebase?
Then, I can address the remaining comments and post it either as a draft
branch for preliminary review or as v7.
Thanks, Eli
--
David Marchand
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev