LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* struct page vs page_link
@ 2008-02-09 6:28 Mark Tuttle
2008-02-09 12:06 ` Nicholas A. Bellinger
0 siblings, 1 reply; 4+ messages in thread
From: Mark Tuttle @ 2008-02-09 6:28 UTC (permalink / raw)
To: linux-kernel
Regarding:
commit 18dabf473e15850c0dbc8ff13ac1e2806d542c15
This actually breaks the 802.11 subsystem (http://80211.sf.net) which
relies on the page struct. (ieee80211_crypt_wep.c, line 190) Can
anyone suggest an alternative kernel function or method? As of 2.6.24,
the 802.11 subsystem cannot compile.
Mark Tuttle
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: struct page vs page_link
2008-02-09 6:28 struct page vs page_link Mark Tuttle
@ 2008-02-09 12:06 ` Nicholas A. Bellinger
2008-02-10 19:26 ` Mark Tuttle
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas A. Bellinger @ 2008-02-09 12:06 UTC (permalink / raw)
To: Mark Tuttle; +Cc: linux-kernel
On Sat, 2008-02-09 at 01:28 -0500, Mark Tuttle wrote:
> Regarding:
> commit 18dabf473e15850c0dbc8ff13ac1e2806d542c15
>
> This actually breaks the 802.11 subsystem (http://80211.sf.net) which
> relies on the page struct. (ieee80211_crypt_wep.c, line 190) Can
> anyone suggest an alternative kernel function or method? As of 2.6.24,
> the 802.11 subsystem cannot compile.
>
Greetings Mark,
I have been updating the LIO-Target codebase to 2.6.24 recently, and
posted some information about what I ended up doing for struct
scatterlist->page changing to scatterlist->page_link and
include/linux/scatterlist.h
http://lkml.org/lkml/2008/2/4/111
Hope this helps,
--nab
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: struct page vs page_link
2008-02-09 12:06 ` Nicholas A. Bellinger
@ 2008-02-10 19:26 ` Mark Tuttle
2008-02-13 4:20 ` Nicholas A. Bellinger
0 siblings, 1 reply; 4+ messages in thread
From: Mark Tuttle @ 2008-02-10 19:26 UTC (permalink / raw)
To: Nicholas A. Bellinger; +Cc: linux-kernel
Thanks for that information, I analysed your code to get a better
understanding of exactly what was going on and was able to
successfully patch what I needed to.
http://www.tuttleresearch.com/80211patch.html
Much appreciated,
Mark Tuttle
On 2/9/08, Nicholas A. Bellinger <nab@linux-iscsi.org> wrote:
> On Sat, 2008-02-09 at 01:28 -0500, Mark Tuttle wrote:
> > Regarding:
> > commit 18dabf473e15850c0dbc8ff13ac1e2806d542c15
> >
> > This actually breaks the 802.11 subsystem (http://80211.sf.net) which
> > relies on the page struct. (ieee80211_crypt_wep.c, line 190) Can
> > anyone suggest an alternative kernel function or method? As of 2.6.24,
> > the 802.11 subsystem cannot compile.
> >
>
> Greetings Mark,
>
> I have been updating the LIO-Target codebase to 2.6.24 recently, and
> posted some information about what I ended up doing for struct
> scatterlist->page changing to scatterlist->page_link and
> include/linux/scatterlist.h
>
> http://lkml.org/lkml/2008/2/4/111
>
> Hope this helps,
>
> --nab
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: struct page vs page_link
2008-02-10 19:26 ` Mark Tuttle
@ 2008-02-13 4:20 ` Nicholas A. Bellinger
0 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2008-02-13 4:20 UTC (permalink / raw)
To: Mark Tuttle, Bart Van Assche, Jens Axboe, FUJITA Tomonori,
Mike Christie, Ming Zhang, Andrew Morton
Cc: linux-kernel
Hi Mark,
After Bark posted an BUG() when CONFIG_DEBUG_SG was used with
LIO-Target, I add the proper usage of sg_table_init() and sg_mark_end()
in the LIO-Target SE. Please update your case (if you are not doing it
already). Here are my new changes for those who are still updating
drivers to use the new include/linux/scatterlist.h API.
--nab
Index: include/iscsi_linux_defs.h
===================================================================
--- include/iscsi_linux_defs.h (revision 214)
+++ include/iscsi_linux_defs.h (revision 215)
@@ -49,11 +49,14 @@
* code, and use inline functions for legacy operation.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+# define SET_SG_TABLE(sg, cnt) sg_init_table((struct scatterlist *)&sg[0], cnt); \
+ sg_mark_end((struct scatterlist *)&sg[cnt - 1]);
# define GET_ADDR_SG(sg) sg_virt(sg)
# define GET_PAGE_SG(sg) sg_page(sg)
# define SET_PAGE_SG(sg, page) sg_assign_page(sg, page)
#else
#include <linux/scatterlist.h>
+#define SET_SG_TABLE(sg, cnt)
static inline void *GET_ADDR_SG(struct scatterlist *sg)
{
return(page_address(sg->page) + sg->offset);
As you can see, the pre 2.6.24 case expands to a nop.
In my case with LIO-Target and generating SC arrays going to the default
path (which is common for PSCSI, IBLOCK, FILE, and RAMDISK_MCP) where
se_mem_t list head struct page is mapped to struct page-link in the
contigious struct scatterlist arrays.
In the iscsi_target_transport.c:transport_calc_sg_num() and scatterlist
allocation for RAMDISK_DR and RAMDISK_MCP, I added the usage of
SET_SG_TABLE right after the array of struct scatterlist right after the
struct scatterlist array has been allocated and memset.
Index: target/iscsi_target_rd.c
===================================================================
--- target/iscsi_target_rd.c (revision 215)
+++ target/iscsi_target_rd.c (revision 217)
@@ -209,6 +209,8 @@
}
memset(sg, 0, sg_per_table * sizeof(struct scatterlist));
+ SET_SG_TABLE(sg, sg_per_table);
+
sg_table[i].sg_table = sg;
sg_table[i].rd_sg_count = sg_per_table;
sg_table[i].page_start_offset = page_offset;
Index: target/iscsi_target_transport.c
===================================================================
--- target/iscsi_target_transport.c (revision 215)
+++ target/iscsi_target_transport.c (revision 217)
@@ -5096,6 +5096,8 @@
}
memset(task->task_buf, 0, task->task_sg_num * sizeof(struct scatterlist));
+ SET_SG_TABLE(task->task_buf, task->task_sg_num);
+
DEBUG_SC("Successfully allocated task->task_sg_num: %u\n", task->task_sg_num);
return(task->task_sg_num);
On Sun, 2008-02-10 at 14:26 -0500, Mark Tuttle wrote:
> Thanks for that information, I analysed your code to get a better
> understanding of exactly what was going on and was able to
> successfully patch what I needed to.
>
> http://www.tuttleresearch.com/80211patch.html
>
> Much appreciated,
> Mark Tuttle
>
> On 2/9/08, Nicholas A. Bellinger <nab@linux-iscsi.org> wrote:
> > On Sat, 2008-02-09 at 01:28 -0500, Mark Tuttle wrote:
> > > Regarding:
> > > commit 18dabf473e15850c0dbc8ff13ac1e2806d542c15
> > >
> > > This actually breaks the 802.11 subsystem (http://80211.sf.net) which
> > > relies on the page struct. (ieee80211_crypt_wep.c, line 190) Can
> > > anyone suggest an alternative kernel function or method? As of 2.6.24,
> > > the 802.11 subsystem cannot compile.
> > >
> >
> > Greetings Mark,
> >
> > I have been updating the LIO-Target codebase to 2.6.24 recently, and
> > posted some information about what I ended up doing for struct
> > scatterlist->page changing to scatterlist->page_link and
> > include/linux/scatterlist.h
> >
> > http://lkml.org/lkml/2008/2/4/111
> >
> > Hope this helps,
> >
> > --nab
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-13 4:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-09 6:28 struct page vs page_link Mark Tuttle
2008-02-09 12:06 ` Nicholas A. Bellinger
2008-02-10 19:26 ` Mark Tuttle
2008-02-13 4:20 ` Nicholas A. Bellinger
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).