[ovs-discuss] Regarding where function pointers in netdev_class/tc_ops hook to their implementations?

YoungTae Noh devbabopol at gmail.com
Fri Apr 17 14:05:59 UTC 2015


Hi Ben and all,

Again many thanks for the prompt and sincere response.

Ben, I agree with your point that I need to add my qdics (queuing
discipline) below:

static const struct tc_ops *const tcs[] = {
    &tc_ops_htb,                /* Hierarchy token bucket (see tc-htb(8)). */
    &tc_ops_hfsc,               /* Hierarchical fair service curve. */
    &tc_ops_default,            /* Default qdisc (see tc-pfifo_fast(8)). */
    &tc_ops_other,              /* Some other qdisc. */
    [adding here],
    NULL
};

Then, add implementation "net/sched/sch_my_queue.c"  and attach it as
"sch_my_queue.ko" for fast path support. (out of scope for this
mailing list)

I also confirmed that communications between netdev-linux and linux
kernel (e.g., Ubuntu qdisc in my setting) are done by socket
communications (i.e., sendmsg & recvmsg) as a/multiple transactions
(e.g., nl_sock_transact_multiple__ in lib/netlink-socket.c file) I
think this suffice my original query. Please feel free to add your
thoughts/comments.

Thank you again and have a nice weekend!
YoungTae



On Thu, Apr 16, 2015 at 11:34 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Wed, Apr 15, 2015 at 09:26:29PM -0400, YoungTae Noh wrote:
>> Hi Ben and all,
>>
>> Thank you for the quick turnaround. I believe my previous explanation
>> was not very clear.
>>
>> Here is my objective:
>> >> I would like to implement/manipulate queueing priority (possibly multiple queues per port in a shared memory) by user-definition.
>>
>> Please correct me if my understanding/approach is wrong.
>> To realize this - control this type of queue from OVS cmd (or controller),
>> 1. I need add expression for this type of queue in ovs-vsctl cmd (or
>> ovsdb client)
>> 2. add an option field (for this type of queue) in ovsdb
>> 3. ovs-vswitdhd dispatches it to  ofproto->netdev(lib)->netdev-linux
>> 4. extending netdev-linux to allocate&construct this queue in linux
>> kernel implementation ==> I believe I am standing here with the
>> question! (also not sure hooking is correct term here)
>> 5. extend queue & its management implementation (socket buffer in linux kernel)
>>
>> Here is a very specific example:
>> struct netdev_rxq *(*rxq_alloc)(void);
>>
>> This will allocate a queue for an interface (netdev) in user-sapce. I
>> believe this rxq_alloc will actually allocate a queue (FIFO) to a
>> physical/virtual port in linux kernel (socket buffer). I would like to
>> know which function is actually executed in kernel space and how they
>> are interacting each other.
>
> I think that you need to identify the Linux qdisc that implements the
> queuing priority that you want (or implement one, if none exists), then
> add support for that qdisc to netdev_linux.c, as a tc_ops.



More information about the discuss mailing list