Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update snull #49

Closed
wants to merge 3 commits into from
Closed

Conversation

jypan-ccu
Copy link
Contributor

Modify sbull and snull, and tested them.
You can check with more tests

dwalkes pushed a commit that referenced this pull request Aug 30, 2020
Copy link
Collaborator

@dwalkes dwalkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jypan-ccu thanks for your contribution! I've made a few changes to support 5.4 kernels on https://github.com/martinezjavier/ldd3/tree/jypan-ccu-update_snull%2Bfixes. Please give this a try and if this works for you I will merge it instead of your branch since I have found some compile issues on 5.4 kernels with this branch.


/*
* The I/O queue, depending on whether we are using our own
* make_request function or not.
*/
switch (request_mode) {
case RM_NOQUEUE:
dev->queue = blk_alloc_queue(GFP_KERNEL);
//dev->queue = blk_alloc_queue(GFP_KERNEL);
dev->queue = blk_alloc_queue(sbull_make_request, NUMA_NO_NODE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jypan-ccu this logic fails for me on a 5.4 Ubuntu kernel with:

/home/yocto/aesd/ldd3/sbull/sbull.c:410:33: warning: passing argument 1 of ‘blk_alloc_queue’ makes integer from pointer without a cast [-Wint-conversion]
   dev->queue =  blk_alloc_queue(sbull_make_request, NUMA_NO_NODE);
                                 ^~~~~~~~~~~~~~~~~~
In file included from ./include/linux/blk-mq.h:5:0,
                 from /home/yocto/aesd/ldd3/sbull/sbull.c:6:
./include/linux/blkdev.h:1146:23: note: expected ‘gfp_t {aka unsigned int}’ but argument is of type ‘blk_qc_t (*)(struct request_queue *, struct bio *) {aka unsigned int (*)(struct request_queue *, struct bio *)}’
 struct request_queue *blk_alloc_queue(gfp_t);
                       ^~~~~~~~~~~~~~~
/home/yocto/aesd/ldd3/sbull/sbull.c:410:17: error: too many arguments to function ‘blk_alloc_queue’
   dev->queue =  blk_alloc_queue(sbull_make_request, NUMA_NO_NODE);
                 ^~~~~~~~~~~~~~~
In file included from ./include/linux/blk-mq.h:5:0,
                 from /home/yocto/aesd/ldd3/sbull/sbull.c:6:
./include/linux/blkdev.h:1146:23: note: declared here
 struct request_queue *blk_alloc_queue(gfp_t);
                       ^~~~~~~~~~~~~~~

I tried using the logic at openzfs/zfs#10187 instead, this compiled successfully for me. Can you verify this works? See 4a91477

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! It works.

@@ -90,7 +90,8 @@ struct snull_priv {
struct napi_struct napi;
};

static void snull_tx_timeout(struct net_device *dev);
//static void snull_tx_timeout(struct net_device *dev);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jypan-ccu this logic also fails on 5.4 kernel builds. I've addressed with 4a91477

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! It works, except the git program is complicated for me.

dwalkes pushed a commit that referenced this pull request Sep 1, 2020
@dwalkes
Copy link
Collaborator

dwalkes commented Sep 1, 2020

Committed with #51

@dwalkes dwalkes closed this Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants